cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Toolbar buttons missing in 7.0?

harora
12-Amethyst

Toolbar buttons missing in 7.0?

Until Arbortext 7 there used to be toolbar button "Insert Equation", but in 7.0 there is no such button. Can someone tell me how can i have it back?

FYI:There are some other toolbar button also that are missing in 7.0

ACCEPTED SOLUTION

Accepted Solutions
harora
12-Amethyst
(To:harora)

I got the answer from the Arbortext support and it might be helpful for others too.

Two ways you can edit the toolbar buttons:

1.  Creating a custom directory. In the dialogs directory within, create a file named Toolbar_equation.xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>

<!--Arbortext, Inc., 1988-2010, v.4002--> <!DOCTYPE window PUBLIC "-//Arbortext//DTD XUI XML 1.1//EN"  "xui.dtd" [ <!ENTITY % xuidlgStrings PUBLIC "-//Arbortext//TOOLBAR ENTITIES XUI XML 1.0//EN" "dialogStrings.ent"> %xuidlgStrings; ]> <window> <imagegroup> <image id="imageInsertEquation" path="icons/equation.png"/> </imagegroup> <toolbargroup> <toolbar id="toolbar11" name="Equation" x="128" y="0"> <button command="InsertEquation" id="Toolbar_Equation" image="imageInsertEquation" statustext="Insert an equation element" tiptext="Insert Equation;"> </button> </toolbar> </toolbargroup> </window>

Then add an Acl call somewhere in the user's application:

window_load_component_file(current_window(), 'Toolbar_equation.xml')

Side effects include a new toolbar named "Equation" in the View->Toolbars menu, the tip and status text are not translated.

2. Create a custom directory. In dialogs directory within, place a copy of the Editor lib/dialogs/editwindow.xml file. In this file, add the following markup within the <imagegroup> after the InsertGraphic:

<image id="imageInsertEquation" path="icons/equation.png"/>

Then add the following markup within the <toolbar id="toolbar1"> after the InsertGraphic button:

<button command="InsertEquation" id="Toolbar_Equation" image="imageInsertEquation" statustext="Insert an equation element" tiptext="Insert Equation;"> </button>

Side effects include the status and tip text are not translated.

View solution in original post

9 REPLIES 9

I think they simplified the UI a little for the 7.0 release. The Help Center hasn't been updated, it still lists all the old toolbar buttons and uses the old toolbar icons. You can still insert equations using the Insert menu.

Controlling toolbars is documented in the Help Center topic "Work with Toolbars". You can add custom toolbars and perhaps restore the buttons that are now missing. Alternatively you can edit the Arbortext default toolbar definitions under the Editor\lib\dialogs\editwindow.xml but that is not recommended!

BrianJ
12-Amethyst
(To:harora)

As Gareth said, it's possible, but not recommended to edit the editwindow.xml file in the Editor install tree. To make it somewhat less risky, you can make a copy of that file in the dialogs folder in the custom directory, which can be the one in the install tree or somewhere else specified by the $APTCUSTOM environment variable. The downside to this is that you would need to sync your custom editwindow.xml file with the one in the install tree whenever you update your version of Editor.

harora
12-Amethyst
(To:harora)

Thanks for your reply. I will not edit the editwindow.xml file for sure because we have a product which works with Arbortext, so we can only install files in users custom directory and can't edit the Arbortext's file.

Adding a modified editwindow.xml with new toolbar buttons in custom/dialog folder is working fine but i am looking for a solution in a way only the new toolbar button is displayed by file in custom and rest of the buttons should be displayed by Arbortext's editwindow.xml. This way even if Arbortext make changes in their editwindow.xml in later versions, i don't have to make any changes. Thanks in advance for any help you may provide in this.

BrianJ
12-Amethyst
(To:harora)

Assuming I understand you correctly, the only thing I can think of would be to create a separate toolbar for your button using XUI. Look at the section "Working with Toolbars" under Customizer's Guide->Working with XUI in help center. Assuming you have a XUI file named custom_toolbar.xml in your custom/dialogs directory with a toolbar element with id="toolbar_x", you can create this function in an ACL file in either your custom/init or custom/editinit directory:

