Rogue Wave Views
Gadgets Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Friends
IlvScrolledComboBox Class Reference

Gadget class. More...

#include <ilviews/gadgets/scombo.h>

Inheritance diagram for IlvScrolledComboBox:
IlvComboBox IlvTextField IlvListGadgetItemHolder IlvGadget IlvGadgetItemHolder IlvSimpleGraphic IlvStylable IlvGraphic IlvValueInterface

Public Member Functions

 IlvScrolledComboBox (IlvDisplay *display, const IlvPoint &point, const char *label, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor. More...
 
 IlvScrolledComboBox (IlvDisplay *display, const IlvRect &rect, const char *label, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor. More...
 
void disableLargeList ()
 Disables the large list mode. More...
 
void enableLargeList (IlvPosition pos=IlvLeft)
 Enables the large list mode. More...
 
IlvStringListgetStringList () const
 Returns a pointer to the string list encapsulated by the scrolled combo box. More...
 
IlUShort getVisibleItems () const
 Returns the number of visible items in the string list. More...
 
IlvPosition hasLargeList () const
 Indicates whether the large list mode is used. More...
 
virtual void hideList ()
 Hides the string list. More...
 
virtual IlBoolean isListVisible () const
 Indicates whether the list of items of the combo box is visible. More...
 
void setVisibleItems (IlUShort count)
 Sets the number of visible items in the string list. More...
 
virtual void showList (IlBoolean grab=IlTrue)
 Displays the string list. More...
 
- Public Member Functions inherited from 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. 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 IlvGadgetItemcreateItem (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 IlvPalettegetNormalTextPalette () const
 Returns the default palette used to draw an item. More...
 
virtual IlvPalettegetOpaquePalette () const
 Returns the opaque palette used to draw opaque items. More...
 
const char * getSelection () const
 Returns the string displayed in the combo box. More...
 
IlvPopupMenugetSubMenu () const
 Returns a pointer to the pop-up menu attached to the combo box. 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...
 
IlSymbolgetChangeCallbackName () 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 IlvGadgetItemapplyToItems (IlvApplyGadgetItem, IlAny)
 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...
 
IlvGadgetItemgetItem (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 indicated 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...
 
IlvGadgetItemgetCallbackItem () const
 Returns the item that triggered a callback. More...
 
IlvGadgetItemgetDragDropTarget () const
 Returns the target item of a drag-and-drop operation. More...
 
IlvGraphicgetDraggedImage () const
 Returns the graphic object used to draw the ghost image during a drag-and-drop operation. More...
 
IlvGadgetItemgetDraggedItem () const
 Returns the item that is being dragged during a drag-and-drop operation. More...
 
IlvGadgetItemgetEditedItem () const
 Returns the item that is being edited. More...
 
virtual IlvPalettegetHighlightTextPalette () const
 Returns the highlight palette used to draw the label of highlighted items. More...
 
virtual IlvGadgetItemgetItemByName (const char *name) const
 Returns the item whose name is specified. More...
 
IlvGadgetItemgetToolTipItem () 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 IlvDefaultScrolledComboBoxLFHandler
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvComboBox
static IlSymbolOpenListSymbol ()
 Returns the symbol of the Open List callback. More...
 
- Static Public Member Functions inherited from IlvGadgetItemHolder
static IlSymbolAbortDragItemCallbackType ()
 Returns the callback type of the Abort Drag callback. More...
 
static IlSymbolAbortEditItemCallbackType ()
 Returns the callback type of the Abort Edit callback. More...
 
static IlSymbolActivateCallbackType ()
 Returns the callback type of the Activate callback. More...
 
static IlSymbolDragItemCallbackType ()
 Returns the callback type of the Drag Item callback. More...
 
static IlSymbolEndDragItemCallbackType ()
 Returns the callback type of the End Drag callback. More...
 
static IlSymbolEndEditItemCallbackType ()
 Returns the callback type of the End Edit callback. More...
 
static IlSymbolStartDragItemCallbackType ()
 Returns the callback type of the Start Drag callback. More...
 
static IlSymbolStartEditItemCallbackType ()
 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...
 

Detailed Description

Gadget class.

Library: ilvadvgdt

This class is a subclass of IlvComboBox that combines a text field (IlvTextField class) with a scrollable string list. The user can enter a character string in the combo box text field, or click on the arrow that appears on the right side of the field to display a string list of the class IlvStringList providing a set of predefined choices.

Note
Because the submenu displayed by an IlvScrolledComboBox is an advanced scrollable string list rather than an IlvPopupMenu as in the superclass, the inherited IlvComboBox::getSubMenu() member function must not be called for the IlvScrolledComboBox class. It returns 0.
See also
IlvStringList

Accessors

Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue(), IlvValueInterface::queryValues(), IlvValueInterface::changeValue(), IlvValueInterface::changeValues(). This class inherits the accessors of its superclass IlvComboBox and adds the following ones:

Name Type Equivalent methods
visibleItems UInt getVisibleItems(), setVisibleItems()
largeList Direction hasLargeList(), enableLargeList()

Styling

This class supports the following CSS properties:

Graphic property CSS property Type
Background color background-colorColor
Text color color Color

Constructor & Destructor Documentation

IlvScrolledComboBox::IlvScrolledComboBox ( 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 class IlvScrolledComboBox. The size of the combo box is computed from the label parameter. If you want to give the combo box a specific size, use the other constructor.

Parameters
displayThe connection to the display.
pointThe position of the combo box.
labelThe label of the combo box.
labelsAn array containing the predefined labels of the combo box.
countThe number of elements in the labels array.
thicknessThe thickness of the combo box.
paletteThe palette used by the combo box.
IlvScrolledComboBox::IlvScrolledComboBox ( IlvDisplay display,
const IlvRect rect,
const char *  label,
const char *const *  labels = 0,
IlUShort  count = 0,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the IlvScrolledComboBox.

Parameters
displayThe connection to the display.
rectThe size and position of the combo box.
labelThe label of the combo box.
labelsAn array containing the predefined labels of the combo box.
countThe number of elements in the labels array.
thicknessThe thickness of the combo box.
paletteThe palette used by the combo box.

Member Function Documentation

void IlvScrolledComboBox::disableLargeList ( )

Disables the large list mode.

See also
enableLargeList(), hasLargeList().
void IlvScrolledComboBox::enableLargeList ( IlvPosition  pos = IlvLeft)

Enables the large list mode.

By default, the string list of the scrolled combo box has the same width as the text field. If the string list contains items that are wider than the text field, these may be hidden partially. When the large list mode is enabled, the string list is resized to accommodate the widest item.

Parameters
posThe alignment of the string list. Valid values are: IlvLeft and IlvRight.
See also
disableLargeList(), hasLargeList().
IlvStringList* IlvScrolledComboBox::getStringList ( ) const

Returns a pointer to the string list encapsulated by the scrolled combo box.

Returns
A pointer to the string list used in the scrolled combo box.
See also
IlvComboBox::getSubMenu().
IlUShort IlvScrolledComboBox::getVisibleItems ( ) const

Returns the number of visible items in the string list.

Returns
The number of visible items in the string list.
See also
setVisibleItems().
IlvPosition IlvScrolledComboBox::hasLargeList ( ) const

Indicates whether the large list mode is used.

Returns
The position where the string list is displayed, or IlvBadPosition if the combo box does not use the large list mode.
See also
enableLargeList(), disableLargeList().
virtual void IlvScrolledComboBox::hideList ( )
virtual

Hides the string list.

See also
showList().
virtual IlBoolean IlvScrolledComboBox::isListVisible ( ) const
virtual

Indicates whether the list of items of the combo box is visible.

Returns
IlTrue if the list of items of the combo box is visible and IlFalse if it is not.
See also
showList, hideList

Reimplemented from IlvComboBox.

void IlvScrolledComboBox::setVisibleItems ( IlUShort  count)

Sets the number of visible items in the string list.

Parameters
countThe new number of visible items in the string list.
See also
getVisibleItems().
virtual void IlvScrolledComboBox::showList ( IlBoolean  grab = IlTrue)
virtual

Displays the string list.

Parameters
grabA Boolean value specifying whether the events occurring in the view where the string list is displayed should be grabbed.
See also
hideList().

© Copyright 2016, 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.