Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/button.h>
Public Member Functions | |
IlvButton (IlvDisplay *display, const IlvPoint &point, IlvBitmap *bitmap, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
IlvButton (IlvDisplay *display, IlvBitmap *bitmap, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
IlvButton (IlvDisplay *display, const IlvPoint &point, const char *label, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
IlvButton (IlvDisplay *display, const char *label, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
virtual void | activate () |
Is called when the button is released after having been pressed. | |
virtual void | drawGadgetItem (const IlvGadgetItem *, IlvPort *port, const IlvRect &rect, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws a specific gadget item. | |
IlvBitmap * | getHighlightedBitmap () const |
Returns the bitmap associated with the highlighted state of the button. | |
IlUInt | getPeriod () const |
Returns the repeat period of the button. | |
IlvBitmap * | getSelectedBitmap () const |
Returns the bitmap associated with the selected state of the button. | |
IlBoolean | isRepeat () const |
Indicates whether the button is in auto-repeat mode. | |
void | setHighlightedBitmap (IlvBitmap *bitmap) |
Sets the highlighted bitmap of the button. | |
void | setPeriod (IlUInt period) |
Sets the repeat period of the button. | |
void | setRepeat (IlBoolean value) |
Specifies whether the button should be in auto-repeat mode. | |
void | setSelectedBitmap (IlvBitmap *bitmap) |
Sets the selected bitmap of the button. | |
Friends | |
class | IlvDefaultButtonLFHandler |
Gadget class.
Library: ilvgadgt
The IlvButton
class is one of the simplest gadgets provided in the library. It displays a label and a bitmap inside a rectangle with a three-dimensional look.
- IlvButton -
IlvButton::IlvButton | ( | IlvDisplay * | display, | |
const char * | label, | |||
const IlvRect & | rect, | |||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new instance of the IlvButton
class with a label. The label is copied.
display | The connection to the display. | |
label | The button label. | |
rect | The size and position of the button. | |
thickness | The thickness of the button. | |
palette | The palette used by the button. |
IlvButton::IlvButton | ( | IlvDisplay * | display, | |
const IlvPoint & | point, | |||
const char * | label, | |||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new instance of the IlvButton
class with a label. The label is copied. The button size is automatically computed from label. If you want to specify the size, use the constructor that takes a rectangle as parameter.
display | The connection to the display. | |
point | The position of the button. | |
label | The button label. | |
thickness | The thickness of the button. | |
palette | The palette used by the button. |
IlvButton::IlvButton | ( | IlvDisplay * | display, | |
IlvBitmap * | bitmap, | |||
const IlvRect & | rect, | |||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new instance of the IlvButton
class with a bitmap. The bitmap is locked.
display | The connection to the display. | |
bitmap | The button bitmap. | |
rect | The size and position of the button. | |
thickness | The thickness of the button. | |
palette | The palette used by the button. |
IlvButton::IlvButton | ( | IlvDisplay * | display, | |
const IlvPoint & | point, | |||
IlvBitmap * | bitmap, | |||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new instance of the IlvButton
class with a bitmap. The bitmap is locked. The button size is automatically computed from the bitmap size. If you want to specify the size, use the constructor that takes a rectangle as parameter.
display | The connection to the display. | |
point | The position of the button. | |
bitmap | The button bitmap. | |
thickness | The thickness of the button. | |
palette | The palette used by the button. |
virtual void IlvButton::activate | ( | ) | [virtual] |
Is called when the button is released after having been pressed.
The default implementation calls the gadget callback.
virtual void IlvButton::drawGadgetItem | ( | const IlvGadgetItem * | item, | |
IlvPort * | port, | |||
const IlvRect & | rect, | |||
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [virtual] |
Draws a specific gadget item.
Redraws item in port at the location specified by rect using the clipping area clip. This method simply calls IlvGadgetItem::draw
using the item
instance.
item | The item to be redrawn. | |
port | The destination drawing port. | |
rect | The bounding box of the item. | |
t | The transformer used to draw the item. Not used. | |
clip | The clipping area. |
IlvGadgetItem::draw
. Reimplemented from IlvGadgetItemHolder.
IlvBitmap* IlvButton::getHighlightedBitmap | ( | ) | const |
Returns the bitmap associated with the highlighted state of the button.
IlUInt IlvButton::getPeriod | ( | ) | const |
IlvBitmap* IlvButton::getSelectedBitmap | ( | ) | const |
Returns the bitmap associated with the selected state of the button.
IlBoolean IlvButton::isRepeat | ( | ) | const |
void IlvButton::setHighlightedBitmap | ( | IlvBitmap * | bitmap | ) |
Sets the highlighted bitmap of the button.
The highlighted bitmap is displayed when the cursor is over the button.
bitmap | The new highlighted bitmap. The previous highlighted bitmap, if any, is unlocked, and the new one is locked. |
void IlvButton::setPeriod | ( | IlUInt | period | ) |
void IlvButton::setRepeat | ( | IlBoolean | value | ) |
Specifies whether the button should be in auto-repeat mode.
When the button is an "auto-repeat" button, the callback is invoked repeatedly until the button is released.
value | A Boolean value specifying whether the button is in auto-repeat mode (IlTrue ) or not (IlFalse ). |
void IlvButton::setSelectedBitmap | ( | IlvBitmap * | bitmap | ) |
Sets the selected bitmap of the button.
The selected bitmap is displayed when the button is clicked on.
bitmap | The new selected bitmap. The previous selected bitmap, if any, is unlocked, and the new one is locked. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.