- Overview
- Handling the Ribbon control and its groups
- Handling a Ribbon control
- Collapsing a Ribbon control
- Handling a group
- Forcing a group to close
- Properties specific to Ribbon controls
Handling a Ribbon control through programming
WINDEV allows you to handle a Ribbon control as well as its panes and groups through programming. The name of the Ribbon control is used to handle the Ribbon and its panes through programming. The name of the group is used to handle the groups through programming. Remark: Going from a pane to another one (when the user clicks the caption of the pane) is automatically managed. Handling the Ribbon control and its groups Handling a Ribbon control To handle a pane of the Ribbon control, use the following syntax:
<Nom Ruban>[NuméroVolet].NomProprieté = <Valeur>
For example, to gray the second pane of the Ribbon control:
RUBAN_Menu[2].Grayed = True
The first pane of the ribbon is enabled by default. The active pane can be changed by programming: - by using the following syntax:
<Nom Ruban> = <Numéro Volet>
- via Value.
To find out the number of the active pane, you can: - perform a simple assignment:
<Num Volet actif> = <Nom Ruban>
- use the Value property.
The Caption property allows to get and modify the text of the active tab. For example:
Trace(RUBAN_Menu[MonVoletActif].Libellé)
Collapsing a Ribbon control Collapsed is used to collapse (or not) a Ribbon control. If the Ribbon control is collapsed, only the caption of the panes will be displayed (like in a standard menu). The content of the pane is displayed when the user clicks the caption of the pane. If the user clicks the caption of the pane again (or one of the buttons found in the pane), the content of the pane is no longer displayed. To force the pane to disappear on a user action (when the user selects a Combo Box control for example), simply use RibbonEndExpandedMode. Handling a group The following syntax is used to handle a groupe:
<Nom Ruban>.<Nom du Regroupement>
For example:
RUBAN_Menu.GRPRUB_AccesRapide.Visible = False
Forcing a group to close In a Ribbon control, the small groups display an icon and an arrow used to open a popup that contains all the controls. By default, this popup is closed: - when the user clicks a button,
- when the user performs a selection in a Combo Box control.
To close the grouping on another action (e.g. after entering 3 characters, ...), use the RibbonCloseGrouping function in the desired treatment. Properties specific to Ribbon controls The following properties can be used with a Ribbon control: | | Collapsed | Used to collapse (or not) a Ribbon control. If the Ribbon control is collapsed, only the caption of the panes will be displayed. When clicking the caption of the pane, the pane is entirely displayed, with all its groups. | Count | Used to find out the number of panes in a Ribbon control. | Undocked | Allows you to know if a pane is detached from a Ribbon control. |
For a complete list of WLanguage properties that can be used with a Ribbon control, see Properties associated with Ribbon controls.
|
|
|
|