source: MML/trunk/machine/SOLEIL/common/toolbox/GUILayout/layoutHelp/User guide3_1.html @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 6.1 KB
Line 
1<html xmlns:saxon="http://icl.com/saxon">
2   <head>
3      <link rel="stylesheet" type="text/css" href="doc.css"/>
4      <link rel="stylesheet" type="text/css" href=""/>
5      <meta author="The MathWorks Ltd."/>
6      <meta copyright="2011 The MathWorks Ltd."/>
7      <title>Enable example</title>
8   </head>
9
10   
11    <body>
12      <table class="header" width="100%" border="0" cellspacing="0" cellpadding="0">
13         <tr>
14            <td bgcolor="#e4f0f8"><A href="User guide.html"><font face="Arial" bgcolor="#e4f0f8" size="+0" underline="0" color="#000000"><b>User guide</b></font></A></td>
15            <td width="36" bgcolor="#e4f0f8"><A HREF="User guide3.html"><IMG SRC="Images/leftarrow.png" BORDER="0" ALT="previous page"/></A><A HREF="User guide3_2.html"><IMG SRC="Images/rightarrow.png" BORDER="0" ALT="next page"/></A></td>
16         </tr>
17      </table>
18   
19
20      <br clear="all"/>
21         
22      <h2>3.1: Enable example&nbsp;<a href="User guide3.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></a></h2>
23     
24            <p>(The code for this example can be found here:
25                            [ <a href="Examples/enableexample.m">view</a>
26                | <a href="matlab: edit(fullfile(layoutRoot,'layoutHelp','Examples','enableexample.m'))">edit</a>
27                | <a href="matlab: p=pwd();cd(fullfile(layoutRoot,'layoutHelp','Examples')); enableexample; cd(p)">run</a> ]
28            )</p>
29        <p>
30            This example shows how the <code>enable</code> property can be
31            used to indicate to users which bits of an interface are currently
32            relevant. This is particularly useful for preventing unwanted
33            clicking during long calculations, loading and saving!
34        </p>
35       
36        <example>
37            <para>Open a window and add a panel</para>
38            <pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">fig = <a href="matlab:doc figure"><code class="FUNCTION">figure</code></a>( 'Name', 'Enable example', ...
39    'Position', [100 100 150 250], ...
40    'MenuBar', 'none', ...
41    'ToolBar', 'none', ...
42    'NumberTitle', 'off' );
43panel = <a href="uiextras.BoxPanel.html"><code class="FUNCTION">uiextras.BoxPanel</code></a>( 'Parent', fig, 'Title', 'Panel' );</font></pre>
44            <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/EnableExample1.png"/></center></font></p>
45        </example>
46        <example>
47            <para>Put some buttons inside the panel</para>
48            <pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">box = <a href="uiextras.VButtonBox.html"><code class="FUNCTION">uiextras.VButtonBox</code></a>( 'Parent', panel );
49<a href="matlab:doc uicontrol"><code class="FUNCTION">uicontrol</code></a>( 'Parent', box, 'String', 'Button 1' );
50<a href="matlab:doc uicontrol"><code class="FUNCTION">uicontrol</code></a>( 'Parent', box, 'String', 'Button 2' );
51<a href="matlab:doc uicontrol"><code class="FUNCTION">uicontrol</code></a>( 'Parent', box, 'String', 'Button 3', 'Enable', 'off' );
52<a href="matlab:doc uicontrol"><code class="FUNCTION">uicontrol</code></a>( 'Parent', box, 'String', 'Button 4' );
53<a href="matlab:doc uicontrol"><code class="FUNCTION">uicontrol</code></a>( 'Parent', box, 'String', 'Button 5', 'Enable', 'off' );
54<a href="matlab:doc uicontrol"><code class="FUNCTION">uicontrol</code></a>( 'Parent', box, 'String', 'Button 6' );</font></pre>
55            <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/EnableExample2.png"/></center></font></p>
56        </example>
57        <example>
58            <para>Try disabling the panel</para>
59            <pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">set( panel, 'Enable', 'off' );</font></pre>
60            <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/EnableExample3.png"/></center></font></p>
61        </example>
62        <example>
63            <para>Try enabling the panel. Note that the original "enable" state of each button is remembered.</para>
64            <pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">set( panel, 'Enable', 'on' );</font></pre>
65            <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/EnableExample2.png"/></center></font></p>
66        </example>
67   
68     
69      <br clear="ALL"/>
70      <table class="footer" width="100%" border="0" cellspacing="0" cellpadding="0">
71         <tr>
72            <td width="18" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide3.html"><img src="images/leftarrow.png" border="0" alt="previous page"/></a></td>
73            <td width="40%" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide3.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Enable and Visible</font></a></td>
74            <td width="20%" height="15" bgcolor="#e4f0f8" align="center"><a href="index.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">[Top]</font></a></td>
75            <td width="40%" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide3_2.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Visible example</font></a></td>
76            <td width="18" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide3_2.html"><img src="images/rightarrow.png" border="0" alt="next page"/></a></td>
77         </tr>
78      </table>
79      <font face="Arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">&copy; 2011 The MathWorks Ltd</font>
80      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/license.txt'])">Terms of Use</a>
81      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/patents.txt'])">Patents</a>
82      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/trademarks.txt'])">Trademarks</a>
83   
84   </body>
85</html>
86       
Note: See TracBrowser for help on using the repository browser.