<?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 Custome value User control in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292408#M4868</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hello! &lt;BR /&gt;&lt;BR /&gt;I need to make custom value list and choosing one of values from list add it to one of object parameter. User Control seems to work only on defined list, color line e.t.c. &lt;BR /&gt;&lt;BR /&gt;PopupControl seems to work similar, but didn't understand how to use them from documentation of "Pop-up Control". I did get PopUpControl to show at my dialog window now i need to add values to it.&lt;BR /&gt;&lt;BR /&gt;Any help will be appreciated.&lt;/DIV&gt;</description>
    <pubDate>Thu, 13 Jul 2023 13:42:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-07-13T13:42:15Z</dc:date>
    <item>
      <title>Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292408#M4868</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello! &lt;BR /&gt;&lt;BR /&gt;I need to make custom value list and choosing one of values from list add it to one of object parameter. User Control seems to work only on defined list, color line e.t.c. &lt;BR /&gt;&lt;BR /&gt;PopupControl seems to work similar, but didn't understand how to use them from documentation of "Pop-up Control". I did get PopUpControl to show at my dialog window now i need to add values to it.&lt;BR /&gt;&lt;BR /&gt;Any help will be appreciated.&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:42:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292408#M4868</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-13T13:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292409#M4869</link>
      <description>Maybe someone have example of using PopUpControls? &lt;BR /&gt;
 &lt;BR /&gt;
Found popupcontrol menu in APIOutputFramework_Test from examples. &lt;BR /&gt;
But couldn't implement it to my dialog menu.</description>
      <pubDate>Tue, 25 Aug 2015 11:04:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292409#M4869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-25T11:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292410#M4870</link>
      <description>Somehow managed to get it work, not the way i wanted, but it works, at least it seems that way.  &lt;BR /&gt;
 &lt;BR /&gt;
On click modal dialog generates new dialog with popup controls.. although not sure how &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
 &lt;BR /&gt;
I'm gonna post if i have any issues and have more precise questions to ask.</description>
      <pubDate>Fri, 28 Aug 2015 11:35:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292410#M4870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-28T11:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292411#M4871</link>
      <description>&lt;PRE&gt;DG::PopUp							databasePopup; 
int SelectedIndex = databasePopup.GetSelectedItem();&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Hello, &lt;BR /&gt;
 &lt;BR /&gt;
I get selected PopUp menu item after closing ModalDialog, but i need to get chosen item reach time it has been changed in PopUp menu inside ModalDialog. &lt;BR /&gt;
 &lt;BR /&gt;
I belive i need to make PopUp menu observer but i don't know how to make one.</description>
      <pubDate>Mon, 31 Aug 2015 13:08:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292411#M4871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-31T13:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292412#M4872</link>
      <description>&lt;BLOCKQUOTE&gt;Rinovo wrote:&lt;BR /&gt;Maybe someone have example of using PopUpControls? 
&lt;/BLOCKQUOTE&gt;

Below is cutted source code.&lt;BR /&gt;
( It is a TabPage, not a ModalDialog )&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;class TabAuxLogItem
	: public DG::TabPage
	, private DG::PopUpObserver
{
public:

	TabAuxLogItem( const DG::TabControl&amp;amp; tabControl, short tabItem=1 );
	~TabAuxLogItem();

private:
	
	virtual void	PopUpChanged (const DG::PopUpChangeEvent&amp;amp; ev);

private:
	DG::PopUp			mi_prf;
};
&lt;/PRE&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;TabAuxLogItem::TabAuxLogItem( const DG::TabControl&amp;amp; tabControl, short tabItem )
	: DG::TabPage( tabControl, tabItem, ACAPI_GetOwnResModule(), RTAB_AUXL_ITEM, ACAPI_GetOwnResModule() )
	, mi_prf( GetReference(), PRF )
{
	mi_prf.Attach( *this );
}

TabAuxLogItem::~TabAuxLogItem()
{
	mi_prf.Detach( *this );
}

void TabAuxLogItem::PopUpChanged (const DG::PopUpChangeEvent&amp;amp; ev)
{
	if ( ev.GetSource() == &amp;amp;mi_prf )
	{
		UID id = (UID)mi_prf.GetItemValue( mi_prf.GetSelectedItem() );
		UpdateProfileID( id );
	}
}
&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2015 14:26:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292412#M4872</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2015-08-31T14:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292413#M4873</link>
      <description>this-&amp;gt;m_comboModels defined in .h file&lt;BR /&gt;
like this&lt;BR /&gt;

