Copy link to clipboard
Copied
Dear friends, be prepared for a lengthy explanation.
There are already reports about similar effects:
Beware of side effects!
Side effect of menu to UI-object colour
But this one took me a very long time to verify and accept - I can not eliminate it.
It is not about scripting, but menu customisation (the main process in the Enhanced Tool Bars).
I came across the problem again when trying to harmonise the various installations of ETB into one for FM versions 14 upwards. The syntax of cfg files in FM considers everything outside of <...> as comment. Hence introduced the notation [label] on a line to ease navigation in these up to 1000 lines long files.
The obscurity occurs with two buttons, which activate a fly-out menu:
ETBChangeCasePopup and ETBCellAlignPopup
There are two menu files involved:
Since we have views (FM-11) ETB-menus is a combination of the original menu, appended with ETB-specifics. These specifics are mainly the same as the file customui.cfg (details later).
For grouping/naviagtion purpose I have introduced (among others) these lables in the files:
This is an excerpt from ETB-menus.cfg:
[etb Flyout Commands]
#-- Since FM-14 Flyouts use a new mechanism: a new command with parameter
<Command ETBCellAlignPopup <Label ETB Cell Alignment…>
<Definition \x914>
<Param ETBCellAlignMenu>>
<Command ETBChangeCasePopup <Label ETB Change text case…>
<Definition \x914>
<Param ETBChangeCaseMenu>>
[etb Flyout Menus]
<Menu ETBCellAlignMenu <Label Cell Alignment…>>
<Add AlignTop <Menu ETBCellAlignMenu>>
<Add AlignMiddle <Menu ETBCellAlignMenu>>
<Add AlignBottom <Menu ETBCellAlignMenu>>
<Menu ETBChangeCaseMenu <Label Change text case…>>
<Add LowerCaseText <Menu ETBChangeCaseMenu>>
<Add InitialCapsText <Menu ETBChangeCaseMenu>>
<Add UpperCaseText <Menu ETBChangeCaseMenu>>
«Add ETB_ToSentenceCap «Menu ETBChangeCaseMenu»» # inactive
[SkipInCustomUI_cfg-Begin]
«-- Skipping this avoids error "Command or menu .. has not been defined"
[etb Commands by Script]
...
[etb Menu]
<Add ETB_ToSentenceCap <Menu ETBChangeCaseMenu>> # active
[SkipInCustomUI_cfg-End]
To get the buttons and menus working (for FM-14):
Why the heck depends the working of button ETBCellAlignPopup on the set-up for button ETBChangeCasePopup? You don't see this effect in the above explanations - but on the long way to the current stage the results of various set-ups clearly gives this impression. Maybe it is due to the fact, that the relevant command ETB_ToSentenceCap is created in a script - and the sequence of menu building is not transparent at all.
→ Can we use this set-up for all following FM version? In principle, yes, says Radio Eriwan, but …
Set-up for FM-15
All the same as with FM-14 with the following exceptions:
Set-up for FM-16 and FM-17
All the same as with FM-14 with the following exceptions:
Conclusion
It is possible to create 'only one' installation process for the various FM versions, but the cfg files must be carefully built observing the required deviations.
Thank you for reading!
Have something to add?