Author Topic: Visio 2010 context menus?  (Read 11364 times)

0 Members and 1 Guest are viewing this topic.

Nikolay

  • Hero Member
  • *****
  • Posts: 1123
    • UnmanagedVisio
Visio 2010 context menus?
« on: April 01, 2010, 01:29:22 AM »
Posted a question to "code forum" but now it seems now I've got easier one -
does context menu customization work in Visio 2010 at all? ???

Lately I tried to port our addin's custom context menu to new Visio 2010, according to this...

Customization of context menus and the outspace are also done via ribbonx XML:

I mean, context menu customization "via ribbon XML":

Code
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <contextMenus>
    <contextMenu idMso="MenuShape">
      <button id="MyId" label="MyButton" onAction="OnRibbonButtonClicked" />
    </contextMenu>
  </contextMenus>
</customUI>

Means, Microsoft guys, you haven't forgotten to implement (or include?!) this nice feature, have you??? :D
Still hoping that "MenuShape" is just a wrong id... Have already tried "ShapeMenu", "ContextMenuShape", "ShapeContextMenu", "MenuShapeContext"... :D

Kernel panic! Thanks in advance!

Barry

  • Jr. Member
  • **
  • Posts: 18
Re: Visio 2010 context menus?
« Reply #1 on: April 01, 2010, 04:42:43 PM »
Hi Nikolay,

Extensibility of the context menus via RibbonX was implemented *after* Beta2, therefore you likely do not have these bits.

The final idMso values for the context menus are:

For 1D shapes: 'ContextMenuShape1D'
For all other shapes: 'ContextMenuShape'
For the page (i.e. no shape selected): 'ContextMenuDrawingPage'


-Barry
« Last Edit: April 02, 2010, 11:58:50 AM by Barry »

Nikolay

  • Hero Member
  • *****
  • Posts: 1123
    • UnmanagedVisio
Re: Visio 2010 context menus?
« Reply #2 on: April 02, 2010, 12:09:54 AM »
Hurra!!! It worked! Barry, thank you so much! :D

It seems you were right and I have been trying "ContextMenuShape" against beta 2.
In the later build, it worked!

By the way, maybe you can tell us where can one find other context menu ids? (in this topic?)
In particular, is "page" menu "ContextMenuPage"?

I have only found this doc on the subject: "Office 2010 control ids":
http://www.microsoft.com/downloads/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en

