|
|
|
|
- Overview
- Characteristics of a menu option
- Overview
- Type of option ("General" tab of the description window)
- Caption of a menu option
- Translating the text of menu options
- Marking/Unmarking a menu option
- Image associated with a menu option
- Background color of menus and menu options
- Keyboard shortcut associated with a menu option
- Displaying the code of a menu option
Characteristics of menu options
WINDEV and WINDEV Mobile support two types of drop-down menus: - main window menus.
A main menu is always associated with a window. This menu can be displayed under the window's title bar. For more details, see Managing main window menus. In a mobile application, the menu is displayed via the Action Bar control. For more details, see Action Bar of a window. - custom context menus.
The user can open a context menu by pressing the right mouse button. For more details, see Custom context menu.
A drop-down menu (main or custom context menu) is composed of one or more options and sub-options. Each option runs a WLanguage code. For example: In the editor, you can handle menu options in the same way for both main menus and custom context menus. To handle the menu options, simply edit the relevant menu. To edit (or display in the editor): - The main menu of a window:
- open the relevant window in the window editor.
- select one of the menu options. The options and the sub-options are automatically displayed.
- A custom context menu: on the "Window" tab, in the "Bars and menus" group, expand "Popup menus" and select one of the existing context menus.
Remark: WINDEV and WINDEV Mobile also allow you to: Characteristics of a menu option Overview Like controls, menu options have a description window. This description window allows you to configure different aspects of the menu option. To open the description window of an option, select "Option description" in the context menu. Type of option ("General" tab of the description window) There are three types of menu options: - Standard: Menu option corresponding to a text, with or without a check box or image.
- Separator: Menu option corresponding to a separator, i.e. a separating line between different options.
- Break: Menu option consisting of a text and a separator on the same line. Generally, this type of option groups options together under a given name.
Caption of a menu option "Standard" or "Break" menu options are associated with a text. The text of a menu option can be edited: - from the "General" tab of the option description window.
- directly in the window being edited:
- Select a menu option.
- Press the Space key.
- Edit the text in the input area.
- Press Enter to validate.
Remark: You can also select "Edit the caption" in the context menu of the menu option.
Tip: To make text bold in the menu option, simply enclose the desired text between <B> and </B> through programming. For example: OPT_New.Caption = "Rename '''Sheet 1'''"
Translating the text of menu options You can translate the text of menu options: - from the "General" tab of the option description window.
- in the editor directly:
- Display the window in the translation language: on the "Display" tab, in the "Options" group, expand "Language displayed" and select the desired language.
- The captions of controls and menu options are displayed in the selected language.
- Type the text of options in the selected language (Space key on the menu options).
Reminder: In a multilingual project, the text entered when creating a menu option is applied to all languages supported by the current window Marking/Unmarking a menu option "Standard" menu options can be preceded: - by a check mark ().
- by a bullet. For example, this checkmark identifies active features.
To mark a menu item in the editor: - Select the menu option to mark.
- Open the "UI" tab in the description window of the menu option ("Option description" in the context menu).
- Select the checkmark style to use:
- Default ()
- Bullet (Radio Button).
- Specify whether the option should be checked by default.
- Validate.
The selected mark will appear next to the active option when the menu is displayed. You can use functions multiple properties to handle the mark of an option: - WLanguage functions:
| | MenuIsMarked | Used to find out whether a checkmark is displayed in front of a menu option (popup menu or drop-down menu). | MenuMark | Positions the checkmark in front of the menu option (popup menu or drop-down menu). | MenuUnMark | Removes the checkmark displayed in front of the menu option (popup menu or drop-down menu). | - WLanguage properties:
| | Checked | The Checked property is used to get and modify the checkmark state of an element. |
Remarks: - The MenuMark and MenuUnmark functions are equivalent to the Checked property.
Only the Checked property is available. - In most cases, a menu option cannot be preceded by both a checkmark and an image.
- Options cannot be checked or unchecked.
Image associated with a menu option An image can be shown next to "Standard" and "Break" menu options.
To display an image in front of a menu option: - Select the menu option in front of which the image must be displayed.
- Open the "UI" tab in the description window of the menu option ("Option description" in the context menu).
- Select the image to display. This image can be chosen in the image catalog (click the button and select the "Catalog" option).
- Validate.
Remarks: - To get or set the image associated with a menu option, use the Image property.
- In most cases, a menu option cannot be preceded by both a checkmark and an image.
Displaying the code of a menu option To display the code of a menu option: - Select the desired menu option.
- Right-click to open the context menu of the option.
- Select "Code". The code window of the current menu option is displayed.
Remarks: - The code of a menu option can also be displayed from its description window. To do so, click . This code corresponds to the code run when the menu option is selected by the user. You can add optional events via the "Add other events to xxx" link at the bottom of the code window.
- Only menu options that do not have a submenu can launch a WLanguage event.
- "Standard" menu options can also be associated with a preset action. For more details, see Preset_action.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|