&lt;PRE&gt;DG::PopUp			m_comboModels;&lt;/PRE&gt;

in your cpp file you can fill it by this way&lt;BR /&gt;

&lt;PRE&gt;this-&amp;gt;m_comboModels.DeleteItem(DG::PopUp::AllItems);
for (int i = 0; i &amp;lt; &amp;lt;your array&amp;gt;; i++)
{
	this-&amp;gt;m_comboModels.AppendItem();
	this-&amp;gt;m_comboModels.SetItemText (DG::PopUp::BottomItem, GS::UniString::Printf("%s", &amp;lt;display member&amp;gt;));
	this-&amp;gt;m_comboModels.SetItemValue (DG::PopUp::BottomItem, &amp;lt;value member&amp;gt;);
}&lt;/PRE&gt;

If you need to catch on selected change event of your popup control then you should inherit your dialog or pallete class from public DG::PopUpObserver&lt;BR /&gt;
&lt;BR /&gt;
and use like this&lt;BR /&gt;
&lt;BR /&gt;
.h
&lt;PRE&gt;void	PopUpChanged(const DG::PopUpChangeEvent&amp;amp; e);&lt;/PRE&gt;

.cpp&lt;BR /&gt;

&lt;PRE&gt;void PopUpChanged(const DG::PopUpChangeEvent&amp;amp; e)
{ 
	Int32 selValue = TruncateTo32Bit(e.GetSource()-&amp;gt;GetItemValue(this-&amp;gt;m_comboModels.GetSelectedItem ()));
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Sep 2015 05:29:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292413#M4873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-01T05:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292414#M4874</link>
      <description>Thanks Oleg, thanks Ggiloyan!&lt;BR /&gt;
&lt;BR /&gt;
Got it working now &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;</description>
      <pubDate>Thu, 03 Sep 2015 07:13:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292414#M4874</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-03T07:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292415#M4875</link>
      <description>Now i have different problem. &lt;BR /&gt;
 &lt;BR /&gt;
IconPushRadio Buttons haven't got icon. I changed my modal dialog from DGLCALLBACK structure to observer structure. And now i don't have Icon for radio Buttons. &lt;BR /&gt;
 GRC: 
&lt;PRE&gt; IconPushRadio		  8   22   52   52  1	 32107&lt;/PRE&gt; &lt;BR /&gt;
.hpp 
&lt;PRE&gt;RadioOneID = 4, 
/... 
DG::IconPushRadio			        RadioOne;&lt;/PRE&gt; &lt;BR /&gt;
.cpp 
&lt;PRE&gt;RadioOne	    (GetReference (),RadioOneID)&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
As i was writing this found a way to initialize icon with
&lt;PRE&gt;RadioOne.SetIcon(DG::Icon(ACAPI_GetOwnResModule (),32106 ));&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Previously SetIcon had errors using with pointers and DG::Icon class, solved them just now. &lt;BR /&gt;
 &lt;BR /&gt;
This is only way to get Icons, or is it a bug  ? Or i might have other errors ?</description>
      <pubDate>Fri, 04 Sep 2015 08:22:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292415#M4875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-04T08:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292416#M4876</link>
      <description>IconPushRadio will show an icon from GRC by default.&lt;BR /&gt;
Use SetIcon if you need to change it only.&lt;BR /&gt;
&lt;BR /&gt;
Make sure the icon GRC text valid and correct icon's ID.&lt;BR /&gt;
In you example is 32107 or 32106 correct.&lt;BR /&gt;
&lt;BR /&gt;
Addition:&lt;BR /&gt;
Make sure you pass valid parameters to ModalDialog constructor.&lt;BR /&gt;
See  ACAPI_GetOwnResModule() as 1 and 3 parameter.&lt;BR /&gt;
: ModalDialog( ACAPI_GetOwnResModule(), RDLG_ABOUT, ACAPI_GetOwnResModule() )</description>
      <pubDate>Fri, 04 Sep 2015 12:02:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292416#M4876</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2015-09-04T12:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Custome value User control</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292417#M4877</link>
      <description>Thanks, Oleg! &lt;BR /&gt;
 &lt;BR /&gt;
My constructor didn't had ACAPI_GetOwnResModule() as 3rd parameter. &lt;BR /&gt;
Now everything works like it should. &lt;BR /&gt;
 &lt;BR /&gt;
Thanks again, Oleg.</description>
      <pubDate>Mon, 07 Sep 2015 06:33:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Custome-value-User-control/m-p/292417#M4877</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-07T06:33:20Z</dc:date>
    </item>
  </channel>
</rss>

