Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 52
Registered: ‎05-30-2016
Accepted Solution

Layout Window Custom Command Ribbon

Hi,

 

I'm working with an application plug-in for GeoMedia desktop that supports 2014 to 2018. We currently have 4 custom commands that appear on the ribbon when a map window is open. The all work fine. We now need to add another that will appear only in the Layout Window.

 

I develop with vs 2012 and GeoMedia 2014, and then test on all other environments. This has all worked fine up to now.

 

So, before I go too far, does GeoMedia 2014 support custom commands in the Layout Window?

 

  1. If so, what happens? Do they show up in a Workflow tab in the Layout Window?
  2. Do I need to create a separate ribbon for those commands or can they be combined with others that appear only in the map window?
  3. Is controlling where each button is displayed (eg. map window vs layout window) determined by the enable mask in the application command xml?

thanks

 

 

 

Technical Evangelist
Posts: 491
Registered: ‎09-11-2015

Re: Layout Window Custom Command Ribbon

GeoMedia does not support placing custom command buttons onto layout ribbon bar. You must start your command from Map ribbon bar, even if it manipulates the layout window. You can bring the layout window to the top as soon as you start your command, however.

 

Pavel

Regular Contributor
Posts: 156
Registered: ‎05-25-2016

Re: Layout Window Custom Command Ribbon

Hi

 

You can create a "ribbon bar" for the Layout Window with a dockable control. Use a tracker (startup) command which is "waiting" for the Layout Window in the background. If the user activate the Layout Window show the dockable control (use the events of the GeoMedia Application object).

 

Such a "dockable control-ribbon bar" is not full integrated in the standard ribbon bar and the tracker command is a bit overhead. Maybe it's still a solution.

 

Best regards

hesrah

Contributor
Posts: 52
Registered: ‎05-30-2016

Re: Layout Window Custom Command Ribbon

Thanks for the info and suggestions.

 

Hesrah, I can't find any event that is triggered when a window becomes active. If so, I could figure out if it is a Layout window and show my 'proxy' ribbon. 

 

"Use a tracker (startup) command"   -- Does this run on start up, without a user clicking a button?

 

I have a few commands configured like so, that all work well, but none is called until clicked, even though they are specified as 'TrackerCommand'.

 

<ApplicationCommand xmlns="http://www.intergraph.com/GeoMedia/appcmd">
<ProgID>MyNameSpace.MyClass</ProgID>
<DllName>My.dll</DllName>
<BitmapRootFileName> </BitmapRootFileName>
<Description>Blah Blah</Description>
<Tooltip>More Blah blah</Tooltip>
<EnableMask>2048</EnableMask>
<IsModal>0</IsModal>
<ModelessCommandPriority>TrackerCommand</ModelessCommandPriority>
<ModelessListenerMask>24</ModelessListenerMask>
</ApplicationCommand>

 

My command wizard is not functioning or I would trial and error a few options. I don't use it as I just use a previous command as a template. If I take the time to trouble shoot my command wizard to get it working, can it generate the xml for a command that starts without a user click.

 

Regards

Regular Contributor
Posts: 156
Registered: ‎05-25-2016

Re: Layout Window Custom Command Ribbon

[ Edited ]

Hi Xguy

 

You're right. There is only an event if a new window is instantiated ...

 

But you can use a timer control and check Application.ActiveWindow.Type = "LayoutWindow" (check also for Application.ActiveWindow is Nothing before if no GWS is open) every half second.

 

The Tracker Command type has nothing to do with startup directly. A Tracker Command always runs in the background and will not be suspended by other commands. But I think you don't need* a Tracker Command. Use a "normal" command (as startup command, see bellow) and start the timer once in the initialize method. (* Conzeputally, a Tracker Command is the right one, but it works also with another command type.)

 

For startup commands see here: https://hgdsupport.hexagongeospatial.com/API/GeoMedia/Building%20on%20the%20GeoMedia%20Engine/#appli...

 

Best regards,

hesrah

Highlighted
Contributor
Posts: 52
Registered: ‎05-30-2016

Re: Layout Window Custom Command Ribbon

[ Edited ]

Thanks again hesrah.

 

I already implemented a timer upon getting your post. However, I implemented it within user command. Based on your suggestion to use a start up command I reworked it and got it working.

 

The only remaining issue is that it appears on the 'My Workflow' tab as a button. I'm guessing I'll have to create a separate application xml file for the start up, place it in a different folder, add an application command registry key for it, and then set the RibbonCmd key to 0. For 2015 and up, I can just omit it from my ribbon, simple enough. Will update this post when confirmed.

 

Update: "I'm guessing I'll have to create a separate application xml file for the start up, place it in a different folder, add an application command registry key for it, and then set the RibbonCmd key to 0."  My guess was right.

 

Thanks so much for your assistance on this hesrach

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.