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

    TreeView CheckBox

    Scheduled Pinned Locked Moved SDK Help
    1 Posts 0 Posters 161 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 03/06/2012 at 13:24, xxxxxxxx wrote:

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

      ---------
      how to getting it working in the treeview checkboxes?
      the other function works in the TreeView, but the function SetCheck does not want.
      does not respond to click

      (Sorry my english)

        
      class FunctionObj : public TreeViewFunctions  
      {  
        public:  
           ................  
        
           virtual LONG IsChecked(void *root,void *userdata,void *obj, LONG lColumn) // for checkboxes (return a combination of LV_CHECKBOX_* or NOTOK if you don't want to show the checkbox)  
           {  
               AcObjNode *node = (AcObjNode* )obj;  
               C4DAtomGoal *link = node->link->GetLinkAtom(NULL);  
        
               if (link)  
               {  
                   GeData data;  
                   if (lColumn=='chk0')  
                   {  
                       link->GetParameter(DescID(COL_CHK_SEP), data, DESCFLAGS_GET_0);  
                       return data.GetBool();  
                   }  
        
                   if (lColumn=='chk1')  
                   {  
                       link->GetParameter(DescID(COL_CHK_INS), data, DESCFLAGS_GET_0);  
                       return data.GetBool();  
                   }  
               }  
               return NULL;  
           }  
        
           virtual void SetCheck(void *root,void *userdata,void *obj, LONG lColumn, Bool bCheck, const BaseContainer& bcMsg) // for checkboxes  
           {  
               //can not get here  
        
                  AcObjNode *node = (AcObjNode* )obj;  
               C4DAtomGoal *link = node->link->GetLinkAtom(NULL);  
        
               if (link)  
               {  
                   if (lColumn=='chk0')  
                       link->SetParameter(DescID(COL_CHK_SEP),    GeData((Bool)TRUE),    DESCFLAGS_SET_0);  
                   if (lColumn=='chk1')  
                       link->SetParameter(DescID(COL_CHK_INS),    GeData((Bool)TRUE),    DESCFLAGS_SET_0);  
               }  
           }  
        
          ..................  
      } functable;  
        
      Bool cDlgInstance::CreateLayout(void)  
      {  
        Bool res = GeModalDialog::CreateLayout();  
        res         = LoadDialogResource(DLG_DIN3D_OBJECT, NULL, NULL);  
        
        if (res){  
            tree = (TreeViewCustomGui* )FindCustomGui(IDC_OBJLIST, CUSTOMGUI_TREEVIEW);  
            if (!tree) return FALSE;  
        
            BaseContainer layout;  
            layout.SetLong('chk0',LV_CHECKBOX);  
            layout.SetLong('chk1',LV_CHECKBOX);  
            layout.SetLong('name',LV_TREE);  
            layout.SetLong('cnt0',LV_USER);  
            tree->SetLayout(4,layout);  
        
            tree->SetColumnWidthUser('chk0', 15);  
            tree->SetColumnWidthUser('chk1', 15);  
            tree->SetColumnWidthUser('name', 200);  
            tree->SetColumnWidthUser('cnt0', 50);  
        }  
        
        return res;  
      }  
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post