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

    Preferences - button [SOLVED]

    SDK Help
    0
    4
    347
    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
      Helper
      last edited by

      On 09/01/2015 at 02:21, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   16 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hey

      I just make my first steps in c++ - usually i use python.

      I try to create a PrefsDialogObject with buttons - where can i get the click and run some code ?

      Thanks

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

        On 09/01/2015 at 07:31, xxxxxxxx wrote:

        There's an example in the C++ docs under "PrefsDialogObject".
        Have you looked at that one?

        -ScottA

        *Edit-
        Hmm. I just took a look at the online R16 docs and it doesn't seem to be there anymore.
        There is a pretty full example in the R14 C++ docs though.

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

          On 09/01/2015 at 08:25, xxxxxxxx wrote:

          Hello,

          PrefsDialogObject[URL-REMOVED] is based on NodeData[URL-REMOVED]. So to find ouf if a button was pressed you have to implement NodeData::Message[URL-REMOVED] and check for the MSG_DESCRIPTION_COMMAND[URL-REMOVED] message. The data is a DescriptionCommand[URL-REMOVED] object which contains the ID of the pressed button.

            
          virtual Bool Message(GeListNode* node, Int32 type, void* data)  
          {  
           if(type == MSG_DESCRIPTION_COMMAND)  
           {  
               DescriptionCommand* dc = (DescriptionCommand* ) data;  
            
            
               if(dc)  
               {  
                   const Int ID = dc->id[0].id;  
            
                   if(ID == MY_BUTTON)  
                   {  
                       GePrint("button pressed");  
                   }  
               }  
           }  
            
            
           return SUPER::Message(node,type,data);  
          }  
          

          We are currently working on the R16 documentaiton so missing parts will be added.

          Best wishes,
          Sebastian


          [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

            On 09/01/2015 at 14:03, xxxxxxxx wrote:

            Thanks 🙂 work

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