The Menu Editor dialog visually represents a Clarion MENUBAR data structure. The menu tree (on the left hand side of the dialog) appears as simplified Clarion language syntax, containing these Clarion keywords:
A MENUBAR keyword at the top.
A MENU statement or statements followed by a menu name, and a corresponding END statement.
An ITEM statement or statements followed by an item name.
To access the Menu Editor, there are several methods:
·Double-click anywhere on the MENUBAR
·Right-click on the MENUBAR and select Edit Menu from the popup menu.
·Click on the MENUBAR and select the Edit Menu link from the Properties Pad
Menu Editor command buttons allow you to add and delete MENUs and ITEMs. You may also move MENUs and ITEMs within the MENUBAR structure with the “up arrow” and “down arrow” buttons.
The right hand side of the dialog lets you specify the text of your MENUs and ITEMs, the equate labels used to reference the MENUs and ITEMs in executable code, and the actions that occur when the user selects an ITEM.
When using the Application Generator, each ITEM you place on a MENU or MENUBAR automatically adds an embed point to the control event handling tree in the Embedded Source dialog. This lets you easily attach functionality to your ITEMs.
Menu Editor Buttons
Menu Properties:
Flags
Color
Enter a valid color equate in the TextColor or BackColor fields, or press the ellipsis (…) button to select a color from the Color dialog. The Window Designer adds the COLOR attribute to your MENU or ITEM declaration.
General
NoMerge | To tell Clarion never to merge this MENUBAR with other MENUBARs, set the No Merge to True. This is available only for the MENUBAR, not for MENUs or ITEMs. See the Language Reference for more information on the NOMERGE attribute. |
Text | Type the text you want displayed for this MENU or ITEM. For example, type &FILE, so the end user sees File. The ampersand within the Menu Text field signifies the character following the ampersand is the accelerator key. That is, the character is underlined, and, when the user presses the accelerator key, the action associated with the ITEM is executed.A MENU accelerator key requires THE ALT key to take effect, whereas an ITEM accelerator key does not require the ALT key, but does require that the ITEM be currently displayed. See Hot Key below for another method of accessing your MENUs and ITEMs. |
TextFont | Calls the Font dialog which lets you change the font (typeface), size, style (such as bold or italic), color, and font effects (underline and strikeout) for the selected MENU or ITEM As you choose options, the dialog box displays a sample of the selected font. |
Use | This defines the USE attribute for the control. Type a Field Equate Label.A Field Equate Label has a leading question mark ( ? ), and you should make it descriptive. For example ?File shows this menu is to manipulate a file. You can refer to the MENU within executable code by its Field Equate Label. |
Icon | Specify the ICON you want displayed for this MENU or ITEM. |
Std | To specify a standard windows action for your menu ITEM, select one of the equates listed below in the Std field. Clarion will automatically implement the command using standard windows behavior; you do not need any other support for it in your code. The standard equate labels and their associated actions are also contained in the ..\LIBSRC\EQUATES.CLW file.STD:PrintSetupPrinter Options Dialog.STD:CloseCloses active window.STD:UndoReverses the last editing action.STD:CutDeletes selection, copies to clipboard.STD:CopyCopies selection to clipboard.STD:PastePastes clipboard contents at the insertion point.STD:ClearDeletes selection.STD:TileWindowArranges child windows edge to edge.STD:TileHorizontalArranges child windows edge to edge.STD:TileVerticalArranges child windows edge to edge.STD:CascadeWindowArranges child windows so all title bars are visible.STD:ArrangeIconsArranges iconized child windows.STD:WindowListAdds child window names to menu.STD:HelpOpens .HLP file to the contents page.STD:HelpIndexOpens .HLP file to the index.STD:HelpOnHelpOpens Microsoft's .HLP file for the Windows Help system.STD:HelpSearchOpens Microsoft's Help Search utility for the .HLP file. |
Position First | To force the selected MENU or ITEM to the first position when merging menus, set this property to True. This adds the FIRST attribute to the MENU or ITEM statement. |
Position Last | To force the menu or item to the last position when merging menus, set this property to True. This adds the LAST attribute to the MENU or ITEM statement. |
LeftOffset | Specify the level of indention for the MENU or ITEM (in dialog units). This sets the parameter for the LEFT attribute. |
AT (Height and Width) | Control the height and width of the selected menu or item |
Default | If set to True, the Clarion runtime library determines the size based on the applicable font and text value. |
Value | When Default is set to False, Value lets you set a precise width or height in Dialog units on a window. |
Help
HelpID | Type either a help keyword or a context string present in a .HLP file.If you fill in the Help ID for a MENU or an ITEM, when the user highlights the MENU or ITEM and presses the F1 key, the help file opens to the referenced topic.The Help ID field (HLP attribute) takes a string constant specifying the key for accessing a specific topic in a Windows Help file. This may be either a Help keyword or a context string. When referencing a context string in the Help ID field, you must identify it with a leading tilde (~). |
Key | Press this button to open the Input Key dialog. Use this dialog to add the KEY attribute to your MENU or ITEM. The KEY attribute specifies a “hot” key or key combination.A hot key is very similar to an accelerator key. A hot key or hot key combination allows the end user to immediately display a MENU, or execute the action associated with an ITEM, without mouse clicking, and without displaying the menu that contains the ITEM. Customarily, hot keys take the form of CTRL + character, or CTRL + SHIFT + character.You may want to add the hot key combination to the menu text to signal its availability to the user. See the Windows Design appendix in the User's Guide for a list of common hot keys associated with standard windows commands. |
Message | Type the MSG attribute contents.This message text displays in the status bar (if enabled) when the user highlights this MENU or ITEM. |
Mode
Hide | Specifies that the menu or item does not appear when the WINDOW or APPLICATION is first opened. UNHIDE must be used to display the target menu or item. |
Actions (CTRL + A)
Use the Actions properties to add functionality to your menu item. Filling in these prompts causes the menu item to execute an action when the user selects the menu item.
When Pressed | From the drop down list, choose Call a Procedure, Run a Program, or No Special Action.The procedure or program you specify executes when the user selects the menu item. The choices are: |
Call a Procedure | You must specify the Procedure Name, and whether the procedure will Initiate a Thread. |
Procedure Name | From the Procedure Name drop down list, choose an existing procedure name, or type a new procedure name. A new procedure appears as a “ToDo” item in your Application Tree. |
Initiate a Thread | Optionally check the Initiate a Thread box. If the procedure initiates a thread, specify the Thread Stack size. Clarion uses the START function to initiate a new execution thread. You can optionally specify Parameters, Requested File Action, or both.A MENU ITEM on an application frame toolbar that calls an MDI child procedure must initiate a thread. |
Thread Stack | Accept the default value in the Thread Stack spin box unless you have extraordinary program requirements. To change the value, type in a new value or click on the spin box arrows. |
Parameters | In the Parameters field, optionally type a list of variables or data structures passed to the procedure. |
Return Value Variable | If the procedure called is prototyped to return a value, press the ellipsis button here to select a variable to receive the returned value.Optionally check the Reference Assign check box if the variable defined is a reference variable |
Requested File Action | From the drop down list, optionally select None, Insert, Change, Delete, or Select. The default selection is None. The Global Request variable gets the selected value. The called procedure can then check the value of the Global Request variable and perform the requested file action. |
Run a Program | You must specify the Program Name, and optionally, any parameters. |
Program Name | Type the program name. The program name must be in your path or current folder, else enter the full path and executable program. Quotes are added to your entry so you don't need to enter any. |
Parameters | Optionally type a list of values that are passed to the program. |
No Special Action | Choose this option if you are providing your menu item's functionality with another method, such as embedded source, or an STD ID.You may combine a procedure or program call with embedded source, but not with an STD ID. |
Embeds(CTRL + M) | Accesses the Embedded Source dialog for points surrounding the event handling for this menu item only. |