You can configure the order of the entries within a group by assigning an appropriate sort attribute to the group. This attribute is optional. If you do not specify it, the end sort attribute is used.
Lucy supports the following sort attribute values:
abc: sorts alphabetically.
zyx: sorts in reverse alphabetical order (from Z to A).
subMenusFirst: moves items with sub-menus before the menu items without sub-menus.
subMenusLast: moves all items with sub-menus after the menu items without sub-menus.
start: adds new items at the start.
end: adds new items at the end. This is the default.
fixed: this value takes a number of additional parameters. These parameters consists of the names of the actions, menus or menu items. The fixed order will sort the group according to this list of parameters. The specified items come first. The items that are not in the list come at the end.
To add a sort attribute to a group, append a semi-colon to the group name, followed by the name of the attribute,
sort, an equal sign and the value of the attribute,
abc for example.
The examples at the end of this article illustrate this.
The above is valid for menu bars as well as all action bars. Figure 1, “The default Lightspeed map tool bar with indications of the groups.” shows the default map tool bar and indicates the different groups.
In this first example, we are going to switch the position of the undo and redo actions in the Lightspeed map tool bar.
You can switch the order of these actions by specifying that you want to use alphabetical order for the
TLcyLspMapAddOn.toolBar.groupPriorities=ControlsGroup, ProjectionsGroup, \ ActionsGroup, FogLightGroup, \ UndoGroup;sort=abc, \ DefaultGroup
The result of this modification is shown in the figure below:
At the right side of the tool bar, the redo button now appears before the undo button.
The second example uses the
sort option to hard-code the order in which the controllers are inserted.
In this example, the ruler controller is defined to come first, followed by the selection controller.
TLcyLspMapAddOn.toolBar.groupPriorities=ControlsGroup;sort=fixed:Ruler!Navigate and select, \ ProjectionsGroup, ScaleGroup, ActionsGroup, FogLightGroup, UndoGroup, DefaultGroup
Use the value specified in the initial
item configuration of the action bar entry as the action identifier in a fixed sort order value.
In this example, the
Navigate and select entries used as values for the
sort property correspond to the last part of the
item configuration option for the corresponding controller:
# Selection controller TLcyLspMapAddOn.selectionPanControllerActiveSettable.toolBar.item=Navigate and select # Ruler controller TLcyLspMapAddOn.rulerControllerActiveSettable.toolBar.item=Ruler
The result of this modification is:
The ruler controller button comes before the navigate and select controller.