programmatically add Groups to a Tab [SOLVED]

On 25/10/2015 at 21:07, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   16 
Platform:   Windows  ;   
Language(s) :

---------
Hello, I want to add new groups to a tab (see: SECOND_TAB). But I don't know, how to achieve that. I found "AddChildren" in the SDK but I don't know how to setup the container. Can someone help me please?

dialog ressource:

  
DIALOG DLG_MAINDIALOG {    
  
  TAB TAB{  
      GROUP FIRST_TAB {  
         ...  
      }  
  
  
      GROUP SECOND_TAB {  
         ...  
      }  
  }  
}  

code for the groups to add:

  
      for (Int32 i = 0; i < materialLinks.GetCount(); i++) {  
          GroupBegin(GROUP_ID12, BFH_SCALEFIT, 0, 0, "", BFV_GRIDGROUP_EQUALROWS);  
              AddEditText (ETEX_UE4MAT+i, BFH_SCALEFIT, 0 , 0);  
              AddEditText (ETEX_C4DMAT+i, BFH_SCALEFIT, 0 , 0);  
              AddEditText (ETEX_LAYER+i, BFH_SCALEFIT, 0 , 0);  
              AddEditText (ETEX_GROUP+i, BFH_SCALEFIT, 0 , 0);  
          GroupEnd();  
      }      

On 26/10/2015 at 05:52, xxxxxxxx wrote:

Hello,

it seems that it is not possible to add a group to an existing tab group. But you could store your tabgroup within a parent group. Then you could empty the parent group and add the tab group with all needed sub-groups dynamically. Something like this:

  
LayoutFlushGroup(PARENTGROUP);  
  
TabGroupBegin(1111, TAB_TABS);  
 GroupBegin(2222, BFH_FIT | BFV_FIT, 1, 1, "Tab Title", 0);  
 AddStaticText(3333, 0, 300, 20, "This is a static text", BORDER_THIN_IN);  
 GroupEnd();  
GroupEnd();  
  
LayoutChanged(PARENTGROUP);  

best wishes,
Sebastian

On 27/10/2015 at 10:56, xxxxxxxx wrote:

Thank You Sebastian,

this works very well. Cool solution! :)