AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Menús desplegables / WINDEV y WINDEV Mobile
  • Overview
  • Characteristics of a menu option
  • Overview
  • Type of option ("General" tab of the description window)
  • Caption of a menu option
  • Translating the text of menu options
  • Marking/Unmarking a menu option
  • Image associated with a menu option
  • Background color of menus and menu options
  • Keyboard shortcut associated with a menu option
  • Displaying the code of a menu option
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
WINDEV and WINDEV Mobile support two types of drop-down menus:
  • main window menus.
    A main menu is always associated with a window. This menu can be displayed under the window's title bar. For more details, see Managing main window menus.
    AndroidiPhone/iPad In a mobile application, the menu is displayed via the Action Bar control. For more details, see Action Bar of a window.
  • custom context menus.
    The user can open a context menu by pressing the right mouse button.
    For more details, see Custom context menu.
A drop-down menu (main or custom context menu) is composed of one or more options and sub-options. Each option runs a WLanguage code.
For example:
Main menu
Context menu
In the editor, you can handle menu options in the same way for both main menus and custom context menus. To handle the menu options, simply edit the relevant menu.
To edit (or display in the editor):
  • WindowsLinux The main menu of a window:
    • open the relevant window in the window editor.
    • select one of the menu options. The options and the sub-options are automatically displayed.
  • A customized context menu: under the "Ventana" pane, in the "Barras y menús" group, pull down "Menús contextuales" and select one of the existing context menus.
Note: WINDEV and WINDEV Mobile also allow you to:
Characteristics of a menu option

Overview

Like controls, menu options have a description window. This description window allows you to configure different aspects of the menu option. To open the description window of an option, select "Option description" in the context menu.

Type of option ("General" tab of the description window)

There are three types of menu options:
  • Standard: Menu option corresponding to text, with or without tick or image.
  • Separator: Menu option corresponding to a separator, i.e. a line separating different options.
  • Break: Menu option consisting of a label and a separator on the same line.. Generally, this type of option groups options together under a given name.

Caption of a menu option

"Standard" or "Break" menu options are associated with a text. The text of a menu option can be edited:
  • from the "General" tab of the option description window.
  • directly in the window being edited:
    1. Select a menu option.
    2. Press the Space key.
    3. Edit the text in the input area.
      Modifying the option caption
    4. Press Enter to validate.
    Note: It is also possible to use the "Edit label" option in the context menu of menu item.
Tip: To make text bold in the menu option label, simply enclose the text to be bolded with <B> and </B> through programming. For example:
OPT_Nouveau.Libellé = "Renommer <B>Feuille 1</B>"

Translating the text of menu options

You can translate the text of menu options:
  • from the "General" tab of the option description window.
  • in the editor directly:
    1. Display the window in the translation language: under the "Vista" pane, in the "Opciones" group, scroll down to "Idioma mostrado" and select the desired language..
    2. The captions of controls and menu options are displayed in the selected language.
    3. Type the text of options in the selected language (Space key on the menu options).
Reminder: In a multilingual project, the label entered when creating a menu option is carried over to all the languages managed by the current window.

Marking/Unmarking a menu option

"Standard" menu options can be preceded:
  • by a check mark (Checkmark).
  • by a bullet. For example, this checkmark identifies active features.
Menu option with checkmark
To mark a menu item in the editor:
  1. Select the menu option to mark.
  2. Open the "UI" tab in the description window of the menu option ("Option description" in the context menu).
  3. Select the checkmark style to use:
    • Default (Checkmark)
    • Bullet (Radio Button).
  4. Specify whether the option should be checked by default.
  5. Validate.
The selected mark will appear next to the active option when the menu is displayed.
You can use functions multiple properties to handle the mark of an option:
  • WINDEV WLanguage functions:
    MenuIsMarkedPermite saber si aparece una marca de verificación delante de una opción de menú (menú contextual o desplegable).
    MenuMarkSitúa la marca de verificación delante de la opción de menú (menú contextual o desplegable).
    MenuUnMarkElimina la marca de verificación que aparece delante de la opción de menú (menú contextual o desplegable).
  • WLanguage properties:
    CheckedLa propiedad Checked obtiene y establece el estado de la marca de verificación de un elemento.
Remarks:
  • The MenuMark and MenuUnmark functions are equivalent to the Checked property.
    Android Only the Checked property is available.
  • In most cases, a menu option cannot be preceded by both a checkmark and an image.
  • iPhone/iPad Options cannot be checked or unchecked.

