General XMetaL Discussion
Progresso March 5, 2010 at 3:21 pm
Prevent view change to Plain Text in XMetaL AuthorMarch 5, 2010 at 3:21 pmParticipants 1Replies 2Last Activity 12 years, 11 months ago
Product: XMetaL Author 22.214.171.124 SP2
OS: Windows XP Professional SP3, English
In XMetaL Author 4.6 we have a series of document macros that record various information. These macros are lost if the user switches to Plain Text view (and back to Tags On or Normal).
I have tried to use On_Before_View_Change to prevent a change to Plain Text but unfortunately this event only fires when changing AWAY from Plain Text view.
I can't use On_View_Change to solve this.
Any ideas will be appreciated.
P.S.: In case the problem cannot be solved now in version 4.6 I would like to know if it can be solved in in version 5.x/6.x. I should report this to my client, since they will upgrade to the newest XMetaL version at the end of 2010.Derek Read March 5, 2010 at 11:15 pm
Reply to: Prevent view change to Plain Text in XMetaL AuthorMarch 5, 2010 at 11:15 pm
There is a method called Application.DisablePlainTextView() which is provided for exactly this purpose. Call this method in your customization's On_Application_Open event.
For detailed information see the XMetaL Developer Programmer's Guide topic called “DisablePlainTextView”.
I believe this API has been available since the 2.x releases in case you are wondering about compatibility with older versions (you mention 4.6).Progresso March 8, 2010 at 6:33 pm
Reply to: Prevent view change to Plain Text in XMetaL AuthorMarch 8, 2010 at 6:33 pm
I was unaware of the existence of Application.DisablePlainTextView()
I can see that it's supposed to be called from the On_Application_Open event, but this cannot be allowed in my client's case since they used the samme application settings for many users that open a variety of document types. Some of these users might enjoy the Plain Text view so I cannot just disable it for all.
However, I have tested Application.DisablePlainTextView() from one of the “document macros”, the On_Macro_File_Load event. This allows me to prevent Plain Text view only for selected document types (Schemas). It works fine in version 4.6 so I'll keep it. Hope that it also works in version 5.x/6.x.
You solved my problem 🙂
- You must be logged in to reply to this topic.