| **Navigation:**  [[introduction.htm|Language Reference]] > 8 - Controls > Control Declarations > ====== MENU (declare a menu box) ====== | [[list declare a window list control .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ole declare a window ole or ocx container control .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} | **MENU(**//text//**)** | [,**AT( )** ] [,**USE( )**] [,**KEY( )**] [,**MSG( )**] [,**HLP( )**] [,**STD( )**] [,**RIGHT**] [,**DISABLE**] [,**COLOR**] [**LEFT( )**] [,**HIDE**] | | | [,**ICON( )**] [,**FONT( )**] | [,| **FIRST**| ] | | | | | **LAST**| | | **END** | | | {{blk2blue.jpg|blk2blue.jpg}} | **MENU** | Declares a menu box within a MENUBAR. | | //text// | A string constant containing the display text for the menu selection (PROP:Text). | | **AT** | Specifies the width and height of the menu box ([[at set position and size .htm|PROP:AT]]). If omitted, default values are selected by the runtime library. The first two parameters of the AT attribute are ignored. The fixed width specified by the AT attribute includes (and therefore must be greater than) the text offset specified by the LEFT attribute. The specified width of the area to draw the menu box can be less than the width of the default area provided by Windows, and the runtime library uses the full width of the specified area. | | **USE** | A field equate label to reference the menu selection in executable code(PROP:USE). | | **KEY** | Specifies an integer constant or keycode equate that immediately opens the menu (PROP:KEY). | | **MSG** | Specifies a string constant containing the text to display in the status bar when the menu is pulled down (PROP:MSG). | | **HLP** | Specifies a string constant containing the help system identifier for the menu (PROP:HLP). | | **STD** | Specifies an integer constant or equate that identifies a "Windows standard behavior" for the menu (PROP:STD). | | **RIGHT** | Specifies the MENU appears at the far right of the action bar (PROP:RIGHT). | | **DISABLE** | Specifies the menu appears dimmed when the WINDOW or APPLICATION is first opened (PROP:DISABLE). | | **COLOR** | Specifies the background, foreground, and selected color for the menu control .(see.[[color set color .htm|COLOR]]) | | **LEFT** | Specifies the offset in dialog units from the left edge of the menu structure. | | **HIDE** | Specifies the MENU does not appear when the WINDOW or APPLICATION is first opened (PROP:HIDE). UNHIDE must be used to display it. | | **ICON** | Specifies an image file or standard icon to display on the menu (PROP:ICON). | | **FONT** | Specifies the display font for the control (PROP:FONT). | | **FIRST** | Specifies the MENU appears at the left or top of the menu when merged (PROP:FIRST). | | **LAST** | Specifies the MENU appears at the right or bottom of the menu when merged (PROP:LAST). | **MENU** declares a drop-down or cascading menu box structure within a MENUBAR structure. When the MENU is selected, the MENU and/or ITEM statements within the structure are displayed in a menu box. A menu box usually appears (drops down) immediately below its //text// on the menu bar (or above, if there is no room below). When selected with ENTER or RIGHT ARROW, any subsequent menu drop-box appears (cascades) immediately to the right of the MENU //text// in the preceding menu box (or left, if there is no room to the right). LEFT ARROW backs up to the preceding menu. The KEY attribute designates a separate accelerator key for the field. This may be any valid Clarion keycode to immediately pull down the MENU. The //text// string may contain an ampersand ( & ) which designates the following character as the accelerator "hot" key which is automatically underlined. If the MENU is on the menu bar, pressing the Alt key together with the accelerator key highlights and displays the MENU. If the MENU is within another MENU, pressing the accelerator key, alone, highlights and executes the MENU. If there is no ampersand in the //text//, the first non-blank character in the //text// string is the accelerator key for the MENU, but it will not be underlined. To include an ampersand as part of the //text//, place two ampersands together (&&) in the //text// string and only one will display. **Example:** !An MDI application frame window with main menu for the application: MainWin APPLICATION('My Application'),SYSTEM,MAX,ICON('MyIcon.ICO'),STATUS,HVSCROLL,RESIZE MENUBAR MENU('File'),USE(?FileMenu),FIRST ITEM('Open…'),USE(?OpenFile) ITEM('Close'),USE(?CloseFile),DISABLE ITEM('E&xit'),USE(?MainExit) END MENU('Edit'),USE(?EditMenu),KEY(CtrlE),HLP('EditMenuHelp') ITEM('Undo'),USE(?UndoText),KEY(CtrlZ),STD(STD:Undo),DISABLE ITEM('Cu&t'),USE(?CutText),KEY(CtrlX),STD(STD:Cut),DISABLE ITEM('Copy'),USE(?CopyText),KEY(CtrlC),STD(STD:Copy),DISABLE ITEM('Paste'),USE(?PasteText),KEY(CtrlV),STD(STD:Paste),DISABLE ITEM,SEPARATOR,USE(?FileSeprator1) END MENU('Window'),STD(STD:WindowList),MSG('Arrange or Select Window'),LAST ITEM('Tile'),STD(STD:TileWindow) ITEM('Cascade'),STD(STD:CascadeWindow) ITEM('Arrange Icons'),STD(STD:ArrangeIcons) END MENU('Help'),USE(?HelpMenu),LAST,RIGHT ITEM('Contents'),USE(?HelpContents),STD(STD:HelpIndex) ITEM('Search for Help On…'),USE(?HelpSearch),STD(STD:HelpSearch) ITEM('How to Use Help'),USE(?HelpOnHelp),STD(STD:HelpOnHelp) ITEM('About MyApp…'),USE(?HelpAbout) END END END See Also: [[menubar_declare_a_pulldown_menu_.htm|Menubar]] [[item_declare_a_menu_item_.htm|Item]]