06-21-2018 05:27 PM
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?
Solved! Go to Solution.
06-21-2018 11:18 PM
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.
06-22-2018 03:18 AM
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.
06-22-2018 11:49 AM
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.
06-23-2018 01:53 AM - edited 06-23-2018 01:54 AM
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...
06-25-2018 07:00 PM - edited 06-25-2018 07:12 PM
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