Pages: 1
Print
Author Topic: Deactivating toolbar buttons when changing view mode  (Read 56 times)
bjorn
Member

Posts: 27



« on: July 04, 2017, 06:15:10 AM »

We use track changes when editing documents.
I see when I switch from "Tags on view" mode to "Plain text view" mode the buttons in the reviewing toolbar goes gray, meaning that they can't be used. I have added a custom button to the reviewing toolbar and I want the new button to also be "gray" when changing to "Plain text view".

I guess the function that is making the default reviewing buttons gray is a builtin function in XMetaL, meaning that they cannot be altered.

Is there a function that is executed when changing view mode? Maybe I can change this method to deactivate the new button/icon.

Or do you have any other suggestions to solve this?


Using XMetaL Version#: 9.0.0.053


Thanks!
Logged
tonys
JustSystems Partner
Member

Posts: 78


« Reply #1 on: July 04, 2017, 09:26:08 PM »

I believe when disabling macros it is best to use the On_Update_UI even macro. All macros are enabled when this is called so disabling macros elsewhere will probably give the wrong result.

Try something like this:

<MACRO name="On_Update_UI" lang="JScript"><![CDATA[
if (ActiveDocument.ViewType == 2) /* 2: plain text */
   Application.DisableMacro("MacroName");
]]></MACRO>
Logged
Pages: 1
Print
Jump to:  

email us