ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • Adding menu options into the context menu
  • Context menu and group of controls
  • Horizontal Table control
  • Changing the context menu and storing information about the Table controls
  • Limitations
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
Warning
From version 28, PopupMenu is kept for backward compatibility. This property is replaced by ContextMenu.
The ContextMenu property is used to:
  • Get the custom context menu of a control, window or page.
  • Change the custom context menu of a control, window or page (or associate another context menu).
  • WINDEVUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetJava Customize the system menus of the controls by adding options.
Reminder: A context menu is a menu that is opened by the user via a right mouse click. You can create context menus directly in the window or page editor, in the UI tab of the control description window. The arrow on the right of the "Context menu" field allows you to edit or create a context menu in the editor. For more details, see:
WINDEVUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetJava Remark: Some types of controls (edit controls, tables, ...) have a default context menu (displayed if no custom context menu is associated with the control). This system menu can also be disabled.
Example
WINDEV
// Code used to modify the context menu associated with the button
// Popup1 and Popup2 are existing context menus
IF BTN_Button1.ContextMenu = "Popup1" THEN
BTN_Button1.ContextMenu = "Popup2"
ELSE
// Restores the default AAF context menu
BTN_Button1.ContextMenu = ""
END
WINDEVAndroidiPhone/iPad
// Initialization code of edit control
// Adds the Popup1 menu after the system context menu of the control
// Popup1 is an existing context menu
MySelf.ContextMenu = "+Popup1"
Syntax

Getting the context menu of a control, window or page Hide the details

<Menu> = <Element>.ContextMenu
<Menu>: Character string
  • Name of custom context menu associated with the object,
  • Empty string ("") if no custom context menu is associated with the object.
<Element>: Control, window or page name
Element for which the name of the context menu should be retrieved:
  • Control name,
  • Window name,
  • Page name.

Changing the context menu of a control, window or page Hide the details

<Element>.ContextMenu = <New menu>
<Element>: Control, window or page name
Name of the element for which the context menu should be modified:
  • Control name,
  • Window name,
  • Page name.
<New menu>: Character string or constant
Name of new custom context menu associated with the object (empty string to restore the system context menu).
WINDEVUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetJava To add a context menu to the system menu, you must:
  • write the "+" sign in front of the menu name (to display the new menu after the options of system menu).
  • write the "+" sign after the menu name (to display the new menu before the options of system menu).
  • specify an empty string ("") to use the AAF default context menu.
WINDEVAndroidiPhone/iPadIOS WidgetJava You also have the ability to use the following constants:
contextMenuDisabledUsed to disable the display of all the context menus (including the system context menus or the context menus for the Currency + Euro edit controls).
Android This constant is not available.
contextMenuSystemUsed to disable the display of menu options specific to the AAFs (Automatic Application Features). Only the Windows context menu is displayed.
Also allows you to access the Unicode options available for some Windows systems ("Read from right to left, Display the Unicode control characters, ...").
Remarks

Adding menu options into the context menu

The ContextMenu property cannot be used to cumulate the custom context menus associated with a control. However, you can add options to an existing context menu using MenuAddMenu, MenuAddOption, ... For more details, see Menu management functions.

Context menu and group of controls

A context menu can be associated with a group of controls: all the controls belonging to the group will have the same context menu. In read mode, <Result> always corresponds to an empty string ("").
WINDEVWindows

Horizontal Table control

The system context menu of the Horizontal Table controls does not contain the export options.

Changing the context menu and storing information about the Table controls

When changing the context menu, the persistent information previously saved for the Table control (size of columns, ...) is not available anymore. This information is reinitialized.

Limitations

The ContextMenu property applies only to controls in a window (including columns in Table controls). This property cannot be used with menus, etc.
The ContextMenu property does not apply to the following controls:
  • Static
  • Non-clickable image
  • Progress Bar
  • Shape
Java The ContextMenu property can only be used with the following elements:
  • Button.
  • Edit control.
  • Image.
  • Check Box.
  • Radio Button.
  • List Box.
  • Combo Box.
  • TreeView.
  • Tab.
  • Window.
  • Column of Table control.
  • Supercontrol.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/24/2023

Send a report | Local help