LayoutFlushGroup doesn't place the insertion point inside the group

  • Hello.

    I have the following simplified resource dialog.

        GROUP TAB1{
            NAME TAB1;
        GROUP TAB2{
            NAME TAB2;
            SCROLLGROUP {
                GROUP GROUP_TO_FLUSH {

    The problem is that the following code doesn't place the button in the flushing group.

    LayoutFlushGroup(GROUP_TO_FLUSH );
    LayoutChanged(GROUP_TO_FLUSH );

    I load the resource file using LoadDialogResource, but I fill the flushing group via code.
    After flushing the group, the button appears below the tab group.
    How Can I place the insertion point in the GROUP_TO_FLUSH ?

    Thank you.

  • Hey peterakos,

    as far as I know once you flushed the group you have to do something like this:

    self.GroupBegin(GROUP_TO_FLUSH, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 1,1,"",0)

    that worked for me. Hope it helps,

  • I think you must not Begin the same group as the one you are flushing.
    It appears that the purpose of LayoutFlushGroup is to clear the group of controls and start adding to it directly.

    I've tested your suggestion but it didn't work :(

  • Hello again.

    Adding all the controls via code and removing the LoadDialogResource solves the issue. For some reason you cannot use both LoadDialogResource and Adding/Flushing the controls manually.

    Thank you.

  • Hello,

    LoadDialogResource() and LayoutFlushGroup() should work perfectly fine together. Typically LayoutFlushGroup() is called in reaction to some user interaction or in InitValues():

    Bool CreateLayout()
      if (!GeDialog::CreateLayout())
        return false;
      if (!LoadDialogResource(11000, nullptr, 0))
        return false;
      return true;
    Bool InitValues()
      AddButton(100, BFH_SCALEFIT, 0, 10, "Button"_s);
      return true;

    best wishes,