DESC_PARENT_COLLAPSE Twirl Down
-
Hello!
I have a pretty simple question about how to create a twirl down group in the Attribute Manager such as thisI managed to track down that it uses DESC_PARENT_COLLAPSE, but I'm having trouble setting it up in GetDDescription(). The SDK doesn't really help with it and the forums didn't turn up any results so I'm a bit lost. Thanks for any help.
Dan
-
hello,
You have to set the DESC_PARENT_COLLAPSE of the "parent" to -1 so it act as a parent. For the children, just set the ID to the parent's ID.
virtual Bool GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags) { if (!description->LoadDescription(node->GetType())) return false; const DescID* singleid = description->GetSingleDescID(); DescID cid = DescLevel(firstID, DTYPE_REAL, 0); // check if this parameter ID is requested (NOTE: this check is important for speed) if (!singleid || cid.IsPartOf(*singleid, nullptr)) { // define the new parameter description BaseContainer settings = GetCustomDataTypeDefault(DTYPE_REAL); settings.SetString(DESC_NAME, "A float"_s); settings.SetInt32(DESC_PARENT_COLLAPSE, -1); // set the new parameter if (!description->SetParameter(cid, settings, ID_OBJECTPROPERTIES)) return false; } cid = DescLevel(secondID, DTYPE_REAL, 0); if (!singleid || cid.IsPartOf(*singleid, nullptr)) { // define the new parameter description BaseContainer settings = GetCustomDataTypeDefault(DTYPE_REAL); settings.SetString(DESC_NAME, "Another float"_s); settings.SetInt32(DESC_PARENT_COLLAPSE, firstID); // set the new parameter if (!description->SetParameter(cid, settings, ID_OBJECTPROPERTIES)) return false; } cid = DescLevel(thirdID, DTYPE_BOOL, 0); if (!singleid || cid.IsPartOf(*singleid, nullptr)) { // define the new parameter description BaseContainer settings = GetCustomDataTypeDefault(DTYPE_BOOL); settings.SetString(DESC_NAME, "A Bool"_s); settings.SetInt32(DESC_PARENT_COLLAPSE, firstID); // set the new parameter if (!description->SetParameter(cid, settings, ID_OBJECTPROPERTIES)) return false; } flags |= DESCFLAGS_DESC::LOADED; return SUPER::GetDDescription(node, description, flags); }
Cheers
Manuel -
Hello,
just FYI: there is also a short description and an example snippet about DESC_PARENT_COLLAPSE in the Description Settings Manual.
best wishes,
Sebastian -
Thank you both for the answers!
Sorry about not finding that, Sebastian, it wasn't popping up when I searched the SDK.
Dan
-
hello,
this thread will be considered as Solved tomorrow is you have nothing to add.
Cheers
Manuel