Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/msglabel.h>
Public Member Functions | |
IlvMessageLabel (IlvDisplay *display, const IlvPoint &at, const char *message, IlvAlignment alignment=IlvLeft, IlUShort thickness=0, IlvPalette *palette=0, IlBoolean copy=IlTrue) | |
Constructor. | |
IlvMessageLabel (IlvDisplay *display, const char *message, const IlvRect &rect, IlvAlignment alignment=IlvLeft, IlUShort thickness=0, IlvPalette *palette=0, IlBoolean copy=IlTrue) | |
Constructor. | |
virtual IlvGadgetItem * | applyToItems (IlvApplyGadgetItem f, IlAny arg) |
Applies the specified function to all the items of the holder. | |
IlvAlignment | getAlignment () const |
Returns the alignment of the message label. | |
IlvBitmap * | getBitmap () const |
Returns the bitmap associated with the message label. | |
IlvBitmap * | getInsensitiveBitmap () const |
Returns the insensitive bitmap of the message label. | |
const char * | getLabel () const |
Returns the label stored in the message label. | |
virtual void | getLabelOrientation (IlvOrientation &orientation, IlBoolean &flip) const |
Returns the orientation of the label. | |
virtual IlvPosition | getLabelPosition () const |
Returns the position of the label relative to the bitmap of the message label. | |
const char * | getMessage () const |
Returns the translated message of the message label. | |
char | getMnemonic () const |
Returns the mnemonic associated with the message label. | |
virtual IlvPalette * | getNormalTextPalette () const |
Returns the default palette used to draw an item. | |
virtual IlvPalette * | getOpaquePalette () const |
Returns the opaque palette used to draw opaque items. | |
IlUShort | getSpacing () const |
Returns the spacing between the label and the bitmap of the message label. | |
void | setAlignment (IlvAlignment alignment) |
Sets the alignment of this message label. | |
void | setBitmap (IlvBitmap *bitmap) |
Sets the bitmap of the message label. | |
void | setInsensitiveBitmap (IlvBitmap *bitmap) |
Sets the insensitive bitmap of the message label. | |
void | setLabel (const char *label, IlBoolean copy=IlTrue) |
Sets the label of the message label. | |
void | setLabelOrientation (IlvOrientation orientation, IlBoolean flip=IlFalse, IlBoolean redraw=IlTrue) |
Sets the orientation of the label. | |
void | setLabelPosition (IlvPosition pos, IlBoolean redraw=IlTrue) |
Sets the position of the label relative to the bitmap of the message label. | |
void | setSpacing (IlUShort spacing, IlBoolean redraw=IlTrue) |
Sets the spacing between the label and the bitmap of the message label. | |
Friends | |
class | IlvDefaultMessageLabelLFHandler |
Gadget class.
Library: ilvgadgt
The IlvMessageLabel
class displays a message and an optional bitmap. A message label is a character string that can be translated to various languages to create localized applications. Translated strings are stored in a message database that can be associated with the current instance of IlvDisplay
. Both sensitive and insensitive bitmaps can be specified for a message label. The insensitive bitmap will be used when the message label is insensitive. The message label can be placed to any position relative to the bitmap. The default IlvMessageLabel
position is IlvCenter
. This object has no associated default interactor.
- IlvMessageLabel -
IlvMessageLabel::IlvMessageLabel | ( | IlvDisplay * | display, | |
const char * | message, | |||
const IlvRect & | rect, | |||
IlvAlignment | alignment = IlvLeft , |
|||
IlUShort | thickness = 0 , |
|||
IlvPalette * | palette = 0 , |
|||
IlBoolean | copy = IlTrue | |||
) |
Constructor.
Initializes a new instance of the IlvMessageLabel
class.
display | The connection to the display. | |
message | The label of the message label. | |
rect | The size and position of the message label. | |
alignment | The alignment of the message label inside its bounding box. | |
thickness | The thickness of the message label. | |
palette | The palette used by the message label. | |
copy | A Boolean value specifying whether a message should be copied. If the value is IlFalse |
IlvMessageLabel::IlvMessageLabel | ( | IlvDisplay * | display, | |
const IlvPoint & | at, | |||
const char * | message, | |||
IlvAlignment | alignment = IlvLeft , |
|||
IlUShort | thickness = 0 , |
|||
IlvPalette * | palette = 0 , |
|||
IlBoolean | copy = IlTrue | |||
) |
Constructor.
Initializes a new instance of the IlvMessageLabel
class. Since only the position of the object is given, its size is computed according to its contents.
display | The connection to the display. | |
message | The label of the message label. | |
at | The position of the message label. | |
alignment | The alignment of the message label inside its bounding box. | |
thickness | The thickness of the message label. | |
palette | The palette used by the message label. | |
copy | A Boolean value specifying whether a message should be copied. If the value is IlFalse |
virtual IlvGadgetItem* IlvMessageLabel::applyToItems | ( | IlvApplyGadgetItem | func, | |
IlAny | arg | |||
) | [virtual] |
Applies the specified function to all the items of the holder.
func | The function to be applied. | |
arg | The argument that will be passed to the function func. |
IlvApplyGadgetItem
for details. IlvApplyGadgetItem
, recomputeAllItems
, getItemByName
. Reimplemented from IlvGadgetItemHolder.
IlvAlignment IlvMessageLabel::getAlignment | ( | ) | const |
Returns the alignment of the message label.
IlvBitmap* IlvMessageLabel::getBitmap | ( | ) | const |
Returns the bitmap associated with the message label.
0
if there is none. IlvBitmap* IlvMessageLabel::getInsensitiveBitmap | ( | ) | const |
Returns the insensitive bitmap of the message label.
The insensitive bitmap is displayed by the message label when it is set to insensitive. If only a sensitive bitmap is provided, and if the message label is set to insensitive, a default insensitive bitmap is automatically computed using the sensitive bitmap.
0
if there is none. const char* IlvMessageLabel::getLabel | ( | ) | const |
Returns the label stored in the message label.
0
if no label has been set. virtual void IlvMessageLabel::getLabelOrientation | ( | IlvOrientation & | orientation, | |
IlBoolean & | flip | |||
) | const [virtual] |
Returns the orientation of the label.
orientation | The label orientation. | |
flip | A Boolean value specifying whether the label is drawn from top to bottom or from bottom to top. |
Reimplemented from IlvGadgetItemHolder.
virtual IlvPosition IlvMessageLabel::getLabelPosition | ( | ) | const [virtual] |
Returns the position of the label relative to the bitmap of the message label.
Reimplemented from IlvGadgetItemHolder.
const char* IlvMessageLabel::getMessage | ( | ) | const |
Returns the translated message of the message label.
0
if no label is associated with this message label. If the message stored in this object has no translation in the current language, the method simply returns the message itself. char IlvMessageLabel::getMnemonic | ( | ) | const |
Returns the mnemonic associated with the message label.
0
if there is none. virtual IlvPalette* IlvMessageLabel::getNormalTextPalette | ( | ) | const [virtual] |
Returns the default palette used to draw an item.
Implements IlvGadgetItemHolder.
virtual IlvPalette* IlvMessageLabel::getOpaquePalette | ( | ) | const [virtual] |
Returns the opaque palette used to draw opaque items.
Reimplemented from IlvGadgetItemHolder.
IlUShort IlvMessageLabel::getSpacing | ( | ) | const |
Returns the spacing between the label and the bitmap of the message label.
void IlvMessageLabel::setAlignment | ( | IlvAlignment | alignment | ) |
Sets the alignment of this message label.
Sets the alignment of the whole message label inside its bounding box. Note that the message label is not redrawn.
alignment | The alignment of the message label. Valid values are: IlvLeft , IlvCenter , IlvRight . |
void IlvMessageLabel::setBitmap | ( | IlvBitmap * | bitmap | ) |
Sets the bitmap of the message label.
Allows you to set a bitmap to this message label. If the message label already owns a bitmap, this bitmap is unlocked. The new bitmap is locked. Note that the message label is not redrawn.
bitmap | The new bitmap. |
void IlvMessageLabel::setInsensitiveBitmap | ( | IlvBitmap * | bitmap | ) |
Sets the insensitive bitmap of the message label.
Allows you to set an insensitive bitmap for this message label. If the message label already owns an insensitive bitmap, this bitmap is unlocked. The new bitmap is locked.
bitmap | The new insensitive bitmap. |
void IlvMessageLabel::setLabel | ( | const char * | label, | |
IlBoolean | copy = IlTrue | |||
) |
Sets the label of the message label.
label | The new label to be set. 0 is a valid value. | |
copy | A Boolean value specifying whether a message should be copied. If the value is IlFalse |
getLabel, getMessage
void IlvMessageLabel::setLabelOrientation | ( | IlvOrientation | orientation, | |
IlBoolean | flip = IlFalse , |
|||
IlBoolean | redraw = IlTrue | |||
) |
Sets the orientation of the label.
orientation | The label orientation. Valid values are: IlvHorizontal and IlvVertical . | |
flip | A Boolean value specifying whether the label is drawn from top to bottom or from bottom to top. | |
redraw | A Boolean value specifying whether the message label should be redrawn. |
void IlvMessageLabel::setLabelPosition | ( | IlvPosition | pos, | |
IlBoolean | redraw = IlTrue | |||
) |
Sets the position of the label relative to the bitmap of the message label.
pos | The new position of the label. Valid positions are: IlvLeft , IlvTopLeft , IlvTop , IlvTopRight , IlvRight , IlvBottomRight , IlvBottom , IlvBottomLeft , IlvCenter . | |
redraw | A Boolean value specifying whether the message label should be redrawn. |
Sets the spacing between the label and the bitmap of the message label.
spacing | The new spacing. | |
redraw | A Boolean value specifying whether the message label should be redrawn. |
© 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.