1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Octave: UI Elements</title>
<meta name="description" content="GNU Octave: UI Elements">
<meta name="keywords" content="GNU Octave: UI Elements">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="GUI-Development.html#GUI-Development" rel="up" title="GUI Development">
<link href="GUI-Utility-Functions.html#GUI-Utility-Functions" rel="next" title="GUI Utility Functions">
<link href="Progress-Bar.html#Progress-Bar" rel="prev" title="Progress Bar">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="UI-Elements"></a>
<div class="header">
<p>
Next: <a href="GUI-Utility-Functions.html#GUI-Utility-Functions" accesskey="n" rel="next">GUI Utility Functions</a>, Previous: <a href="Progress-Bar.html#Progress-Bar" accesskey="p" rel="prev">Progress Bar</a>, Up: <a href="GUI-Development.html#GUI-Development" accesskey="u" rel="up">GUI Development</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="UI-Elements-1"></a>
<h3 class="section">35.3 UI Elements</h3>
<p>The ui* series of functions work best with the <code>qt</code> graphics
toolkit, although some functionality is available with the <code>fltk</code> toolkit.
There is no support for the <code>gnuplot</code> toolkit.
</p>
<a name="XREFuicontextmenu"></a><dl>
<dt><a name="index-uicontextmenu"></a>Function File: <em><var>hui</var> =</em> <strong>uicontextmenu</strong> <em>(<var>property</var>, <var>value</var>, …)</em></dt>
<dt><a name="index-uicontextmenu-1"></a>Function File: <em><var>hui</var> =</em> <strong>uicontextmenu</strong> <em>(<var>h</var>, <var>property</var>, <var>value</var>, …)</em></dt>
<dd>
<p>Create a uicontextmenu object and return a handle to it.
</p>
<p>If <var>h</var> is omitted then a uicontextmenu for the current figure is
created. If no figure is available, a new figure is created first.
</p>
<p>If <var>h</var> is given then a uicontextmenu relative to <var>h</var> is created.
</p>
<p>Any provided property value pairs will override the default values of the created
uicontextmenu object.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">% create figure and uicontextmenu
f = figure;
c = uicontextmenu (f);
% create menus in the context menu
m1 = uimenu ("parent",c,"label","Menu item 1","callback","disp('menu item 1')");
m2 = uimenu ("parent",c,"label","Menu item 2","callback","disp('menu item 2')");
% set the context menu for the figure
set (f, "uicontextmenu", c);
</pre></div>
<p><strong>See also:</strong> <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a href="Interacting-with-Plots.html#XREFuimenu">uimenu</a>.
</p></dd></dl>
<a name="XREFuicontrol"></a><dl>
<dt><a name="index-uicontrol"></a>Function File: <em><var>hui</var> =</em> <strong>uicontrol</strong> <em>(<var>property</var>, <var>value</var>, …)</em></dt>
<dt><a name="index-uicontrol-1"></a>Function File: <em><var>hui</var> =</em> <strong>uicontrol</strong> <em>(<var>parent</var>, <var>property</var>, <var>value</var>, …)</em></dt>
<dt><a name="index-uicontrol-2"></a>Function File: <em></em> <strong>uicontrol</strong> <em>(<var>h</var>)</em></dt>
<dd>
<p>Create a uicontrol object and return a handle to it.
</p>
<p>uicontrols are used to create simple interactive controls such as push buttons, checkboxes, edit and list controls.
</p>
<p>If <var>parent</var> is omitted then a uicontrol for the current figure is
created. If no figure is available, a new figure is created first.
</p>
<p>If <var>parent</var> is given then a uicontrol relative to <var>parent</var> is created.
</p>
<p>Any provided property value pairs will override the default values of the created
uicontrol object.
</p>
<p>Control of the type of uicontrol created is through the use of the <var>style</var> property.
If no style property is provided, a push button will be created.
</p>
<p>Valid styles for uicontrol are:
</p>
<dl compact="compact">
<dt><code>"checkbox"</code></dt>
<dd><p>Create a checkbox control that allows user on/off selection.
</p>
</dd>
<dt><code>"edit"</code></dt>
<dd><p>Create a edit control that allows user input of single or multiple lines of text.
</p>
</dd>
<dt><code>"listbox"</code></dt>
<dd><p>Create a listbox control that displays a lit of items and allows user slelection of
single or multiple items.
</p>
</dd>
<dt><code>"popupmenu"</code></dt>
<dd><p>Create a popupmenu control that displays a list of options that can be selected
when the user clicks on the control.
</p>
</dd>
<dt><code>"pushbutton"</code></dt>
<dd><p>Create a push button control that allows user to press to cause an action.
</p>
</dd>
<dt><code>"radiobutton"</code></dt>
<dd><p>Create a radio button control intended to be used for mutually exclusive input in a group of
of radiobutton controls.
</p>
</dd>
<dt><code>"slider"</code></dt>
<dd><p>Create a slider control that allows user selection from a range of values by sliding
knob on the control.
</p>
</dd>
<dt><code>"text"</code></dt>
<dd><p>Create a static text control to display single or multiple lines of text.
</p>
</dd>
<dt><code>"togglebutton"</code></dt>
<dd><p>Create a toggle button control that appears like a push button but allows the user to
select between two states.
</p>
</dd>
</dl>
<p>Examples:
</p>
<div class="example">
<pre class="example">% 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]);
</pre></div>
<p><strong>See also:</strong> <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a href="#XREFuipanel">uipanel</a>.
</p></dd></dl>
<a name="XREFuipanel"></a><dl>
<dt><a name="index-uipanel"></a>Function File: <em><var>hui</var> =</em> <strong>uipanel</strong> <em>(<var>property</var>, <var>value</var>, …)</em></dt>
<dt><a name="index-uipanel-1"></a>Function File: <em><var>hui</var> =</em> <strong>uipanel</strong> <em>(<var>parent</var>, "<var>property</var>, <var>value</var>, …)</em></dt>
<dd>
<p>Create a uipanel object and return a handle to it.
</p>
<p>uipanels are used as containers to group other uicontrol objects.
</p>
<p>If <var>parent</var> is omitted then a uipanel for the current figure is
created. If no figure is available, a new figure is created first.
</p>
<p>If <var>parent</var> is given then a uipanel relative to <var>parent</var> is created.
</p>
<p>Any provided property value pairs will override the default values of the created
uipanel object.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">% create figure and panel on it
f = figure;
p = uipanel ("title", "Panel Title", "position", [.25 .25 .5 .5]);
% add two buttons to the panel
b1 = uicontrol ("parent", p, "string", "A Button", "position",[18 10 150 36]);
b2 = uicontrol ("parent", p, "string", "Another Button", "position",[18 60 150 36]);
</pre></div>
<p><strong>See also:</strong> <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a href="#XREFuicontrol">uicontrol</a>.
</p></dd></dl>
<a name="XREFuipushtool"></a><dl>
<dt><a name="index-uipushtool"></a>Function File: <em><var>hui</var> =</em> <strong>uipushtool</strong> <em>(<var>property</var>, <var>value</var>, …)</em></dt>
<dt><a name="index-uipushtool-1"></a>Function File: <em><var>hui</var> =</em> <strong>uipushtool</strong> <em>(<var>parent</var>, <var>property</var>, <var>value</var>, …)</em></dt>
<dd>
<p>Create a uipushtool object and return a handle to it.
</p>
<p>uipushtools are buttons that appear on a figure toolbar. The button is created with a border that
is shown when the user hovers over the button. An image can be set using the cdata property.
</p>
<p>If <var>parent</var> is omitted then a uipushtool for the current figure is
created. If no figure is available, a new figure is created first. If a figure is
available, but does not contain a uitoolbar, a uitoolbar will be created.
</p>
<p>If <var>parent</var> is given then a uipushtools is created on the <var>parent</var> uitoolbar.
</p>
<p>Any provided property value pairs will override the default values of the created
uipushtool object.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">% create figure without a default toolbar
f = figure ("toolbar", "none");
% create empty toolbar
t = uitoolbar (f);
% create a 19x19x3 black square
img=zeros(19,19,3);
% add pushtool button to toolbar
b = uipushtool (t, "cdata", img);
</pre></div>
<p><strong>See also:</strong> <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a href="#XREFuitoolbar">uitoolbar</a>, <a href="#XREFuitoggletool">uitoggletool</a>.
</p></dd></dl>
<a name="XREFuitoggletool"></a><dl>
<dt><a name="index-uitoggletool"></a>Function File: <em><var>hui</var> =</em> <strong>uitoggletool</strong> <em>(<var>property</var>, <var>value</var>, …)</em></dt>
<dt><a name="index-uitoggletool-1"></a>Function File: <em><var>hui</var> =</em> <strong>uitoggletool</strong> <em>(<var>parent</var>, <var>property</var>, <var>value</var>, …)</em></dt>
<dd>
<p>Create a uitoggletool object and return a handle to it.
</p>
<p>uitoggletool are togglebuttons that appear on a figure toolbar. The button is created with a border that
is shown when the user hovers over the button. An image can be set using the cdata property.
</p>
<p>If <var>parent</var> is omitted then a uitoggletool for the current figure is
created. If no figure is available, a new figure is created first. If a figure is
available, but does not contain a uitoolbar, a uitoolbar will be created.
</p>
<p>If <var>parent</var> is given then a uitoggletool is created on the <var>parent</var> uitoolbar.
</p>
<p>Any provided property value pairs will override the default values of the created
uitoggletool object.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">% create figure without a default toolbar
f = figure ("toolbar", "none");
% create empty toolbar
t = uitoolbar (f);
% create a 19x19x3 black square
img=zeros(19,19,3);
% add uitoggletool button to toolbar
b = uitoggletool (t, "cdata", img);
</pre></div>
<p><strong>See also:</strong> <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a href="#XREFuitoolbar">uitoolbar</a>, <a href="#XREFuipushtool">uipushtool</a>.
</p></dd></dl>
<a name="XREFuitoolbar"></a><dl>
<dt><a name="index-uitoolbar"></a>Function File: <em><var>hui</var> =</em> <strong>uitoolbar</strong> <em>(<var>property</var>, <var>value</var>, …)</em></dt>
<dt><a name="index-uitoolbar-1"></a>Function File: <em><var>hui</var> =</em> <strong>uitoolbar</strong> <em>(<var>parent</var>, <var>property</var>, <var>value</var>, …)</em></dt>
<dd>
<p>Create a uitoolbar object and return a handle to it. A uitoolbar displays uitoggletool and uipushtool buttons.
</p>
<p>If <var>parent</var> is omitted then a uitoolbar for the current figure is
created. If no figure is available, a new figure is created first.
</p>
<p>If <var>parent</var> is given then a uitoolbar relative to <var>parent</var> is created.
</p>
<p>Any provided property value pairs will override the default values of the created
uitoolbar object.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">% create figure without a default toolbar
f = figure ("toolbar", "none");
% create empty toolbar
t = uitoolbar (f);
</pre></div>
<p><strong>See also:</strong> <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a href="#XREFuitoggletool">uitoggletool</a>, <a href="#XREFuipushtool">uipushtool</a>.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="GUI-Utility-Functions.html#GUI-Utility-Functions" accesskey="n" rel="next">GUI Utility Functions</a>, Previous: <a href="Progress-Bar.html#Progress-Bar" accesskey="p" rel="prev">Progress Bar</a>, Up: <a href="GUI-Development.html#GUI-Development" accesskey="u" rel="up">GUI Development</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|