Undo list and menu customization?

N

Nikolay Belyh

I have recently run into following:

----
If I customize Visio UI using CommandBars, an undo item is added on
every menu click (WTF?)... Namely, I do the following:

item.OnAction = "MYADDON"
item.Parameter = "My addon parameters"

Here undo item named "MYADDON" appears in undo list, though addon
performed no actions that relate to visio

-----
If I customize Visio UI using UIObjects interface, then no undo items
are added (that is correct of course)

item.AddonName = "MYADDON"
item.AddonArgs = "My addon parameters"

Here no extra undo item appears.

---
In case I use ".Click" even with command bars, there is no undo item
as well, but nevertheless the behavior above does seem to be an odd
one...

Kind regards, Nikolay.
 
C

Chris Roth [Visio MVP]

Hi Nikolay,

Old Visio veterans like me prefer the UIObjects customization, because
it offers finer control (like per-document customization!)

When Microsoft bought Visio Corp, there was a hurry to incorporate as
many Office features as possible. Command Bars became the "official
recommendation", although I was never convinced they were the best.

Also, most Office apps don't have the theme-specific areas like Visio
does. So, for example, a Word add-on is good for just about every Word
document, in MS' opinion. With Visio, a UML-related add-on isn't useful
for a Space Plan diagram.

For just this reason, Command Bars are odd for Visio. They are always
there (unless you do lots of coding to show and hide them)

My gut tells me there are lots of problems with Command Bars, like what
you have just described, but I can't say exactly what they are from memory.

Doesn't really answer your question, but might help folks with some
useful history.

--
Hope this helps,

Chris Roth
Visio MVP


Visio Guy: Smart Graphics for Visual People

Articles: http://www.visguy.com
Shapes: http://www.visguy.com/shapes
Dev: http://www.visguy.com/category/development/
Forum: http://www.viguy.com/vgforum
 
J

John... Visio MVP

Don't worry. You will eventually have a ribbon to add to the mix. From the
hassles I have with the toolbars, I am looking forward to the ribbon. ;-)

John... Visio MVP
 
N

Nikolay Belyh

On 21 ÑÎ×, 18:23, "Chris Roth [Visio MVP]" <[email protected]>
wrote:

Hi Chris, thanks.

Unfortunately UIObjects in not an option for us anymore due to an
issue we encountered with them... We tried to overcome it but
unfortunately ended up rewriting the next version of our addin using
CommandBars... But UIObjects worked like a charm for the most things.
Now we fight the command bars that are monitored and "placed to the
correct state" if needed (i.e. if Visio re-advises/re-creates command
bars and command bar events, when needed, e.g. when the "visio
context" changes). But unfortunately I can't say this is any fun...
Here is kinda "final" description of the problem we were unable to
overcome with UIObjects:

http://groups.google.com/group/microsoft.public.visio.developer/msg/3a018a4fedc52e64

Anyways, now with the CommandBars the addin seem to:
- Work simultaneously with "bad-behaved" Visio UML/Database addons
(those that just don't care and replace the Application-level custom
menus)
- Work simultaneously with user customizations and "third-party"
addin's customizations (when user clicks "Customize" and adds/removes
some buttons, the addin still remains functional)
- Have more or less stable *hierarchical* context (right-click) menus
(this is why we dropped UIObjects - they seem to have "that issue"
about this, see the link above...)

So, concluding (and hopefully), viva la ribbon !!! :)

Kind regards, Nikolay.
 

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