changeset 25298:5ca8abb27644

Only emit a warning, not error, when uiXXX.m are called for focusing (bug #53710). * uibuttongroup.m, uicontrol.m: Change docstrings to avoid having to capitalize first letter 'U' of "ui" objects. Use Octave convention of '##' for comments in example code in documentation. Change existing input validation from error() to warning() when it detects that a call to perform focusing has been given.
author Rik <rik@octave.org>
date Mon, 23 Apr 2018 17:41:21 -0700
parents b99b0d423807
children 94b4c19c0fd9
files scripts/gui/uibuttongroup.m scripts/gui/uicontrol.m
diffstat 2 files changed, 35 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/gui/uibuttongroup.m	Mon Apr 23 15:18:42 2018 -0700
+++ b/scripts/gui/uibuttongroup.m	Mon Apr 23 17:41:21 2018 -0700
@@ -23,7 +23,7 @@
 ##
 ## Create a uibuttongroup object and return a handle to it.
 ##
-## uibuttongroups are used to create group uicontrols.
+## A uibuttongroup is used to group uicontrol objects.
 ##
 ## If @var{parent} is omitted then a uibuttongroup for the current figure is
 ## created.  If no figure is available, a new figure is created first.
@@ -34,29 +34,34 @@
 ## Any provided property value pairs will override the default values of the
 ## created uibuttongroup object.
 ##
-## Uibuttongroup properties are documented at @ref{Uibuttongroup Properties}.
+## Properties of uibuttongroup objects are documented at
+## @ref{Uibuttongroup Properties}.
 ##
 ## Examples:
 ##
 ## @example
 ## @group
-## % create figure and panel on it
+## ## Create figure and panel on it
 ## f = figure;
-## % create a button group
+## ## Create a button group
 ## gp = uibuttongroup (f, "Position", [ 0 0.5 1 1])
-## % create a buttons in the group
+## ## Create a buttons in the group
 ## b1 = uicontrol (gp, "style", "radiobutton", ...
 ##                 "string", "Choice 1", ...
 ##                 "Position", [ 10 150 100 50 ]);
 ## b2 = uicontrol (gp, "style", "radiobutton", ...
 ##                 "string", "Choice 2", ...
 ##                 "Position", [ 10 50 100 30 ]);
-## % create a button not in the group
+## ## Create a button not in the group
 ## b3 = uicontrol (f, "style", "radiobutton", ...
 ##                 "string", "Not in the group", ...
 ##                 "Position", [ 10 50 100 50 ]);
 ## @end group
 ## @end example
+##
+## When called with a single argument @var{h} which is a handle to an existing
+## uibuttongroup object, switch the focus to the specified uibuttongroup.  This
+## functionality is not currently implemented.
 ## @seealso{figure, uipanel}
 ## @end deftypefn
 
@@ -65,7 +70,8 @@
 function hui = uibuttongroup (varargin)
 
   if (nargin == 1 && isgraphics (varargin{1}, "uibuttongroup"))
-    error ("uibuttongroup: focusing not implemented yet");
+    warning ("uibuttongroup: focusing not implemented yet");
+    return;
   endif
 
   [h, args] = __uiobject_split_args__ ("uibuttongroup", varargin,
@@ -74,6 +80,7 @@
 
 endfunction
 
+
 %!demo
 %! f = figure;
 %! gp = uibuttongroup (f, "Position", [ 0 0.5 1 1], ...
--- a/scripts/gui/uicontrol.m	Mon Apr 23 15:18:42 2018 -0700
+++ b/scripts/gui/uicontrol.m	Mon Apr 23 17:41:21 2018 -0700
@@ -23,8 +23,8 @@
 ##
 ## Create a uicontrol object and return a handle to it.
 ##
-## uicontrols are used to create simple interactive controls such as push
-## buttons, checkboxes, edit and list controls.
+## A uicontrol object is used to create simple interactive controls such as
+## push buttons, checkboxes, edit and list controls.
 ##
 ## If @var{parent} is omitted then a uicontrol for the current figure is
 ## created.  If no figure is available, a new figure is created first.
@@ -35,11 +35,11 @@
 ## Any provided property value pairs will override the default values of the
 ## created uicontrol object.
 ##
-## Uicontrol properties are documented at @ref{Uicontrol Properties}.
+## Properties of uicontrol objects are documented at
+## @ref{Uicontrol Properties}.
 ##
-## Control of the type of uicontrol created is through the use of the
-## @var{style} property.  If no style property is provided, a push button will
-## be created.
+## The type of uicontrol created is specified by the @var{style} property.  If
+## no style property is provided, a push button will be created.
 ##
 ## Valid styles for uicontrol are:
 ##
@@ -83,16 +83,22 @@
 ##
 ## @example
 ## @group
-## % create figure and panel on it
+## ## Create figure and panel on it
 ## f = figure;
-## % create a button (default style)
-## b1 = uicontrol (f, "string", "A Button", "position",[10 10 150 40]);
-## % create an edit control
-## e1 = uicontrol (f, "style", "edit", "string", "editable text", "position",[10 60 300 40]);
-## % create a checkbox
-## c1 = uicontrol (f, "style", "checkbox", "string", "a checkbox", "position",[10 120 150 40]);
+## ## Create a button (default style)
+## b1 = uicontrol (f, "string", "A Button", "position", [10 10 150 40]);
+## ## Create an edit control
+## e1 = uicontrol (f, "style", "edit", "string", "editable text", ...
+##                    "position", [10 60 300 40]);
+## ## Create a checkbox
+## c1 = uicontrol (f, "style", "checkbox", "string", "a checkbox", ...
+##                    "position", [10 120 150 40]);
 ## @end group
 ## @end example
+##
+## When called with a single argument @var{h} which is a handle to an existing
+## uicontrol object, switch the focus to the specified uicontrol.  This
+## functionality is not currently implemented.
 ## @seealso{figure, uipanel}
 ## @end deftypefn
 
@@ -101,7 +107,8 @@
 function hui = uicontrol (varargin)
 
   if (nargin == 1 && isgraphics (varargin{1}, "uicontrol"))
-    error ("uicontrol: focusing not implemented yet");
+    warning ("uicontrol: focusing not implemented yet");
+    return;
   endif
 
   [h, args] = __uiobject_split_args__ ("uicontrol", varargin,