THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/11/2012 at 12:48, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
I'm trying to hide/unhide gizmos in a GeDialog. But once they are hidden I can't manage to bring them back again.
Here's my button code that calls the hide/unhide for a gizmo
Hide works fine. But the unhide code does not work:
switch (id)
{
case MY_BUTTON_HIDE:
HideElement(MY_GIZMO, TRUE); //Tell C4D to hide this gizmo
LayoutFlushGroup(GIMO_GROUP_ID); //Redraw the gizmo's group reflecting the changes
LayoutChanged(GIMO_GROUP_ID); //Tell C4D the GeDialog has changed
break;
case MY_BUTTON_UNHIDE:
HideElement(MY_GIZMO, FALSE);
LayoutFlushGroup(GIMO_GROUP_ID); //<--This code block does not bring the gizmo back!?
LayoutChanged(GIMO_GROUP_ID);
break;
}
Do I need to use a gadget *ptr for this?
The docs show an example how to create a gadget ptr
C4DGadget* ptr = dlg.AddStaticText(123, ...); // Generates GadgetPtr(123)
Which I'm assuming is placed inside the CreateLayout() method?
But then I'm unclear how to actually use this new ptr.
Normally I would create a ptr like this as a class member variable so it's available for use in all the methods in my plugin. But the way it's written in the docs it appears to be created as a local CreateLayout() variable.
So I don't know how to actually use that ptr in my Command() method where my buttons code is?
-ScottA