But there are no ids for the context menus in this file...:(

Kind regards, Nikolay
« Last Edit: April 02, 2010, 01:52:38 AM by Nikolay Belyh »

Barry

  • Jr. Member
  • **
  • Posts: 18
Re: Visio 2010 context menus?
« Reply #3 on: April 02, 2010, 01:39:27 AM »
Glad this is now working for you, thanks for the confirmation.

The MSDN download you linked to is stale and will need to be updated.  In the interim, I'll post a complete list here once I'm back in the office.

-Barry

Barry

  • Jr. Member
  • **
  • Posts: 18
Re: Visio 2010 context menus?
« Reply #4 on: April 02, 2010, 11:57:24 AM »
OK, here's the complete list of Visio-specific context menus available via RibbonX.

ContextMenuCommentMarker   Context menu for reviewer comment markers
ContextMenuCommentMarker   Context menu for reviewer comment markers
ContextMenuConnectionPoint   Context menu for Visio connection points
ContextMenuDrawingPage      Context menu for a page (no selection)
ContextMenuExplorerDocument   Context menu for a document in the Drawing Explorer
ContextMenuExplorerLayer      Context menu for a layer in the Drawing Explorer
ContextMenuExplorerLayers      Context menu for layers  in the Drawing Explorer
ContextMenuExplorerMaster      Context menu for a master in the Drawing Explorer
ContextMenuExplorerMasters   Context menu for masteres in the Drawing Explorer
ContextMenuExplorerPage      Context menu for a page in the Drawing Explorer
ContextMenuExplorerPages      Context menu for pages in the Drawing Explorer
ContextMenuExplorerPatterns   Context menu for patterns in the Drawing Explorer
ContextMenuExplorerShape      Context menu for a shape  in the Drawing Explorer
ContextMenuExplorerShapes      Context menu for shapes  in the Drawing Explorer
ContextMenuExplorerStyle      Context menu for a style in the Drawing Explorer
ContextMenuExplorerStyles      Context menu for styles in the Drawing Explorer
ContextMenuFullScreen      Context menu for full screen mode
ContextMenuMaster                  Context menu for a master
ContextMenuMasterExplorerDocument      Context menu for a document in the Master Explorer
ContextMenuMasterExplorerMaster            Context menu for a master in the Master Explorer
ContextMenuOleObject                        Context menu for OLE objects
ContextMenuPageNavigation                  Context menu for page navigation buttons
ContextMenuPageTab                              Context menu for a page tab
ContextMenuShape1D                              Context menu for a 1D shape
ContextMenuShape                              Context menu for a 2D shape
ContextMenuShapeSheet                        Context menu for a ShapeSheet
ContextMenuSpelling                              Context menu for spelling
ContextMenuText                                    Context menu for shape text editor
ContextMenuTextDrag                        Context menu for dragging text
ContextMenuWindowDrawingExplorer      Context menu for the Drawing Explorer window
ContextMenuWindowExternalData            Context menu for the External Data Window
ContextMenuWindowExternalDataItem      Context menu for the Data Explorer
ContextMenuWindowExternalDataTab      Context menu for a Data Explorer tab
ContextMenuWindowFormulaTracing            Context menu for the Formula Tracing window
ContextMenuWindowIssues                        Context menu for the Validation issues Window
ContextMenuWindowIssuesItem                  Context menu for an individual validation issue
ContextMenuWindowMasterExplorer            Context menu for the Master Explorer window
ContextMenuWindowPanZoom                  Context menu for the Pan and Zoom Window
ContextMenuWindowShapeData                  Context menu for the Shape Data window
ContextMenuWindowShapes                        Context menu for the Shapes window
ContextMenuWindowShapesMoreShapes      Context menu for the More Shapes flyout
ContextMenuWindowShapesStencil            Context menu for a stencil
ContextMenuWindowSizePosition            Context menu for the Size and Position window
ContextMenuWindowStyleExplorer            Context menu for the Style Explorer window
« Last Edit: April 02, 2010, 09:11:11 PM by Barry »

Yacine

  • Hero Member
  • *****
  • Posts: 2991
Re: Visio 2010 context menus?
« Reply #5 on: April 02, 2010, 03:27:01 PM »
Barry,
what are you doing in the office on easter friday?
;)
Yacine

Nikolay

  • Hero Member
  • *****
  • Posts: 1123
    • UnmanagedVisio
Re: Visio 2010 context menus?
« Reply #6 on: April 05, 2010, 06:34:27 AM »
OK, here's the complete list of Visio-specific context menus available via RibbonX.

Barry, thanks!

BTW, is Visio 2010 own user interface defined using an XML file? In this case, I think it would be helpful for Visio developers if Microsoft can make this XML file available to the public.. (e.g. as a separate download?), so that it can be used as a reference, or as a source of idMso... Means, excel files are great, but wouldn't it be much easier to publish the original XML... (unless it does not exist of course?)
Either way, your help was invaluable!

Regards, Nikolay.
« Last Edit: April 06, 2010, 11:11:56 PM by Nikolay Belyh »

Barry

  • Jr. Member
  • **
  • Posts: 18
Re: Visio 2010 context menus?
« Reply #7 on: April 06, 2010, 02:57:11 PM »
The built-in ribbon layouts for each office app are declared via an internal format that is not RibbonX.  Hence, what you are asking for does not exist, unfortunately.

-Barry