Preferences - button [SOLVED]



  • 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



  • 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.



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

    Hello,

    PrefsDialogObject is based on NodeData. So to find ouf if a button was pressed you have to implement NodeData::Message and check for the MSG_DESCRIPTION_COMMAND message. The data is a DescriptionCommand 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



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

    Thanks :) work


Log in to reply