How to create ToolBox in C++.
-
Hello colleagues,
I used C++ to write the C4D S26 plugin on Windows 10, How to create ToolBox in CreateLayout(), As this picture shows, like the Time, Creates an unfolding group
Thanks in advance!
-
Hello @pchg,
Thank you for reaching out to us. As announced here, Maxon is currently conducting a company meeting. Please understand that our capability to answer questions is therefore limited at the moment.
The screenshot you are showing us is the Attribute Manager displaying the Project Settings node. I.e., what we see here is a description resource. The foldable sections in it are simply labeled groups, i.e.,
GROUP
elements with angroupid
and therefore label.The method your are mentioning,
GeDialog.CreateLayout
, uses however a different UI concept, dialog resources. There is some overlap between these two resource concepts but they are not identical, and you cannot directly replicate the group folding behavior of nodes in dialogs.In the past, there were collapsible groups in dialogs via
GeDialog.GroupBegin
and BFV_GROUP::BFV_BORDERGROUP_FOLD, but that feature has been deprecated. Your options are now:- Use another interface paradigm such as tabs with GeDialog.TabGroupBegin.
- Implement foldable groups yourself. You should not reimplement groups (you can't) but their headers. So, implement a GeUserArea which renders a title and has a toggle state. I.e., implement a toggle button, you could also use a bitmap button but that might not look as nice. Then tie the GeDialog::HideElement state of an associated group to the toggle state of that button. With some extra logic you could also have an 'accordion', i.e., multiple groups of which only one can be open at a time.
I would suggest using the first option, because I personally would always avoid implementing UIs when I can get somehow away without doing that.
Cheers,
Ferdinand -
@ferdinand Thank you