Book a Demo

Author Topic: Addin toolbar  (Read 7959 times)

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Addin toolbar
« on: September 04, 2009, 08:11:10 pm »
Hi all,

I've created an AddIn that works perfectly and like a number of other users wanted to make it accessible by a toolbar rather than the Addin Menu option. I see from various other discussions here that that's not possible via code but thought I could do it manually via the Customize option of the toolbar.

I created a new toolbar and dragged my addin menu item onto the new toolbar. I, however, noticed 2 things.

1. My addin has a name/label of Dummy0
2. There's no icon defined for the menu item.

So my question(s) is/are: does anyone know how to set the name/label to something sensible  ;), and can the icon of an addin be set when it's created.

TIA
Martin


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Addin toolbar
« Reply #1 on: September 04, 2009, 08:49:58 pm »
I don't know the answers (I don't think so), but I do have a question.
When you put the dummy0 on the toolbar, did it do something when selected?

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Addin toolbar
« Reply #2 on: September 04, 2009, 09:05:06 pm »
Hi Geert,

Thanks for the reply.

Whoops - oddly, I didn't try it  :-[ but just have and no, it seems to be greyed out and nothing happens, so looks like we're on a losing wicket whatever!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Addin toolbar
« Reply #3 on: September 04, 2009, 09:12:16 pm »
I was afraid so  :-/

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: Addin toolbar
« Reply #4 on: September 04, 2009, 10:12:55 pm »
1. Right click on menu bar --> Customize
2. Tab "Toolbars" --> button "New..." --> Write the toolbar name
3. The new toolbar appears.
4. Go to "Add-In" menĂº and select the desired menu (add-in menu or action) --> Drag and drop this menu or submenu to the recently created toolbar.
5. Close the customize window.

This is not valid for parent menus, only for the last level.

I've tried this in v7.5 build 848 and works fine!

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Addin toolbar
« Reply #5 on: September 04, 2009, 10:19:43 pm »
Hi Luis,

That's what I've done initially. The only difference is that I'm using 845 so I'll download the latest and see what happens.

When you do it, do you get sensible labels and an icon?

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: Addin toolbar
« Reply #6 on: September 04, 2009, 10:26:52 pm »
While in "customize" mode, you can right click over the new toolbar and select "Button Appearance", and decide only text, only image and text & image. The images could be selected or drawed by yourself.

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: Addin toolbar
« Reply #7 on: September 04, 2009, 10:32:57 pm »
It looks like this:


Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: Addin toolbar
« Reply #8 on: September 04, 2009, 10:58:57 pm »
I've tried to put several buttons in toolbars and works fine the first time you call their functions. Later times, when you press a button another command is launched.

There are several bugs here...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Addin toolbar
« Reply #9 on: September 04, 2009, 11:05:42 pm »
I can image that this mixup is related to the dynamic nature of the addin-menu option.
Actually, before the EA_getMenuItems is executed EA does not know what they will be, the are constructed at the very last moment.
I guess it is difficult to keep a reference to something that doesn't exist yet.

Geert

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Addin toolbar
« Reply #10 on: September 05, 2009, 12:47:19 am »
Ok - i've managed to create the toolbar with sensible label and icon but it's still greyed out.

@Geert: The EA_getMenuItems call really ought to be called when the class is instantiated but is only called when the AddIn menu item is clicked so it's no wonder EA doesn't know what's happening.

I'm still going to try 7.5.848.

Thanks anyway guys

Martin