<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hide a tab group of a resource-based GeDialog]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have a dialog with a tab group here. All the dialog contents is defined via a .res file.<br />
When the Dialog opens, I want to hide one of the tab groups and change the dialog title, depending on a bool value.</p>
<p dir="auto">The tab group is defined in the .res file like this (I shortened it a little):</p>
<pre><code>TAB DLG_TAB_GROUP
{
	SELECTION_TABS;
	SCALE_H; SCALE_V;

	GROUP DLG_TAB_GROUP_0
	{
		NAME DLG_TAB_GROUP_0_TITLE;
		SCALE_H; SCALE_V;
		BORDERSIZE 10,10,10,10;
		COLUMNS 1;

		STATICTEXT DLG_TAB_0_HELP1 { NAME DLG_TAB_0_HELP1; }
		STATICTEXT DLG_TAB_0_HELP2 { NAME DLG_TAB_0_HELP2; }
		STATICTEXT DLG_TAB_0_HELP3 { NAME DLG_TAB_0_HELP3; }
	}

	GROUP DLG_TAB_GROUP_1
	{
		NAME DLG_TAB_GROUP_1_TITLE;
		ALIGN_TOP; SCALE_H; SCALE_V;
		BORDERSIZE 10,10,10,10;
		COLUMNS 1;

		STATICTEXT DLG_TAB_1_HELP1 { NAME DLG_TAB_1_HELP1; }
		STATICTEXT DLG_TAB_1_HELP2 { NAME DLG_TAB_1_HELP2; }
		STATICTEXT DLG_TAB_1_HELP3 { NAME DLG_TAB_1_HELP3; }
	}

	GROUP DLG_TAB_GROUP_2
	{
		NAME DLG_TAB_GROUP_2_NAME;
		ALIGN_TOP; SCALE_H; SCALE_V;
		BORDERSIZE 10,10,10,10;
		COLUMNS 1;

		STATICTEXT DLG_TAB_2_HELP1 { NAME DLG_TAB_2_HELP1; }
		STATICTEXT DLG_TAB_2_HELP2 { NAME DLG_TAB_2_HELP2; }
		STATICTEXT DLG_TAB_2_HELP3 { NAME DLG_TAB_2_HELP3; }
	}
}
</code></pre>
<p dir="auto">The code looks like this:</p>
<pre><code class="language-cpp">Bool SomeDialog::CreateLayout()
{
	if (!GeDialog::CreateLayout())
		return false;

	// load dialog from resource file
	if (!LoadDialogResource(DLG_SOMEDIALOG, nullptr, 0))
		return false;

	if (_showFirstTab)
	{
		SetTitle(GeLoadString(IDS_SOMETITLE));
	}
	else
	{
		SetTitle(GeLoadString(IDS_SOMEOTHERTITLE));
		HideElement(DLG_TAB_GROUP_0, true);
	}
	return true;
}
</code></pre>
<p dir="auto">Changing the title works fine. But the tab group is not hidden, it's still visible.</p>
<p dir="auto">Any tips or advice?</p>
<p dir="auto">Cheers &amp; greetings,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/topic/12519/hide-a-tab-group-of-a-resource-based-gedialog</link><generator>RSS for Node</generator><lastBuildDate>Thu, 11 Jun 2026 10:29:03 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/12519.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Apr 2020 10:13:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hide a tab group of a resource-based GeDialog on Wed, 29 Apr 2020 16:20:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi Frank sorry for the delay needed for this issue,</p>
<p dir="auto">I get the time to look at it, and this is the thing I should have checked first, but either in a GeDialog with a Layout created in a script, I'm not able to hide a tab.<br />
Since you said it was working previously, could you confirm you don't want to hide only the content (in your case the 3 StaticText) but also the tab in the tab entry, isn't? If yes could you provide a code sample because I would say even in a normal case I'm not able to reproduce.</p>
<pre><code>import c4d

class Dlg(c4d.gui.GeDialog):
    def CreateLayout(self):
        
        if self.TabGroupBegin(10001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, tabtype=c4d.TAB_TABS):
            
            if self.GroupBegin(10010, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, title="First Tab"):
                self.AddStaticText(10011, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, name="Text01")
                self.GroupEnd()
                
            if self.GroupBegin(10020, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, title="Second Tab"):
                self.AddStaticText(10021, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, name="Text02")
                self.GroupEnd()

        self.GroupEnd()
        self.AddButton(10030, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, name="Remove First Tab")
        
        return True
    
    def Command(self, id, msg):
        if id == 10030:
            print self.HideElement(10010, True)
            print self.LayoutChanged(10001)
            
        return True
    
def main():
    global dlg
    dlg = Dlg()
    dlg.Open(c4d.DLG_TYPE_ASYNC)

# Execute main()
if __name__=='__main__':
    main()
