a week ago
a week ago
Hi,
You need something like this in your Palette/Dialog resource.
/* [ 3] */ IconButton 216 8 24 24 10002
The last number is the resource number for the icon which is typically specified in the fixed resource file (RFIX/AddOnFix.grc in a lot of templates).
For example:
#include "ResourceMDIDIds.hpp"
'MDID' 32500 "Add-On Identifier" {
AC_MDID_DEV /* Developer id. */
AC_MDID_LOC /* Add-On local id. */
}
'GICN' 10002 "SettingsIcon" {
"SettingsIcon"
}
If you use the Dialog Manager in C++ style, then you'll need DG::IconButton in your code.
Hope that helps
a week ago
Put your image in RFIX/Images folder.
a week ago
Hi,
You need something like this in your Palette/Dialog resource.
/* [ 3] */ IconButton 216 8 24 24 10002
The last number is the resource number for the icon which is typically specified in the fixed resource file (RFIX/AddOnFix.grc in a lot of templates).
For example:
#include "ResourceMDIDIds.hpp"
'MDID' 32500 "Add-On Identifier" {
AC_MDID_DEV /* Developer id. */
AC_MDID_LOC /* Add-On local id. */
}
'GICN' 10002 "SettingsIcon" {
"SettingsIcon"
}
If you use the Dialog Manager in C++ style, then you'll need DG::IconButton in your code.
Hope that helps
a week ago
How do I get the image?
a week ago
Put your image in RFIX/Images folder.
a week ago
For example 32612 is for my settings icon and I want to add a refresh icon. How do I get it's number? And do any image in the internet is applicable?
yesterday
HI, you can use arbitrary icon identifier as you like, what matters is that it must be unique in your add-on resource (and must be a positive value in the signed short value range also (eg < 32768)).
How to create image file
You should create a .svg image. This way your icon will be correctly scaled according to the display scale factor. The svg file name must follow a special naming convention. For example in your case if you want an 18x18 pixel size icon it should be 'Refresh_18x18.svg'. Here the name is 'Refresh' and the _18x18 is added to it for the resource compiler system to handle it correctly. Obviously an other icon with size 32x24 would be OtherIcon_32x24.svg and so on.
The svg file can be prepared with Inkscape or an other svg-capable application. Inkscape is freely usable. If you use it there are some rules when drawing AC icons, some of them:
Place image to the add-on resource
In the grc file the .svg and the image size extension is omitted, so add the icon name only as mentioned above:
'GICN' 10002 "SettingsIcon" {
"RefreshIcon"
}
You can load this image to the IconButton either in the resource as a previous comment shows, or you can instantiate a DG::Icon object and set it to a button or an other control.
DG::Icon refreshIcon (resourceModule, 10002);
button.SetIcon (refreshIcon);