<html><head><title>[xgap] 7.4 Popups</title></head> <body text="#000000" bgcolor="#ffffff"> [<a href = "C007S000.htm">Up</a>] [<a href ="C007S003.htm">Previous</a>] [<a href ="C008S000.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <h1>7.4 Popups</h1><p> <p> <a name = "SSEC1"></a> <li><code>PopupMenu( </code><var>name</var><code>, </code><var>labels</var><code> ) O</code> <p> creates a new popup menu and returns a <font face="Gill Sans,Helvetica,Arial">GAP</font> object describing it. <var>name</var> is the title of the menu and <var>labels</var> is a list of strings for the entries. Use <code>Query</code> to actually put the popup on the screen. <p> <a name = "SSEC2"></a> <li><code>Query</code> <p> actually puts a popup on screen. <code>Query</code> returns the string of the selected entry or <code>false</code> if the user clicks outside the popup. See also <code>Query</code> for dialogs in <a href="C007S003.htm#SSEC2">Query</a>. <p> <a name = "SSEC3"></a> <li><code>TextSelector( </code><var>name</var><code>, </code><var>list</var><code>, </code><var>buttons</var><code> ) O</code> <p> creates a new text selector and returns a <font face="Gill Sans,Helvetica,Arial">GAP</font> object describing it. <var>name</var> is a title. <var>list</var> is an alternating list of strings and functions. The strings are displayed and can be selected by the user. If this happens the corresponding function is called with two parameters. The first is the text selector object itself, the second the string that is selected. A selected string is highlighted and all other strings are reset at the same time. Use <code>Reset</code> to reset all entries. <p> <var>buttons</var> is an analogous list for the buttons that are displayed at the bottom of the text selector. The text selector is displayed immediately and stays on screen until it is closed (use the <code>Close</code> operation). Buttons can be enabled and disabled by the <code>Enable</code> operation and the string of a text can be changed via <code>Relabel</code>. <p> <a name = "SSEC4"></a> <li><code>Enable( </code><var>sel</var><code>,</code><var>bt</var><code>,</code><var>flag</var><code> )</code> <li><code>Enable( </code><var>sel</var><code>,</code><var>btindex</var><code>,</code><var>flag</var><code> )</code> <p> Enables or disables the button <var>bt</var> (string value) or <var>btindex</var> (integer index) of the text selector <var>sel</var>, according to <var>flag</var>. <p> <a name = "SSEC5"></a> <li><code>Relabel( </code><var>sel</var><code>, </code><var>list</var><code> )</code> <li><code>Relabel( </code><var>sel</var><code>, </code><var>index</var><code>, </code><var>text</var><code> )</code> <p> Changes the strings that are displayed in the text selector. In the first form <var>list</var> must be a list of strings. The second form only changes the text at index <var>index</var>. <p> <a name = "SSEC6"></a> <li><code>SetName( </code><var>sel</var><code>, </code><var>index</var><code>, </code><var>string</var><code> )</code> <p> Every string in a text selector has a name. The names are stored in the list <code>names</code> component of the text selector. So <code>sel!.names</code> ist a list containing the names. The names are initialized with the strings from the creation of the text selector. <p> <a name = "SSEC7"></a> <li><code>Reset( </code><var>sel</var><code> )</code> <p> Resets all strings of a text selector, such that they are no longer selected. <p> <a name = "SSEC8"></a> <li><code>Close( </code><var>sel</var><code> )</code> <p> Closes a text selector. It vanishes from screen. <p> Note that you have access to the indices and names of strings and buttons: <p> <a name = "SSEC9"></a> <li><code>IndexOfSelectedText</code> <p> Whenever the user clicks on a text in a text selector, the global variable is set to the index of the text in the text selector. <p> <a name = "SSEC10"></a> <li><code>IndexOfSelectedButton</code> <p> Whenever the user clicks on a button in a text selector, the global variable is set to the index of the button in the text selector. <p> [<a href = "C007S000.htm">Up</a>] [<a href ="C007S003.htm">Previous</a>] [<a href ="C008S000.htm">Next</a>] [<a href = "theindex.htm">Index</a>] <P> <address>xgap manual<br>Mai 2003 </address></body></html>