ITEM (declare a menu item)

Top  Previous  Next



[,AT( ) ] [,USE( )] [,KEY( )] [,MSG( )] [,HLP( )] [,STD( )] [,CHECK] [,DISABLE] [,COLOR] [,LEFT( )] [,HIDE]



[,| FIRST| ]





Declares a menu choice within a MENUBAR or MENU structure.


A string constant containing the display text for the menu item (PROP:Text).


Specifies the width and height of the menu item (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 item 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.


A field equate label to reference the menu item in executable code, or the variable used with CHECK (PROP:USE).


Specifies an integer constant or keycode equate that immediately executes the menu item (PROP:KEY).


Specifies a string constant containing the text to display in the status bar when the menu item is highlighted (PROP:MSG).


Specifies a string constant containing the help system identifier for the menu item (PROP:HLP).


Specifies an integer constant or equate that identifies a "Windows standard action" the menu item executes (PROP:STD).


Specifies an on/off ITEM (PROP:CHECK).


Specifies the menu item appears dimmed when the WINDOW or APPLICATION is first opened (PROP:DISABLE).


Specifies the background, foreground, and selected color for the menu item control.(see.COLOR)


Specifies the offset in dialog units from the left edge of the menu structure.


Specifies the ITEM does not appear when the WINDOW or APPLICATION is first opened (PROP:HIDE). UNHIDE must be used to display it.


Specifies the ITEM displays a solid horizontal line across the menu box at run-time to delimit groups of menu selections. The USE attribute may be specified with SEPARATOR.


Specifies an image file or standard icon to display on the menu item (PROP:ICON).


Specifies the display font for the control (PROP:FONT).


Specifies the ITEM appears at the top of the menu when menus are merged (PROP:FIRST).


Specifies the ITEM appears at the bottom of the menu when menus are merged (PROP:LAST).

ITEM declares a menu choice within a MENUBAR or MENU structure. The text string may contain an ampersand ( & ) which designates the following character as an accelerator "hot" key which is automatically underlined. If the ITEM is on the menu bar, pressing the Alt key together with the accelerator key highlights and executes the ITEM. If the ITEM is in a MENU, pressing the accelerator key, alone, when the menu is displayed, highlights and executes the ITEM. If there is no ampersand in the text, the first non-blank character in the text string is the accelerator key for the ITEM, which 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. The KEY attribute designates a separate "hot" key for the item. This may be any valid Clarion keycode to immediately execute the ITEM's action.

A cursor bar highlights individual ITEMs within the MENU structure. Each ITEM is usually associated with some code to be executed upon selection of that ITEM, unless the STD attribute is present. The STD atribute specifies a standard Windows action the menu item performs, such as Tile or Cascade the windows. The SEPARATOR attribute creates an ITEM which serves only to delimit groups of menus selections so it should not have a text parameter. The USE attribute may be used with a SEPARATOR. It creates a solid horizontal line across the menu box. An ITEM that is not within a MENU structure is placed on the menu bar. This creates a menu bar selection which has no related drop-down menu. The normal convention to indicate this to the user is to terminate the text displayed for the item with an exclamation point (!). For example, the text for the ITEM might contain 'Exit!' to alert the user to the executable nature of the menu choice.

Events Generated:


The control has been pressed by the user.







      ITEM('Open...'),USE(?OpenFile) ,HLP('OpenFileHelp') ,FIRST


      ITEM('Auto Increment'),USE(ToggleVar),CHECK









     MENU('Window'),STD(STD:WindowList),MSG('Arrange or Select Window'),LAST



       ITEM('Arrange Icons'),STD(STD:ArrangeIcons)





       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),MSG('Copyright Info'),LAST


    END !Menubar

   END  !Application