Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Hide/Unhide GeDialog Gizmos?

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 444 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 06/11/2012 at 16:51, xxxxxxxx wrote:

        Doh!
        Nevermind. I found what I was doing wrong.

        By using LayoutFlushGroup() when hiding the gizmo. I am basically deleting the gizmo from the dialog. So it has no way of returning back to where I started from when I choose to unhide it.

        So the code needs to be like this:

            switch (id)   
          {  
              case MY_BUTTON_HIDE:  
                  HideElement(MY_GIZMO, TRUE);       //Tell C4D to hide this gizmo    
                  LayoutChanged(GIZMO_GROUP_ID);     //Tell C4D the group this gizmo is in has changed  
                  break;  
          
              case MY_BUTTON_UNHIDE:  
                  HideElement(MY_GIZMO, FALSE);     //Tell C4D to unhide this gizmo    
                  LayoutChanged(GIZMO_GROUP_ID);    //Tell C4D the group this gizmo is in has changed  
                  break;  
          }
        

        The way the docs are written. It sort of led me to believe that we had to use Flush to hide/unhide gizmos.
        But that's not the case.

        -ScottA

        1 Reply Last reply Reply Quote 0
        • First post
          Last post