18.5 How Icons Are Associated and Presented on Toolbars
When an ACT/BAR style process is compiled a standard method is used to decide which functions (i.e. drop down menu items) should also have their associated icon appear in the tool bar.
The association method (which is performed and locked in at compile time) works like this:
1. The "object" name (process or function) is converted into the standard name format. Usually this is identical to the object name unless it contains special characters or is too long. The method used for this conversion process is described in earlier sections of this guide.
2. A check is made in the current partitions SOURCE directory (i.e. <drive>:\X_LANSA\X_ppp\SOURCE) for a file with the same name as the object, suffixed by .ICO (icon).
3. If such a file exists, the association is complete and none of the following steps are used. The function will appear in the tool bar area.
If step 2 does not find an association, a more complex step is invoked. This step uses a file called X_ICOBMP.DAT that may exist in the current partitions SOURCE directory (i.e. <drive>:\X_LANSA\X_ppp\SOURCE). This file is called the icon and bitmap defaulting file.
The contents of file X_ICOBMP.DAT are used to try to produce an "intelligent" default icon by comparing the PD$OPT (Pull Down Option) value associated with the function (in its current pull down context) to all icons in the default file that use the PDO= option keyword. If a match is found, then the function is selected to appear in the tool bar area and no further checking is done.
The exact layout and use of X_ICOBMP.DAT is described in detail in a following section.
If step 3 does not find an association, then the function will not appear on the toolbar. The function can only be invoked by selecting it from the pull down in the normal manner.
This ability to select which functions appear in the tool bar and the drop down menus, and which only appear in the drop down menus, is quite important.
For example, an action bar may have 7 items, and each item has an associated pulldown averaging 5 items. This means that there are 35 "actions" selectable from the pull down menus.
If all of these had their own icon, then Visual LANSA would try to fit 35 icons on the tool bar. In fact they would not all fit, and many of them would not actually be visible or selectable from the tool bar.
So of the 35, you should choose 5 or 6 that are heavily used (often these are the ones that have associated accelerator keys) and create icons or automatic associations for them. This means that the heavily used 5 or 6 functions are accessible from the pulldown menus and the tools bar, but the less heavily used 30 other functions are only accessible from the pull down menus.
It is also important to note that step 3 allows multiple icons to be associated with a single function.
For example, a single RDML function called FUNC01 may actually "service" 3 pull down options called OPN, CLS and VEW. By using the icon association file you can cause 3 different icons to appear on the tool bar, even if they all cause the same function to be invoked.