<?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: IMPORTANT Is there a way to create controls programmatic in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Is-there-a-way-to-create-controls-programmatically/m-p/279464#M4811</link>
    <description>Hi ggiloyan, &lt;BR /&gt;
 &lt;BR /&gt;
Sure, you can add dynamically new dialog items to your dialog using DGAppendDialogItem function. &lt;BR /&gt;
 &lt;BR /&gt;
Here's a short example how to create new ListView control to your dialog: 
&lt;PRE&gt;listInd = DGAppendDialogItem (dialID, DG_ITM_LISTVIEW, DG_LVT_SINGLESELECT, 0, x, y, dx, dy); 
if (listInd == 0) { 
	ACAPI_WriteReport ("Failed to create ListView!", true); 
} else { 
	DGSetItemFont (dialID, listInd, DG_IS_SMALL | DG_IS_PLAIN); 
	DGListViewSetItemSize (dialID, listInd, itemWidth, itemHeight); 
	DGShowItem (dialID, listInd); 
 
	for (short i = 0; i &amp;lt; nItems; i++) { 
		DGListViewInsertItem (dialID, listInd, DG_LIST_BOTTOM); 
		DGListViewSetItemText (dialID, listInd, DG_LIST_BOTTOM, GS::UniString::Printf ("ListView item #%d", i)); 
	} 
}&lt;/PRE&gt; &lt;BR /&gt;
Of course to make space to your new controls you should resize your dialog using DGSetDialogSize or move other controls. &lt;BR /&gt;
 &lt;BR /&gt;
You can find many useful functions in DG.h header file. &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
    <pubDate>Mon, 29 Jun 2015 10:54:03 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2015-06-29T10:54:03Z</dc:date>
    <item>
      <title>Is there a way to create controls programmatically</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Is-there-a-way-to-create-controls-programmatically/m-p/279463#M4810</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I want to create a several listview control programmatically depend on API information. &lt;BR /&gt;Is there a way to do that without writing something in .grc resource file ? &lt;BR /&gt;&lt;BR /&gt;How I can do this ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jul 2023 14:23:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Is-there-a-way-to-create-controls-programmatically/m-p/279463#M4810</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-13T14:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORTANT Is there a way to create controls programmatic</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Is-there-a-way-to-create-controls-programmatically/m-p/279464#M4811</link>
      <description>Hi ggiloyan, &lt;BR /&gt;
 &lt;BR /&gt;
Sure, you can add dynamically new dialog items to your dialog using DGAppendDialogItem function. &lt;BR /&gt;
 &lt;BR /&gt;
Here's a short example how to create new ListView control to your dialog: 
&lt;PRE&gt;listInd = DGAppendDialogItem (dialID, DG_ITM_LISTVIEW, DG_LVT_SINGLESELECT, 0, x, y, dx, dy); 
if (listInd == 0) { 
	ACAPI_WriteReport ("Failed to create ListView!", true); 
} else { 
	DGSetItemFont (dialID, listInd, DG_IS_SMALL | DG_IS_PLAIN); 
	DGListViewSetItemSize (dialID, listInd, itemWidth, itemHeight); 
	DGShowItem (dialID, listInd); 
 
	for (short i = 0; i &amp;lt; nItems; i++) { 
		DGListViewInsertItem (dialID, listInd, DG_LIST_BOTTOM); 
		DGListViewSetItemText (dialID, listInd, DG_LIST_BOTTOM, GS::UniString::Printf ("ListView item #%d", i)); 
	} 
}&lt;/PRE&gt; &lt;BR /&gt;
Of course to make space to your new controls you should resize your dialog using DGSetDialogSize or move other controls. &lt;BR /&gt;
 &lt;BR /&gt;
You can find many useful functions in DG.h header file. &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Mon, 29 Jun 2015 10:54:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Is-there-a-way-to-create-controls-programmatically/m-p/279464#M4811</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-06-29T10:54:03Z</dc:date>
    </item>
  </channel>
</rss>

