My add-in menu problem

B

BBD

Hi all,

I have strange my add-in menu problem when it dissapears under some
circumstances in Visio 2007. The problem can be illustrated using "WBS
TreeView" add-in example from Visio SDK:

1. Initial Visio 2007 menu has a following list of top menu items: "File,
Edit, View, Insert, Format, Tools, Data, Shape, Window, Help",

2. After "WBS TreeView" is activated and some MS Project data file is loaded
in Visio, menu is extended with "TreeView Sample", like: "File, Edit, View,
Insert, Format, Tools, Data, Shape, TreeView Sample, Window, Help",

3. However, when new database document is created ("File / New / Software
and Database / Database model diagram"), new menu item "Database" is
created, but "WBS TreeView" menu is removed from Visio 2007: "File, Edit,
View, Insert, Format, Tools, Data, Database, Shape, Window, Help".

There is no way to restore "TreeView Sample" whatever I do. How "WBS
TreeView" sample code can be extended to have its menu permanent in Visio
2007?

Thanks in advance,
BBD
 
A

AlEdlund

If you check out the sample code, I would suspect that it tests to see if
the correct document has been loaded before it initializes the menu. You
might try removing the test.
al
 
B

BBD

Hi Al,

Thank you.

No, WBS does not test the document before it creates the menu entry. It
simply creates new item "TreeView Sample".

I would suspect that new database diagram clears all Visio top menu items
what does not have BuiltIn property set to "true". All built-in Visio menu
items ("File", "Edit", etc) has such member set to "true", while all custom
menu items, created by some add-in, does not. How can I set my add-in menu
popup to "built-in" programmatically to avoid the removal? Any other ideas?

BBD
 
D

David Parker

The Database Modelling AddOn does remove other menus, because it assumes
that you don't need them.
Visio UI has two alternative class hierarchies - UIObjects (pre Microsoft -
used by the Database Model diagram probably) and OfficeCommandBar (post
Microsoft - used by WBS TreeView), and in my experience, they are not always
compatible.

My WBS Modeler was an enhancement of the WBS TreeView sample, and it suffers
the same problem of losing its menu when the Database Model diagram is
opened. I'll need to investigate, but I 'm sure that you cannot change them
to "built-in"

The next version of Visio will have the Fluent UI, thus the future of the
older UIObjects must be uncertain.
 
P

Paul Herber

The Database Modelling AddOn does remove other menus, because it assumes
that you don't need them.

Along with the UML addon, it shouldn't be a difficult job to modify
these addons to check the CustomUI menu before creating their own menu
entry. It's an extra three lines of code.
Who owns the source code for these addons?
 
N

Nikolay Belyh

Along with the UML addon, it shouldn't be a difficult job to modify
these addons to check the CustomUI menu before creating their own menu
entry. It's an extra three lines of code.

Fully agree.
"Does remove other menus because It (note capital) assumes you don't
need them". That's the spirit! ;-)
Who owns the source code for these addons?

I suppose that Microsoft does...doesn't it?
Just wondering why these two (UML and Database) still believe they are
"the ones"...

Kind regards, Nikolay.
 
D

David Parker

Microsoft does ... but that doesn't mean that they have anyone actively
maintaining them, or that they would dream of issuing a patch ...

Along with the UML addon, it shouldn't be a difficult job to modify
these addons to check the CustomUI menu before creating their own menu
entry. It's an extra three lines of code.

Fully agree.
"Does remove other menus because It (note capital) assumes you don't
need them". That's the spirit! ;-)
Who owns the source code for these addons?

I suppose that Microsoft does...doesn't it?
Just wondering why these two (UML and Database) still believe they are
"the ones"...

Kind regards, Nikolay.
 
A

AlEdlund

They have announced that (at least for now) what you see is what you get,
since they aren't currently planning to release a v2007 version (per
visiotoolbox).
al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top