
Home |
|
PegBitmapButton
|

Examples |

Index |
|
|
|
 |
|
Overview |
Derived from class
PegButton
|
 |
|
The PegBitmapButton class is
a PegButton class that displays a
PegBitmap centered in the button client area.
|
|
PegTextButton
PegRadioButton
PegCheckBox
The PegBitmapButton class supports
the following style flags:
FF_NONE | No frame. |
FF_THIN | Thin frame. |
FF_THICK | Thick 3D frame. |
FF_RAISED | Raised 3D frame. |
FF_RECESSED | Recessed 3D frame. |
AF_ENABLED |
This style flag is used to indicate that the object can be selected. |
BF_REPEAT |
If this style flag is set, a button object will generate periodic
PSF_CLICKED signals when the button is held down by the user. |
BF_SELECTED |
This style flag is actually a state flag which indicates if a button
object is currently selected. For the object to be selectable, the object's
AF_ENABLED style flag must be set. |
BF_DOWNACTION |
If this style flag is set, a button object will generate the
PSF_CLICKED signal when the button is pressed.
Normally, the signal is generated when the button is released. |
BF_FULLBORDER |
The button object is to be drawn with a full border, the normal look
for most buttons. Without this style, a thin button border will be applied. |
The PegBitmapButton class generates
the following signals:
PSF_CLICKED | Sent by any object when it is selected. |
Constructors:
 |
 |
PegBitmapButton(PegRect &Rect,
|
| |

PegBitmap *bm, WORD wId = 0,
|
| |

WORD wStyle = AF_ENABLED)
|
This constructor creates a
PegBitmapButton at a specific location within a
rectangle specified by parameter Rect.
The PegBitmap associated with the button will be displayed
in the center of the button client area.
 |
 |
PegBitmapButton(SIGNED iLeft, SIGNED iTop,
|
| |

PegBitmap *bm, WORD wId = 0,
|
| |

WORD wStyle = AF_ENABLED)
|
This constructor creates a
PegBitmapButton with its
top left corner located at (iLeft,iTop).
The button automatically sizes itself
according to the dimensions of the bitmap.
The PegBitmap associated with the button will be displayed
in the center of the button client area.
Public Functions:
 |
 |
virtual void Draw(void)
|
PegBitmapButton
overrides the Draw() function to draw the associated bitmap.
 |
 |
virtual void SetBitmap(PegBitmap *nbm)
|
| |

{ mpBitmap = nbm;}
|
This inline function
assigns the PegBitmap bitmap to be drawn on the button.
The bitmap may be changed at any time.
The following are examples of PegBitmapButton buttons:
The following example
creates a PegBitmapButton.
The button will display the PegBitmap specified by public variable
gbOnMapBitmap in the button client area. The button
automatically determines the correct size based on the bitmap size.
extern PegBitmap gbOnMapBitmap;
:
:
Add(new PegBitmapButton(20, 20, &gbOnMapBitmap));
:
: