rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvButton Class Reference

Gadget class. More...

#include <ilviews/gadgets/button.h>

Inheritance diagram for IlvButton:
IlvMessageLabel IlvGadget IlvGadgetItemHolder IlvSimpleGraphic IlvGraphic IlvArrowButton

List of all members.

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.
IlvBitmapgetHighlightedBitmap () const
 Returns the bitmap associated with the highlighted state of the button.
IlUInt getPeriod () const
 Returns the repeat period of the button.
IlvBitmapgetSelectedBitmap () 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

Detailed Description

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.

IlvButtona.gif

- IlvButton -

See also:
IlvToggle

Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Member Function Documentation

virtual void IlvButton::activate (  )  [virtual]

Is called when the button is released after having been pressed.

The default implementation calls the gadget callback.

See also:
IlvGraphic::callCallback
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.

Parameters:
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.
See also:
IlvGadgetItem::draw.

Reimplemented from IlvGadgetItemHolder.

IlvBitmap* IlvButton::getHighlightedBitmap (  )  const

Returns the bitmap associated with the highlighted state of the button.

Returns:
The bitmap associated with the highlighted state of the button.
See also:
setHighlightedBitmap, getSelectedBitmap, IlvMessageLabel::getInsensitiveBitmap
IlUInt IlvButton::getPeriod (  )  const

Returns the repeat period of the button.

This value is meaningful only if the button is in auto-repeat mode.

Returns:
The repeat period of the button in milliseconds.
See also:
setPeriod, isRepeat
IlvBitmap* IlvButton::getSelectedBitmap (  )  const

Returns the bitmap associated with the selected state of the button.

Returns:
The bitmap associated with the selected state of the button.
See also:
setSelectedBitmap, getHighlightedBitmap, IlvMessageLabel::getInsensitiveBitmap
IlBoolean IlvButton::isRepeat (  )  const

Indicates whether the button is in auto-repeat mode.

Returns:
IlTrue if the button is in auto-repeat mode.
See also:
setRepeat, getPeriod
void IlvButton::setHighlightedBitmap ( IlvBitmap bitmap  ) 

Sets the highlighted bitmap of the button.

The highlighted bitmap is displayed when the cursor is over the button.

Parameters:
bitmap The new highlighted bitmap. The previous highlighted bitmap, if any, is unlocked, and the new one is locked.
See also:
getHighlightedBitmap, setSelectedBitmap
void IlvButton::setPeriod ( IlUInt  period  ) 

Sets the repeat period of the button.

Parameters:
period The new period in milliseconds.
See also:
getPeriod, setRepeat
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.

Parameters:
value A Boolean value specifying whether the button is in auto-repeat mode (IlTrue) or not (IlFalse).
See also:
isRepeat, setPeriod
void IlvButton::setSelectedBitmap ( IlvBitmap bitmap  ) 

Sets the selected bitmap of the button.

The selected bitmap is displayed when the button is clicked on.

Parameters:
bitmap The new selected bitmap. The previous selected bitmap, if any, is unlocked, and the new one is locked.
See also:
getSelectedBitmap, setHighlightedBitmap
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© 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.