Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/combo.h>
Public Member Functions | |
IlvComboBox (IlvDisplay *display, const IlvPoint &point, const char *label, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlvComboBox (IlvDisplay *display, const IlvRect &rect, const char *label, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
virtual IlvGadgetItem * | createItem (const char *label, IlvGraphic *g=0, IlvBitmap *bitmap=0, IlvBitmap *sbitmap=0, IlBoolean copy=IlTrue) const |
Returns a new gadget item. More... | |
virtual void | empty () |
Empties the list. More... | |
virtual IlvPalette * | getNormalTextPalette () const |
Returns the default palette used to draw an item. More... | |
virtual IlvPalette * | getOpaquePalette () const |
Returns the opaque palette used to draw opaque items. More... | |
const char * | getSelection () const |
Returns the string displayed in the combo box. More... | |
IlvPopupMenu * | getSubMenu () const |
Returns a pointer to the pop-up menu attached to the combo box. More... | |
virtual IlBoolean | isListVisible () const |
Indicates whether the list of items of the combo box is visible. More... | |
void | itemsBBox (IlvRect &labelRect, IlvRect &arrowRect, const IlvTransformer *t=0) const |
The bounding boxes of the main two components of the combo box. More... | |
virtual void | labelChanged () |
Is called by the interactor whenever the label of the text field changes. More... | |
virtual void | setItems (IlvGadgetItem *const *items, IlUShort count) |
Replaces the entire list of items. More... | |
virtual void | setLabel (const char *, IlBoolean redraw=IlFalse) |
Sets the label of the text field. More... | |
void | setSelected (IlUShort i, IlBoolean redraw=IlTrue) |
Sets the selected item in the combo box. More... | |
IlShort | whichSelected () const |
Returns the index of the selected item. More... | |
Public Member Functions inherited from IlvTextField | |
IlvTextField (IlvDisplay *display, const char *label, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlvTextField (IlvDisplay *display, const IlvPoint &point, const char *label, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
void | addChangeCallback (IlvGraphicCallback callback) |
Adds a Label Changed callback. More... | |
void | addChangeCallback (IlSymbol *callbackName) |
Adds a named Label Changed callback. More... | |
void | addChangeCallback (IlvGraphicCallback callback, IlAny arg) |
Adds a Label Changed callback. More... | |
void | addChangeCallback (IlSymbol *callbackName, IlAny arg) |
Adds a named Label Changed callback. More... | |
virtual const char * | check (IlUShort character) |
Is called by the interactor for each key down event that corresponds to a regular character. More... | |
void | ensureVisible (IlShort position, const IlvTransformer *t=0) |
Ensures that the character located at the specified position is visible. More... | |
IlvPosition | getAlignment () const |
Returns the alignment of the text field. More... | |
IlvGraphicCallback | getChangeCallback () const |
Returns a pointer to the first unnamed callback in the Label Changed callback list. More... | |
IlSymbol * | getChangeCallbackName () const |
Returns the name of the first named callback in the Label Changed callback list. More... | |
IlBoolean | getChangeFocusOnValidation () const |
Indicates whether the text field moves the keyboard focus to the next gadget once validated. More... | |
IlShort | getCursorPosition () const |
Returns the cursor position. More... | |
IlShort | getEndSelection () const |
Returns the index of the last selected character. More... | |
IlFloat | getFloatValue () const |
Converts the text field contents to a floating point value and returns the result of the conversion. More... | |
IlInt | getIntValue () const |
Converts the text field contents to an integer and returns the result of the conversion. More... | |
const char * | getLabel () const |
Returns the label displayed by the text field. More... | |
IlShort | getMaxChar () const |
Returns the maximum number of characters that the user can type in the text field. More... | |
virtual const char * | getMessage () const |
Returns the message displayed by this text field. More... | |
IlShort | getStartSelection () const |
Returns the index of the first selected character. More... | |
IlShort | getTextPosition () const |
Returns the index of the first visible character of the text field. More... | |
virtual IlBoolean | handleControl (IlUShort character) |
Is called by the interactor to handle control keys. More... | |
IlBoolean | isCursorShown () const |
Indicates whether the cursor is visible. More... | |
IlBoolean | isEditable () const |
Indicates whether the text field can be edited. More... | |
IlShort | pointToPosition (const IlvPoint &point, const IlvTransformer *t=0) const |
Returns the index of the character located at the specified point. More... | |
virtual void | removeSelection () |
Removes the selected label from the text field. More... | |
void | setAlignment (IlvPosition alignment) |
Sets the alignment of the text field. More... | |
void | setChangeCallback (IlvGraphicCallback callback) |
Sets a Label Changed callback. More... | |
void | setChangeCallback (IlSymbol *callbackName) |
Sets a named Label Changed callback. More... | |
void | setChangeCallback (IlvGraphicCallback callback, IlAny arg) |
Sets a Label Changed callback. More... | |
void | setChangeCallback (IlSymbol *callbackName, IlAny arg) |
Sets a named Label Changed callback. More... | |
void | setChangeFocusOnValidation (IlBoolean value) |
Specifies whether the text field should move the keyboard focus to the next gadget once validated. More... | |
void | setCursorPosition (IlShort position) |
Sets the cursor position. More... | |
void | setEditable (IlBoolean value) |
Specifies whether the text field can be edited. More... | |
void | setEndSelection (IlShort position) |
Sets the index of the last selected character. More... | |
void | setMaxChar (IlShort count) |
Sets the maximum number of characters that the user can type in the text field. More... | |
void | setSelection (IlShort start, IlShort end) |
Selects a portion of the text field content. More... | |
void | setStartSelection (IlShort position) |
Sets the index of the first selected character. More... | |
void | setTextPosition (IlShort position) |
Sets the index of the first visible character of the text field. More... | |
void | setValue (IlInt value, IlBoolean redraw=IlFalse) |
Sets the text field label to an integer value. More... | |
void | setValue (IlFloat value, const char *format=0, IlBoolean redraw=IlFalse) |
Sets the text field label to a floating-point value. More... | |
void | showCursor (IlBoolean value, IlBoolean redraw=IlFalse) |
Specifies whether the cursor should be visible. More... | |
virtual void | validate () |
Is called by the interactor when the user presses the Return or the Enter key. More... | |
Public Member Functions inherited from IlvListGadgetItemHolder | |
virtual void | addLabel (const char *label, IlAny data=0) |
Adds an item with a label to the holder list. More... | |
virtual IlvGadgetItem * | applyToItems (IlvApplyGadgetItem func, IlAny arg) |
Applies the specified function to all the items of the holder. More... | |
virtual int | compareItems (const char *string1, const char *string2, IlAny value1, IlAny value2) |
Compares a pair of items. More... | |
virtual void | deSelectAll () |
Deselects all the items. More... | |
IlUShort | getCardinal () const |
Returns the number of items stored in this holder. More... | |
IlShort | getFirstSelectedItem () const |
Returns the index of the first selected item. More... | |
IlShort | getIndex (const IlvGadgetItem *item, IlUShort start=0, IlUShort stop=(IlUShort)-1) const |
Returns the index of the specified item in the holder list. More... | |
IlvGadgetItem * | getItem (IlUShort index) const |
Returns an item from its position in the holder. More... | |
IlAny | getItemData (IlUShort index) const |
Returns an item user data. More... | |
IlvGadgetItem *const * | getItems (IlUShort &count) const |
Returns the array of all the items. More... | |
const char * | getLabel (IlUShort index) const |
Returns the i th label of the list. More... | |
const char *const * | getLabels (IlUShort &count) const |
Returns an array of all the items labels. More... | |
IlShort | getPosition (const char *label, IlUShort start=0) const |
Returns the position of an item using its label. More... | |
IlUShort const * | getSelectionIndices (IlUShort &count) const |
Returns an array containing the indexes of the selected item. More... | |
const char *const * | getSelections (IlUShort &count) const |
Returns an array of the selected items. More... | |
IlAny const * | getUserDataArray (IlUShort &count) const |
Returns an array of all the user data for the items. More... | |
IlUShort | insertBitmap (IlvBitmap *bitmap, IlShort pos=-1) |
Inserts an item with a bitmap at the given position in the holder list. More... | |
IlUShort | insertGraphic (IlvGraphic *graphic, IlShort pos=-1) |
Inserts an item with a graphic as picture at a given position in the holder list. More... | |
IlUShort | insertItem (IlvGadgetItem *item, IlShort index=-1) |
Inserts an item at a given position in the holder's list. More... | |
virtual void | insertLabel (IlUShort pos, const char *label, IlAny data=0) |
Inserts an item with a label at a given position in the holder list. More... | |
IlBoolean | isSelected (IlUShort index) const |
Specifies whether the item whose position is specified is selected. More... | |
void | removeItem (IlUShort index, IlBoolean destroy=IlTrue) |
Removes an item from the holder. More... | |
void | removeLabel (IlUShort index) |
Removes and destroys an item. More... | |
void | setItemData (IlUShort index, IlAny itemData) |
Sets an item user data. More... | |
void | setLabel (IlUShort index, const char *label, IlBoolean copy) |
Modifies the label of an item. More... | |
virtual void | setLabels (const char *const *labels, IlAny const *itemData, IlUShort count, IlBoolean copy=IlTrue) |
Replaces the entire list of items. More... | |
virtual void | setLabels (const char *const *labels, IlUShort count, IlBoolean copy=IlTrue) |
Replaces the entire list of items. More... | |
virtual void | sort (IlvListCompareFunction func=0) |
Sorts the items. More... | |
Public Member Functions inherited from IlvGadgetItemHolder | |
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 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... | |
Static Public Member Functions | |
static IlSymbol * | OpenListSymbol () |
Returns the symbol of the Open List callback. More... | |
Friends | |
class | IlvComboBoxWLFHandler |
class | IlvDefaultComboBoxLFHandler |
Additional Inherited Members | |
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.
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 |
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 |
|
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.
|
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.
|
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 |
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 |
Returns the symbol of the Open List callback.
The Open List callback is invoked when the user opens the combo box list.
|
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.
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.