<html><head><title>[xgap] 7.1 Menus in Graphic Sheets</title></head> <body text="#000000" bgcolor="#ffffff"> [<a href = "C007S000.htm">Up</a>] [<a href ="C007S002.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <h1>7.1 Menus in Graphic Sheets</h1><p> <p> <a name = "SSEC1"></a> <li><code>Menu( </code><var>sheet</var><code>, </code><var>title</var><code>, </code><var>ents</var><code>, </code><var>fncs</var><code> ) O</code> <li><code>Menu( </code><var>sheet</var><code>, </code><var>title</var><code>, </code><var>zipped</var><code> ) O</code> <p> <code>Menu</code> returns a pulldown menu. It is attached to the sheet <var>sheet</var> under the title <var>title</var>. In the first form <var>ents</var> is a list of strings consisting of the names of the menu entries. <var>fncs</var> is a list of functions. They are called when the corresponding menu entry is selected by the user. The parameters they get are the graphic sheet as first parameter, the menu object as second, and the name of the selected entry as third parameter. In the second form the entry names and functions are all in one list <var>zipped</var> in alternating order, meaning first a menu entry, then the corresponding function and so on. Note that you can delete menus but it is not possible to modify them, once they are attached to the sheet. If a name of a menu entry begins with a minus sign or the list entry in <var>ents</var> is not bound, a dummy menu entry is generated, which can sort the menu entries within a menu in blocks. The corresponding function does not matter. <p> <a name = "SSEC2"></a> <li><code>Check( </code><var>menu</var><code>, </code><var>entry</var><code>, </code><var>flag</var><code> ) O</code> <p> Modifies the ``checked'' state of a menu entry. This is visualized by a small check mark behind the menu entry. <var>menu</var> must be a menu object, <var>entry</var> the string exactly as in the definition of the menu, and <var>flag</var> a boolean value. <p> <a name = "SSEC3"></a> <li><code>Enable( </code><var>menu</var><code>, </code><var>entry</var><code>, </code><var>flag</var><code> ) O</code> <li><code>Enable( </code><var>menu</var><code>, </code><var>boollist</var><code> ) O</code> <p> Modifies the ``enabled'' state of a menu entries. Only enabled menu entries can be selected by the user. Disabled menu entries are visualized by grey or shaded letters in the menu. <var>menu</var> must be a menu object, <var>entry</var> the string exactly as in the definition of the menu, and <var>flag</var> a boolean value. <var>entry</var> can also be a natural number meaning the index of the corresponding menu entry. In the second form <var>boollist</var> must be a list where each entry has either a boolean value or the value <code>fail</code> The list must be as long as the number of menu entries in the menu <var>menu</var>. All menu entries where a boolean value is provided are enabled or disabled according to this value. <p> See the explanation of <code>GraphicSheet</code> (<a href="C006S001.htm#SSEC2">Close!Callback</a>) for the ``Close'' event, which occurs when the user selects the menu entry <code>close graphic sheet</code> in the <code>Sheet</code> menu. <p> <p> [<a href = "C007S000.htm">Up</a>] [<a href ="C007S002.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <P> <address>xgap manual<br>Mai 2003 </address></body></html>