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

    BitmapButtons

    SDK Help
    0
    3
    453
    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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 16/02/2003 at 09:17, xxxxxxxx wrote:

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

      ---------
      I add BitmapButtons to my ObjectPlugin (as in morphmixer example). I am using a bitmapbutton in another objectplugin already (like the example Mikael once posted here in the forum), this works fine, no problems.
      But when I add bitmapbuttons I never get a message of type MSG_DESCRIPTION_GETBITMAP, so there is no picture in the button.
      Here is some code of my plugin:

          
          
          
          
          Bool TreelibData::GetDParameter(GeListNode* node, const DescID& id, GeData& t_data, LONG& flags)  
          { 
          
          
          
          
           BaseContainer *vdata = ((BaseObject* )node)->GetDataInstance();
          
          
          
          
            for(LONG i=0;i<vdata->GetLong(TREEGEN_IDC)+1;i+=2) 
          
          
          
          
            {  
             if(id[0].id==i)   
             {  
                
              PluginMaterial *mat = (PluginMaterial* )node;  
              LONG dirty = 0;     
              BitmapButtonStruct bbs(static_cast<PluginObject*>(node), DescID(i), dirty);   
              t_data = GeData(CUSTOMDATATYPE_BITMAPBUTTON,bbs);  //bbs overwritten...  
            
              flags |= DESCFLAGS_PARAM_GET;      
                
              }   
            }  
              
           return ObjectData::GetDParameter(node, id, t_data, flags);  
          }
          
          
          
          
          Bool TreelibData::GetDDescription(GeListNode *node, Description *description,LONG &flags)  
          {   
           if (!description || !node) return FALSE;   
           if (!description->LoadDescription(node->GetType())) return FALSE;
          
          
          
          
             [...]
          
          
          
          
              ++i;
          
          
          
          
              BaseContainer bc2 = GetCustomDataTypeDefault(DTYPE_BUTTON);
          
          
          
          
              bc2.SetLong(DESC_CUSTOMGUI,CUSTOMGUI_BITMAPBUTTON);  
              bc2.SetBool(BITMAPBUTTON_BUTTON,TRUE);  
              bc2.SetLong(BITMAPBUTTON_BORDER,1);  
              if (!description->SetParameter(DescLevel(i),bc2,DescLevel(TREEGEN_LIBRARY))) return FALSE;  
                
               }
          
          
          
          
            }  
            data->SetLong(TREEGEN_IDC,i);  
              
           }
          
          
          
          
           flags |= DESCFLAGS_PARAM_SET;
          
          
          
          
           return ObjectData::GetDDescription(node, description, flags);  
          }
          
          
          
          
          Bool TreelibData::SetDParameter(GeListNode* node, const DescID& id, const GeData& t_data, LONG& flags)  
          {   
           BaseContainer *data = ((BaseObject* )node)->GetDataInstance();  
           for(LONG i=0;i<data->GetLong(TREEGEN_IDC)+1;i+=2)  
           {  
            if(id[0].id==i)   
            {   
             flags |= DESCFLAGS_PARAM_SET;     
            }  
           }     
             
           return ObjectData::SetDParameter(node, id, t_data, flags);  
          }
          
          
          
          
          [...]
          
          
          
          
          if (type == MSG_DESCRIPTION_GETBITMAP)   
           {    
               GePrint("message");
          
          
          
          
           } 
          
          
          
      

      There are two bitmapbuttons I am testing it with. Variable i represents the bitmapbuttons ID. So the buttons have the id 2 and 4. But as I said I never get a message. What´s wrong?
      Thanks
      Samir

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 16/02/2003 at 09:21, xxxxxxxx wrote:

        And yes, the ids are correct, are called correctly etc. Already checked. There seems to be an error (surely my fault) that I cannot find... 😕

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 16/02/2003 at 09:45, xxxxxxxx wrote:

          ok, forget about it. Got it. It was the ids. *shame* 🙂

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