ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Drop-down menus / WINDEV and WINDEV Mobile
  • Overview
  • Principle
  • WLanguage functions
  • WLanguage properties
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The menu options can be handled:
Principle
Options are handled in the same way in context menus and main menus.
To handle a menu option programmatically, use the following syntax:
  • "<Option name>" if the menu option is handled from the window.
  • "<Window name>.<Menu name>.<Option name>" if the option is handled from another window.
Remark: You can also handle context menus programmatically, not only their options. For more details, see Custom context menu.

WLanguage functions

WINDEV and WINDEV Mobile include several WLanguage functions specific to menu options:
EnumMenuReturns:
  • the name of nth option or sub-option found in the main menu of window.
  • the name of nth option or sub-option found in a custom context menu (created with WINDEV or WINDEV Mobile).
MenuAddAdds an existing popup menu into the main menu of the current window.
MenuAddMenuAdds a new menu to an existing drop-down or context menu of a window or page.
MenuAddOptionAdds a new option after the last option of a drop-down or context menu.
MenuAddSeparatorAdds a new separator in a menu (drop-down or context menu).
MenuCloneClones a menu or a menu option as well as the associated code.
MenuDeleteDeletes a menu or a menu option.
MenuExistIndicates whether a menu option exists in a menu.
MenuInsertMenuInserts a menu before another menu in a window.
MenuInsertOptionInserts a new option at a specific position.
MenuInsertSeparatorInserts a separator into a menu.
MenuInvisibleMakes a menu option invisible (popup menu or drop-down menu).
MenuIsMarkedUsed to find out whether a checkmark is displayed in front of a menu option (popup menu or drop-down menu).
MenuLabelGets or changes the label of a menu option (context or drop-down menu).
MenuMarkPositions the checkmark in front of the menu option (popup menu or drop-down menu).
MenuSelectMinusDisables (grays out) a menu option (popup menu or drop-down menu).
MenuSelectPlusEnables a menu option (popup menu or drop-down menu).
MenuStateIdentifies the state of a menu option (context menu or drop-down menu): active, inactive or invisible.
MenuUnMarkRemoves the checkmark displayed in front of the menu option (popup menu or drop-down menu).

WLanguage properties

WINDEV and WINDEV Mobile include several WLanguage properties specific to menu options:
CaptionGets and sets the text of a menu option
CheckedAllows you to use a checkmark () next to a menu option.
GroupDetermines if the menu option is part of a group of controls
ImageGets and sets the image of a menu option
MessageGets and sets the help message of a menu option
NameGets the name of a menu option
OccurrenceGets the number of options in a menu.
ReportGets and sets the state of a menu option (active, inactive or grayed)
TypeDetermines if the element used is a menu option
ValueGets and sets the number associated with a menu option
VisibleDetermines if a menu option is visible and shows or hides the option
Related Examples:
Managing the main menu of a window by programming Unit examples (WINDEV): Managing the main menu of a window by programming
[ + ] Handling the options found in the main menu of a window. This example is used to:
- Select or deselect a menu option
- Make a menu option visible or invisible
- Modifying the caption of a menu option
- Mark or unmark a menu option
- Run the code of a menu option
WD Animated Menu Training (WINDEV): WD Animated Menu
[ + ] The "WD Animated Menu" example proposes several menu animations, based on the interface of the full example named "WD Managing Orders".
These animations allow the main menu to be more attractive and dynamic when opening the window:
- appearance of the menu buttons with a fade-in effect,
- movement of the buttons
- etc.
WD LastDocuments Sample components (WINDEV): WD LastDocuments
[ + ] This example explains how the list of last opened documents can be added to the application menu.
This insertion is performed via a class proposed in the "LastDocuments" component.
Four code lines are sufficient to insert the list of last opened documents into an existing application.
These processes can be found in:
- the declaration code of the global variables of the main window,
- the code of the OpenDocument procedure,
- the code of the menu options "File 1" to "File 10".
The example has been simplified regarding the number of features (text files only) in order to highlight the use of the component.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/26/2023

Send a report | Local help