DESC_PARENT_COLLAPSE Display
-
Hello.
I am trying to create a parameter that will function as a parent to another parameter using DESC_PARENT_COLLAPSE. with the code below.
cid = DescLevel(idAngleEdgeThreshold, DTYPE_REAL, 0); if (!singleid || cid.IsPartOf(*singleid, NULL)) { BaseContainer bc; bc = GetCustomDataTypeDefault(DTYPE_REAL); bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_REALSLIDER); bc.SetInt32(DESC_UNIT, DESC_UNIT_DEGREE); bc.SetFloat(DESC_STEP, PI / 180.0); bc.SetFloat(DESC_MIN, 0); bc.SetFloat(DESC_MAX, PI); bc.SetFloat(DESC_DEFAULT, 0); bc.SetInt32(DESC_PARENT_COLLAPSE, -1); bc.SetString(DESC_NAME, "Angle Threshold"_s); if (!description->SetParameter(cid, bc, DescMainTabGroup)) return TRUE; } cid = DescLevel(idAngleEdgeInvert, DTYPE_BOOL, 0); if (!singleid || cid.IsPartOf(*singleid, NULL)) { BaseContainer bc; bc = GetCustomDataTypeDefault(DTYPE_BOOL); bc.SetInt32(DESC_PARENT_COLLAPSE, idAngleEdgeThreshold); bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BOOL); bc.SetString(DESC_NAME, "Invert"_s); bc.SetBool(DESC_DEFAULT, FALSE); if (!description->SetParameter(cid, bc, DescMainTabGroup)) return TRUE; }
This code works properly to set the parameter as a parent of the other.
My question is it possible for me to control whether the twirl down will be open or closed based on the user selecting different parameters or pressing something like a button?
I looked at the sdk and in the Description Settings Manual it is specifically stated that the child parameter is hidden until the user click on the little arrow, is it possible to control this or is this functionality only available to a user.
Any help would be greatly appreciated.
John Terenece
-
Hi I guess setting the boolean value DESC_GUIOPEN on the group (so idAngleEdgeThreshold), should do the trick, but I'm not 100% sure if this does not work I will have a look more indepth tomorrow.
Cheers,
Maxime. -
Thanks for the response.
DESC_GUIOPEN works having the twirl down open by default. What I'm looking for is the ability to modify whether or not it is actively open based on controls by the user. For example if "Angle Threshold" is greater than 90 degrees than have it twirled down, otherwise have it closed.
John Terenece
-
Hi after looking into the code this is sadly not possible to open/close a group.
Cheers,
Maxime. -
Thanks for the response. I was assuming that would be the case.
John Terenece