# HG changeset patch # User Rik # Date 1524530481 25200 # Node ID 5ca8abb276444ebf78080699975525b40ce713c9 # Parent b99b0d423807776c1f67191ac8b5e80112f39aa3 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. diff -r b99b0d423807 -r 5ca8abb27644 scripts/gui/uibuttongroup.m --- 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], ... diff -r b99b0d423807 -r 5ca8abb27644 scripts/gui/uicontrol.m --- 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,