• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Side effects of menu to other menu

Community Expert ,
Dec 01, 2022 Dec 01, 2022

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

ETB-Change-case.pngETB-cell-align.png

There are two menu files involved:

  • ETB-menus.cfg which is in the user area in Workspaces\...\menus and
  • customui.cfg which is normally placed in $HOME\fminit\configui\, but can be elsewhere if defined in the user's maker.ini (which is necessary to avoid access to the installation directory in IT environments).

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):

  1. customui.cfg must not contain the lines in ETB-menus.cfg between [Skip...-Begin] and [Skip...-End]
  2. The menu entries Add ETB_ToSentenceCap must be inactive in [etb Flyout Menus] and active in [etb Menu]
  3. Due to 1 [etb Menu] does not exist in customui.cfg
  4. After start of FM the menus are not intact - because no workspace is assigned. Only after opening a document the workspace ETB becomes active - but the two mentioned buttons are inactive.
  5. After switching to workspace to Authoring (or other) and back to ETB, the button ETBChangeCasePopup is active and working, but the other is not
  6. After switching to workspace again to Authoring (or other) and back to ETB, also button ETBCellAlignPopup works as intended
  7. Nevertheless in the console log you find the message maker: When reading the menu customization file c:\users\klaus\appdata\roaming\d+dd\etb14up\etb-en\customui.cfg, maker: (440) The ETB_ToSentenceCap command or menu has not been defined.

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:

  • Neither is a second switch of the workspace required (6),
  • nor does the log message appear (7).

Set-up for FM-16 and FM-17

All the same as with FM-14 with the following exceptions:

  • (2) The menu entries Add ETB_ToSentenceCap must be active in [etb Flyout Menus] and in active in [etb Menu]
  • Adobe had fixed the problem requiring the Workspace switching (4…6) and the message in the log does not appear (7).

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!

TOPICS
Scripting

Views

70

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation