Gadget class that displays a message and a bitmap. More...
#include <ilviews/gadgets/msglabel.h>
Public Member Functions | |
IlvMessageLabel (IlvDisplay *display, const char *message, const IlvRect &rect, IlvAlignment alignment=IlvLeft, IlUShort thickness=0, IlvPalette *palette=0, IlBoolean copy=IlTrue) | |
Constructor. More... | |
IlvMessageLabel (IlvDisplay *display, const IlvPoint &at, const char *message, IlvAlignment alignment=IlvLeft, IlUShort thickness=0, IlvPalette *palette=0, IlBoolean copy=IlTrue) | |
Constructor. More... | |
virtual IlvGadgetItem * | applyToItems (IlvApplyGadgetItem f, IlAny arg) |
Applies the specified function to all the items of the holder. More... | |
virtual IlvAlignment | getAlignment () const |
Returns the alignment of the message label. More... | |
IlvBitmap * | getBitmap () const |
Returns the bitmap associated with the message label. More... | |
IlvBitmap * | getInsensitiveBitmap () const |
Returns the insensitive bitmap of the message label. More... | |
const char * | getLabel () const |
Returns the label stored in the message label. More... | |
virtual void | getLabelOrientation (IlvOrientation &orientation, IlBoolean &flip) const |
Returns the orientation of the label. More... | |
virtual IlvPosition | getLabelPosition () const |
Returns the position of the label relative to the bitmap of the message label. More... | |
const char * | getMessage () const |
Returns the translated message of the message label. More... | |
char | getMnemonic () const |
Returns the mnemonic associated with the message label. More... | |
virtual const IlvPalette * | getNormalTextPalette () const |
Returns the default palette used to draw an item. More... | |
virtual const IlvPalette * | getOpaquePalette () const |
Returns the opaque palette used to draw opaque items. More... | |
IlUShort | getSpacing () const |
Returns the spacing between the label and the bitmap of the message label. More... | |
virtual void | setAlignment (IlvAlignment alignment) |
Sets the alignment of this message label. More... | |
void | setBitmap (IlvBitmap *bitmap) |
Sets the bitmap of the message label. More... | |
void | setInsensitiveBitmap (IlvBitmap *bitmap) |
Sets the insensitive bitmap of the message label. More... | |
void | setLabel (const char *label, IlBoolean copy=IlTrue) |
Sets the label of the message label. More... | |
void | setLabelOrientation (IlvOrientation orientation, IlBoolean flip=IlFalse, IlBoolean redraw=IlTrue) |
Sets the orientation of the label. More... | |
void | setLabelPosition (IlvPosition pos, IlBoolean redraw=IlTrue) |
Sets the position of the label relative to the bitmap of the message label. More... | |
void | setSpacing (IlUShort spacing, IlBoolean redraw=IlTrue) |
Sets the spacing between the label and the bitmap of the message label. More... | |
Public Member Functions inherited from IlvGadgetItemHolder | |
virtual IlvGadgetItem * | createItem (const char *label, IlvGraphic *graphic=0, IlvBitmap *bitmap=0, IlvBitmap *selbitmap=0, IlBoolean copy=IlTrue) const |
Returns a new gadget item. More... | |
virtual void | drawGadgetItem (const IlvGadgetItem *item, IlvPort *port, const IlvRect &rect, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws a specific gadget item. More... | |
IlvGadgetItem * | getCallbackItem () const |
Returns the item that triggered a callback. More... | |
IlvGadgetItem * | getDragDropTarget () const |
Returns the target item of a drag-and-drop operation. More... | |
IlvGraphic * | getDraggedImage () const |
Returns the graphic object used to draw the ghost image during a drag-and-drop operation. More... | |
IlvGadgetItem * | getDraggedItem () const |
Returns the item that is being dragged during a drag-and-drop operation. More... | |
IlvGadgetItem * | getEditedItem () const |
Returns the item that is being edited. More... | |
virtual const IlvPalette * | getHighlightTextPalette () const |
Returns the highlight palette used to draw the label of highlighted items. More... | |
virtual IlvGadgetItem * | getItemByName (const char *name) const |
Returns the item whose name is specified. More... | |
IlvGadgetItem * | getToolTipItem () const |
Returns the item that is displaying a tooltip. More... | |
virtual void | initReDrawItems () |
Begins a redraw session. More... | |
virtual void | recomputeAllItems () |
Recomputes the size of all the items managed by the holder. More... | |
virtual void | reDrawItems () |
Ends a redraw session. More... | |
void | setDragDropTarget (IlvGadgetItem *item) |
Sets the target item of a drag-and-drop operation. More... | |
void | setDraggedImage (IlvGraphic *graphic) |
Sets the graphic object used to draw the ghost image during a drag-and-drop operation. More... | |
void | setDraggedItem (IlvGadgetItem *item) |
Sets the dragged item. More... | |
Friends | |
class | IlvDefaultMessageLabelLFHandler |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvGadgetItemHolder | |
static IlSymbol * | AbortDragItemCallbackType () |
Returns the callback type of the Abort Drag callback. More... | |
static IlSymbol * | AbortEditItemCallbackType () |
Returns the callback type of the Abort Edit callback. More... | |
static IlSymbol * | ActivateCallbackType () |
Returns the callback type of the Activate callback. More... | |
static IlSymbol * | DragItemCallbackType () |
Returns the callback type of the Drag Item callback. More... | |
static IlSymbol * | EndDragItemCallbackType () |
Returns the callback type of the End Drag callback. More... | |
static IlSymbol * | EndEditItemCallbackType () |
Returns the callback type of the End Edit callback. More... | |
static IlSymbol * | StartDragItemCallbackType () |
Returns the callback type of the Start Drag callback. More... | |
static IlSymbol * | StartEditItemCallbackType () |
Returns the callback type of the Start Edit callback. More... | |
Protected Member Functions inherited from IlvGadgetItemHolder | |
virtual void | abortDragItem () |
Is called when a drag-and-drop operation is aborted. More... | |
virtual void | abortEdit (IlvGadgetItem *item) |
Is called when the editing of the specified item is aborted. More... | |
virtual void | drawDraggedImage (const IlvPoint &point, const IlvTransformer *t) |
Is called to draw the ghost image during a drag-and-drop operation. More... | |
virtual void | endDragItem (const IlvPoint &point) |
Is called when a drag-and-drop operation is finished. More... | |
virtual void | endEdit (IlvGadgetItem *item) |
Is called after an item has been edited. More... | |
virtual void | itemActivated (IlvGadgetItem *item) |
Is called when an item is activated. More... | |
virtual void | itemDeSelected (IlvGadgetItem *item) |
Is called when an item is deselected. More... | |
virtual void | itemDragged (const IlvPoint &point) |
Is called each time the user moves the mouse during a drag-and-drop operation. More... | |
virtual void | itemHighlighted (IlvGadgetItem *item) |
Is called when an item is highlighted or unhighlighted. More... | |
virtual void | itemSelected (IlvGadgetItem *item) |
Is called when an item is selected. More... | |
virtual void | startDragItem (IlvGadgetItem *item) |
Is called when a drag-and-drop operation begins. More... | |
virtual void | startEdit (IlvGadgetItem *item) |
Is called when an item is edited. More... | |
Gadget class that displays a message and a bitmap.
Library: ilvgadgt
The 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 -
IlvMessageDatabase
, IlvBitmap
.Name | Type | Equivalent methods |
---|---|---|
alignment | Direction | getAlignment() , setAlignment() |
bitmap | Bitmap | getBitmap() , setBitmap() |
insensitiveBitmap | Bitmap | getInsensitiveBitmap() , setInsensitiveBitmap() |
label | String | getLabel() , setLabel() |
labelPosition | Direction | getLabelPosition() , setLabelPosition() |
opaque | Boolean | isTransparent() , setTransparent() |
spacing | UInt | getSpacing() , setSpacing() |
labelOrientation | Direction | getLabelOrientation() , setLabelOrientation() |
flipLabel | Boolean | getLabelOrientation() , setLabelOrientation() |
Graphic property | CSS property | Type |
---|---|---|
Background color | background-color | Color |
Text color | color | Color |
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 , then you must allocate some memory for the message because in any case the message characters are deleted from the memory by the IlvMessageLabel. |
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 , then you must allocate some memory for the message because in any case the message characters are deleted from the memory by the IlvMessageLabel. |
|
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
, recomputeAllItems()
, getItemByName()
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
Returns the alignment of the message label.
setAlignment()
, setLabelPosition()
. IlvBitmap* IlvMessageLabel::getBitmap | ( | ) | const |
Returns the bitmap associated with the message label.
0
if there is none. setBitmap()
, setInsensitiveBitmap()
. 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. setInsensitiveBitmap()
, setBitmap()
. const char* IlvMessageLabel::getLabel | ( | ) | const |
Returns the label stored in the message label.
0
if no label has been set. setLabel()
, getMessage()
.
|
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. |
setLabelOrientation()
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
Returns the position of the label relative to the bitmap of the message label.
setLabelPosition()
, setAlignment()
. 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. getLabel()
, IlvMessageDatabase
. char IlvMessageLabel::getMnemonic | ( | ) | const |
Returns the mnemonic associated with the message label.
0
if there is none. setLabel()
.
|
virtual |
Returns the default palette used to draw an item.
Implements IlvGadgetItemHolder.
|
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.
setSpacing()
, setLabelPosition()
.
|
virtual |
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 . |
getAlignment()
, getLabelPosition()
. 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. |
getBitmap()
, getInsensitiveBitmap()
. 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. |
getInsensitiveBitmap()
, getBitmap()
. 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 , then you must allocate some memory for the message because in any case the message characters are deleted from the memory by the IlvMessageLabel. |
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. |
getLabelOrientation()
. 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. |
getLabelPosition()
, getAlignment()
. 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. |
getSpacing()
, getLabelPosition()
.