DDesc BitmapButtons when changed



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

    On 19/10/2010 at 21:54, xxxxxxxx wrote:

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

    ---------
    In R11.5 and earlier, the code to add a BitmapButton in a Dynamic Description and set the image by state works.

    In R12, when the image is set to a new state, it disappears, then it defaults to some partial size and causes bad auto-layout of the AM elements.

    None of the similar static descriptions are affected (despite using the same code to set the image by state and so on).

    What has changed?



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

    On 22/10/2010 at 07:21, xxxxxxxx wrote:

    I am surprised that you could add a BitmapButton to the user data at all. Afaik buttons are not supported by user data.

    cheers,
    Matthias



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

    On 22/10/2010 at 12:48, xxxxxxxx wrote:

    Not 'user data'; GetDDescription()



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

    On 26/10/2010 at 08:33, xxxxxxxx wrote:

    Please post some source code showing the problem.

    cheers,
    Matthias



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

    On 26/10/2010 at 10:55, xxxxxxxx wrote:

    It is not a code problem as far as I am aware.  Again, this works in all other builds except R12.  First, here are some images to illustrate the problem:

    The first two are static bitmap buttons (in the .res file).  These are working.

    http://www.kuroyumes-developmentzone.com/referenced/Before_Static.jpg

    http://www.kuroyumes-developmentzone.com/referenced/After_Static.jpg

    These are the dynamic bitmap buttons.  Note that the secondary image (for disabled) is not being displayed:

    http://www.kuroyumes-developmentzone.com/referenced/Before_Dynamic.jpg

    http://www.kuroyumes-developmentzone.com/referenced/After_Dynamic.jpg

    The same basic code is employed for static and dynamic bitmap changes on state change and it works in R11.5 and earlier (same code).  The code below is how I was instructed to achieve this type of bitmap state change using Descriptions in the Attribute Manager.  Something change in R12 (surprise) and it is not documented as far as I am aware.

    // NodeData.GetDDescription - Descriptions and Parameters  
    //*---------------------------------------------------------------------------*  
    Bool GreeblerObj::GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags)  
    //*---------------------------------------------------------------------------*  
    {  
      gcbArray->Flush();  
      nubArray->Flush();  
      //pipArray->Flush();  
      
      // Initial validity checks  
      if (CheckIsRunning(CHECKISRUNNING_EXTERNALRENDERING) || CheckIsRunning(CHECKISRUNNING_EDITORRENDERING))        return TRUE;  
      if (!(node && description))            return FALSE;  
      if (!description->LoadDescription(node->GetType())) return FALSE;  
      
      // Get necessary pointers  
      BaseDocument*    baseDoc =            node->GetDocument();  
      if (!baseDoc)                        return FALSE;  
      BaseObject*        obj =                static_cast<BaseObject*>(node);  
      if (!obj)                            return FALSE;  
      BaseContainer*    opBC =                obj->GetDataInstance();  
      if (!opBC)                            return FALSE;  
      
    #ifndef    C4D_R115  
      // important to check for speedup c4d!  
      const DescID *singleid = description->GetSingleDescID();  
      
      DescID cid = DescLevel(GREEBLER_NURN_RENDERINSTANCE,DTYPE_BOOL,0);  
      
      if (!singleid || cid.IsPartOf(*singleid,NULL)) // important to check for speedup c4d!  
      {  
          BaseContainer *bc = description->GetParameterI(cid,NULL);  
          bc->SetBool(DESC_HIDE, TRUE);  
      }  
      //if (!description->SetParameter(DescLevel(GREEBLER_NURN_RENDERINSTANCE,DTYPE_BOOL,0L), stateBC, DescLevel(GREEBLER_GROUP_NURN_SETTING)))    return FALSE;  
    #endif  
      
      // *************************  
      // Add Dynamic Descriptions  
      // *************************  
      // Custom Greeble Shapes  
      // - Add Shapes from those inserted into Document and specified under GREEBLER_GREEC_LIBRARY link  
      BaseObject*        libop =                opBC->GetObjectLink(GREEBLER_GREEC_LIBRARY, baseDoc);  
      if (libop)  
      {  
          if (!GetDDesc_CGreebles(description, baseDoc, obj, opBC, libop))    return FALSE;  
      }  
      // Add Nurnie BitmapButtons and Frequency sliders  
      // - Add Objects from those inserted into Document and specified under GREEBLER_NURN_LIBRARY link  
      libop =                                opBC->GetObjectLink(GREEBLER_NURN_LIBRARY, baseDoc);  
      if (libop)  
      {  
          if (!GetDDesc_Nurnies(description, baseDoc, obj, opBC, libop))        return FALSE;  
      }  
      /*  
      // Add Piping Elements  
      // - Add Objects from those inserted into Document and specified under GREEBLER_PIPE_LIBRARY link  
      libop =                                opBC->GetObjectLink(GREEBLER_PIPE_LIBRARY, baseDoc);  
      if (libop)  
      {  
          if (!GetDDesc_Piping(description, baseDoc, obj, opBC, libop))        return FALSE;  
      }  
      */  
      
      flags |=    DESCFLAGS_DESC_LOADED|DESCFLAGS_DESC_RECURSIONLOCK;  
      return SUPER::GetDDescription(node,description,flags);  
    }  
    // GreeblerObj.GetDDesc_CGreebles  
    //*---------------------------------------------------------------------------*  
    Bool GreeblerObj::GetDDesc_CGreebles(Description* description, BaseDocument* baseDoc, BaseObject* obj, BaseContainer* opBC, BaseObject* libop)  
    //*---------------------------------------------------------------------------*  
    {  
      // Add Shape BitmapButtons and Frequency sliders  
      // (States and Frequencies stored in dynamic aarray!)  
      // - Custom Shape Bar and Array lists  
      BaseContainer        listBC;  
      BaseTag*            tag =            NULL;  
      BaseContainer*        gbc =            NULL;  
      LONG                col =            GREEBLER_GREEC_GREEBLES_COL1;  
      LONG                ccnt =            0L;  
      for (BaseObject* op = libop->GetDown(); op; op = op->GetNext())  
      {  
          // Get existing GCBInfoTag (BaseContainer) or create new tag  
          tag =            ProcessGCBInfoTag(baseDoc, obj, op, "ggicon");  
          if (!tag)        continue;  
          gcbArray->Append(tag);  
          gbc =            tag->GetDataInstance();  
          gbc->SetLong(TGCBINFO_ID,        GREEBLER_GREEC_BITMAP+ccnt);  
          gbc->SetString(TGCBINFO_NAME,    op->GetName());  
          gbc->SetLink(TGCBINFO_LINK,        obj);  
          listBC.SetString(ccnt, op->GetName());  
          // Add Descriptions  
          // - BitmapButton (actual bitmap is supplied like stock bitmaps!)  
          if (!description->SetParameter(DescLevel(GREEBLER_GREEC_BITMAP+ccnt,DTYPE_BUTTON,0L), bmbBC, DescLevel(col)))    return FALSE;  
          // - Labels on Left  
          if (col == GREEBLER_GREEC_GREEBLES_COL1)  
          {  
              nameBC.SetString(DESC_SHORT_NAME,    GeLoadString(GRES_GDD_NAME));  
              freqBC.SetString(DESC_SHORT_NAME,    GeLoadString(GRES_GDD_FREQUENCY));  
              rrndBC.SetString(DESC_SHORT_NAME,    GeLoadString(GRES_GDD_ROTRANDOM));  
              rangBC.SetString(DESC_SHORT_NAME,    GeLoadString(GRES_GDD_ROTANGLE));  
          }  
          else  
          {  
              nameBC.SetString(DESC_SHORT_NAME,    String(""));  
              freqBC.SetString(DESC_SHORT_NAME,    String(""));  
              rrndBC.SetString(DESC_SHORT_NAME,    String(""));  
              rangBC.SetString(DESC_SHORT_NAME,    String(""));  
          }  
          // - Name  
          if (!description->SetParameter(DescLevel(GREEBLER_GREEC_NAME+ccnt,DTYPE_STATICTEXT,0L), nameBC, DescLevel(col)))    return FALSE;  
          opBC->SetString(GREEBLER_GREEC_NAME+ccnt,    gbc->GetString(TGCBINFO_NAME));  
          // - Frequency  
          if (!description->SetParameter(DescLevel(GREEBLER_GREEC_FREQ+ccnt,DTYPE_REAL,0L), freqBC, DescLevel(col)))    return FALSE;  
          opBC->SetReal(GREEBLER_GREEC_FREQ+ccnt,        gbc->GetReal(TGCBINFO_FREQUENCY));  
          // - Random Surface Rotation  
          if (!description->SetParameter(DescLevel(GREEBLER_GREEC_ROT_RANDOM+ccnt,DTYPE_BOOL,0L), rrndBC, DescLevel(col)))        return FALSE;  
          opBC->SetBool(GREEBLER_GREEC_ROT_RANDOM+ccnt,    gbc->GetBool(TGCBINFO_ROTRANDOM));  
          // - Surface Rotation  
          if (!description->SetParameter(DescLevel(GREEBLER_GREEC_ROT_ANGLE+ccnt,DTYPE_REAL,0L), rangBC, DescLevel(col)))            return FALSE;  
          opBC->SetReal(GREEBLER_GREEC_ROT_ANGLE+ccnt,    gbc->GetReal(TGCBINFO_ROTANGLE));  
          // - State  
          if (!description->SetParameter(DescLevel(GREEBLER_GREEC_STATE+ccnt,DTYPE_BOOL,0L), stateBC, DescLevel(col)))    return FALSE;  
          opBC->SetBool(GREEBLER_GREEC_STATE+ccnt,    gbc->GetBool(TGCBINFO_STATE));  
          ++ccnt;  
          // Control Column Group in use  
          ++col;  
          if (col > GREEBLER_GREEC_GREEBLES_COL5)    col = GREEBLER_GREEC_GREEBLES_COL1;  
      }  
      opBC->SetLong(GREEBLER_GREEC_COUNT, ccnt);  
      // Fill in Bar and Array shape options  
      BaseContainer    shapeBC =            GetCustomDataTypeDefault(DTYPE_LONG);  
      shapeBC.SetString(DESC_SHORT_NAME,    "Shape");  
      shapeBC.SetBool(DESC_ANIMATE,        FALSE);  
      shapeBC.SetContainer(DESC_CYCLE,    listBC);  
      if (!description->SetParameter(DescLevel(GREEBLER_GREEC_BARS_OBJ,DTYPE_LONG,0L), shapeBC, DescLevel(GREEBLER_GROUP_GREEBLES_CUSTOM)))    return FALSE;  
      if (!description->SetParameter(DescLevel(GREEBLER_GREEC_ARRAY_OBJ,DTYPE_LONG,0L), shapeBC, DescLevel(GREEBLER_GROUP_GREEBLES_CUSTOM)))    return FALSE;  
      if (!description->SetParameter(DescLevel(GREEBLER_GREEC_RARRAY_OBJ,DTYPE_LONG,0L), shapeBC, DescLevel(GREEBLER_GROUP_GREEBLES_CUSTOM)))    return FALSE;  
      if (opBC->GetLong(GREEBLER_GREEC_BARS_OBJ) >= ccnt)        opBC->SetLong(GREEBLER_GREEC_BARS_OBJ, 0L);  
      if (opBC->GetLong(GREEBLER_GREEC_ARRAY_OBJ) >= ccnt)    opBC->SetLong(GREEBLER_GREEC_ARRAY_OBJ, 0L);  
      if (opBC->GetLong(GREEBLER_GREEC_RARRAY_OBJ) >= ccnt)    opBC->SetLong(GREEBLER_GREEC_RARRAY_OBJ, 0L);  
      return TRUE;  
    }  
    // NodeData.Message  
    //*---------------------------------------------------------------------------*  
    Bool GreeblerObj::Message(GeListNode* node, LONG type, void* data)  
    //*---------------------------------------------------------------------------*  
    {  
      //GePrint(MsgToString(type));  
      if (!node)    return FALSE;  
      if        (type == MSG_DESCRIPTION_GETBITMAP)  
          return MsgGetBitmap(static_cast<DescriptionGetBitmap*>(data), static_cast<BaseObject*>(node));  
      else if (type == MSG_DESCRIPTION_COMMAND)  
          return MsgCommand(static_cast<DescriptionCommand*>(data), static_cast<BaseObject*>(node));  
      else if (type == MSG_DESCRIPTION_POSTSETPARAMETER)  
          return MsgPostSetParameter(static_cast<DescriptionPostSetValue*>(data), static_cast<BaseObject*>(node));  
      /*  
      else if (type == MSG_DESCRIPTION_CHECKDRAGANDDROP)  
          return MsgCheckDragAndDrop(static_cast<BaseTag*>(node), static_cast<DescriptionCheckDragAndDrop*>(data));  
      */  
      return SUPER::Message(node,type,data);  
    }  
    // GreeblerObj.GetSSBitMap  
    //*---------------------------------------------------------------------------*  
    void GreeblerObj::GetSSBitMap(DescriptionGetBitmap* dgb, const Bool& enabled, const String& sfn)  
    //*---------------------------------------------------------------------------*  
    {  
      Filename    bg;  
      if (enabled)        bg =    stocksfn+Filename(sfn+"_T.tif");  
      else                bg =    stocksfn+Filename(sfn+"_F.tif");  
      if (!GeFExist(bg))    return;  
      AutoAlloc<BaseBitmap>    bm;  
      if (!bm)            return;  
      bm->Init(bg);  
      dgb->bmp =            bm.Release();  
    }  
    // GreeblerObj.MsgGetBitmap  
    //*---------------------------------------------------------------------------*  
    Bool GreeblerObj::MsgGetBitmap(DescriptionGetBitmap* dgb, BaseObject* op)  
    //*---------------------------------------------------------------------------*  
    {  
      if (!(dgb && op))        return TRUE;  
      BaseContainer*    bc =    op->GetDataInstance();  
      LONG            id =    dgb->id[0].id;  
      if (id == GREEBLER_INFO)  
      {  
          Filename    bg =    GeGetPluginPath()+Filename("res")+Filename("banner.tif");  
          if (!GeFExist(bg))    return TRUE;  
          AutoAlloc<BaseBitmap>    bm;  
          if (!bm)            return TRUE;  
          bm->Init(bg);  
          dgb->bmp =            bm.Release();  
      }  
      // Stock Greebles  
      else if (id == GREEBLER_BITMAP_CUBE)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_CUBE),        "cube");  
      else if (id == GREEBLER_BITMAP_T)                GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_T),            "Tshape");  
      else if (id == GREEBLER_BITMAP_L)                GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_L),            "Lshape");  
      else if (id == GREEBLER_BITMAP_C)                GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_C),            "Cshape");  
      else if (id == GREEBLER_BITMAP_H)                GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_H),            "Hshape");  
      else if (id == GREEBLER_BITMAP_D)                GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_D),            "Dshape");  
      else if (id == GREEBLER_BITMAP_BOX)                GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_BOX),        "box");  
      else if (id == GREEBLER_BITMAP_CUBECC)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_CUBECC),    "cubecc");  
      else if (id == GREEBLER_BITMAP_OBLOCT)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_OBLOCT),    "obloct");  
      else if (id == GREEBLER_BITMAP_CYLINDER)        GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_CYLINDER),    "cyl");  
      else if (id == GREEBLER_BITMAP_RING)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_RING),        "ring");  
      else if (id == GREEBLER_BITMAP_REGPOLY)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_REGPOLY),    "regpoly");  
      else if (id == GREEBLER_BITMAP_REGPOLYR)        GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_REGPOLYR),    "regpolyr");  
      else if (id == GREEBLER_BITMAP_BARS)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_BARS),        "bars");  
      else if (id == GREEBLER_BITMAP_ARRAY)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_ARRAY),        "array");  
      else if (id == GREEBLER_BITMAP_RARRAY)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_RARRAY),    "rarray");  
      else if (id == GREEBLER_GREE_BOXIMAGE)            GetSSBitMap(dgb, TRUE,                                    "box");  
      else if (id == GREEBLER_GREE_CYLIMAGE)            GetSSBitMap(dgb, TRUE,                                    "cyl");  
      else if (id == GREEBLER_GREE_RNGIMAGE)            GetSSBitMap(dgb, TRUE,                                    "ring");  
      else if (id == GREEBLER_GREE_POLIMAGE)            GetSSBitMap(dgb, TRUE,                                    "regpoly");  
      else if (id == GREEBLER_GREE_PLRIMAGE)            GetSSBitMap(dgb, TRUE,                                    "regpolyr");  
      // Custom Greebles  
      else if (id == GREEBLER_BITMAP_CBARS)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_CBARS),        "bars");  
      else if (id == GREEBLER_BITMAP_CARRAY)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_CARRAY),    "array");  
      else if (id == GREEBLER_BITMAP_CRARRAY)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_SHAPE_CRARRAY),    "rarray");  
      else if ((id >= GREEBLER_GREEC_BITMAP) && (id < GREEBLER_GREEC_FREQ))  
      {  
          // Get associated GCBInfo bitmap  
          BaseBitmap*        ibm =            GetGCBInfoBitmap_Greebles(op, bc, id);  
          if (!ibm)                        return TRUE;  
          AutoAlloc<BaseBitmap>    bm;  
          if (!bm)                        return TRUE;  
          ibm->CopyTo(bm);  
          dgb->bmp =                        bm.Release();  
      }  
      // Nurnies  
      else if (id == GREEBLER_BITMAP_NBARS)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_OBJECT_NBARS),    "bars");  
      else if (id == GREEBLER_BITMAP_NARRAY)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_OBJECT_NARRAY),    "array");  
      else if (id == GREEBLER_BITMAP_NRARRAY)            GetSSBitMap(dgb, bc->GetBool(GREEBLER_OBJECT_NRARRAY),    "rarray");  
      else if ((id >= GREEBLER_NURN_BITMAP) && (id <= GREEBLER_NURN_BITMAP_END))  
      {  
          // Get associated GCBInfo bitmap  
          BaseBitmap*        ibm =            GetGCBInfoBitmap_Nurnies(op, bc, id);  
          if (!ibm)                        return TRUE;  
          AutoAlloc<BaseBitmap>    bm;  
          if (!bm)                        return TRUE;  
          ibm->CopyTo(bm);  
          dgb->bmp =                        bm.Release();  
      }  
      return TRUE;  
    }  
    // NodeData.GetDParameter  
    //*---------------------------------------------------------------------------*  
    Bool GreeblerObj::GetDParameter(GeListNode* node, const DescID& id, GeData& t_data, DESCFLAGS_GET& flags)  
    //*---------------------------------------------------------------------------*  
    {  
      if (!node)        return FALSE;  
      LONG    did =    id[0].id;  
      // Custom Greebles  
      if ((did >= GREEBLER_GREEC_BITMAP) && (did <= GREEBLER_GREEC_BITMAP_END))  
      {  
          BitmapButtonStruct bbs(static_cast<PluginObject*>(node), id, cg_bm_dirty);  
          t_data =        GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);  
          flags |=        DESCFLAGS_GET_PARAM_GET;  
          --cg_bm_dirty;  
      }  
      // Nurnies  
      else if ((did >= GREEBLER_NURN_BITMAP) && (did <= GREEBLER_NURN_BITMAP_END))  
      {  
          BitmapButtonStruct bbs(static_cast<PluginObject*>(node), id, nu_bm_dirty);  
          t_data =        GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);  
          flags |=        DESCFLAGS_GET_PARAM_GET;  
          --nu_bm_dirty;  
      }  
      else  
      {  
          switch (did)  
          {  
              // BitmapButtons  
              case GREEBLER_INFO:  
              {  
                  BitmapButtonStruct bbs(static_cast<PluginObject*>(node), id, 0L);  
                  t_data =        GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);  
                  flags |=        DESCFLAGS_GET_PARAM_GET;  
                  break;  
              }  
              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_CUBECC:  
              case GREEBLER_BITMAP_OBLOCT:  
              case GREEBLER_BITMAP_CYLINDER:  
              case GREEBLER_BITMAP_RING:  
              case GREEBLER_BITMAP_REGPOLY:  
              case GREEBLER_BITMAP_REGPOLYR:  
              case GREEBLER_BITMAP_BARS:  
              case GREEBLER_BITMAP_ARRAY:  
              case GREEBLER_BITMAP_RARRAY:  
              case GREEBLER_GREE_BOXIMAGE:  
              case GREEBLER_GREE_CYLIMAGE:  
              case GREEBLER_GREE_RNGIMAGE:  
              case GREEBLER_GREE_POLIMAGE:  
              case GREEBLER_GREE_PLRIMAGE:  
              {  
                  BitmapButtonStruct bbs(static_cast<PluginObject*>(node), id, sg_bm_dirty);  
                  t_data =        GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);  
                  flags |=        DESCFLAGS_GET_PARAM_GET;  
                  --sg_bm_dirty;  
                  break;  
              }  
              // Custom Greebles  
              case GREEBLER_BITMAP_CBARS:  
              case GREEBLER_BITMAP_CARRAY:  
              case GREEBLER_BITMAP_CRARRAY:  
              {  
                  BitmapButtonStruct bbs(static_cast<PluginObject*>(node), id, cg_bm_dirty);  
                  t_data =        GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);  
                  flags |=        DESCFLAGS_GET_PARAM_GET;  
                  --cg_bm_dirty;  
              }  
              // Nurnies  
              case GREEBLER_BITMAP_NBARS:  
              case GREEBLER_BITMAP_NARRAY:  
              case GREEBLER_BITMAP_NRARRAY:  
              {  
                  BitmapButtonStruct bbs(static_cast<PluginObject*>(node), id, nu_bm_dirty);  
                  t_data =        GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);  
                  flags |=        DESCFLAGS_GET_PARAM_GET;  
                  --nu_bm_dirty;  
              }  
              default:  
                  break;  
          }  
      }  
      return SUPER::GetDParameter(node, id, t_data, flags);  
    }  
    // NodeData.SetDParameter  
    //*---------------------------------------------------------------------------*  
    Bool GreeblerObj::SetDParameter(GeListNode* node, const DescID& id, const GeData& t_data, DESCFLAGS_SET& flags)  
    //*---------------------------------------------------------------------------*  
    {  
      if (!node)        return FALSE;  
      LONG    did =    id[0].id;  
      // Info BitmapButton  
      if (did == GREEBLER_INFO)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              // user clicked on button - open Dialog  
              greebler->ShowHelpDialog();  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Cube BitmapButton  
      else if (did == GREEBLER_BITMAP_CUBE)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_CUBE, !bc->GetBool(GREEBLER_SHAPE_CUBE));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // T BitmapButton  
      else if (did == GREEBLER_BITMAP_T)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_T, !bc->GetBool(GREEBLER_SHAPE_T));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // L BitmapButton  
      else if (did == GREEBLER_BITMAP_L)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_L, !bc->GetBool(GREEBLER_SHAPE_L));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // C BitmapButton  
      else if (did == GREEBLER_BITMAP_C)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_C, !bc->GetBool(GREEBLER_SHAPE_C));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // H BitmapButton  
      else if (did == GREEBLER_BITMAP_H)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_H, !bc->GetBool(GREEBLER_SHAPE_H));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // D BitmapButton  
      else if (did == GREEBLER_BITMAP_D)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_D, !bc->GetBool(GREEBLER_SHAPE_D));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Box BitmapButton  
      else if (did == GREEBLER_BITMAP_BOX)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_BOX, !bc->GetBool(GREEBLER_SHAPE_BOX));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // CubeCC BitmapButton  
      else if (did == GREEBLER_BITMAP_CUBECC)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_CUBECC, !bc->GetBool(GREEBLER_SHAPE_CUBECC));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Oblong Octagon BitmapButton  
      else if (did == GREEBLER_BITMAP_OBLOCT)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_OBLOCT, !bc->GetBool(GREEBLER_SHAPE_OBLOCT));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Cylinder BitmapButton  
      else if (did == GREEBLER_BITMAP_CYLINDER)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_CYLINDER, !bc->GetBool(GREEBLER_SHAPE_CYLINDER));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Ring BitmapButton  
      else if (did == GREEBLER_BITMAP_RING)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_RING, !bc->GetBool(GREEBLER_SHAPE_RING));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // RegularPolygon BitmapButton  
      else if (did == GREEBLER_BITMAP_REGPOLY)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_REGPOLY, !bc->GetBool(GREEBLER_SHAPE_REGPOLY));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // RegularPolygonR BitmapButton  
      else if (did == GREEBLER_BITMAP_REGPOLYR)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_REGPOLYR, !bc->GetBool(GREEBLER_SHAPE_REGPOLYR));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Bars BitmapButton  
      else if (did == GREEBLER_BITMAP_BARS)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_BARS, !bc->GetBool(GREEBLER_SHAPE_BARS));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Array BitmapButton  
      else if (did == GREEBLER_BITMAP_ARRAY)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_ARRAY, !bc->GetBool(GREEBLER_SHAPE_ARRAY));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Ring Array BitmapButton  
      else if (did == GREEBLER_BITMAP_RARRAY)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_RARRAY, !bc->GetBool(GREEBLER_SHAPE_RARRAY));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Custom Greebles  
      // - Bars BitmapButton  
      else if (did == GREEBLER_BITMAP_CBARS)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_CBARS, !bc->GetBool(GREEBLER_SHAPE_CBARS));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // - Array BitmapButton  
      else if (did == GREEBLER_BITMAP_CARRAY)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_CARRAY, !bc->GetBool(GREEBLER_SHAPE_CARRAY));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // - Ring Array BitmapButton  
      else if (did == GREEBLER_BITMAP_CRARRAY)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_SHAPE_CRARRAY, !bc->GetBool(GREEBLER_SHAPE_CRARRAY));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // - Individual Shapes  
      else if ((did >= GREEBLER_GREEC_BITMAP) && (did < GREEBLER_GREEC_FREQ))  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              LONG            inc =    did-GREEBLER_GREEC_BITMAP;  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              Bool            state =    !bc->GetBool(GREEBLER_GREEC_STATE+inc);  
              bc->SetBool(GREEBLER_GREEC_STATE+inc, state);  
              BaseTag*        tag =    SetGCBInfoTag_Greebles(node->GetDocument(), static_cast<BaseObject*>(node), did);  
              if (tag)        tag->GetDataInstance()->SetBool(TGCBINFO_STATE, state);  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // Nurnies  
      // - Bars BitmapButton  
      else if (did == GREEBLER_BITMAP_NBARS)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_OBJECT_NBARS, !bc->GetBool(GREEBLER_OBJECT_NBARS));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // - Array BitmapButton  
      else if (did == GREEBLER_BITMAP_NARRAY)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_OBJECT_NARRAY, !bc->GetBool(GREEBLER_OBJECT_NARRAY));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // - Ring Array BitmapButton  
      else if (did == GREEBLER_BITMAP_NRARRAY)  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              bc->SetBool(GREEBLER_OBJECT_NRARRAY, !bc->GetBool(GREEBLER_OBJECT_NRARRAY));  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      // - Individual Nurnie objects  
      else if ((did >= GREEBLER_NURN_BITMAP) && (did <= GREEBLER_NURN_BITMAP_END))  
      {  
          if (flags & DESCFLAGS_SET_USERINTERACTION)  
          {  
              LONG            inc =    did-GREEBLER_NURN_BITMAP;  
              BaseContainer*    bc =    static_cast<PluginObject*>(node)->GetDataInstance();  
              // user clicked on button - toggle state  
              Bool            state =    !bc->GetBool(GREEBLER_NURN_STATE+inc);  
              bc->SetBool(GREEBLER_NURN_STATE+inc, state);  
              BaseTag*        tag =    SetGCBInfoTag_Nurnies(node->GetDocument(), static_cast<BaseObject*>(node), did);  
              if (tag)        tag->GetDataInstance()->SetBool(TGCBINFO_STATE, state);  
          }  
          flags |=    DESCFLAGS_SET_PARAM_SET;  
      }  
      return SUPER::SetDParameter(node, id, t_data, flags);  
    }  
    

Log in to reply