|
|
|
|
|
- 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
Manipulating Ribbon controls programmatically
WINDEV allows you to programmatically manipulate Ribbon controls, as well as their tabs and groups. The name of the Ribbon control is used to handle the Ribbon and its tabs programmatically. The names of the groups are used to handle groups programmatically. Remark: Switching from one pane to another (when the user clicks on the pane label) is automatically managed.. Handling the Ribbon control and its groups Handling a Ribbon control To handle a tab 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 tab of the ribbon is active by default. The active tab can be changed programmatically: - by using the following syntax:
<Nom Ruban> = <Numéro Volet> - using the Value property.
To get the number of the active tab, you can: - use a simple assignment expression:
<Num Volet actif> = <Nom Ruban> - use the Value property.
The Caption property gets and sets the text of the active tab. For example: Trace(RUBAN_Menu[MonVoletActif].Libellé)
Collapsing a Ribbon control The Collapsed property collapses (or not) a Ribbon control. If the Ribbon control is collapsed, only the text of the tabs are displayed (like in a standard menu). The content of the tab is displayed when the user clicks the tab. If the user clicks the tab again (or one of the buttons in the tab), the content of the tab is no longer displayed. To force the tab 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 set a different action that closes the group (e.g., entering 3 characters), use RibbonCloseGrouping in the desired process. 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 text of the tabs is displayed. When clicking the text of the tab, it is entirely displayed with all its groups. | Count | Gets the number of tabs of a Ribbon control. | Undocked | Allows you to know if a tab is detached from a Ribbon control. |
For a complete list of WLanguage properties that can be used with Ribbon controls, see Ribbon control properties.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|