ONLINE HELP
 WINDEVWEBDEV 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 also have the ability to handle the context menus through programming (not only their options). For more details, see Custom context menu.

WLanguage functions

WINDEV and WINDEV Mobile propose several WLanguage functions specific to the 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 propose several WLanguage properties specific to the menu options:
CaptionUsed to find out and modify the caption of a menu option
CheckedUsed to manage a checkmarkin front of the menu option.
GroupUsed to find out whether the menu option belongs (or not) to a group of controls
ImageUsed to find out and modify the image of a menu option
MessageUsed to find out and modify the help message of a menu option
NameUsed to find out the name of a menu option
OccurrenceUsed to find out the number of options in a menu.
ReportUsed to find out and modify the display status (active, inactive or grayed) of a menu option
TypeDetermines if the element used is a menu option
ValueUsed to find out and modify the number associated with a menu option
VisibleDetermines if a menu option is visible and shows or hides the option
Related Examples:
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