Casio ClassPad 300 Programming Manual page 65

Sdk programming guide
Hide thumbs Also See for ClassPad 300:
Table of Contents

Advertisement

PEG also allows for a button to display an image instead of text. These buttons support
the standard border frames, but the text style flags do no apply. A PegBitmapButton also
sends the signal PSF_CLICKED.
To create a PegBitmapButton you must first create an image and define a PegBitmap that
represents this image. Creating a PegBitmap for a button is simple with the help of the
Bitmap Converter tool, accessible under the Tools menu.
First, create a bitmap in your favorite image-editing program. When you save the file,
make sure that the image is monochrome. Since the ClassPad is monochrome, only
monochrome bitmaps will work. In this example, we will use the following bitmap
named smile.bmp:
Next, open the BMP Converter tool. Browse to your bitmap image and type in the name
of the output C++ file you wish to create. The C++ file will contain the byte data for the
bitmap and create a PegBitmap. Press the convert button and add the output file to your
add-in project. Open the file and you will see that a PegBitmap called gbsmileBitmap
was created.
Finally, go back to the window class where you would like to add this button. At the top
of the file declare an extern to the name of your bitmap:
extern PegBitmap gbsmileBitmap;
Then, create your PegBitmapButton like this:
PegBitmapButton *button = new PegBitmapButton(2, 2, & gbsmileBitmap);
AddR(button);
Here is the result on the ClassPad:
BF_REPEAT
BF_DOWNACTION
PSF_FOCUS_RECEIVED
PSF_FOCUS_LOST
PSF_KEY_RECEIVED
PSF_CLICKED
65

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents