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

    Setting BORDER_OUT on tag BitmapButtons?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 348 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 17/12/2012 at 15:08, xxxxxxxx wrote:

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

      ---------
      Can anyone tell me how to set the BORDER_OUT option for a bitmap button that's on a tag?
      Oddly enough. I can create a copy of the button and then set the BORDER_OUT option just fine.
      But I can't figure out how to do it to the original bitmap button.

      //The .res file
      BITMAPBUTTON IMG_BUTTON {ANIM OFF;}

      //The .cpp code

      Bool SimpleTag::GetDDescription(GeListNode *node, Description *description,DESCFLAGS_DESC &flags)  
      {  
        BaseTag *tag = (BaseTag* )node;  
        BaseContainer *data = tag->GetDataInstance();  
        if (!description->LoadDescription(node->GetType())) return FALSE;  
        
        const DescID *singleid = description->GetSingleDescID();  
        
        DescID cid = DescLevel(IMG_BUTTON, DTYPE_BUTTON, 0);       //My bitmap button's ID is "IMG_BUTTON"  
        BaseContainer bmbBC;  
        if (!singleid || cid.IsPartOf(*singleid,NULL))             //important to check for speedup c4d!  
        {  
            bmbBC.SetLong(DESC_CUSTOMGUI, CUSTOMGUI_BITMAPBUTTON); //<--This makes a copy of the bitmap button  
            bmbBC.SetLong(BITMAPBUTTON_BORDER, BORDER_OUT);        //The copy has an out border... but original button does not!?  
            bmbBC.SetBool(BITMAPBUTTON_BUTTON, TRUE);   
        }  
        if (!description->SetParameter(cid,bmbBC,DescLevel(ID_OBJECTPROPERTIES))) return FALSE;  
        
        
        flags |= DESCFLAGS_DESC_LOADED;  
        
        return TRUE;  
      }
      

      -ScottA

      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 17/12/2012 at 17:41, xxxxxxxx wrote:

        might be a bit simple, but have you tried to return a call to the parent class instead
        of a straight True ?

        return SUPER::GetDDescription(node, description, flags);
        

        the sdk also says :

        Note:  Only return FALSE[URL-REMOVED] if a massive error occured, e.g. a failed memory allocation. Don't return FALSE[URL-REMOVED] if a description parameter can't be found for instance.


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

        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 17/12/2012 at 18:12, xxxxxxxx wrote:

          Calling to the SUPER class has no bearing on changing the bitmap button's options.
          I wish it was that simple.

          -ScottA

          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 17/12/2012 at 22:03, xxxxxxxx wrote:

            Ugh. Unbelievable.
            I've managed to figure it out. And boy was this thing obscure and hard to figure out.
            I feel like I just gave birth.......................................To an accountant! 😂

            Bool SimpleTag::GetDDescription(GeListNode *node, Description *description,DESCFLAGS_DESC &flags)  
            {  
              BaseTag *tag = (BaseTag* )node;  
              BaseContainer *data = tag->GetDataInstance();  
              if (!description->LoadDescription(node->GetType())) return FALSE;  
              
              DescID cid = DescLevel(IMG_BUTTON, CUSTOMDATATYPE_BITMAPBUTTON, 0);  
              BaseContainer bmbBC = GetCustomDataTypeDefault(CUSTOMDATATYPE_BITMAPBUTTON);  
              bmbBC.SetLong(BITMAPBUTTON_BORDER, BORDER_OUT);  
              bmbBC.SetBool(BITMAPBUTTON_BUTTON, TRUE);  
              if (!description->SetParameter(cid,bmbBC,DescLevel(ID_OBJECTPROPERTIES))) return FALSE;  
              
              flags |= DESCFLAGS_DESC_LOADED;  
               
              return TRUE;  
            }
            

            -ScottA

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