Gadget class. More...
#include <ilviews/gadgets/slist.h>
Public Member Functions | |
IlvStringList (IlvDisplay *display, const IlvPoint &point, const char *const *labels, IlAny const *itemData, IlUShort count, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlvStringList (IlvDisplay *display, const IlvPoint &point, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlvStringList (IlvDisplay *display, const IlvRect &rect, const char *const *labels, IlAny const *itemData, IlUShort count, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlvStringList (IlvDisplay *display, const IlvRect &rect, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
void | addSelectCallback (IlSymbol *callbackName) |
Adds a named Select callback. More... | |
void | addSelectCallback (IlSymbol *callbackName, IlAny arg) |
Adds a named Select callback. More... | |
void | addSelectCallback (IlvGraphicCallback callback) |
Adds a Select callback. More... | |
void | addSelectCallback (IlvGraphicCallback callback, IlAny arg) |
Adds a Select callback. More... | |
virtual IlBoolean | allowDragDrop () const |
Indicates whether drag-and-drop operations are allowed for the string list. More... | |
void | allowDragDrop (IlBoolean allow) |
Specifies whether drag-and-drop operations should be allowed for the string list. More... | |
IlBoolean | autoLabelAlignment () const |
Indicates whether the automatic label alignment mode is on. More... | |
void | autoLabelAlignment (IlBoolean align, IlBoolean redraw=IlTrue) |
Specifies whether the automatic alignment mode should be used. More... | |
virtual void | doIt () |
Is called when the user double-clicks an item in the list or presses the Enter key. More... | |
virtual void | drawBackground (IlvPort *, const IlvTransformer *, const IlvRegion *) const |
Draws the gadget background. More... | |
virtual void | drawFrame (IlvPort *, const IlvTransformer *, const IlvRegion *) const |
Draws the gadget frame. More... | |
virtual void | drawGadgetContents (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the gadget contents. More... | |
virtual void | drawGadgetItem (const IlvGadgetItem *, IlvPort *port, const IlvRect &rect, const IlvTransformer *t, const IlvRegion *clip) const |
Draws a specific gadget item. More... | |
virtual void | empty () |
Empties the list. More... | |
void | ensureVisible (IlUShort index, IlBoolean redraw=IlFalse, IlBoolean horizontal=IlFalse) |
Changes the first visible item so that the specified item remains visible. More... | |
IlvDim | getDefaultItemHeight () const |
Returns the height of the items when all items are the same height. More... | |
IlUShort | getFirstItem () const |
Returns the index of the first visible item in the string list. More... | |
virtual IlvDim | getLabelOffset () const |
Returns the offset used to display each item label. More... | |
virtual void | getLabelOrientation (IlvOrientation &orientation, IlBoolean &flip) const |
Returns the default orientation of the labels associated with the string list items. More... | |
virtual IlvPosition | getLabelPosition () const |
Returns the default position of the labels associated with the string list items, relative to their picture. More... | |
IlUShort | getLastFullVisibleItem () const |
Returns the index of the last visible item that can be seen without scrolling the list. More... | |
IlUShort | getLastVisibleItem (const IlvTransformer *t=0) const |
Returns the index of the last visible item of the string list. More... | |
virtual IlvPalette * | getNormalTextPalette () const |
Returns the default palette used to draw an item. More... | |
IlvDim | getOffset () const |
Returns the horizontal offset set for the string list. More... | |
virtual IlvPalette * | getOpaquePalette () const |
Returns the opaque palette used to draw opaque items. More... | |
IlvGraphicCallback | getSelectCallback () const |
Returns a pointer to the first unnamed callback in the Select callback list. More... | |
IlSymbol * | getSelectCallbackName () const |
Returns the name of the first named callback in the Select callback list. More... | |
IlShort | getSelectionLimit () const |
Returns the maximum number of items that can be selected at the same time. More... | |
IlvStringListSelectionMode | getSelectionMode () const |
Returns the current selection mode of the string list. More... | |
IlvDim | getSpacing () const |
Returns the spacing between two items in the string list. More... | |
virtual IlBoolean | handleGadgetEvent (IlvEvent &event) |
Handles the gadget events. More... | |
IlBoolean | hasFullSelection () const |
Indicates whether the selection extends over the whole width of the string list. More... | |
virtual IlBoolean | hasToolTips () const |
Indicates whether the string list displays tooltips. More... | |
virtual IlBoolean | isEditable () const |
Indicates whether the string list can be edited. More... | |
IlBoolean | isExclusive () const |
Indicates whether the exclusive selection mode is on. More... | |
virtual IlBoolean | isShowingLabel () const |
Indicates whether the labels associated with the string list items are displayed. More... | |
virtual IlBoolean | isShowingPicture () const |
Indicates whether the pictures associated with the string list items are displayed. More... | |
IlBoolean | itemBBox (IlUShort index, IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the bounding box of the specified item. More... | |
IlShort | pointToPosition (const IlvPoint &point, const IlvTransformer *t=0) const |
Returns the index of the item located at the specified position. More... | |
virtual void | recomputeAllItems () |
Recomputes the size of all the items managed by the holder. More... | |
virtual void | scrollBarChanged (IlvScrollBar *scrollbar, IlvOrientation direction) |
Is called each time the user manipulates one of the scroll bars. More... | |
virtual void | select (IlUShort index) |
Is called when the user selects the specified item in the string list. More... | |
IlBoolean | selectionLimitReached () const |
Indicates whether the maximum number of items that can be selected at the same time has been reached. More... | |
void | setDefaultItemHeight (IlvDim height, IlBoolean redraw=IlTrue) |
Sets the height of all the items in the string list. More... | |
void | setEditable (IlBoolean value=IlTrue) |
Specifies whether the string list should be editable. More... | |
void | setExclusive (IlBoolean value=IlTrue) |
Sets the selection mode for the string list. More... | |
virtual void | setItems (IlvGadgetItem *const *items, IlUShort count) |
Replaces the entire list of items. More... | |
void | setLabelOffset (IlvDim offset, IlBoolean redraw=IlTrue) |
Sets the label offset of the string list. More... | |
void | setLabelOrientation (IlvOrientation orientation, IlBoolean flip=IlFalse, IlBoolean redraw=IlTrue) |
Sets the default orientation of the labels associated with the string list items. More... | |
void | setLabelPosition (IlvPosition position, IlBoolean redraw=IlTrue) |
Sets the default position of the string list item labels relative to their picture. More... | |
void | setOffset (IlvDim offset) |
Sets the horizontal offset of the string list. More... | |
void | setSelectCallback (IlSymbol *callbackName) |
Sets a named Select callback. More... | |
void | setSelectCallback (IlSymbol *callbackName, IlAny arg) |
Sets a named Select callback. More... | |
void | setSelectCallback (IlvGraphicCallback callback) |
Sets a Select callback. More... | |
void | setSelectCallback (IlvGraphicCallback callback, IlAny arg) |
Sets a Select callback. More... | |
virtual void | setSelected (IlUShort index, IlBoolean value=IlTrue, IlBoolean redraw=IlFalse) |
Selects or deselects an item. More... | |
void | setSelectionIndices (IlUShort const *indexArray, IlUShort count) |
Selects a set of items based on their index. More... | |
void | setSelectionLimit (IlShort limit) |
Sets the maximum number of items that can be selected at the same time. More... | |
void | setSelectionMode (IlvStringListSelectionMode mode) |
Sets the selection mode of the string list. More... | |
virtual void | setSpacing (IlvDim spacing, IlBoolean redraw=IlFalse) |
Sets the spacing between two items in the string list. More... | |
void | showLabel (IlBoolean value=IlTrue, IlBoolean redraw=IlTrue) |
Indicates whether the labels associated with the string list items should be shown or hidden. More... | |
void | showPicture (IlBoolean value=IlTrue, IlBoolean redraw=IlTrue) |
Indicates whether the pictures associated with the string list items are displayed. More... | |
virtual void | sort (IlvListCompareFunction=0) |
Sorts the items. More... | |
virtual void | unSelect (IlUShort index) |
Is called when the user deselects the specified item in the string list. More... | |
void | useFullSelection (IlBoolean value=IlTrue, IlBoolean redraw=IlTrue) |
Specifies whether the full selection mode should be used. More... | |
void | useToolTips (IlBoolean value=IlTrue) |
Specifies whether the string list should display tooltips. More... | |
Public Member Functions inherited from IlvScrolledGadget | |
IlvScrolledGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
virtual void | adjustScrollBars (IlBoolean redraw=IlFalse) |
Recomputes the scroll bars. More... | |
void | computeBBox (IlvRect &ibox, IlvRect &vbox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const |
Computes the bounding boxes of the elements that compose the gadget. More... | |
void | computeBBox (IlvRect &ibox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const |
Computes the bounding boxes of the elements that compose the gadget. More... | |
virtual IlvScrollBar * | createScrollBar (const IlvRect &rect, IlvDirection direction, IlUShort thickness, IlvPalette *palette) |
Returns a new instance of the IlvScrollBar class. More... | |
virtual void | drawScrollBar (IlvPort *dst, IlvDirection direction, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the specified internal scroll bar. More... | |
void | fitToRect (const IlvRect &rect) |
Resizes the object so that the scrollable area fits the specified rectangle. More... | |
IlUShort | getBottomMargin () const |
Returns the bottom margin. More... | |
IlvScrollBar * | getHorizontalScrollBar () const |
Returns a pointer to the internal horizontal scroll bar. More... | |
IlUShort | getLeftMargin () const |
Returns the left margin. More... | |
IlUShort | getRightMargin () const |
Returns the right margin. More... | |
IlvScrollBar * | getScrollBar (IlvDirection direction) const |
Returns a pointer to the specified internal scroll bar. More... | |
void | getScrollBarShowAsNeeded (IlBoolean &vert, IlBoolean &hor) const |
Returns the scroll bar mode of the internal scroll bars. More... | |
IlUShort | getTopMargin () const |
Returns the top margin. More... | |
IlvScrollBar * | getVerticalScrollBar () const |
Returns a pointer to the internal vertical scroll bar. More... | |
virtual IlBoolean | handleScrollBarsEvent (IlvEvent &event) |
Handles the internal scroll bars event. More... | |
void | hideScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Hides the specified internal scroll bar. More... | |
virtual void | internalBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the internal bounding box of the gadget. More... | |
void | moveScrollBar (IlvDirection direction, IlvPosition where, IlBoolean redraw=IlTrue) |
Moves the specified internal scroll bar to a new position. More... | |
virtual void | scrollableSize (IlvDim &width, IlvDim &height) const |
Returns the size of the scrollable area of the gadget. More... | |
virtual void | scrollBarBBox (IlvDirection direction, IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the bounding box of the specified internal scroll bar. More... | |
void | scrollBarShowAsNeeded (IlBoolean vertical, IlBoolean horizontal, IlBoolean redraw=IlTrue) |
Sets the scroll bar mode of the internal scroll bars. More... | |
virtual void | scrollBarVisibilityChanged (IlvDirection direction) |
Is called when an internal scroll bar is shown or hidden. More... | |
void | setBottomMargin (IlUShort margin) |
Sets the bottom margin. More... | |
void | setLeftMargin (IlUShort margin) |
Sets the left margin. More... | |
void | setMargin (IlUShort val) |
Sets the left, right, top, and bottom margins. More... | |
void | setRightMargin (IlUShort margin) |
Sets the right margin. More... | |
void | setTopMargin (IlUShort margin) |
Sets the top margin. More... | |
void | showScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Shows the specified internal scroll bar. More... | |
virtual void | visibleBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the visible bounding box of the gadget. More... | |
IlvPosition | whereIsScrollBar (IlvDirection direction) const |
Returns the location of the specified internal scroll bar. 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, 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... | |
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 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... | |
virtual const char * | getSelection () const |
Returns the first selected item 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... | |
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... | |
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 | 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 * | SelectSymbol () |
Returns the symbol of the Select callback list. More... | |
Static Public Member Functions inherited from IlvScrolledGadget | |
static IlSymbol * | ScrollBarMovedSymbol () |
Returns the callback type for the Scroll Bar Moved callback. More... | |
static IlSymbol * | ScrollBarVisibilitySymbol () |
Returns the callback type for the Scroll Bar Visibility Changed callback. More... | |
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 | |
virtual void | adjustFromScrollBar (const IlvScrollBar *sb, IlvDirection dir) |
Is called to adjust the gadget to the scroll bars values. More... | |
virtual void | adjustScrollBarValue (IlvScrollBar *sb, IlvDirection dir) |
Is called to adjust the scroll bar values. More... | |
virtual void | scrollBarHasMoved (IlvDirection dir) |
Is called when an internal scroll bar has moved. More... | |
Protected Member Functions inherited from IlvScrolledGadget | |
IlvDim | getLimitHeightValue () const |
Returns the limit value for the vertical scrolling. More... | |
IlvDim | getLimitWidthValue () const |
Returns the limit value for the horizontal scrolling. More... | |
IlvDim | getScrollableHeight () const |
Returns the height of the scrollable area. More... | |
IlvDim | getScrollableWidth () const |
Returns the width of the scrollable area. More... | |
void | setLimitHeightValue (IlvDim value) |
Sets the limit value for the vertical scrolling. More... | |
void | setLimitWidthValue (IlvDim value) |
Sets the limit value for the horizontal scrolling. More... | |
void | setScrollableHeight (IlvDim height) |
Sets the height of the scrollable area. More... | |
void | setScrollableWidth (IlvDim width) |
Sets the width of the scrollable area. 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... | |
Friends | |
class | IlvDefaultStringListLFHandler |
Gadget class.
Library: ilvadvgdt
The IlvStringList
class lets you display and manipulate lists of gadget items. You can store up to 32768 items in a string list.
A String List
The main callback manages double-click events. Use the IlvStringList::setSelectCallback()
method to track the selection.
IlvGadgetItem
[*] : The returned array is a static array internally managed. Other Rogue Wave Views routines may overwrite this buffer so it should be copied in a safe place if it needs to be persistent.
Name | Return type | Equivalent methods |
---|---|---|
getLabel(UInt index) | String | getLabel(IlUShort index) const |
setLabel(UInt index, String label) | Void | setLabel(IlUShort index, const char* label, IlBoolean) |
addLabel(String label) | Void | addLabel(const char* label, IlAny) |
isSelected(UInt index) | Boolean | isSelected(IlUShort index) const |
removeLabel(UInt index) | Void | removeLabel(IlUShort index) |
getItem(UInt index) | Object | getItem(IlUShort index) const |
getItemByName(String name) | Object | getItemByName(const char* name) const |
Graphic property | CSS property | Type |
---|---|---|
Background color | background-color | Color |
Text color | color | Color |
IlvStringList::IlvStringList | ( | IlvDisplay * | display, |
const IlvPoint & | point, | ||
const char *const * | labels = 0 , |
||
IlUShort | count = 0 , |
||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
Initializes a new instance of the IlvStringList
class. The size of the object is computed by calling the IlvGadget::fitToContents()
method. If you want to specify the size, use a constructor that takes an IlvRect
reference instead of an IlvPoint
object as parameter. The labels are copied.
display | The connection to the display. |
point | The position of the string list. |
labels | An array of predefined labels. |
count | The number of elements in the labels array. |
thickness | The thickness of the string list. |
palette | The palette used to draw the string list. |
IlvStringList::IlvStringList | ( | IlvDisplay * | display, |
const IlvRect & | rect, | ||
const char *const * | labels = 0 , |
||
IlUShort | count = 0 , |
||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
Initializes a new instance of the IlvStringList
class. The labels are copied.
display | The connection to the display. |
rect | The size and position of the string list. |
labels | An array of predefined labels. |
count | The number of elements in the labels array. |
thickness | The thickness of the string list. |
palette | The palette used to draw the string list. |
IlvStringList::IlvStringList | ( | IlvDisplay * | display, |
const IlvPoint & | point, | ||
const char *const * | labels, | ||
IlAny const * | itemData, | ||
IlUShort | count, | ||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
Initializes a new instance of the IlvStringList
class. The size of the object is computed by calling the IlvGadget::fitToContents()
method. If you want to specify the size, use a constructor that takes an IlvRect
reference instead of an IlvPoint
object as parameter. The labels are copied.
display | The connection to the display. |
point | The position of the string list. |
labels | An array of predefined labels. |
itemData | An array of the predefined data that will be set to each created item. For details, see IlvGadgetItem::setClientData() . |
count | The number of elements in the labels array. |
thickness | The thickness of the string list. |
palette | The palette used to draw the string list. |
IlvStringList::IlvStringList | ( | IlvDisplay * | display, |
const IlvRect & | rect, | ||
const char *const * | labels, | ||
IlAny const * | itemData, | ||
IlUShort | count, | ||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
Initializes a new instance of the IlvStringList
class. The labels are copied.
display | The connection to the display. |
rect | The size and position of the string list. |
labels | An array of predefined labels. |
itemData | An array of the predefined data that will be set to each created item. See IlvGadgetItem::setClientData() for more details. |
count | The number of elements in the labels array. |
thickness | The thickness of the string list. |
palette | The palette used to draw the string list. |
void IlvStringList::addSelectCallback | ( | IlSymbol * | callbackName | ) |
Adds a named Select callback.
Adds callbackName to the Select callback list. A Select callback is invoked whenever the selection in the string list changes.
callbackName | The name of the new callback. |
focusIn()
, setSelectCallback()
, getSelectCallbackName()
. Adds a named Select callback.
Adds callbackName to the Select callback list. The callback function, when invoked, receives the user parameter arg. A Select callback is invoked whenever the selection in the string list changes.
callbackName | The name of the new callback. |
arg | The callback argument. |
focusIn()
, setSelectCallback()
, getSelectCallbackName()
. void IlvStringList::addSelectCallback | ( | IlvGraphicCallback | callback | ) |
Adds a Select callback.
Adds callback to the Select callback list. A Select callback is invoked whenever the selection in the string list changes.
callback | A pointer to the new callback. |
focusIn()
, setSelectCallback()
, getSelectCallback()
. void IlvStringList::addSelectCallback | ( | IlvGraphicCallback | callback, |
IlAny | arg | ||
) |
Adds a Select callback.
Adds callback to the Select callback list. The callback function, when invoked, receives the user parameter arg. A Select callback is invoked whenever the selection in the string list changes.
callback | A pointer to the new callback. |
arg | The callback argument. |
focusIn()
, setSelectCallback()
, getSelectCallback()
.
|
protectedvirtual |
Is called to adjust the gadget to the scroll bars values.
Is called each time the scroll bar scrollbar of direction direction moves. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
adjustScrollBarValue()
. Reimplemented from IlvScrolledGadget.
|
protectedvirtual |
Is called to adjust the scroll bar values.
Is called by the member function adjustScrollBars()
to adjust the values of the scroll bar scrollbar of direction direction. This member function must modify the scrollbar values to match the gadget scrolling mode. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
adjustFromScrollBar()
. Reimplemented from IlvScrolledGadget.
|
virtual |
Indicates whether drag-and-drop operations are allowed for the string list.
IlTrue
if drag-and-drop operations are allowed and IlFalse
otherwise. Reimplemented from IlvGadgetItemHolder.
void IlvStringList::allowDragDrop | ( | IlBoolean | allow | ) |
Specifies whether drag-and-drop operations should be allowed for the string list.
allow | A Boolean value specifying whether drag-and-drop operations should be allowed (IlTrue ). |
IlBoolean IlvStringList::autoLabelAlignment | ( | ) | const |
Indicates whether the automatic label alignment mode is on.
IlTrue
if the automatic label alignment mode is on and IlFalse
otherwise. Specifies whether the automatic alignment mode should be used.
When the automatic label alignment mode is enabled (the default), a label offset is automatically computed to make sure that all the item pictures are visible, and all the item labels are aligned.
align | A Boolean value specifying whether the automatic alignment mode should be used. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
setLabelOffset()
, autoLabelAlignment()
.
|
virtual |
Is called when the user double-clicks an item in the list or presses the Enter key.
Its default implementation invokes the callback associated with the object.
IlvGraphic::callCallbacks()
.
|
virtual |
Draws the gadget background.
Is called from the draw()
method. This method is not called if the gadget is transparent.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
Reimplemented from IlvScrolledGadget.
|
virtual |
Draws the gadget frame.
Is called from the draw()
method. This method is not called if the method isShowingFrame()
returns IlFalse
.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
drawBackground()
, drawScrollBar()
, drawGadgetContents()
. Reimplemented from IlvScrolledGadget.
|
virtual |
Draws the gadget contents.
Is called from the draw()
method. The default implementation does nothing.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
drawBackground()
, drawScrollBar()
, drawFrame()
. Reimplemented from IlvScrolledGadget.
|
virtual |
Draws a specific gadget item.
Redraws item in port at the location specified by rect using the clipping area clip. This method simply calls IlvGadgetItem::draw()
using the item instance.
item | The item to be redrawn. |
port | The destination drawing port. |
rect | The bounding box of the item. |
t | The transformer used to draw the item. Not used. |
clip | The clipping area. |
IlvGadgetItem::draw()
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
void IlvStringList::ensureVisible | ( | IlUShort | index, |
IlBoolean | redraw = IlFalse , |
||
IlBoolean | horizontal = IlFalse |
||
) |
Changes the first visible item so that the specified item remains visible.
index | The index of the string list item. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
horizontal | A Boolean value specifying whether the item visibility will be checked in the horizontal direction. In other words, the offset of the string list can be changed by this method if horizontal is set to IlTrue . |
getOffset()
. IlvDim IlvStringList::getDefaultItemHeight | ( | ) | const |
Returns the height of the items when all items are the same height.
setDefaultItemHeight()
. IlUShort IlvStringList::getFirstItem | ( | ) | const |
Returns the index of the first visible item in the string list.
getLastVisibleItem()
, getLastFullVisibleItem()
.
|
virtual |
Returns the offset used to display each item label.
0
if no offset has been defined. Reimplemented from IlvListGadgetItemHolder.
|
virtual |
Returns the default orientation of the labels associated with the string list items.
orientation | The default orientation of the labels. |
flip | A Boolean value specifying whether the labels should be flipped or not. See the setLabelOrientation() method for more details. |
setLabelOrientation()
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
Returns the default position of the labels associated with the string list items, relative to their picture.
setLabelPosition()
. Reimplemented from IlvGadgetItemHolder.
IlUShort IlvStringList::getLastFullVisibleItem | ( | ) | const |
Returns the index of the last visible item that can be seen without scrolling the list.
getFirstItem()
, getLastVisibleItem()
. IlUShort IlvStringList::getLastVisibleItem | ( | const IlvTransformer * | t = 0 | ) | const |
Returns the index of the last visible item of the string list.
t | The transformer applied to the string list. |
getLastFullVisibleItem()
, getFirstItem()
.
|
virtual |
Returns the default palette used to draw an item.
Implements IlvGadgetItemHolder.
IlvDim IlvStringList::getOffset | ( | ) | const |
Returns the horizontal offset set for the string list.
This offset moves the items horizontally in the list. The bigger the value, the further the items will be displayed to the left. This value is modified when moving the horizontal scroll bar.
setOffset()
, getLabelOffset()
.
|
virtual |
Returns the opaque palette used to draw opaque items.
Reimplemented from IlvGadgetItemHolder.
IlvGraphicCallback IlvStringList::getSelectCallback | ( | ) | const |
Returns a pointer to the first unnamed callback in the Select callback list.
A Select callback is invoked whenever the selection in the string list changes.
focusIn()
, setSelectCallback()
, addSelectCallback()
. IlSymbol* IlvStringList::getSelectCallbackName | ( | ) | const |
Returns the name of the first named callback in the Select callback list.
A Select callback is invoked whenever the selection in the string list changes.
focusIn()
, setSelectCallback()
, addSelectCallback()
. IlShort IlvStringList::getSelectionLimit | ( | ) | const |
Returns the maximum number of items that can be selected at the same time.
setSelectionLimit()
. IlvStringListSelectionMode IlvStringList::getSelectionMode | ( | ) | const |
Returns the current selection mode of the string list.
setSelectionMode()
, IlvStringListSelectionMode
. IlvDim IlvStringList::getSpacing | ( | ) | const |
Returns the spacing between two items in the string list.
The default value is 0
.
setSpacing()
. Handles the gadget events.
Is called by handleEvent()
when the member function handleScrollBarsEvent()
returns IlFalse
. Its default implementation does nothing. You can override this member function to implement your own gadget behavior.
event | The event. |
handleScrollBarsEvent()
. Reimplemented from IlvScrolledGadget.
IlBoolean IlvStringList::hasFullSelection | ( | ) | const |
Indicates whether the selection extends over the whole width of the string list.
IlTrue
if the string list is in full selection mode and IlFalse
otherwise. useFullSelection()
.
|
virtual |
Indicates whether the string list displays tooltips.
IlTrue
if the string list displays tooltips and is not in full selection mode. It returns IlFalse
if it does not display tooltips. useToolTips()
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
Indicates whether the string list can be edited.
IlTrue
if the list can be edited and IlFalse
otherwise. Reimplemented from IlvGadgetItemHolder.
IlBoolean IlvStringList::isExclusive | ( | ) | const |
Indicates whether the exclusive selection mode is on.
In exclusive selection mode, only one item can be selected at a time.
IlTrue
if the exclusive selection mode is set and IlFalse
otherwise. setExclusive()
, getSelectionMode()
.
|
virtual |
Indicates whether the labels associated with the string list items are displayed.
IlTrue
if the labels associated with the string list items are displayed and IlFalse
otherwise. showLabel()
, isShowingPicture()
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
Indicates whether the pictures associated with the string list items are displayed.
IlTrue
if the pictures associated with the string list items are displayed and IlFalse
otherwise. showPicture()
, isShowingLabel()
. Reimplemented from IlvGadgetItemHolder.
IlBoolean IlvStringList::itemBBox | ( | IlUShort | index, |
IlvRect & | bbox, | ||
const IlvTransformer * | t = 0 |
||
) | const |
Returns the bounding box of the specified item.
index | The index of the item. |
bbox | The returned bounding box of the specified item. |
t | The transformer applied to the string list. |
pointToPosition()
. IlShort IlvStringList::pointToPosition | ( | const IlvPoint & | point, |
const IlvTransformer * | t = 0 |
||
) | const |
Returns the index of the item located at the specified position.
point | The position in view coordinates. |
t | The transformer applied to the string list. |
itemBBox()
.
|
virtual |
Recomputes the size of all the items managed by the holder.
Calls the IlvGadgetItem::recomputeSize()
member function for all the items managed by this holder.
IlvGadgetItem::recomputeSize()
, applyToItems()
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
Is called each time the user manipulates one of the scroll bars.
This method is obsolete. Use the IlvScrolledGadget::scrollBarHasMoved
method instead. The default implementation does nothing. To detect events relating to scroll bars, you have to override this member function in a subclass.
scrollbar | A pointer to the instance of the scroll bar that was changed. |
direction | The direction of the scroll bar that was changed. |
|
protectedvirtual |
Is called when an internal scroll bar has moved.
Is called by handleEvent()
each time the value of the internal scroll bar specified by direction changes. The default implementation invokes the Scroll Bar Moved callback.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
ScrollBarMovedSymbol()
. Reimplemented from IlvScrolledGadget.
|
virtual |
Is called when the user selects the specified item in the string list.
The default implementation selects the item by calling the setSelected()
method.
index | The index of the selected item. |
unSelect()
. IlBoolean IlvStringList::selectionLimitReached | ( | ) | const |
Indicates whether the maximum number of items that can be selected at the same time has been reached.
IlTrue
if the maximum number of items that can be selected at the same time has been reached and IlFalse
otherwise. getSelectionLimit()
, setSelectionLimit()
.
|
static |
Returns the symbol of the Select callback list.
setSelectCallback()
, IlvGraphic::setCallback()
. Sets the height of all the items in the string list.
height | The new default height. If height is set to 0 , each item keeps its own height. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
getDefaultItemHeight()
. Specifies whether the string list should be editable.
When the list is editable, you can edit one of its items by clicking on it once selected, or by pressing the F2 key.
value | A Boolean value specifying whether the string list should be editable (IlTrue ) or not (IlFalse ). |
isEditable()
, IlvGadgetItem::edit()
. Sets the selection mode for the string list.
value | If value is set to IlTrue , only one item can be selected at a time. If it is set to IlFalse , several items can be selected simultaneously. |
setSelectionMode()
.
|
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. |
getItems()
, insertItem()
, removeItem()
. Reimplemented from IlvListGadgetItemHolder.
Sets the label offset of the string list.
When a label offset is defined, all the item labels are aligned using this offset. Calling this method disables the automatic alignment mode.
offset | The new label offset. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
void IlvStringList::setLabelOrientation | ( | IlvOrientation | orientation, |
IlBoolean | flip = IlFalse , |
||
IlBoolean | redraw = IlTrue |
||
) |
Sets the default orientation of the labels associated with the string list items.
If the orientation is IlvHorizontal
, labels are drawn from left to right. If the orientation is IlvVertical
, labels are drawn vertically from top to bottom if flip is IlFalse
, or from bottom to top if flip is IlFalse
.
orientation | The new orientation of the labels. |
flip | A Boolean value specifying whether the labels are flipped or not. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
getLabelOrientation()
. Sets the default position of the string list item labels relative to their picture.
This setting is used to compute the geometry of each string list item. For more information, see the member function IlvGadgetItem::setLabelPosition()
.
position | The new position of the items labels relative to their pictures. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
void IlvStringList::setOffset | ( | IlvDim | offset | ) |
Sets the horizontal offset of the string list.
This offset lets you move the items horizontally in the list. The bigger the value, the further the items will be displayed to the left. This value is modified when moving the horizontal scroll bar.
offset | The new horizontal offset. |
getOffset()
, setLabelOffset()
. void IlvStringList::setSelectCallback | ( | IlSymbol * | callbackName | ) |
Sets a named Select callback.
Removes all the existing Select callbacks before adding callbackName to the Select callback list. A Select callback is invoked whenever the selection in the string list changes.
callbackName | The name of the new callback. |
focusIn()
, addSelectCallback()
, getSelectCallbackName()
. Sets a named Select callback.
Removes all the existing Select callbacks before adding callbackName to the Select callback list. The callback function, when invoked, receives the user parameter arg. A Select callback is invoked whenever the selection in the string list changes.
callbackName | The name of the new callback. |
arg | The callback argument. |
focusIn()
, addSelectCallback()
, getSelectCallbackName()
. void IlvStringList::setSelectCallback | ( | IlvGraphicCallback | callback | ) |
Sets a Select callback.
Removes all the existing Select callbacks before adding callback to the Select callback list. A Select callback is invoked whenever the selection in the string list changes.
callback | A pointer to the new callback. |
focusIn()
, addSelectCallback()
, getSelectCallback()
. void IlvStringList::setSelectCallback | ( | IlvGraphicCallback | callback, |
IlAny | arg | ||
) |
Sets a Select callback.
Removes all the existing Select callbacks before adding callback to the Select callback list. The callback function, when invoked, receives the user parameter arg. A Select callback is invoked whenever the selection in the string list changes.
callback | A pointer to the new callback. |
arg | The callback argument. |
focusIn()
, addSelectCallback()
, getSelectCallback()
.
|
virtual |
Selects or deselects an item.
index | The index of the item. |
value | A Boolean value specifying whether the item specified by index should be selected or deselected. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
Selects a set of items based on their index.
The method starts by deselecting all items. Then, it selects all the items corresponding to the indices in the array.
The behaviour is subject to the current selection mode. If the selection is exclusive, only the last item successfully selected will be selected. When the selection limit is reached, the remaining items in the array will not be selected.
indexArray | The array of item indices. |
count | The number of indices in the array. |
void IlvStringList::setSelectionLimit | ( | IlShort | limit | ) |
Sets the maximum number of items that can be selected at the same time.
limit | The maximum number of items that can be selected simultaneously. |
getSelectionLimit()
. void IlvStringList::setSelectionMode | ( | IlvStringListSelectionMode | mode | ) |
Sets the selection mode of the string list.
Changes the selection mode only if mode matches the setting defined by setExclusive()
. For example, calling this method with IlvStringListSingleSelection
as parameter if the exclusive selection mode is not set (that is, isExclusive()
returns IlFalse
) has no effect.
mode | The new selection mode. |
getSelectionMode()
, IlvStringListSelectionMode
. Sets the spacing between two items in the string list.
spacing | The new spacing value. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
Indicates whether the labels associated with the string list items should be shown or hidden.
value | A Boolean value specifying whether the labels of the string list items should be shown (IlTrue ) or hidden (IlFalse ). |
redraw | A Boolean value specifying whether the string list should be redrawn. |
isShowingLabel()
, showPicture()
. Indicates whether the pictures associated with the string list items are displayed.
value | A Boolean value specifying whether the pictures of the string list items should be shown or hidden. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
isShowingPicture()
, showLabel()
.
|
virtual |
Sorts the items.
Runs the sorting algorithm on all the items. If you provide a sorting function in the form of an IlvListCompareFunction
, this function is called to compare each item pair. If you do not provide a sorting function, a default comparison function is used.
func | A sorting function. |
IlvListCompareFunction
, compareItems()
. Reimplemented from IlvListGadgetItemHolder.
|
virtual |
Is called when the user deselects the specified item in the string list.
The default implementation deselects the item by calling the setSelected()
method.
index | The index of the deselected item. |
select()
. Specifies whether the full selection mode should be used.
value | If value is IlTrue , the selection extends over the whole width of the string list. If value is IlFalse , only the labels are selected. |
redraw | A Boolean value specifying whether the string list should be redrawn. |
hasFullSelection()
. Specifies whether the string list should display tooltips.
A tooltip is displayed when the cursor is over a partially visible item.
value | A Boolean value specifying whether the string list should display tooltips (IlTrue ) or not (IlFalse ). |
hasToolTips()
.