Visio 2010 context menus?

Started by Nikolay, April 01, 2010, 06:29:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nikolay

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? ???

Quote from: Nikolay Belyh on March 31, 2010, 02:10:31 PM
Lately I tried to port our addin's custom context menu to new Visio 2010, according to this...

Quote from: Barry on August 29, 2009, 04:49:07 PM
Customization of context menus and the outspace are also done via ribbonx XML:

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


<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

#1
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

Nikolay

#2
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

Barry

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

#4
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

Yacine

Barry,
what are you doing in the office on easter friday?
;)
Yacine

Nikolay

#6
Quote from: Barry on April 02, 2010, 04:57:24 PM
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.

Barry

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