ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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 Context Menu controls
  • Associating a context menu with an element
  • How to?
  • Listing the available context menus
  • Editing a context menu
  • Deleting a context menu
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview of the Context Menu control
Context menus are often used in websites. To manage these context menus, WEBDEV offers a specific field: the Context menu field..
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.
    Note: To open the "Context menu management" window, under the "Page" pane, in the "Edit" group, pull down "Context menus" and select "Edit".
Characteristics of Context Menu controls
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.
Note: The "Description" option in the drop-down menu's home zone also displays the context menu's description window..
The main characteristics are as follows:
  • Menu orientation ("General" tab): The options are as follows:
    • Vertical Popup (default): The sub-menu of a context menu option is displayed to the right of the parent option..
    • Vertical Déroulant: The sub-menu of a context menu option is displayed below the parent option..
  • Option selected ("General" tab): Default context menu option selected.
    Note: The default option can be changed by programming with property Selected.
  • Value of page fields ("UI" Tab Control): Allows you to specify that processing will be performed on page fields (send data to server, send nothing, ...). 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.
Notes: For details of how to change 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: 09/21/2024

Send a report | Local help