Mercurial > octave-nkf
annotate scripts/gui/uicontrol.m @ 20632:7890893a0e69 stable
Add uiXXXX documentation (Bug #46076)
* scripts/gui/uicontextmenu.m: add function documentation.
* scripts/gui/uitoolbar.m: add function documentation.
* scripts/gui/uitoggletool.m: add function documentation.
* scripts/gui/uipushtool.m: add function documentation.
* scripts/gui/uipanel.m: add function documentation.
* scripts/gui/uicontrol.m: add function documentation.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Thu, 08 Oct 2015 20:59:25 -0400 |
parents | 9fc020886ae9 |
children | 93d96da9ff3e |
rev | line source |
---|---|
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
1 ## Copyright (C) 2012-2015 Michael Goffioul |
13284
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
2 ## |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
4 ## |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
8 ## your option) any later version. |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
9 ## |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
13 ## General Public License for more details. |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
14 ## |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
18 |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
20632
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
20 ## @deftypefn {Function File} {@var{hui} =} uicontrol (@var{property}, @var{value}, @dots{}) |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
21 ## @deftypefnx {Function File} {@var{hui} =} uicontrol (@var{parent}, @var{property}, @var{value}, @dots{}) |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
22 ## @deftypefnx {Function File} {} uicontrol (@var{h}) |
20632
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
23 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
24 ## Create a uicontrol object and return a handle to it. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
25 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
26 ## uicontrols are used to create simple interactive controls such as push buttons, checkboxes, edit and list controls. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
27 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
28 ## If @var{parent} is omitted then a uicontrol for the current figure is |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
29 ## created. If no figure is available, a new figure is created first. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
30 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
31 ## If @var{parent} is given then a uicontrol relative to @var{parent} is created. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
32 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
33 ## Any provided property value pairs will override the default values of the created |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
34 ## uicontrol object. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
35 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
36 ## Control of the type of uicontrol created is through the use of the @var{style} property. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
37 ## If no style property is provided, a push button will be created. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
38 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
39 ## Valid styles for uicontrol are: |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
40 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
41 ## @table @asis |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
42 ## @item @qcode{"checkbox"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
43 ## Create a checkbox control that allows user on/off selection. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
44 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
45 ## @item @qcode{"edit"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
46 ## Create a edit control that allows user input of single or multiple lines of text. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
47 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
48 ## @item @qcode{"listbox"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
49 ## Create a listbox control that displays a lit of items and allows user slelection of |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
50 ## single or multiple items. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
51 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
52 ## @item @qcode{"popupmenu"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
53 ## Create a popupmenu control that displays a list of options that can be selected |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
54 ## when the user clicks on the control. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
55 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
56 ## @item @qcode{"pushbutton"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
57 ## Create a push button control that allows user to press to cause an action. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
58 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
59 ## @item @qcode{"radiobutton"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
60 ## Create a radio button control intended to be used for mutually exclusive input in a group of |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
61 ## of radiobutton controls. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
62 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
63 ## @item @qcode{"slider"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
64 ## Create a slider control that allows user selection from a range of values by sliding |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
65 ## knob on the control. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
66 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
67 ## @item @qcode{"text"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
68 ## Create a static text control to display single or multiple lines of text. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
69 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
70 ## @item @qcode{"togglebutton"} |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
71 ## Create a toggle button control that appears like a push button but allows the user to |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
72 ## select between two states. |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
73 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
74 ## @end table |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
75 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
76 ## Examples: |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
77 ## |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
78 ## @example |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
79 ## @group |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
80 ## % create figure and panel on it |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
81 ## f = figure; |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
82 ## % create a button (default style) |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
83 ## b1 = uicontrol (f, "string", "A Button", "position",[10 10 150 40]); |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
84 ## % create an edit control |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
85 ## e1 = uicontrol (f, "style", "edit", "string", "editable text", "position",[10 60 300 40]); |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
86 ## % create a checkbox |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
87 ## c1 = uicontrol (f, "style", "checkbox", "string", "a checkbox", "position",[10 120 150 40]); |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
88 ## @end group |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
89 ## @end example |
7890893a0e69
Add uiXXXX documentation (Bug #46076)
John Donoghue <john.donoghue@ieee.org>
parents:
19867
diff
changeset
|
90 ## @seealso{figure, uipanel} |
13284
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
91 ## @end deftypefn |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
92 |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
93 ## Author: goffioul |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
94 |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
95 function hui = uicontrol (varargin) |
13284
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
96 |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
97 if (nargin == 1 && ishandle (varargin{1}) |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
98 && strcmpi (get (varargin{1}, "type"), "uicontrol")) |
13284
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
99 error ("uicontrol focusing not implemented yet."); |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
100 endif |
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
101 |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
102 [h, args] = __uiobject_split_args__ ("uicontrol", varargin, |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
103 {"figure", "uipanel", "uibuttongroup"}); |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
104 hui = __go_uicontrol__ (h, args{:}); |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
105 |
13284
5ab9c721ce59
Add uicontrol and uipanel m-scripts.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
106 endfunction |
17338
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
107 |