EVOLUTION-MANAGER
Edit File: winMenus.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: User Menus under MS Windows (Rgui)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for winMenus {utils}"><tr><td>winMenus {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>User Menus under MS Windows (Rgui)</h2> <h3>Description</h3> <p>Enables users to add, delete and program menus for the <code>Rgui</code> in MS Windows. </p> <h3>Usage</h3> <pre> winMenuAdd(menuname) winMenuAddItem(menuname, itemname, action) winMenuDel(menuname) winMenuDelItem(menuname, itemname) winMenuNames() winMenuItems(menuname) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>menuname</code></td> <td> <p>a character string naming a menu.</p> </td></tr> <tr valign="top"><td><code>itemname</code></td> <td> <p>a character string naming a menu item on an existing menu.</p> </td></tr> <tr valign="top"><td><code>action</code></td> <td> <p>a character string describing the action when that menu is selected, or <code>"enable"</code> or <code>"disable"</code>.</p> </td></tr> </table> <h3>Details</h3> <p>User menus are added to the right of existing menus, and items are added at the bottom of the menu. </p> <p>By default the action character string is treated as <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> input, being echoed on the command line and parsed and executed as usual. </p> <p>If the <code>menuname</code> parameter of <code>winMenuAddItem</code> does not already exist, it will be created automatically. </p> <p>Normally new submenus and menu items are added to the main console menu. They may be added elsewhere using the following special names: </p> <dl> <dt><code>$ConsoleMain</code></dt><dd><p>The console menu (the default)</p> </dd> <dt><code>$ConsolePopup</code></dt><dd><p>The console popup menu</p> </dd> <dt><code>$Graph<n>Main</code></dt><dd><p>The menu for graphics window <code><n></code></p> </dd> <dt><code>$Graph<n>Popup</code></dt><dd><p>The popup menu for graphics window <code><n></code></p> </dd> </dl> <p>Specifying an existing item in <code>winMenuAddItem</code> enables the action to be changed. </p> <p>Submenus can be specified by separating the elements in <code>menuname</code> by slashes: as a consequence menu names may not contain slashes. </p> <p>If the <code>action</code> is specified as <code>"none"</code> no action is taken: this can be useful to reserve items for future expansion. </p> <p>The function <code>winMenuNames</code> can be used to find out what menus have been created by the user and returns a vector of the existing menu names. </p> <p>The <code>winMenuItems</code> function will take the name of a menu and return the items that exist in that menu. The return value is a named vector where the names correspond to the names of the items and the values of the vector are the corresponding actions. </p> <p>The <code>winMenuDel</code> function will delete a menu and all of its items and submenus. <code>winMenuDelItem</code> just deletes one menu item. </p> <p>The total path to an item (menu string plus item string) cannot exceed 1000 bytes, and the menu string cannot exceed 500 bytes. </p> <h3>Value</h3> <p><code>NULL</code>, invisibly. If an error occurs, an informative error message will be given. </p> <h3>Note</h3> <p>These functions are only available on Windows and only when using the <code>Rgui</code>, hence not in <code>ESS</code> nor <code>RStudio</code>. </p> <h3>See Also</h3> <p><code><a href="winDialog.html">winDialog</a></code></p> <h3>Examples</h3> <pre>## Not run: winMenuAdd("Testit") winMenuAddItem("Testit", "one", "aaaa") winMenuAddItem("Testit", "two", "bbbb") winMenuAdd("Testit/extras") winMenuAddItem("Testit", "-", "") winMenuAddItem("Testit", "two", "disable") winMenuAddItem("Testit", "three", "cccc") winMenuAddItem("Testit/extras", "one more", "ddd") winMenuAddItem("Testit/extras", "and another", "eee") winMenuAdd("$ConsolePopup/Testit") winMenuAddItem("$ConsolePopup/Testit", "six", "fff") winMenuNames() winMenuItems("Testit") ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>