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
    • Recent
    • Tags
    • Users
    • Login

    Multi-Selection button problem

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 414 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 27/05/2011 at 11:41, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi guys,

      I'm having trouble with Multi-Selection buttons returning the correct results.
      I'm trying to get a print result only when the multi-button is changed to a specific option.

      Here is my code:

      EXECUTIONRESULT MyTag::Execute(BaseTag *tag, BaseDocument *doc, BaseObject *op, BaseThread *bt, LONG priority, EXECUTIONFLAGS flags)  
      {  
        if (tag->GetData().GetBool(MYBOX)) // if the MYBOX checkbox attribute is enabled  
        {    
         GePrint("CheckBox is enabled"); // This Works fine          
        }      
        
        if (tag->GetData().GetLong(MULTIBUTTON, TWO)) // if the multi-button is set to this mode  
        {  
            GePrint("Option Two Selected"); //<--- This Does not work!! It always prints.. no matter what option is selected!!  
        }      
          
        return EXECUTIONRESULT_OK;  
      }
      

      Here is what's in my .res file:

      CONTAINER Tmytag  
      {  
        NAME Tmytag;  
        INCLUDE Texpression;  
        INCLUDE Obase;      
          
        GROUP ID_TAGPROPERTIES  
        {  
        COLUMNS 1;              
        BOOL MYBOX { }  
          GROUP  
          {  
          COLUMNS 1;  
            
        LINK MY_LINK  
        {   
        ACCEPT { Obase; }   
        REFUSE { Osky; Oforeground; }  
        }  
        
          SEPARATOR { LINE; }  
          BUTTON BUTTON1 {}        
          BUTTON BUTTON2 {}  
          //BUTTON BUTTON2 {HIDDEN;} //Use this to hide the button if desired  
            
          SEPARATOR { LINE; }  
          REAL MYSLIDER { UNIT PERCENT; MIN 0.0; MAX 100.0; MINSLIDER 0.0; MAXSLIDER 10000.0; CUSTOMGUI REALSLIDER; }        
          REAL MYNUMERIC {MIN 0.0; MAX 100.0; STEP 1;} //STEP controls the amount the values increase using the arrows   
          STRING MYTEXTBOX {ANIM OFF; } //ANIM OFF hides the set key option from the user  
        
          LONG    MULTIBUTTON  
            {  
            CYCLE  
              {                  
                ONE;  
                TWO;  
              }  
            }    
          }          
        }  
      }
      

      Can anyone tell me what I'm doing wrong?

      -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 27/05/2011 at 12:36, xxxxxxxx wrote:

        That's not how the BaseContainer works. 🙂

        if (tag->GetData().GetLong(MULTIBUTTON) == TWO) ....

        The second argument in the BaseContainer GetXXX() methods is a default value if the container ID has not been set.

        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 27/05/2011 at 13:18, xxxxxxxx wrote:

          Thanks . 🍺

          -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 23/09/2011 at 13:32, xxxxxxxx wrote:

            Hey Guys,

            I'm trying to do this with a Combo Button and a dialog now. But I can't figure out what it needs.

            Bool myDialog::Command(LONG id,const BaseContainer &msg)    
            {  
                
              switch (id)   
                {  
                case MY_BUTTON:  
                  GePrint("Button Was Pressed");  //Works  
                      break;  
              
                case MY_CHECKBOX:            
                      GePrint("CHKBox was Toggled");  //Works  
                      break;  
              
                case MY_COMBOBUTTON == SECOND_CHILD:  
                      GePrint("Second Option Selected");//Does Not Work!              
                      break;  
                   
                }  
              
              return TRUE;  
            }
            

            If I use: case MY_COMBOBUTTON it works. But of course it always returns the print method. No matter which child option I select. Which is bad.
            How do I get the child options of a ComboButton to return my print method if I only select a specific child?

            -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 24/09/2011 at 09:57, xxxxxxxx wrote:

              Never mind.
              I think I've managed to figure it out... At least one way anyway.

              Bool myDialog::Command(LONG id,const BaseContainer &msg)    
              {  
                LONG second = msg.GetLong(BFM_ACTION_VALUE);  //Assigns an action to a variable  
                  
                switch (id)   
                  {  
                  case MY_BUTTON:  
                    GePrint("Button Was Pressed");   
                        break;  
                
                  case MY_CHECKBOX:            
                        GePrint("CHKBox was Toggled");   
                        break;  
                
                  case MY_COMBOBUTTON:              
                        if(second == SECOND_CHILD) GePrint("Second Option Selected");              
                        break;         
                  }  
                
                return TRUE;  
              }
              

              This was NOT obvious at all.
              Luckily the AsyncTest dialog plugin example in the SDK uses a Combo Button in it. And I was able to track down how it was working.
              I never would have been able to figure this out from the docs.

              -ScottA

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