ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Context Menu control
  • Overview of the Context Menu control
  • Creating a Context Menu control
  • Other creation modes
  • Characteristics of the Context Menu control
  • Associating a context menu with an element
  • How to?
  • Listing the available context menus
  • Editing a context menu
  • Deleting a context menu
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 of the Context Menu control
Context menus are often used in websites. WEBDEV includes a specific control to handle these context menus: the Context Menu control.
Options are created in the same way as for a drop-down menu.
A context menu can be associated with a control, a control template or an entire page.
Creating a Context Menu control
To create a Context Menu control:
  1. On the "Page" tab, in the "Edit" group, expand "Context menus" and select "New context menu".
  2. The Context Menu control appears in the editor.
  3. Add menu options to the new context menu. For more details, see Handling menu options.

Other creation modes

You can also create a custom context menu:
  • from the "UI" tab of the description of a page or control. Simply click the button to the right of the "Context menu" combo box and select "Create a new context menu". A page for editing the new custom context menu opens. This context menu will be automatically associated with the current element (or with all the elements in case of multi-selection).
    New context menu
  • from the "Manage context menus" window. Simply click the "New" button and enter the name of the new context menu.
    Remark: To open the "Manage context menus" window, go to the "Page" tab, "Edit" group, expand "Context menus" and select "Edit".
Characteristics of the Context Menu control
To edit the description of the context menu currently displayed in the editor:
  1. On the "Modification" tab, in the "Quick edit" group, click "Description".
  2. The control description window appears.
Remark: You can also open the description window of the context menu via a right click.
The main characteristics are as follows:
  • Menu orientation ("General" tab): The options are as follows:
    • Vertical Popup (default): The submenu of a context menu option opens next to the parent option.
    • Vertical Drop-down: The submenu of a context menu option opens below the parent option.
  • Selected option ("General" tab): Context menu option selected by default.
    Remark: The option selected by default can be changed programmatically using the Selected property.
  • Value of page controls ("UI" tab): Specifies that the process will be executed on the controls of the page (send values to the server, don't send, etc.). By default, no data is sent to the server when a context menu option is clicked.
At runtime:
  • opening the context menu does not dim disabled windows.
  • the context menu is opened either programmatically or by right-clicking a control associated with the context menu.
  • the context menu is closed automatically.
Remarks:
  • The space between menu options cannot be adjusted.
  • The menu style allows you to define the appearance of the menu options (colors, font, etc.).
Associating a context menu with an element

How to?

To associate a custom context menu with one or more elements (page or controls):
  1. Select the elements you want to associate with the context menu.
  2. Go to the "UI" tab in the description window of the current element(s) ("Description" in the context menu).
  3. The "Context menu" combo box allows you to configure the context menu:
    • the Context menu creation icon button is used to create a new context menu.
      New context menu
    • you can select the desired context menu in the combo box.
  4. Validate.
Remarks:
  • To edit the selected context menu, click the Context menu edit icon button to the right of "Context menu" combo box and select "Edit this context menu".
  • To programmatically associate a page or control with an existing context menu, use the ContextMenu property.
Listing the available context menus
To get all the custom context menus available for a given page, go to the "Page" tab, "Edit" group, expand "Context menus" and select "Edit". These context menus can be associated with this page or with the controls in this page.
Editing a context menu
A context menu can be edited via one of the following methods:
  • on the "Page" tab, in the "Edit" group, expand "Context menus" and select "<ContextMenuName>".
  • from the "UI" tab of the description of a page or control associated with this context menu:
    • Select the context menu you want to edit from the "Context menu" combo box.
    • Click the Context menu edit icon button to the right of the "Context menu" combo box and select "Edit this context menu".
  • from the "Manage context menus" window:
    • Select the context menu you want to edit.
    • Click the "Open" button.
Remarks: For more details on how to edit context menu options, see Handling menu options in the editor.
Deleting a context menu
To delete a context menu:
  1. On the "Page" tab, in the "Edit" group, expand "Context menus" and select "Edit".
  2. Select the context menu to delete.
  3. Click "Delete". The page and/or controls associated with the deleted context menu will no longer be associated with a context menu.
Minimum version required
  • Version 28
Comments
Click [Add] to post a comment

Last update: 05/15/2023

Send a report | Local help