THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/05/2012 at 10:04, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
Hey Guys,
I'm spawing LinkBox and EditNumber GUI's in a tag plugin. And I'm having trouble laying them out horizontally in pairs.
By default, when they are created the LinkBox GUI's are all stacked linear from top to bottom. And so are the EditNumber GUI's. Which is not what I want.
I want the EditNumber GUI's to be placed to the right of the LinkBox GUI's as they are spawned. But I can't find any way to do this.
I've tried all manner of groups and column stuff. But I can't seem to get them to layout horizontally.
Here's my .cpp code that spawns the GUI's. And attempts to lay them out horizontally.
DescID cid = DescLevel(6001, DTYPE_GROUP, 0); //Begin the Main Group code
if (!singleid || cid.IsPartOf(*singleid,NULL)) // important to check for speedup c4d!
{
BaseContainer maingroup = GetCustomDataTypeDefault(DTYPE_GROUP);
maingroup.SetString(DESC_NAME, "Main Group");
maingroup.SetBool(DESC_LAYOUTGROUP, TRUE);
maingroup.SetLong(DESC_COLUMNS, 2);
linkboxBc = GetCustomDataTypeDefault(DTYPE_LONG); //Add this to the container
linkboxBc.SetLong(DESC_CUSTOMGUI,CUSTOMGUI_LINKBOX); //Add this to the container
linkboxBc.SetLong(DESC_FORBID_SCALING,TRUE); //Add this to the container
linkboxBc.SetBool(DESC_REMOVEABLE,TRUE); //Add this to the container
linkboxBc.SetBool(DESC_ALIGNLEFT,TRUE);
linkboxBc.SetBool(DESC_SCALEH,TRUE);
frameBc = GetCustomDataTypeDefault(DTYPE_REAL); //Add this to the container
frameBc.SetLong(DESC_CUSTOMGUI,CUSTOMGUI_REAL); //Add this to the container
frameBc.SetBool(DESC_REMOVEABLE,TRUE); //Add this to the container
frameBc.SetLong(DESC_FORBID_SCALING,TRUE); //Add this to the container
frameBc.SetBool(DESC_REMOVEABLE,TRUE); //Add this to the container
frameBc.SetBool(DESC_ALIGNLEFT,TRUE);
frameBc.SetBool(DESC_SCALEH,TRUE);
//Create LINKBOX GUI's
for (int i=4000L; i<index; i++)
{
if (!myswitch)
{
myswitch = TRUE;
DescID newLinkboxid = DescLevel(i,DTYPE_LONG,0);
if(!singleid || newLinkboxid.IsPartOf(*singleid,NULL)) // important to check for speedup c4d!
{
linkboxBc.SetString(DESC_NAME,"Controller Object" + LongToString(i)); //Set the LinkBox text name
linkboxBc.SetString(DESC_SHORT_NAME,"Controller Object" + LongToString(i));
description->SetParameter(newLinkboxid,linkboxBc,DescLevel(ID_OBJECTPROPERTIES)); //Update the changes made to the container
}
}
myswitch = FALSE; //Reset the variable back to false
}
//Create editable number field GUI's with their own ID's separate from the LinkBox GUI's
index = data->GetReal(NUMofGUIS)+5000L;
for (int i=5000L; i<index; i++)
{
if (!myswitch)
{
myswitch = TRUE;
DescID newFrameid = DescLevel(i,DTYPE_REAL,0);
if(!singleid || newFrameid.IsPartOf(*singleid,NULL)) // important to check for speedup c4d!
{
frameBc.SetString(DESC_NAME,"Frame" + LongToString(i)); //Set the Frame text name
frameBc.SetString(DESC_NAME,"Frame" + LongToString(i));
description->SetParameter(newFrameid,frameBc,DescLevel(ID_OBJECTPROPERTIES)); //Update the changes made to the container
}
}
myswitch = FALSE; //Reset the variable back to false
}
if (!description->SetParameter(cid, maingroup, DescLevel(0))) return TRUE; //End of the main group code
}
I'm wondering if I have to use the .res file to layout these GUI's horizontally?
And If I do. Since I'm dynamically creating and removing these GUI's. How would I handle that kind of thing in the .res file?
-ScottA