Image associated with a menu option

An image can be shown next to "Standard" and "Break" menu options.
Menu option with image
To display an image in front of a menu option:
  1. Select the menu option in front of which the image must be displayed.
  2. Open the "UI" tab in the description window of the menu option ("Option description" in the context menu).
  3. Select the image to display. This image can be chosen in the image catalog (click the Drop-down button button and select the "Catalog" option).
  4. Validate.
Remarks:
  • To get or set the image associated with a menu option, use the Image property.
  • In most cases, a menu option cannot be preceded by both a checkmark and an image.
Available image formats:
Windows The following image formats are supported in Windows:
  • Bitmap (*.BMP)
  • Graphics Interchange Format (*.gif)
  • Joint Picture Experts Group (*.jpg ; *.jpeg)
  • Kodak Photo CD (*.pcd)
  • PaintBrush (*.pcx)
  • Adobe Photoshop Format (*.psd)
  • TrueVision TARGA (*.tga)
  • Tagged Image File Format (*.tif ; *.tiff)
    Note: the "Tiled TIFF" option in TIFF 6.0 is not supported. In this case, we advise you to save the image in tiff 5.0 standard.
  • Portable Network Graphics (*.png)
  • Windows MetaFiles (*.emf ; *.wmf)
  • Icons (*.ico ; *.icw)
    Remarks:
    • HQ display (High Quality) available.
    • Management of sheets in transparent BMP format (32 bits).
  • Cursors (*.cur)
  • Portable Document Format (*.pdf)
  • Scalable Vector Graphics (*.svg)
  • WINDEV images (generated by the image editor, *.WDPIC).
  • Novedad versión 2025
    Images in WebP format (*.webp).
Android The supported image formats are:
  • Bitmap (*.BMP)
  • Graphics Interchange Format (*.gif)
  • Joint Picture Experts Group (*.jpeg)
  • Portable Network Graphics (*.png)
  • WINDEV images (generated by the image editor, *.WDPIC).
Java The supported image formats are:
  • Graphics Interchange Format (*.gif)
  • Joint Picture Experts Group (*.jpeg)
  • Portable Network Graphics (*.png)
  • WINDEV images (generated by the image editor, *.WDPIC).
WindowsLinux

Background color of menus and menu options

To modify the background color of menus and menu options:
  1. Select the menu or one of its options.
  2. Open the description window ("Option description" in the context menu).
  3. On the "Style" tab, configure:
    • the color of the menu bar when inactive or hovered over.
    • the color of the options when inactive or hovered over.
    • the color of the break.
"Automatic" applies the default color used by Windows.
WindowsLinuxJava

Keyboard shortcut associated with a menu option

Each "Standard" menu option can be associated with a keyboard shortcut.
Reminder: A keyboard shortcut corresponds to an alphanumeric character, a keyboard key or a combination of keyboard keys.. This keyboard shortcuts provides direct keyboard access to a menu option.
To associate a keyboard shortcut with a menu option:
  1. Select the menu option to which a keyboard shortcut must be associated.
  2. Open the description window of the current option ("Option description" in the context menu).
  3. On the "General" tab, select the keys that make up the shortcut for the menu option.
    Option shortcut in the editor
  4. Confirm changes and close the description window. The selected keyboard shortcut will be displayed after the caption of menu option:
    Shortcuts in the menu options
Remarks:
  • If a context menu option and a control have the same keyboard shortcut, the control will take precedence over the option.
  • Hotkeys are not available in context menus. Only the keyboard shortcuts can be used.
Tip If you don't want the keyboard shortcuts to be displayed after the menu option, simply change the option label by programming (property Caption). For example:
OPT_Nouveau.Libellé = "Nouveau"

Displaying the code of a menu option

To display the code of a menu option:
  1. Select the desired menu option.
  2. Right-click to open the context menu of the option.
  3. Select "Code". The code window of the current menu option is displayed.
Remarks:
  • The code of a menu option can also be displayed from its description window. To do so, click Code icon. This code corresponds to the code run when the menu option is selected by the user. You can add optional events via the "Add other events to xxx" link at the bottom of the code window.
  • Only menu options that do not have a submenu can launch a WLanguage event.
  • "Standard" menu options can also be associated with a preset action. For more details, see Preset_action.
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 06/12/2024

Señalar un error o enviar una sugerencia | Ayuda local