GeDialog with group columns
-
On 15/06/2018 at 06:06, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R19
Platform: Windows ;
Language(s) : C++ ;---------
Hi,When using the code below in a GeDialog's CreateLayout I get the first 2 static text nicely in two columns. However, I would have expected this to apply to "child" groups as well.
Unfortunately, the static text in these child groups end up on separate lines, resulting in:Left column Right column Left column (group) Right column(group)
Is there a way to get groups next to each other?
// separate the dialog into 2 columns GroupBegin(0, BFH_SCALEFIT, 2, 0, String(), 0); { AddStaticText(0, BFH_LEFT | BFV_TOP, 100, 0, String("Left column"), 0); AddStaticText(0, BFH_LEFT | BFV_TOP, 100, 0, String("Right column"), 0); GroupBegin(0, BFH_SCALEFIT, 1, 0, String(), 0); { AddStaticText(0, BFH_LEFT | BFV_TOP, 100, 0, String("Left column (group)"), 0); // ... some more } GroupBegin(0, BFH_SCALEFIT, 1, 0, String(), 0); { AddStaticText(0, BFH_LEFT | BFV_TOP, 100, 0, String("Right column (group)"), 0); // ... some more } } GroupEnd();
Thanks
-
On 18/06/2018 at 09:12, xxxxxxxx wrote:
Hi,
I see your issue with nested groups. Unfortunately I need a bit more time to investigate.
Strangely so, the GeDialog manual shows a code snippet demonstrating nested groups, which works as expected. But I haven't found the relevant difference to your snippet. As I said, I need a bit more time.
For other readers entering this thread: It's good practice (though not related to the actual issue) to use different IDs for all widgets and groups (C4DS probably just simplified the posted example).
Edit: Not my evening, yesterday. I accidentally called the widget IDs DescIDs, which they are NOT. Corrected.
-
On 18/06/2018 at 11:29, xxxxxxxx wrote:
Well, I have this bad habit of not assigning meaningful IDs to gadgets or groups that don't need interaction. So groups that are only used for layouting, or static text gadgets that are used for labeling only ... will all end up with "0" as DescID. As these don't actually need to be identified.
Bad habit, I know.
I need to join the anonymous anonymizers support group.
On a more serious note.
I looked once more at my code and found the obvious mistake. So obvious it's blasphemy, and I apologize for having you waste (again) time on trying to help me with this.
I am using curly brackets in order to better visualize the grouping, but doing so I assumed having ended the group by closing the curly brackets. You see ... there are no GroupEnd();
Just adding them makes it work, as expected.So sorry !!!
-
On 18/06/2018 at 23:26, xxxxxxxx wrote:
No worries, I guess I look pretty stupid here... I was so focused on GroupBegin() and the flags involved, I overlooked the missing GroupEnd() as well.