A.M. BITMAPBUTTON set by another button?



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

    On 15/07/2009 at 18:51, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R10-R11 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    There are a set of BITMAPBUTTONs in my plugin object and tag. Work great. Clicking on one changes its state from enabled->disabled or disabled->enabled (state stored in associated BOOL descriptions). The image changes according to the state. Again, works great.

    Now there are two buttons "Select All" and "Deselect All" that should change the state of all of the buttons. The BOOL descriptions are set. Good. But the BITMAPBUTTON state isn't updated. It is updated if one goes to another tab and back in the A.M.

    Instead of changing the state in Message() from MSG_DESCRIPTION_COMMAND, it needs to be done somewhere else (SetDParameter()?).

    At a bit of a loss on how to get the bitmaps for the buttons updated in this situation.



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

    On 15/07/2009 at 21:41, xxxxxxxx wrote:

    Found it with a little help from an old Samir thread:

    First, GetDParameter() needs to be done like this (note the decrement!!!) :

    > // NodeData.GetDParameter \> //\*---------------------------------------------------------------------------\* \> Bool GreeblerObj::GetDParameter(GeListNode\* node, const DescID& id, GeData& t_data, LONG& flags) \> //\*---------------------------------------------------------------------------\* \> { \>      if (!node)          return FALSE; \>      switch (id[0].id) \>      { \>           // BitmapButtons \>           case GREEBLER_INFO: \>           case GREEBLER_BITMAP_CUBE: \>           case GREEBLER_BITMAP_T: \>           case GREEBLER_BITMAP_L: \>           case GREEBLER_BITMAP_C: \>           case GREEBLER_BITMAP_H: \>           case GREEBLER_BITMAP_D: \>           case GREEBLER_BITMAP_BOX: \>           case GREEBLER_BITMAP_CYLINDER: \>           case GREEBLER_BITMAP_RING: \>           case GREEBLER_BITMAP_BARS: \>           { \>                BitmapButtonStruct bbs(static_cast<PluginObject\*>(node), id, bm_dirty); \>                t_data =          GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs); \>                flags |=          DESCFLAGS_PARAM_GET; \>                --bm_dirty; \>           } \>           default: \>                break; \>      } \>      return SUPER::GetDParameter(node, id, t_data, flags); \> }

    When one of the two buttons is clicked, a MSG_DESCRIPTION_COMMAND is sent to NodeData::Message() wherein I call this (note the increment!!!) :

    > // GreeblerObj.SelectShapes \> //\*---------------------------------------------------------------------------\* \> void GreeblerObj::SelectShapes(BaseObject\* op, const Bool& state) \> //\*---------------------------------------------------------------------------\* \> { \>      BaseContainer\*     bc =     op->GetDataInstance(); \>      bc->SetBool(GREEBLER_SHAPE_CUBE,          state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_T,               state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_L,               state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_C,               state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_H,               state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_D,               state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_BOX,               state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_CYLINDER,     state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_RING,          state); \>      ++bm_dirty; \>      bc->SetBool(GREEBLER_SHAPE_BARS,          state); \>      ++bm_dirty; \> }

    bm_dirty is a LONG declared as a class member and initialized in Init() to 0.


Log in to reply