Add a Toolbar button to the IDE

Here is a complete example for adding TopScan to the IDE toolbar as a button.
I’ve included the instructions for making the icon, as well as the finished addin and resources.

The Addin belongs in \clarion\accessory\addins folder
The resource belongs in \clarion\accessory\addins\resources folder


Step 1: To create the Icon resource from a .ICO file

Using SharpDevelop, version 2.2.1 (apparently the version matter).

SharpDevelop can be installed on the same machine as clarion itself.

  • File / New / File / Misc / Empty Resource File
  • Save as \Clarion\accessory\addins\resources\topscan.BitmapResources.resources
  • Should now see an empty resource area in the IDE. right-Click on the area and choose Add Files
  • Select your icon file (note 1)
  • The icon will be added. Click on the name to rename it. In this example I’m going to call it topscan.icon
  • Save the resources file

Note 1: The icon file should contain a single icon image of a specific resolution and size.

Step 2: Include the resource in the addin

Assuming the file created in Step 1 is called topscan.BitmapResources.resources and assuming it is installed into the resources subfolder of the topscan.addin file the following is added into the Addin;

<BitmapResources file="Resources\topscan.BitmapResources.resources" />

Step 3: Assuming the name of the icon in the resource is whatever.icon

Then inside the <Menuitem> place the following attribute;

  icon = "topscan.icon"

The final example addin looks like this;

<AddIn name        = "topscan"
       author      = "example"
       copyright   = "public domain"
       url         = ""
       description = "">
 
  <Manifest>
    <Identity name = "topscanToolbarButton" version="1.0"/>
  </Manifest>
 
  <BitmapResources file="Resources\topscan.BitmapResources.resources" />
 
  <Path name = "/SharpDevelop/Workbench/ToolBar/Standard">
    <MenuItem id = "topscanToolbarButton"
       label = ""
       icon = "topscan.icon"  
       link = "home://.\bin\topscan.exe" />
  </Path>
</AddIn>

The addin is placed in \clarion10\accessory\addin and the topscan.BitmapResources.resources file is in \clarion10\accessory\addin\resources

Example resource file, and addin file are below:
topscan.addin (600 Bytes)

topscan.BitmapResources.resources (4.7 KB)

1 Like

It’s great to see some more addin content here. If anyone makes use of this it will be awesome to hear what you add to the toolbar! Perhaps we can work out a community addin to include the most useful items?

There are also ways to make a dropdown menu of items as well if anyone is interested…

1 Like