Bitmap Buttons



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

    On 02/04/2003 at 13:51, xxxxxxxx wrote:

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

    ---------
    Hello,
        I implemeted the source code found in this forum for a BitmapButton. The original res declaration for the button is in the res file ( BITMAPBUTTON PLUGIN_BUTTON {} ). Everything works fine except there is no event generated when the button is clicked on. I am checking using the following:

    case MSG_DESCRIPTION_COMMAND:
                             {
                                  DescriptionCommand *dc = ( DescriptionCommand * ) data;
                                  if ( dc->id[0].id == PLUGIN_BUTTON )
                                       {
                                            GePrint( "Here We Are" ); // ***
                                       }
                             }

    This message is never sent unless I change the res file element to BUTTON instead of BITMAP_BUTTON. I think that I am not setting a seond image for the button may be an issue. The code I found only sets one image:

    case MSG_DESCRIPTION_GETBITMAP:
                             {
                                  DescriptionGetBitmap* dgb = static_cast < DescriptionGetBitmap * > ( data );
                                  if ( dgb->id[0] == PLUGIN_BUTTON )
                                       {
                                            AutoAlloc < BaseBitmap > bm;
                                            bm->Init( GeGetPluginPath() + Filename( "res" ) + Filename( "PLUGIN_BUTTON_UP.tif" ) );
                                            dgb->bmp = bm.Release();
                                       }
                             }

    Where and how should I set the second down image? Is it possible that is why there is not event generated?

    Thanks!

    bt



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

    On 04/04/2003 at 01:24, xxxxxxxx wrote:

    I would like to know that too :
    Trying to get teh Customdatatype and setting the image with SetImage() (no matter where) or even GetHeight does crash my cinema 4d immediately.
    P.S.: Would be highly appreciated if you could tell me if you find out darf. Thanks



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

    On 04/04/2003 at 04:58, xxxxxxxx wrote:

    You must set the "BITMAPBUTTON_BUTTON" flag in the settings. In the resource file this means "BITMAPBUTTON PLUGIN_BUTTON {BUTTON; }".



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

    On 04/04/2003 at 05:05, xxxxxxxx wrote:

    I did BITMAPBUTTON ID {BORDER; BUTTON;}
    But that doesn´t help setting a second image when the button is pressed down. :
    BitmapButtonCustomGui butt = (BitmapButtonCustomGui* )data->GetCustomDataType(id,CUSTOMGUI_BITMAPBUTTON);
    butt->SetImage(bm,TRUE);
    this code then crashes cinema 4D. Maybe I am doing it in the wrong function (tried in message,init)? Where do we have to set the second image?


Log in to reply