User Tools

Site Tools


menu_editor.htm
Navigation:  Window Designer >====== Menu Editor ====== Previous pageReturn to chapter overviewNext page

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.

TipBox.jpg

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

New Menu(SHIFT+INSERT)NewMenu.jpg This button adds a new MENU statement, its Menu Text, and its corresponding END statement. The MENU is added after the highlighted line. MENUs may be nested within other menus. MENUs may contain MENUs or ITEMs.
New Item(INSERT)NewMenuItem.jpg This button inserts an ITEM after the highlighted line. Note that ITEMs are used to execute commands or procedures, whereas MENUs are used to display a selection of other MENUs or ITEMs.
New Separator(CTRL+INSERT)NewSeparator.jpg To add a separator bar after the currently highlighted MENU or ITEM, press the Separator button.TipBox.jpgSeparator bars can provide the user with a visual cue that a group of ITEMs on the menu perform related functions.
Delete Menu/Item Button(DELETE)DeleteMenu.jpg To delete the currently highlighted MENU, ITEM, or SEPARATOR, press the Delete button. If you delete a MENU statement, all ITEMs and MENUs within it, and its associated END statement are also deleted.
Move Buttons(CTRL+UP Arrow)(CTRL+Down Arrow)MoveMenuUp.jpgMoveMenuDown.jpg To move the currently highlighted MENU, ITEM, or SEPARATOR up or down in the menu list, press the or ¯ button. When moving a MENU, all ITEMs and MENUs within it, and its associated END statement move also.
Actions(CTRL + A) Calls the Actions dialog (see below). Use the Actions tab 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.
Embeds(CTRL + E) Accesses the Embedded Source dialog for points surrounding the event handling for this menu item only.

Menu Properties:

Flags

Check To create an on/off toggle for a selected ITEM, set the Check property to True. The ITEM should have a numeric variable in the Use field. The variable should be declared using one of the data dialogs, or in embedded source. The Menu Editor adds the CHECK attribute to this ITEM.With the CHECK attribute, when the user selects the ITEM for the first time, the ITEM is “on,” the Use Variable's value is one (1), and a check mark appears beside the ITEM. When the user selects the ITEM a second time, the ITEM is “off,” the Use Variable's value is zero (0) and no check mark is displayed. You should add source code to control the application's behavior depending on the state of the Use Variable.
Disable To disable a MENU or ITEM (dim the text and make it unavailable to the user), set Disable to True. This adds the DISABLE attribute to the MENU or ITEM statement.TipBox.jpgThe Disable box is handy when you incorporate modality into a program–that is, when one type of child window does not support the same commands another type does. For the type that doesn't support the command, disable the ITEM rather than omitting it. This will avoid confusing the user with menu ITEMs that disappear and reappear depending on which window is active.
Right To right justify the selected MENU on the action bar, set Right to True. This is available only for MENUs on the action bar. Nested MENUs (subMENUs) cannot be right justified. Checking this box displays the selected MENU, and all MENUs after the selected MENU, at the far right of the action bar.

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.NoteBox.jpgA 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.TipBox.jpgYou 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.TipBox.jpgA 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.NoteBox.jpgYou 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.
menu_editor.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1