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

Adding new toolbar/buttons to Epic Editor 5.1

songmyos
Newbie

Adding new toolbar/buttons to Epic Editor 5.1

Adepters,

Documentation clearly state: "You can not add new toolbar buttons to the
toolbar."

I find this to be unbelievable! Can anyone verify this?

Aloha.
Tags (2)
10 REPLIES 10

Re: Adding new toolbar/buttons to Epic Editor 5.1


I remember reading that, too. I assume they mean you can't add new
buttons to any of the toolbars Arbortext provides (anyone confirm
that?). You can, however, add your own toolbar defined in XUI and loaded
using either the AOM method Window.loadComponentFile or an ACL function
that I can't remember right now. The documentation (to me) is a
little lacking in this area, but there is some good info on the Adepters
archive if you search for 'toolbar'.

>
> From: "Song, Myong S. \(Gerald\)" <songmyos@jicpac.pacom.mil>
> Date: Wed, 19 Jan 2005 14:15:40 -1000
> Subject: Adding new toolbar/buttons to Epic Editor 5.1
>
> Adepters,
>
> Documentation clearly state: "You can not add new toolbar buttons to the
> toolbar."
>
> I find this to be unbelievable! Can anyone verify this?
>
> Aloha.
>
>

Re: Adding new toolbar/buttons to Epic Editor 5.1

Brain, Thanks! Should've checked the archives first.

-Gerald.

Re: Adding new toolbar/buttons to Epic Editor 5.1

Adeptors,

I've created a XUI Toolbar file and was able to use the
window_load_component_file ACL command or in our .NET customization a
call to the Epic.ActiveWindow.LoadComponentFile method. Unfortunately, I
can't seem to load an image or place a label on the toolbar button. Any
ideas? This is getting very frustrating....

(We're running Epic 5.1 on Windows.)

Here's the XUI File:





<window dock="top" enabledocking="topleft" resize="none"><imagegroup<br/>id="test1">

<image id="test2" path="c:\test.bmp"/"></imagegroup>

<toolbargroup>

<toolbar id="test">

<button backgroundcolor="gray4" command="response("test")" <br="/>image="test2">

</button>

</toolbar>

</toolbargroup>

</window>

Re: Adding new toolbar/buttons to Epic Editor 5.1

Just a quick question, because I am totally new to all of this.

EDIT: I have edited this post because I was able to find some new information.

         However, I am not able to get the toolbar to show when Arbortext is first started

         and I think it's because there's no window yet and so my init() function is being

         called too early. I don't know how to fix that.

 

I still cannot figure out where to put this ACL code so it will run correctly and at the right time. As you can see, I have created an ACL file, called "my-custom-toolbar.acl", and it has the following code within it:

# My ACL file "my-custom-toolbar.acl"

# Set _debug variable so I can see the response output

global _debug = 1
function init(win = current_window())

  if (window_state(win) < 0) {
    if(_debug) {

      # The $win variable is always -1 because when Arbortext \

      # is first started, there's no window yet!
      response("Invalid window $win")    
    }    
    return
  }

 
  local doc = window_doc(win) 
  if (!doc_valid(doc)) {
    if(_debug) {
      response("Invalid document")

    }    
    return
  } 

  return win
}
# Call the above function
init()

 

I put it in the C:\Program Files (x86)\PTC\Arbortext Editor\custom\init folder because I want it to run as soon as the Arbortext editor has finished starting up. When it runs it fails because the $win variable is -1. I am guessing that it is -1 because the Arbortext window is not yet loaded when the above script runs. In other words, the script runs too early. This is where I remain stuck. How do I check to see if the Arbortext editor has fully started before trying to load my custom toolbar in it?

 

 

Re: Adding new toolbar/buttons to Epic Editor 5.1

Is the image of the right dimensions? I think it needs to be 16 x 16
bits or else you need to use an imagegroup where you can have images
stuck together in one bitmap.

John Dreystadt
Director of Product Management
Arbortext

Re: Adding new toolbar/buttons to Epic Editor 5.1

John, I change the path attribute of the button element to single quotes
(from path = "c:\test.bmp" to path = 'c:\test.bmp') and the image
displayed. Thanks.

-Gerald.

Re: Adding new toolbar/buttons to Epic Editor 5.1

Anyone here have a workaround to this problem?:

1) User opens a new document. ACL code creates custom toolbar on the
active window.
2) doc_add_callback function specifying the callback 'destroy' is
instantiated.
3) User closes the document. The callback routine is called to hide the
toolbar, but the first parameter; current_window() returns -1 when it
attempts to hide the toolbar using the dlgitem_withraw call. Epic
complains that the window specified does not exist.

I'm trying to clean up any custom toolbar buttons when the user closes
the document.

-Gerald.

Re: Adding new toolbar/buttons to Epic Editor 5.1

I assume (in other words, I'm guessing) that your problem is caused by
the window already being gone by the time your callback function is
executed. I was able to accomplish this in Java using a DocumentUnload
event listener rather than the doc_add_callback. The documentation for
the DocumentUnload event in the programmer's guide states:
"The DocumentUnload event occurs when a document is unloaded from a
window frame. There is no ACL callback equivalent for this event."
Inside of my event handler code is (among other things) a call to
Acl.eval("dlgitem_withdraw()")
I left out the parameters to dlgitem_withdraw just to make it easier to
read here.

>
> From: "Song, Myong S. \(Gerald\)" <songmyos@jicpac.pacom.mil>

Re: Adding new toolbar/buttons to Epic Editor 5.1

Brian,

Your guess is correct. I'll try the DocumentUnload event Monday. Thanks for the input.

-Gerald.

Re: Adding new toolbar/buttons to Epic Editor 5.1

Adepters,

What am I doing wrong here? I've implemented the IDOMEventListener
interface with my handleEvent method. "Registered" my events with the
AddEventListener method of the events I'd like to capture. The Window
events seem to work. MenuSelected works fine. But I can't capture any of
the Document events such as DocumentUnload, DocumentCreated,
DocumentClosed, etc? What am I missing?

-Gerald.
Announcements