OK. I can live with that. Thanks!
-----Original Message----- From: Hussein Shafie [mailto:[email protected]] Sent: Wednesday, May 03, 2006 1:55 AM To: Mark Fletcher Cc: xmleditor-support at xmlmind.com Subject: Re: [XXE] custom commands referenced in GUI file? Everything you did is 100% okay, but you have found a very stupid bug. Sorry for that. The bug is that editingContextSensitive="true", which is really needed in your case, is totally ignored. This is not a workaround but if you want to check this by yourself, simply move the caret to a location where addComment should be enabled, then switch to a non-"Workday Topic" document, then switch again to your "Workday Topic" document. This time "Edit|Comment|Insert Comment XXX" is enabled. The workaround is to insert at the top of the addComment sequence something which never fails (e.g. <pass><command name="beep"/></pass>). Mark Fletcher wrote: > > Now I'm having trouble getting the tweaked GUI menu actions to become > active. Here's my code: > > In custom.xxe_gui: > > <!-- include default gui --> > <include location="xxe-gui:app/default.xxe_gui" /> > > <!-- override the three insert comment actions --> > <action name="insertCommentBeforeAction" label="Insert Comment > _Before"> > <context editingContextSensitive="true"> > <configuration name="Workday Topic"> > <command name="addComment" parameter="before[implicitElement]"/> > </configuration> > <default> > <command name="insertNode" > parameter="commentBefore[implicitElement]" /> > </default> > </context> > </action> > > <action name="insertCommentAction" label="_Insert Comment"> > <context editingContextSensitive="true"> > <configuration name="Workday Topic"> > <command name="addComment" parameter="into"/> > </configuration> > <default> > <command name="insertNode" parameter="commentInto" /> > </default> > </context> > </action> > > <action name="insertCommentAfterAction" label="Insert Comment _After"> > <context editingContextSensitive="true"> > <configuration name="Workday Topic"> > <command name="addComment" parameter="after[implicitElement]"/> > </configuration> > <default> > <command name="insertNode" > parameter="commentAfter[implicitElement]" /> > </default> > </context> > </action> > > <!-- reinstantiate layout --> > <layout label="Document Editor" icon="docedit.png"> > <insert /> > </layout> > > > In my "Workday Topic" config file: > > <command name="addComment"> > <macro> > <sequence> > <command name="insert" parameter="%0 draft-comment"/> > <command name="run" parameter="date /t"/> > <set variable="theDate" expression="%_" plainString="true"/> > <command name="run" parameter="time /t"/> > <set variable="theTime" expression="%_" plainString="true"/> > <get expression="normalize-space(concat($theDate,$theTime))"/> > <command name="addAttribute" parameter="time '%_'"/> > <command name="addAttribute" parameter="author %U"/> > </sequence> > </macro> > </command> > > > The command works from a toolbar button that I've added. And it works > from the Execute Command window. But the three actions are always > grayed out when I view them in the Edit > Comment menu. What have I > forgotten to do? >

