<?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: Events and Notifications on dialog items in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Events-and-Notifications-on-dialog-items/m-p/288031#M2207</link>
    <description>Thank you!&lt;BR /&gt;
I tried it and it works.</description>
    <pubDate>Wed, 28 Jul 2021 11:13:19 GMT</pubDate>
    <dc:creator>Mihalcea Bogdan</dc:creator>
    <dc:date>2021-07-28T11:13:19Z</dc:date>
    <item>
      <title>Events and Notifications on dialog items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Events-and-Notifications-on-dialog-items/m-p/288029#M2205</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello!&lt;BR /&gt;How can I use the event notifications in Archicad API?&lt;BR /&gt;I created a new Button class based on the DG::Button class which has a "name" variable. When I click this button I want to make something happen. &lt;BR /&gt;For now I am using
&lt;PRE&gt; if(ev.GetSource() == some button) { do something ... }&lt;/PRE&gt;
My problem is that the ev.GetSource() does not return my Button class pointer but it returns DG::ButtonItem pointer which does not contain the newly created functions like GetName().&lt;BR /&gt;I even made a new Observer class which inherits the ButtonItemObserver but I am stuck at this. This button will do only one type of thing like a HTTP request based on the name of this button.&lt;BR /&gt;To be more clear I will write the code here:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;class MyButton : public DG::Button {
   public:
      GS::UniString GetName();
      void Do_HTTPRequest();//Based on the name of the button
   private:
      GS::UniString name;
}
class MyButtonObserver : public DG::ButtonItemObserver {
}
&lt;/PRE&gt;
is there any way to override the OnClick event of a button?&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:25:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Events-and-Notifications-on-dialog-items/m-p/288029#M2205</guid>
      <dc:creator>Mihalcea Bogdan</dc:creator>
      <dc:date>2021-09-14T07:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Events and Notifications on dialog items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Events-and-Notifications-on-dialog-items/m-p/288030#M2206</link>
      <description>&lt;B&gt;ev.GetSource()&lt;/B&gt; will always return a pointer to the base class, so you have to &lt;B&gt;dynamic_cast&lt;/B&gt; it to your inherited class.&lt;BR /&gt;
&lt;BR /&gt;
Something like this:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;MyButton* myButton = dynamic_cast&amp;lt;MyButton*&amp;gt; (ev.GetSource ());
&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jul 2021 09:11:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Events-and-Notifications-on-dialog-items/m-p/288030#M2206</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2021-07-28T09:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Events and Notifications on dialog items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Events-and-Notifications-on-dialog-items/m-p/288031#M2207</link>
      <description>Thank you!&lt;BR /&gt;
I tried it and it works.</description>
      <pubDate>Wed, 28 Jul 2021 11:13:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Events-and-Notifications-on-dialog-items/m-p/288031#M2207</guid>
      <dc:creator>Mihalcea Bogdan</dc:creator>
      <dc:date>2021-07-28T11:13:19Z</dc:date>
    </item>
  </channel>
</rss>

