Setting BORDER_OUT on tag BitmapButtons?



  • 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



  • 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](file:///D:/Incoming/help/pages/ge_sys_math/enum_BoolConstants150.html#FALSE1) if a massive error occured, e.g. a failed memory allocation. Don't return [FALSE](file:///D:/Incoming/help/pages/ge_sys_math/enum_BoolConstants150.html#FALSE1) if a description parameter can't be found for instance.



  • 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



  • 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


Log in to reply