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
    • Register
    • Login

    CheckBox Abfrage

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 487 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/12/2005 at 08:27, xxxxxxxx wrote:

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

      ---------
      Hi All,
      als NewBe im Pluginprogrammieren kämpfe ich mit folgendem Problem:
      Ich habe einen Dialog erzeugt in dem eine Checkbox enthalten ist.
      Nach Schliesen des Dialoges möchte ich Abhänig vom Zustand der Checkbox etwas ausführen lassen.
      Leider leifern mir alle Versuche  nur Blödsinn!
      Frage: WIe kann ich den Zustand der Checkbox in eine Variable speichern?
      Laut SDK9.5 mit GetBool(100012,ButtonBox);
      Dabei sollte ButtonBox ein Bool sein. Dann liefert der Compiler aber Fehlermeldungen!
      BIIITTTEEEE um HIIILLLLFFFEEE
      Hier mein Code:
      Bool MyDialog::CreateLayout()      // Define Metode "MyDialog::CreateLayout"
      {
       SetTitle("My Dialog");       // Setzt Titel
       
          GroupBegin(100010, 0, 1, 0, "", 0);    //
          {
            GroupSpace(4, 4);
            GroupBorderSpace(4, 4, 4, 4);
       
            AddStaticText(100011, 0, 0, 0, "Test1", 0);
         AddCheckbox  (100012, 0, 0, 0, "Chek");
          }
          GroupEnd();
       
          AddDlgGroup(DLG_OK | DLG_CANCEL );    // Übergibt 0 für CANCEL und 1 für OK
         
       AddButton (100013,0,0,0,"Mein Text");
          return TRUE;
       }

      Bool MyDialog::Command(LONG id,const BaseContainer &msg)
      { 
       BaseDocument* doc = NULL;
       doc=GetActiveDocument();
       if (!doc) return false;
       switch (id)
       {
       case 100012:
        {
        GetBool(100012,ButtonBox);
        MessageDialog(ButtonBox);
        }
        
       }
         return true;
      }

      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/12/2005 at 15:53, xxxxxxxx wrote:

        ...
        case 100012:
        {
        ButtonBox = msg.GetBool(BFM_ACTION_VALUE);
        MessageDialog(ButtonBox);
        }
        ...

        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 07/12/2005 at 02:12, xxxxxxxx wrote:

          Danke für die Antwort.
          Leider passiert nur nicht dass was ich erwarte:
          1. msg.GetBool(BFM_ACTION_VALUE)  gibt einen int zurück!
          Ich hätte einen bool erwartet.
          2. MessageDialog(ButtonBox) gibt zwei Strings aus: jedoch nicht True oder False oder 0 und 1
          Ich habe versucht sowohl alle SDK-Beispiele durchzuarbeiten , als auch das SDK aufmerksam zu lesen.
          Kann ich nicht eine Variable mit dem Zustand der CheckBox belegen?
          P.S. Wahrscheinlich ist die Antwort so nah, dass ich sie nicht sehe :{

          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 07/12/2005 at 03:27, xxxxxxxx wrote:

            1. In C4D, 'Bool' is defined: typedef int Bool. Yes, msg.GetBool(BFM_ACTION_VALUE) returns an int. You will need to cast it to a 'bool' if that is the type into which it is being stored:

            ButtonBox = static_cast<bool>(msg.GetBool(BFM_ACTION_VALUE));

            BFM_ACTION_VALUE retrieves the state of the Checkbox from BaseContainer msg.

            2. ? MessageDialog(String((ButtonBox)?"True":"False"));

            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 07/12/2005 at 23:45, xxxxxxxx wrote:

              Thanks a lot.
              It solved my problem for this time.
              But , sorry to be so "hardnäckig".
              For what what do I need then "GetCheckbox(ID)" or "GetBool(ID,VARIABLE)"
              what is explaned in the GUI?
              With this question I want to understand how to read the GUI.

              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 08/12/2005 at 00:26, xxxxxxxx wrote:

                I don't see a reference to "GetCheckbox(ID)" in the documentation. If you are finding this in the source code, it may be an internal method.

                Use SetBool(ID,VARIABLE) to set the Checkbox gadget state - in InitValues(), for instance.

                Use GetBool(ID,VARIABLE) to retrieve the Checkbox gadget state somewhere else. I use this when saving my plugin's preferences (saving the states of Checkboxes for later restoration).

                Basically, SetBool() and GetBool() are for you, as the developer, to set and get the Checkbox state. msg.GetBool(BFM_ACTION_VALUE) in GeDialog::Command() retrieves the user's interaction with the Checkbox when using the plugin.

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