The number of items in a group.
Usage
Set_Property(OLECtrlEntID, "OLE.GroupItemCount[group]", Value)
Values
Value can be any positive or negative whole number:
Default: 0
Indices
Index | Description |
---|---|
group | Index to an existing group |
Remarks
The GroupItemCount property sets the number of items in a group. To add new items, simply incease the value of GroupItemCount. Doing so will add new items after the last existing item without altering your current items' settings. To delete items, just decrement the GroupItemCount. This will delete items from the bottom up. Any remaining items will not be altered. Setting this property to any value less than zero is the same as setting it to zero.
Dynamic Index
Every indexed property, including this one, supports dynamic indexing. There are three ways to index a ShortcutBar property: single, ranged, and all. Single indexing operates on one element at a time while ranged and all indexing operates on several elements at once, reducing the amount of code required.
Single
Single indexing is simple. Just pass a single integer to index an existing element.
Ranged
Ranged indexing operates on one or more properties. Instead of passing a single integer, you pass two integers delimited by a dash '-' character. For instance, to operate on elements 3, 4, 5 and 6 you pass '3-6'.
All
All indexing operates on all existing elements at once. Instead of passing a numerical index, you pass the word "All".
Setting multiple properties
Use ranged or all indexing to set the same value for multiple properties at once. This is particularly useful for boolean properties, such as enabling/disabling settings for several properties at once. It can also be useful for initializing or resetting a control.
Getting multiple properties
Getting multiple properties is tricky because it is possible to be getting multiple properties with different values. The ShortcutBar control resolves this by using a same/indeterminate paradigm. If all values of multiple properties are the same, then that value is returned. If there is at least one different value, then an indeterminate value is returned. In most cases the returned value is "", except for boolean properties. They return a value of 2, which is the value of OI Check Boxes in their indeterminate states.
Example
// Init the frist group with 3 items Set_Property(@Window:".OLE_SHORTCUT", "OLE.GroupItemCount[1]", 3) // Add 3 more items to it Set_Property(@Window:".OLE_SHORTCUT", "OLE.GroupItemCount[1]", 6) // Remove 2 items from it Set_Property(@Window:".OLE_SHORTCUT", "OLE.GroupItemCount[1]", 4) // Remove all items from all groups Set_Property(@Window:".OLE_SHORTCUT", "OLE.GroupItemCount[All]", 0)