RibbonSetProperty

(Engine-Level Function)

Description: Set a property on a command.
A ribbon control will access those properties of a command that it needs to render itself and respond to user interaction.
Returns: Nothing
Usage: Script Only.
Function Groups: Window
Related to: RibbonCmd | RibbonContextUI | RibbonGalleryItems | RibbonPersistState
Format: RibbonSetProperty(CommandID, Property, Value);
Parameters:  
CommandID

Required. The unique identifier of the command.

If set to zero, the property and value are applied to all elements of the ribbon, allowing all to be disabled or enabled with a single call.

Property

Required. An integer from the table that follows.

Value
Varies according to the property being set.
 
Property
Value
Property Meaning Value Type
0 Enable/Disable the command. If the command is disabled, all control representations of the command will be rendered grayed and the user will be unable to activate the command. Boolean: 0 (Disable). 1 (Enable)
1 Boolean value of the command. For example, a command intended to be represented by a toggle button or check-box would have Boolean value. Boolean
2 Numeric value of the command. Commands represented by a combo-box or spinner control use numeric values. Integer or double
3 String value. Commands represented by controls that display a string value use this to provide the value. Text
4 Minimum value. Commands represented by a spinner control use this to regulate the minimum value the user can select. Integer or double
5 Maximum value. Commands represented by a spinner control use this to regulate the maximum value the user can select. Integer or double
6 Label. The label displayed by a control that has a textual representation of the command, for example the text next to a button. Text
7 Description. The description displayed by a control that has a long textual description of a command, for example, a "MajorItems" button in a DropDownButton control. Text
8 Tooltip Title. The emboldened title displayed in a tooltip. Text
9 Tooltip Description. The textual description displayed in a tooltip. This is not emboldened and is displayed below the tooltip title (if any). Text
10 Key tip. Text that is displayed to assist the user when a key combination is bound to the key, e.g. "F9" or "Alt+U". Text
11 Small Image. The small (?x?) image displayed by a control. Image (see comments)
12 Large Image. The large (?x?) image displayed by a control. Image
13 Color. An RGB quad value for a command that is intended to be represented by a color picker control. Integer
14 Color Type. An enumerated type for use by a command that is intended to be represented by a color picker control. Normally used in conjunction with the Color property.

Integer as follows:

0 == no color

1 == automatic color

2 == RGB color value

15 Selected Item. Used for item galleries to force a specific item to be drawn as selected. Integer
16 Context Available. Commands whose representation is a contextual tab group have their visibility controlled by this. Boolean
17 Font. Commands represented by a font selection control have the values for the fields in the font control set by this property. A font command structure
18 Representative String. Supply a string for combo-box or spinner controls to set their width. The string will be used to measure how wide the control will be. Text
19 Increment. For spinner controls, the increment or decrement applied when the up or down arrow buttons are clicked. Integer or double
20 Decimal places. For spinner controls, the number of decimal places displayed. Integer
Comments:

Note that setting a property on a command affects all controls that use the changed property of the command.

Images displayed on buttons and other controls that accept images can be defined by the XML markup or via script code.

Images supplied via markup are restricted to Windows .BMP 32-bit ARGB format for supported Windows systems up to and including Windows 7. From Windows 8, .PNG are also supported.

Images supplied via script code can be of any image type supported by VTScada and are internally converted to the appropriate type for the ribbon.

Image size can be hard to define. The exact image size expected by the ribbon framework depends on the resolution the display device is set to. There are two image sizes used by the ribbon, denoted as Large and Small, as follows:

Display resolution(DPI) Small Image size (pixels) Large Image size (pixels)
96 dpi 16x16 pixels 32x32 pixels
120 dpi 20x20 pixels 40x40 pixels
144 dpi 24x24 pixels 48x48 pixels
192 dpi 32x32 pixels 64x64 pixels