<?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: Property Manager style ListBox in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/652258#M10133</link>
    <description>&lt;P&gt;I think there is no general usable solution for such a listbox, so you need to implement it for yourself. You need a data structure that describes the groups and the items in the group, and then build up a listbox with the data.&lt;/P&gt;
&lt;P&gt;The group items accept mouse click (expand/collapse) and the observer handles them by inserting/removing the items of the group to/from the listbox. They will be slightly different than the other normal list items.&lt;/P&gt;
&lt;P&gt;Displaying content through multiple columns is easily achievable. There is an 'owner drawn' flag on listbox items that can be enabled for each list item individually:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void	SetItemOwnerDrawFlag (short listItem, bool isOwnerDrawn);
&lt;/LI-CODE&gt;
&lt;P&gt;You should enable this flag on the group items. This way for these group-rows the following happens: the listbox control draws the content of each column of that row, then the following notification is sent to the listbox observer:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;virtual void	ListBoxItemUpdate (const ListBoxItemUpdateEvent&amp;amp; ev);&lt;/LI-CODE&gt;
&lt;P&gt;The notificaton handler function receives the drawing context of the whole list row in the event argument. It can draw anything on the drawing context independently of column boundaries.&lt;/P&gt;
&lt;P&gt;Here is an example for a listbox item update function that draws a text and an icon:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void SampleDialog::ListBoxItemUpdate (const DG::ListBoxItemUpdateEvent&amp;amp; ev)
{
	if (ev.GetSource () == &amp;amp;listBox) {
		short listFont = DGGetItemFont (listBox.GetPanelId (), listBox.GetId ());
		short listItemSize = DG_IS_LARGE;
		if (listFont != DG_IS_DEFAULT)
			listItemSize = listFont &amp;amp; DG_IS_SIZEMASK;
		short listItemStyle = DGListGetItemStyle (listBox.GetPanelId (), listBox.GetId (), ev.GetListItem ());
		short fontType = listItemSize | listItemStyle;

		NewDisplay::ListBoxUpdateEventContext context (ev);
		DG::Utils::DrawText (context, DG::Rect (listBox.GetTabFieldBeginPosition (TextColumnId) + 10, 2, ev.GetWidth () - 2, ev.GetHeight () - 2), 
							 "Text of the group item", fontType, DG_IS_LEFT);
		DG::Rect tabItemRect = DG::Rect (listBox.GetTabFieldBeginPosition (IconColumnId), 0, listBox.GetTabFieldEndPosition (IconColumnId), ev.GetHeight ());
		DG::Utils::DrawIcon (context, tabItemRect, DG::Icon (....));
	}
}
&lt;/LI-CODE&gt;
&lt;P&gt;Note: The owner drawn flag can be set not only on individual rows but on columns also, but that is an other feature resulting a different notification.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2025 15:45:32 GMT</pubDate>
    <dc:creator>Miklos Vegh</dc:creator>
    <dc:date>2025-02-18T15:45:32Z</dc:date>
    <item>
      <title>Property Manager style ListBox</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/652021#M10119</link>
      <description>&lt;P&gt;Is there any ListBox kind of class which handles grouped lists like the Property Manager?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Features: closeable groups, group names / headlines (one row one text through multiple columns)&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:44:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/652021#M10119</guid>
      <dc:creator>LaszloHatvani</dc:creator>
      <dc:date>2025-02-17T11:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Property Manager style ListBox</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/652068#M10120</link>
      <description>&lt;P&gt;Hi Laszlo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can almost achieve this with the "Tree View" item type. Only proper group names / headlines through multiple columns I wasn't able to achieve with this item type yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 16:21:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/652068#M10120</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2025-02-17T16:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Property Manager style ListBox</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/652258#M10133</link>
      <description>&lt;P&gt;I think there is no general usable solution for such a listbox, so you need to implement it for yourself. You need a data structure that describes the groups and the items in the group, and then build up a listbox with the data.&lt;/P&gt;
&lt;P&gt;The group items accept mouse click (expand/collapse) and the observer handles them by inserting/removing the items of the group to/from the listbox. They will be slightly different than the other normal list items.&lt;/P&gt;
&lt;P&gt;Displaying content through multiple columns is easily achievable. There is an 'owner drawn' flag on listbox items that can be enabled for each list item individually:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void	SetItemOwnerDrawFlag (short listItem, bool isOwnerDrawn);
&lt;/LI-CODE&gt;
&lt;P&gt;You should enable this flag on the group items. This way for these group-rows the following happens: the listbox control draws the content of each column of that row, then the following notification is sent to the listbox observer:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;virtual void	ListBoxItemUpdate (const ListBoxItemUpdateEvent&amp;amp; ev);&lt;/LI-CODE&gt;
&lt;P&gt;The notificaton handler function receives the drawing context of the whole list row in the event argument. It can draw anything on the drawing context independently of column boundaries.&lt;/P&gt;
&lt;P&gt;Here is an example for a listbox item update function that draws a text and an icon:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void SampleDialog::ListBoxItemUpdate (const DG::ListBoxItemUpdateEvent&amp;amp; ev)
{
	if (ev.GetSource () == &amp;amp;listBox) {
		short listFont = DGGetItemFont (listBox.GetPanelId (), listBox.GetId ());
		short listItemSize = DG_IS_LARGE;
		if (listFont != DG_IS_DEFAULT)
			listItemSize = listFont &amp;amp; DG_IS_SIZEMASK;
		short listItemStyle = DGListGetItemStyle (listBox.GetPanelId (), listBox.GetId (), ev.GetListItem ());
		short fontType = listItemSize | listItemStyle;

		NewDisplay::ListBoxUpdateEventContext context (ev);
		DG::Utils::DrawText (context, DG::Rect (listBox.GetTabFieldBeginPosition (TextColumnId) + 10, 2, ev.GetWidth () - 2, ev.GetHeight () - 2), 
							 "Text of the group item", fontType, DG_IS_LEFT);
		DG::Rect tabItemRect = DG::Rect (listBox.GetTabFieldBeginPosition (IconColumnId), 0, listBox.GetTabFieldEndPosition (IconColumnId), ev.GetHeight ());
		DG::Utils::DrawIcon (context, tabItemRect, DG::Icon (....));
	}
}
&lt;/LI-CODE&gt;
&lt;P&gt;Note: The owner drawn flag can be set not only on individual rows but on columns also, but that is an other feature resulting a different notification.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 15:45:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/652258#M10133</guid>
      <dc:creator>Miklos Vegh</dc:creator>
      <dc:date>2025-02-18T15:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Property Manager style ListBox</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/659315#M10264</link>
      <description>&lt;P&gt;An additional hint for this topic.&lt;/P&gt;
&lt;P&gt;You could check the DG_Test example add-on and the AttributeListDialog.hpp/cpp. That uses an ACAPI::UI::AttributeList control which is an enhanced ListBox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 13:26:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Property-Manager-style-ListBox/m-p/659315#M10264</guid>
      <dc:creator>MOREH Tamas</dc:creator>
      <dc:date>2025-04-14T13:26:58Z</dc:date>
    </item>
  </channel>
</rss>

