Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/combo.h>
Public Member Functions | |
IlvComboBox (IlvDisplay *display, const IlvRect &rect, const char *label, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
IlvComboBox (IlvDisplay *display, const IlvPoint &point, const char *label, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
virtual IlvGadgetItem * | createItem (const char *label, IlvGraphic *g=0, IlvBitmap *bitmap=0, IlvBitmap *sbitmap=0, IlBoolean copy=IlTrue) const |
Returns a new gadget item. | |
virtual void | empty () |
Empties the list. | |
const char * | getLabel (IlUShort pos) const |
Returns the i th label of the list. | |
const char * | getLabel () const |
Returns the label displayed by the text field. | |
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. | |
const char * | getSelection () const |
Returns the string displayed in the combo box. | |
IlvPopupMenu * | getSubMenu () const |
Returns a pointer to the pop-up menu attached to the combo box. | |
IlBoolean | isEditable () const |
Indicates whether the text field can be edited. | |
virtual IlBoolean | isListVisible () const |
Indicates whether the list of items of the combo box is visible. | |
void | itemsBBox (IlvRect &labelRect, IlvRect &arrowRect, const IlvTransformer *t=0) const |
The bounding boxes of the main two components of the combo box. | |
virtual void | labelChanged () |
Is called by the interactor whenever the label of the text field changes. | |
virtual void | setItems (IlvGadgetItem *const *items, IlUShort count) |
Replaces the entire list of items. | |
virtual void | setLabel (const char *, IlBoolean redraw=IlFalse) |
Sets the label of the text field. | |
void | setSelected (IlUShort i, IlBoolean redraw=IlTrue) |
Sets the selected item in the combo box. | |
IlShort | whichSelected () const |
Returns the index of the selected item. | |
Static Public Member Functions | |
static IlSymbol * | OpenListSymbol () |
Returns the symbol of the Open List callback. | |
Friends | |
class | IlvComboBoxWLFHandler |
class | IlvDefaultComboBoxLFHandler |
Gadget class.
Library: ilvgadgt
The IlvComboBox
class combines a text field (IlvTextField
class) with a pop-up menu displaying a set of predefined entries from which the user can choose.
- A Combo Box -
The user can enter a character string in the text field, or click on the arrow appearing on the right side of the field and select one of the choices from the menu that is displayed. You can access the pop-up menu attached to the combo box to modify its behavior.
IlvComboBox::IlvComboBox | ( | IlvDisplay * | display, | |
const IlvPoint & | point, | |||
const char * | label, | |||
const char *const * | labels = 0 , |
|||
IlUShort | count = 0 , |
|||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new instance of the IlvComboBox
class. The size of the combo box is computed from the label parameter. If you want to specify the size, use the other constructor.
display | The connection to the display. | |
point | The position of the combo box. | |
label | The label of the combo box. | |
labels | An array containing the predefined labels of the combo box. | |
count | The number of elements in the labels array. | |
thickness | The thickness of the combo box. | |
palette | The palette used by the combo box. |
IlvComboBox::IlvComboBox | ( | IlvDisplay * | display, | |
const IlvRect & | rect, | |||
const char * | label, | |||
const char *const * | labels = 0 , |
|||
IlUShort | count = 0 , |
|||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
n Initializes a new instance of the class IlvComboBox
.
display | The connection to the display. | |
rect | The size and position of the combo box. | |
label | The label of the combo box. | |
labels | An array containing the predefined labels of the combo box. | |
count | The number of elements in the labels array. | |
thickness | The thickness of the combo box. | |
palette | The palette used by the combo box. |
virtual IlvGadgetItem* IlvComboBox::createItem | ( | const char * | label, | |
IlvGraphic * | graphic = 0 , |
|||
IlvBitmap * | bitmap = 0 , |
|||
IlvBitmap * | selbitmap = 0 , |
|||
IlBoolean | copy = IlTrue | |||
) | const [virtual] |
Returns a new gadget item.
You can override this member function in a subclass to create your own items.
label | The item label. | |
graphic | The IlvGraphic object representing the picture associated with the item. | |
bitmap | The IlvBitmap object representing the picture associated with the item. | |
selbitmap | The IlvBitmap object representing the picture of the item when it is selected. | |
copy | A Boolean value specifying whether a label should be copied. If the value is IlFalse |
[note] If both the second and third parameters are not null, only the second parameter is used.
The created gadget item.
Reimplemented from IlvGadgetItemHolder.
virtual void IlvComboBox::empty | ( | ) | [virtual] |
const char* IlvComboBox::getLabel | ( | IlUShort | index | ) | const |
Returns the i
th label of the list.
index | The item index. |
index
is not in the holder range, 0
is returned. Reimplemented from IlvListGadgetItemHolder.
const char* IlvComboBox::getLabel | ( | ) | const |
Returns the label displayed by the text field.
Reimplemented from IlvTextField.
virtual IlvPalette* IlvComboBox::getNormalTextPalette | ( | ) | const [virtual] |
Returns the default palette used to draw an item.
Implements IlvGadgetItemHolder.
virtual IlvPalette* IlvComboBox::getOpaquePalette | ( | ) | const [virtual] |
Returns the opaque palette used to draw opaque items.
Reimplemented from IlvGadgetItemHolder.
const char* IlvComboBox::getSelection | ( | ) | const [virtual] |
Returns the string displayed in the combo box.
Reimplemented from IlvListGadgetItemHolder.
IlvPopupMenu* IlvComboBox::getSubMenu | ( | ) | const |
Returns a pointer to the pop-up menu attached to the combo box.
IlvScrolledComboBox
subclass has no associated submenu. Therefore, the IlvComboBox::getSubMenu
member function always returns 0
. To get the IlvStringList
of an IlvScrolledComboBox
object, use IlvScrolledComboBox::getStringList
instead. IlBoolean IlvComboBox::isEditable | ( | ) | const |
Indicates whether the text field can be edited.
The contents of a noneditable text field can be copied and localized. See IlvTextField::getMessage
.
IlTrue
if the text field can be edited and IlFalse
otherwise. Reimplemented from IlvTextField.
virtual IlBoolean IlvComboBox::isListVisible | ( | ) | const [virtual] |
Indicates whether the list of items of the combo box is visible.
IlTrue
if the list of items of the combo box is visible and IlFalse
if it is not. Reimplemented in IlvScrolledComboBox.
void IlvComboBox::itemsBBox | ( | IlvRect & | labelRect, | |
IlvRect & | arrowRect, | |||
const IlvTransformer * | t = 0 | |||
) | const |
The bounding boxes of the main two components of the combo box.
labelRect | The bounding box of the text field. | |
arrowRect | The bounding box of the arrow. | |
t | The transformer applied to the combo box. |
virtual void IlvComboBox::labelChanged | ( | ) | [virtual] |
Is called by the interactor whenever the label of the text field changes.
The default implementation calls the Label Changed callback.
Reimplemented from IlvTextField.
static IlSymbol* IlvComboBox::OpenListSymbol | ( | ) | [static] |
Returns the symbol of the Open List callback.
The Open List callback is invoked when the user opens the combo box list.
virtual void IlvComboBox::setItems | ( | IlvGadgetItem *const * | items, | |
IlUShort | count | |||
) | [virtual] |
Replaces the entire list of items.
Sets the items of the holder to items, which must be an array of count IlvGadgetItem
objects. Items are not copied, but the deletion of the array items is the responsibility of the caller.
items | The new items. | |
count | The number of items in items. |
Reimplemented from IlvListGadgetItemHolder.
virtual void IlvComboBox::setLabel | ( | const char * | label, | |
IlBoolean | redraw = IlFalse | |||
) | [virtual] |
Sets the label of the text field.
label | The new label of the text field. The old label is deleted and the new one is copied. | |
redraw | A Boolean value specifying whether the text field should be redrawn. |
Reimplemented from IlvTextField.
Sets the selected item in the combo box.
index | The index of the selected item. | |
redraw | A Boolean value specifying whether the combo box should be redrawn. |
IlShort IlvComboBox::whichSelected | ( | ) | const |
Returns the index of the selected item.
-1
. © 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.