function show_toolbar() {

    local $docId = current_doc();

    local $winId = doc_window($docId);

    if(window_class($winId) != 'edit') { return; }

    if(dlgitem_is_active($winId, 'linc_toolbar') != 1) {

      window_load_component_file($winId, 'custom_toolbar.xml');

      dlgitem_show($winId, 'toolbar_x');

    }

}

show_toolbar();

harora
12-Amethyst
(To:BrianJ)

i did this same way as you have mentioned, but arbortext is crashing when this function is called, here is my custom_toolbar.xml file

<window>

<imagegroup>

<image id="imageInsertEquation" path="icons/edit_insert_equation.png"/>

</imagegroup>

<toolbargroup>

<toolbar id="toolbar5" name="&ToolbarInsertMathML;" x="0" y="125">

<button command="InsertEquation" id="Toolbar_Equation"  image="imageInsertEquation" statustext="&EditWindow_StatusTextInsertEquation;"

tiptext="Insert Equation"></button>

</toolbar>

</toolbargroup>

</window>

The arbortext is crashing on executing, dlgitem_show($winId, 'toolbar5');

I also checked if there is some problem in loading the custom_toolbar.xml file by using function, dlgitem_set(win,'Toolbar_InsertGraphic', 'IMAGE', 'imageInsertEquation');
This worked fine and replaced the image shown for insertgraphic button to my custom one. Bu ti don;t know why dlgitem_show($winId, 'toolbar5') is not working

BrianJ
12-Amethyst
(To:harora)

Not sure, but I wouldn't use toolbar5 as the id, and I'd try changing all the entities to literals, just to eliminate that as a potential problem.

harora
12-Amethyst
(To:BrianJ)

Actually the error is: Argument#1 (-1) to window_class() is not a valid window id

Any idea how to deal with this

BrianJ
12-Amethyst
(To:harora)

If your ACL file is in custom/init, try moving it to custom/editinit. If that doesn't work and you can't otherwise figure out the cause, it doesn't hurt to just drop the line

if(window_class($winId) != 'edit') { return; }


It's only purpose is to prevent the toolbar from being added to non-edit windows.

harora
12-Amethyst
(To:harora)

I got the answer from the Arbortext support and it might be helpful for others too.

Two ways you can edit the toolbar buttons:

1.  Creating a custom directory. In the dialogs directory within, create a file named Toolbar_equation.xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>

<!--Arbortext, Inc., 1988-2010, v.4002--> <!DOCTYPE window PUBLIC "-//Arbortext//DTD XUI XML 1.1//EN"  "xui.dtd" [ <!ENTITY % xuidlgStrings PUBLIC "-//Arbortext//TOOLBAR ENTITIES XUI XML 1.0//EN" "dialogStrings.ent"> %xuidlgStrings; ]> <window> <imagegroup> <image id="imageInsertEquation" path="icons/equation.png"/> </imagegroup> <toolbargroup> <toolbar id="toolbar11" name="Equation" x="128" y="0"> <button command="InsertEquation" id="Toolbar_Equation" image="imageInsertEquation" statustext="Insert an equation element" tiptext="Insert Equation;"> </button> </toolbar> </toolbargroup> </window>

Then add an Acl call somewhere in the user's application:

window_load_component_file(current_window(), 'Toolbar_equation.xml')

Side effects include a new toolbar named "Equation" in the View->Toolbars menu, the tip and status text are not translated.

2. Create a custom directory. In dialogs directory within, place a copy of the Editor lib/dialogs/editwindow.xml file. In this file, add the following markup within the <imagegroup> after the InsertGraphic:

<image id="imageInsertEquation" path="icons/equation.png"/>

Then add the following markup within the <toolbar id="toolbar1"> after the InsertGraphic button:

<button command="InsertEquation" id="Toolbar_Equation" image="imageInsertEquation" statustext="Insert an equation element" tiptext="Insert Equation;"> </button>

Side effects include the status and tip text are not translated.

Announcements

Top Tags