<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to add new Icon button? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634903#M9874</link>
    <description>&lt;P&gt;How do I get the image?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 02:47:26 GMT</pubDate>
    <dc:creator>RAFD</dc:creator>
    <dc:date>2024-10-09T02:47:26Z</dc:date>
    <item>
      <title>How to add new Icon button?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634579#M9861</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Does anyone know how to add icon button and image?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 09:25:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634579#M9861</guid>
      <dc:creator>RAFD</dc:creator>
      <dc:date>2024-10-07T09:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new Icon button?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634808#M9869</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You need something like this in your Palette/Dialog resource.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;/* [  3] */ IconButton  	216   8	 24  24	10002
&lt;/LI-CODE&gt;
&lt;P&gt;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).&lt;BR /&gt;For example:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include "ResourceMDIDIds.hpp"

'MDID' 32500 "Add-On Identifier" {
	AC_MDID_DEV /* Developer id. */
	AC_MDID_LOC /* Add-On local id. */
}

'GICN' 10002 "SettingsIcon" {
	"SettingsIcon"
}
&lt;/LI-CODE&gt;
&lt;P&gt;If you use the Dialog Manager in C++ style, then you'll need DG::IconButton in your code.&lt;/P&gt;
&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 13:04:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634808#M9869</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2024-10-08T13:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new Icon button?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634903#M9874</link>
      <description>&lt;P&gt;How do I get the image?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 02:47:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634903#M9874</guid>
      <dc:creator>RAFD</dc:creator>
      <dc:date>2024-10-09T02:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new Icon button?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634912#M9875</link>
      <description>&lt;P&gt;Put your image in RFIX/Images folder.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 05:37:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634912#M9875</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2024-10-09T05:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new Icon button?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634922#M9876</link>
      <description>&lt;P&gt;For example&amp;nbsp;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?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 07:17:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/634922#M9876</guid>
      <dc:creator>RAFD</dc:creator>
      <dc:date>2024-10-09T07:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new Icon button?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/635937#M9900</link>
      <description>&lt;P&gt;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 &amp;lt; 32768)).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How to create image file&lt;/STRONG&gt;&lt;BR /&gt;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.&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use pixels as unit&lt;/LI&gt;
&lt;LI&gt;Do not add pixmaps on the svg canvas&lt;/LI&gt;
&lt;LI&gt;Save your image with the 'Save As.../Optimized svg' menu command&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Place image to the add-on resource&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In the grc file the .svg and the image size extension is omitted, so add the icon name only as mentioned above:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;'GICN' 10002 "SettingsIcon" {
	"RefreshIcon"
}&lt;/LI-CODE&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;DG::Icon refreshIcon (resourceModule, 10002);
button.SetIcon (refreshIcon);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 08:50:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-add-new-Icon-button/m-p/635937#M9900</guid>
      <dc:creator>Miklos Vegh</dc:creator>
      <dc:date>2024-10-16T08:50:56Z</dc:date>
    </item>
  </channel>
</rss>