</code></pre>
<p dir="auto">To me, the only way to remove a tab is to flush the complete group master of the TabGroup and re-add tabs except for the one you don't want.</p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/62702</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/62702</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Wed, 29 Apr 2020 16:20:35 GMT</pubDate></item><item><title><![CDATA[Reply to Hide a tab group of a resource-based GeDialog on Tue, 28 Apr 2020 08:28:05 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, that would be nice. If you find out that it's not possible to do dynamic changes to a .res file-based dialog, I have to undo quite some changes here <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title=";-)" alt="😉" /></p>
]]></description><link>http://developers.maxon.net/forum/post/62676</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/62676</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Tue, 28 Apr 2020 08:28:05 GMT</pubDate></item><item><title><![CDATA[Reply to Hide a tab group of a resource-based GeDialog on Fri, 24 Apr 2020 15:56:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/fwilleke80">@<bdi>fwilleke80</bdi></a> sorry for the trouble I thought the answers by Sebastian solved your issue, so I set it to fixed sorry.</p>
<p dir="auto">Regarding the problem, I have to dig into it more on Monday, but I guess this is due that LoadDialogResource actually creates a new dialog that is embedded within the original dialog, but of course, nothing you can change, so I have to see if it's a bug of something else missing <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/62621</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/62621</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Fri, 24 Apr 2020 15:56:13 GMT</pubDate></item><item><title><![CDATA[Reply to Hide a tab group of a resource-based GeDialog on Thu, 23 Apr 2020 09:27:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/pluginstudent">@<bdi>PluginStudent</bdi></a> said in <a href="https://developers.maxon.net/forum/post/62582" target="_blank" rel="noopener noreferrer nofollow ugc">Hide a tab group of a resource-based GeDialog</a>:</p>
<blockquote>
<p dir="auto">Maybe you have to call <code>LayoutChanged()</code> after that. See <a href="https://github.com/PluginCafe/cinema4d_cpp_sdk/blob/c613f6104f05649b909451f20014c3c923c43bfa/source/gui/gedialog_gadgets.cpp#L209-L210" target="_blank" rel="noopener noreferrer nofollow ugc">gedialog_gadgets.cpp</a>.</p>
</blockquote>
<p dir="auto">Thanks for that example! However, in that code, hiding the group is done in <code>Command()</code>, so on user interaction. I need to hide it when the dialog is opened. The second (and probably most significant) difference is that it's a dialog which creates its complete layout in <code>CreateLayout()</code>. My dialog was like that before, and hiding the tab group worked just fine. But now I changed my dialog to load its layout from a <code>.res</code> file, and since then the group does not hide anymore.</p>
]]></description><link>http://developers.maxon.net/forum/post/62604</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/62604</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Thu, 23 Apr 2020 09:27:27 GMT</pubDate></item><item><title><![CDATA[Reply to Hide a tab group of a resource-based GeDialog on Thu, 23 Apr 2020 09:07:28 GMT]]></title><description><![CDATA[<p dir="auto">Not sure why this was marked as solved. It's not.<br />
I have added the call <code>LayoutChanged(DLG_TAB_GROUP);</code> as suggested, but it changed nothing.</p>
<p dir="auto">So, the question remains: How do I hide a TAB in a TAB group defined in a .res file?</p>
<pre><code class="language-cpp">Bool SomeDialog::CreateLayout()
{
	if (!GeDialog::CreateLayout())
		return false;

	// load dialog from resource file
	if (!LoadDialogResource(DLG_SOMEDIALOG, nullptr, 0))
		return false;

	if (_showFirstTab)
	{
		SetTitle(GeLoadString(IDS_SOMETITLE));
	}
	else
	{
		SetTitle(GeLoadString(IDS_SOMEOTHERTITLE));
		HideElement(DLG_TAB_GROUP_0, true);
		LayoutChanged(DLG_TAB_GROUP);
	}
	return true;
}
</code></pre>
<p dir="auto">I also tried <code>LayoutChanged(DLG_TAB_GROUP_0)</code> and <code>LayoutChanged(DLG_SOMEDIALOG)</code>, with no effect whatsoever.</p>
<p dir="auto">Cheers,<br />
Frank</p>
]]></description><link>http://developers.maxon.net/forum/post/62601</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/62601</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Thu, 23 Apr 2020 09:07:28 GMT</pubDate></item><item><title><![CDATA[Reply to Hide a tab group of a resource-based GeDialog on Tue, 21 Apr 2020 11:44:11 GMT]]></title><description><![CDATA[<p dir="auto">Oh, right, I'll check that. Thanks!</p>
]]></description><link>http://developers.maxon.net/forum/post/62587</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/62587</guid><dc:creator><![CDATA[fwilleke80]]></dc:creator><pubDate>Tue, 21 Apr 2020 11:44:11 GMT</pubDate></item><item><title><![CDATA[Reply to Hide a tab group of a resource-based GeDialog on Tue, 21 Apr 2020 10:49:22 GMT]]></title><description><![CDATA[<p dir="auto">Maybe you have to call <code>LayoutChanged()</code> after that. See <a href="https://github.com/PluginCafe/cinema4d_cpp_sdk/blob/c613f6104f05649b909451f20014c3c923c43bfa/source/gui/gedialog_gadgets.cpp#L209-L210" target="_blank" rel="noopener noreferrer nofollow ugc">gedialog_gadgets.cpp</a>.</p>
]]></description><link>http://developers.maxon.net/forum/post/62582</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/62582</guid><dc:creator><![CDATA[PluginStudent]]></dc:creator><pubDate>Tue, 21 Apr 2020 10:49:22 GMT</pubDate></item></channel></rss>