ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Menu functions
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
Adds a new menu to an existing drop-down or context menu of a window or page. This new menu can contain:
To insert a menu at a specific location, use MenuInsertMenu.
Example
WINDEV
// Adds a new menu to MENU_MyMenu
MenuAddMenu(MENU_MyMenu, "OPT_Schedule", "Schedule")
// Adds an option to the new OPT_Schedule menu
MenuAddOption("OPT_Schedule", "OPT_Create", "Create", Create_Schedule)
// Associates an image with the OPT_Create menu option
{"OPT_Create", indControl}..Image = "schedule.png"
// Add a separator
MenuAddSeparator("OPT_Schedule")
// Adds a new option (OPT_View)
MenuAddOption("OPT_Schedule", "OPT_View", "View", View_schedule)
Syntax

Adding a menu Hide the details

<Result> = MenuAddMenu(<Source menu> , <Menu to create> , <Caption>)
<Result>: Integer
Position of the menu. If the menu is not added, a fatal error occurs.
<Source menu>: Menu name
Name of the drop-down or context menu to which the new menu should be added. The name of the menu corresponds to:
  • WINDEV the name of the main menu in the window. The new menu will be added after the options of the main menu.
  • the name of a context menu. The new menu will be added after the options of the context menu.
  • the name of a menu option. This option will then be transformed into a menu.
PHP Remarks: Context menus are not available.
<Menu to create>: Character string
Name of the menu to be added. This name will be used to programmatically handle the menu. A fatal error occurs if this name corresponds to an existing menu.
<Caption>: Character string
Text of the new menu. This text will be displayed in the window or page.
WEBDEV - Server codePHP

Adding a menu while associating it with WLanguage code Hide the details

<Result> = MenuAddMenu(<Source menu> , <Menu to create> , <Caption> , <WLanguage procedure> [, <Procedure parameter>])
<Result>: Integer
Position of the menu. If the menu is not added, a fatal error occurs.
<Source menu>: Control name
Name of the menu to which the new menu should be added. The name of the menu corresponds to:
  • the name of a context menu. The new menu will be added after the options of the context menu.
  • to the name of a submenu.
Remark: This name must be different from the name of a main menu.
<Menu to create>: Character string
Name of the menu to be added. This name will be used to programmatically handle the menu. A fatal error occurs if this name corresponds to an existing menu.
<Caption>: Character string
Text of the new menu. This text will be displayed in the page.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called when the menu is selected.
<Procedure parameter>: Any optional type
Parameter that can be passed to <WLanguage procedure> when the menu is selected by the user.
Component: wd290obj.dll
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2023

Send a report | Local help