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
SMC
Contributor
Posts: 51
Registered: ‎04-11-2016

Custom Command Icon

Hi All,

 

I have created a custom command (c# and Visual Studio 2015). All works okay, and I can register it, it appears in the ribbon bar, and operates correctly.

 

I cant seem to change the icon that appears in the ribbon bar though (during the registration process).

 

My batch file (to register) and XML file and INI file look like this - any ideas?

 

Register.BAT

-----------------

"D:\Program Files (x86)\Hexagon\GeoMedia Professional\Program\InstallAppCmd" /r /cmdset "OpenJob" /loc "%cd%" /dll "%cd%\Debug" /r /s

 

 

OpenJob.XML

-------------------

<?xml version='1.0' encoding='UTF-8'?>
<!--sample xml file created using XML DOM object.-->
<ApplicationCommands xmlns="http://www.intergraph.com/GeoMedia/appcmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
<ApplicationCommand xmlns="http://www.intergraph.com/GeoMedia/appcmd">
<ProgID>GeoMediaCommand.OpenJob</ProgID>
<DllName>ValidateJob.dll</DllName>
<BitmapRootFileName>
</BitmapRootFileName>
<Description>Open a Job</Description>
<Tooltip>Open a Job</Tooltip>
<EnableMask>589824</EnableMask>
<IsModal>1</IsModal>
<ModelessCommandPriority>NotAMapViewListener</ModelessCommandPriority>
<ModelessListenerMask>0</ModelessListenerMask>
</ApplicationCommand>
</ApplicationCommands>

 

 

OpenJob.ini

-------------------

[CreateGrid]
ProgID=GeoMediaCommand.OpenJob
CommandType=0
EnableMask=589824
ListenerMask=0
IsModal=1
Description=OpenJob
ToolTip=OpenJob
SmallMonoBitmapPath=D:\Projects\JobManagement\CSharp\Images\Open32x32.bmp
SmallColorBitmapPath=D:\Projects\JobManagement\CSharp\Images\Open32x32.bmp
LargeMonoBitmapPath=D:\Projects\JobManagement\CSharp\Images\Open32x32.bmp
LargeColorBitmapPath=D:\Projects\JobManagement\CSharp\Images\Open32x32.bmp

 

 

Might the location of the bmps have to be somewhere in the GeoMedia folders?

 

Regards,

Simon

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

Re: Custom Command Icon

Hi Simon

 

You have to define a value for the BitmapRootFileName tag in the XML file. And create four Bitmap files (large color / large monochrom / small color / small monochrom) with the specific file name postfixes (see below).

The Bitmap files have to be in the folder or a subfolder of the dll file (specified by the parameter 'dll' in the batch file).

 

In your case the BitmapRootFileName tag (with the example 'OpenJob') should be

<BitmapRootFileName>OpenJob</BitmapRootFileName>

or with a subfolder named 'Images'

<BitmapRootFileName>Images/OpenJob</BitmapRootFileName>

 

The four Bitmap files have to be

OpenJob_LC.bmp (32x32)

OpenJob_SC.bmp (16x16)

OpenJob_LM.bmp (32x32)

OpenJob_SM.bmp (16x16)

 

The Bitmap files must ALWAYS have exactly this four postfixes (with underline)!

 

You can find this information also under ...> Developer Documentation > GeoMedia Command Wizard Help > Choose Custom Bitmaps.

 

Btw: The ini file is not necessary if you register the command with InstallAppCmd.

 

Best regards,

hesrah

 

PS: In your batch file the parameter /r is double.

Highlighted
SMC
Contributor
Posts: 51
Registered: ‎04-11-2016

Re: Custom Command Icon

[ Edited ]

Hi hesrah,

 

Thanks for the pointer. I had a look at the documentation too, but cant figure out what the issue is. I have updated the custom command and the file name is now called OpenJob.dll.

 

I created a folder called s1 (to store the images) and created s1_lc, _lm, _sc and _sm (within the s1 folder) - see images below.

 

The command registers fine but the images never appear in the ribbon.

 

I know I am doing somehting daft here - any ideas?

 

geomedia_command_folders.png

 

My updated files look like this:

 

Register.bat

----------------

cd D:\Projects\Sources\JobManagement\CSharp\bin\Deploy
"D:\Program Files (x86)\Hexagon\GeoMedia Professional\Program\InstallAppCmd" /cmdset "OpenJob" /loc "%cd%" /dll "%cd%" /r

 

UnRegister.bat

----------------

cd D:\Projects\Sources\JobManagement\CSharp\bin\Deploy
"D:\Program Files (x86)\Hexagon\GeoMedia Professional\Program\InstallAppCmd" /cmdset "OpenJob" /loc "%cd%" /dll "%cd%" /u

 

OpenJob.XML

----------------

<?xml version='1.0' encoding='UTF-8'?>
<!--sample xml file created using XML DOM object.-->
<ApplicationCommands xmlns="http://www.intergraph.com/GeoMedia/appcmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
<ApplicationCommand xmlns="http://www.intergraph.com/GeoMedia/appcmd">
<ProgID>GeoMediaCommand.OpenJob</ProgID>
<DllName>OpenJob.dll</DllName>
<BitmapRootFileName>s1</BitmapRootFileName>
<Description>Open a Job</Description>
<Tooltip>Open a Job</Tooltip>
<EnableMask>8192</EnableMask>
<IsModal>1</IsModal>
<ModelessCommandPriority>NotAMapViewListener</ModelessCommandPriority>
<ModelessListenerMask>0</ModelessListenerMask>
</ApplicationCommand>
</ApplicationCommands>

 

I have also attached the folder (zipped up) - if that helps.

 

Best Regards,

Simon

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

Re: Custom Command Icon

In this case the value of BitmapRootFileName has to be 's1/s1' (not only 's1'). So th tag definition looks like this

<BitmapRootFileName>s1/s1</BitmapRootFileName>

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