<?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: Rolldown modal dialog resizing in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366082#M1315</link>
    <description>&lt;P&gt;The PanelResized is a virtual method of the PanelObserver, not TabPage itself.&lt;BR /&gt;So you need some class inherits from PanelObserver, implements&amp;nbsp;PanelResized and Attach it to Panel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most simple way is to inherit your TabPage class from the PanelObserver and Attach in your tabpage's constructor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;class SubsetRollDownTabPage : public DG::TabPage, private DG::PanelObserver
...

SubsetRollDownTabPage::SubsetRollDownTabPage(...)
...
{
...
	Attach(*this);
}
&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Dec 2022 08:01:43 GMT</pubDate>
    <dc:creator>Oleg</dc:creator>
    <dc:date>2022-12-28T08:01:43Z</dc:date>
    <item>
      <title>Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/365835#M1312</link>
      <description>&lt;P&gt;I am implementing a rolldown modal dialog, really similar to the scheme settings rolldown dialog (see attached image). I already looked up the SDK example BasicElementIconsRollDownDialog (DG_Test), but i am having a really hard time handling the resize of the items inside the rolldown panels. Do i have to move/resize all the items (from the tab pages) inside the PanelResized event of the dialog, or inside the&amp;nbsp;PanelResized event of each individual tab page? If neither of these are the case, how can i accomplish the same resizing effects as the scheme settings?&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/55865iE6E8B0314A00C27B/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Rolldown dialog.png" title="Rolldown dialog.png" /&gt;</description>
      <pubDate>Thu, 22 Dec 2022 21:08:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/365835#M1312</guid>
      <dc:creator>Leonardo Lopes</dc:creator>
      <dc:date>2022-12-22T21:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/365942#M1313</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Inside the&amp;nbsp;PanelResized event of each individual tab page.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Every RollDown panel may have individual GrowType.&lt;BR /&gt;So it may have different "Change" value.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I use like this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void TabDocReport::PanelResized (const DG::PanelResizeEvent&amp;amp; ev)
{
	short h = ev.GetHorizontalChange();
	short v = ev.GetVerticalChange();

	mi_path_set.Move( h, 0 );
	mi_path.Resize( h, 0 );
	mi_list.Resize( h, v );
	m_table.ResizeTableColumns();
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 14:40:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/365942#M1313</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2022-12-24T14:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366043#M1314</link>
      <description>&lt;P&gt;Thanks for the reply Oleg, but I already tried doing this way. When I debug my code the event never gets fired. My TabPage class and the event are defined as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TabPage Constructor&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;SubsetRollDownTabPage::SubsetRollDownTabPage(const DG::TabControl&amp;amp; tabControl) : 
	DG::TabPage(tabControl, 1, ACAPI_GetOwnResModule(), SUBSET_PAGE_ID, ACAPI_GetOwnResModule()),
	newSubsetRB(GetReference(), NewRadioButtonId),
	existingSubsetRB(GetReference(), ExistingRadioButtonId),
	subSetText(GetReference(), SubSetTextId),
	subsetTree(GetReference(), SubSetTreeId)
{
	// Attach items
	AttachToAllItems(*this);
	
	// Select default radiobutton
	newSubsetRB.Select();

	// Build and expand tree view
	BuildTreeview(API_LayoutMap, API_SubSetNavItem, &amp;amp;SubSetTreeNodes, &amp;amp;subsetTree);	
	subsetTree.ExpandItem(1);
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;PanelResized Event&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void SubsetRollDownTabPage::PanelResized(const DG::PanelResizeEvent&amp;amp; ev)
{
	short hGrow = ev.GetHorizontalChange();
	short vGrow = ev.GetVerticalChange();

	subsetTree.Resize(hGrow, vGrow);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dialog has a roll panel on the left side, 2 roll panels on the right side and a bottom panel with the "OK" and "Cancel" buttons. All of the roll panels have GrowType set to HVGrow. The code above refers to one of the panels on the right side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got confused where the event should be implemented, because unlike the dialog class that has methods like BeginMoveResizeItems( ) and EndMoveResizeItems( ), the TabPage class does not have this kind of methods.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 18:08:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366043#M1314</guid>
      <dc:creator>Leonardo Lopes</dc:creator>
      <dc:date>2022-12-27T18:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366082#M1315</link>
      <description>&lt;P&gt;The PanelResized is a virtual method of the PanelObserver, not TabPage itself.&lt;BR /&gt;So you need some class inherits from PanelObserver, implements&amp;nbsp;PanelResized and Attach it to Panel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most simple way is to inherit your TabPage class from the PanelObserver and Attach in your tabpage's constructor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;class SubsetRollDownTabPage : public DG::TabPage, private DG::PanelObserver
...

SubsetRollDownTabPage::SubsetRollDownTabPage(...)
...
{
...
	Attach(*this);
}
&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 08:01:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366082#M1315</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2022-12-28T08:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366083#M1316</link>
      <description>&lt;P&gt;BTW about AttachToAllItems(*this).&amp;nbsp;&lt;BR /&gt;If you want got events from items you will need inherits from different observers as well.&lt;BR /&gt;And override required virtual functions of some observer.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;class TabDocReport
	: public TabDocBase
	, private DG::PanelObserver
	, private DG::ButtonItemObserver
	, private DG::RadioItemObserver
	, private DG::ListBoxObserver
...
private:
	virtual void PanelResized (const DG::PanelResizeEvent&amp;amp; ev);
	virtual void PanelResizeExited (const DG::PanelResizeEvent&amp;amp; ev);
	virtual void ButtonClicked (const DG::ButtonClickEvent&amp;amp; ev);
	virtual void RadioItemChanged (const DG::RadioItemChangeEvent&amp;amp; ev);
	virtual void ListBoxSelectionChanged (const DG::ListBoxSelectionEvent&amp;amp; ev);
	virtual void ListBoxClicked (const DG::ListBoxClickEvent&amp;amp; ev);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 28 Dec 2022 08:11:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366083#M1316</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2022-12-28T08:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366103#M1317</link>
      <description>&lt;P&gt;I also already have this inheritance setup in my .h file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Snippet of SubsetRollDownTabPage Class&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;class SubsetRollDownTabPage : public DG::TabPage, 
			                  public DG::RadioItemObserver,
			                  public DG::PanelObserver,
			                  public DG::CompoundItemObserver
{
private:
    ...
    virtual void PanelResized(const DG::PanelResizeEvent&amp;amp; ev) override;
    ...
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An instance of this class is being created inside the constructor of the dialog:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;MainDialog::MainDialog(DG::NativePoint* position) : UD::RollDownModalDialog(dialogGUID, position)													
{
	// Dialog properties
	SetGrowType(HVGrow);
	...

	UD::IRollDownSurface* rollDownSurface = GetRollDownSurface();
	bool valid = rollDownSurface != nullptr &amp;amp;&amp;amp; UD::RollDownModalDialog::IsValid();

	UD::IRollDownPanelSet* rollDownPanelSet = nullptr;

	try {
		if (valid) {
			rollDownPanelSet = rollDownSurface-&amp;gt;CreateRollDownPanelSet();
			if (rollDownPanelSet == nullptr)
				valid = false;
		}

		// Subset roll panel ==========
		if (valid) {
			UD::IRollPanel* subsetRollDownPanel = rollDownPanelSet-&amp;gt;CreateRollDownPanel();

			subsetRollDownPanel-&amp;gt;SetGrowType(UD::IRollPanel::HVGrow);
			subsetRollDownPanel-&amp;gt;SetTitle("LAYOUT BOOK");
			subsetRollDownPanel-&amp;gt;SetIcon(DG::Icon(ACAPI_GetOwnResModule(), BOOK_ICON_ID));

			if (subsetRollDownPanel == nullptr)
				valid = false;
			else
				new SubsetRollDownTabPage(subsetRollDownPanel-&amp;gt;GetTabControl());
		}
        ...
    }
    catch (...) {
	    ...
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The closest i've got from achieving the resize effect i want is when i defined the PanelResized event inside the dialog class and created a pointer to all of the rollpanels (as properties of the dialog class) and then, inside the PanelResized event, called public methods of the TagPages to handle their resizing individually. This didn't work out, because the roll panels didn't grow proportionally. Every time i resized the dialog to it's original size, the roll panels were not being resized to their original size as well, they were a little bit bigger.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 12:51:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366103#M1317</guid>
      <dc:creator>Leonardo Lopes</dc:creator>
      <dc:date>2022-12-28T12:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366104#M1318</link>
      <description>&lt;P&gt;Thanks for the advice, i ended up learning this the hard way while debugging my code hahaha.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 12:56:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366104#M1318</guid>
      <dc:creator>Leonardo Lopes</dc:creator>
      <dc:date>2022-12-28T12:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366120#M1319</link>
      <description>&lt;P&gt;Have you except&amp;nbsp;&lt;SPAN&gt;AttachToAllItems(*this) in your constructor and Attach(*this) also ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 13:40:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366120#M1319</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2022-12-28T13:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rolldown modal dialog resizing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366165#M1320</link>
      <description>&lt;P&gt;This worked perfectly. I thought AttachToAllItems(*this) already handled all the panel events like resizing, opening, etc.&lt;/P&gt;&lt;P&gt;Thanks a lot for the help!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 16:05:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Rolldown-modal-dialog-resizing/m-p/366165#M1320</guid>
      <dc:creator>Leonardo Lopes</dc:creator>
      <dc:date>2022-12-28T16:05:10Z</dc:date>
    </item>
  </channel>
</rss>

