Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Item holder class. More...
#include <ilviews/gadgets/itemgdt.h>
Public Member Functions | |
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... | |
virtual void | empty ()=0 |
Empties the list. 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... | |
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... | |
virtual void | setItems (IlvGadgetItem *const *items, IlUShort count) |
Replaces the entire list of items. 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 IlvGadgetItem * | createItem (const char *label, IlvGraphic *graphic=0, IlvBitmap *bitmap=0, IlvBitmap *selbitmap=0, IlBoolean copy=IlTrue) const |
Returns a new gadget item. More... | |
virtual void | drawGadgetItem (const IlvGadgetItem *item, IlvPort *port, const IlvRect &rect, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws a specific gadget item. More... | |
IlvGadgetItem * | getCallbackItem () const |
Returns the item that triggered a callback. More... | |
IlvGadgetItem * | getDragDropTarget () const |
Returns the target item of a drag-and-drop operation. More... | |
IlvGraphic * | getDraggedImage () const |
Returns the graphic object used to draw the ghost image during a drag-and-drop operation. More... | |
IlvGadgetItem * | getDraggedItem () const |
Returns the item that is being dragged during a drag-and-drop operation. More... | |
IlvGadgetItem * | getEditedItem () const |
Returns the item that is being edited. More... | |
virtual IlvPalette * | getHighlightTextPalette () const |
Returns the highlight palette used to draw the label of highlighted items. More... | |
virtual IlvPalette * | getInsensitivePalette () const =0 |
Returns the palette used to draw an item that is not sensitive. More... | |
virtual IlvGadgetItem * | getItemByName (const char *name) const |
Returns the item whose name is specified. More... | |
virtual IlvPalette * | getNormalTextPalette () const =0 |
Returns the default palette used to draw an item. More... | |
virtual IlvPalette * | getOpaquePalette () const |
Returns the opaque palette used to draw opaque items. More... | |
virtual IlvPalette * | getSelectionPalette () const =0 |
Returns the selection palette used to draw selected items. More... | |
virtual IlvPalette * | getSelectionTextPalette () const =0 |
Returns the selection palette used to draw the label of selected items. 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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvGadgetItemHolder | |
static IlSymbol * | AbortDragItemCallbackType () |
Returns the callback type of the Abort Drag callback. More... | |
static IlSymbol * | AbortEditItemCallbackType () |
Returns the callback type of the Abort Edit callback. More... | |
static IlSymbol * | ActivateCallbackType () |
Returns the callback type of the Activate callback. More... | |
static IlSymbol * | DragItemCallbackType () |
Returns the callback type of the Drag Item callback. More... | |
static IlSymbol * | EndDragItemCallbackType () |
Returns the callback type of the End Drag callback. More... | |
static IlSymbol * | EndEditItemCallbackType () |
Returns the callback type of the End Edit callback. More... | |
static IlSymbol * | StartDragItemCallbackType () |
Returns the callback type of the Start Drag callback. More... | |
static IlSymbol * | StartEditItemCallbackType () |
Returns the callback type of the Start Edit callback. More... | |
Protected Member Functions inherited from IlvGadgetItemHolder | |
virtual void | abortDragItem () |
Is called when a drag-and-drop operation is aborted. More... | |
virtual void | abortEdit (IlvGadgetItem *item) |
Is called when the editing of the specified item is aborted. More... | |
virtual void | drawDraggedImage (const IlvPoint &point, const IlvTransformer *t) |
Is called to draw the ghost image during a drag-and-drop operation. More... | |
virtual void | endDragItem (const IlvPoint &point) |
Is called when a drag-and-drop operation is finished. More... | |
virtual void | endEdit (IlvGadgetItem *item) |
Is called after an item has been edited. More... | |
virtual void | itemActivated (IlvGadgetItem *item) |
Is called when an item is activated. More... | |
virtual void | itemDeSelected (IlvGadgetItem *item) |
Is called when an item is deselected. More... | |
virtual void | itemDragged (const IlvPoint &point) |
Is called each time the user moves the mouse during a drag-and-drop operation. More... | |
virtual void | itemHighlighted (IlvGadgetItem *item) |
Is called when an item is highlighted or unhighlighted. More... | |
virtual void | itemSelected (IlvGadgetItem *item) |
Is called when an item is selected. More... | |
virtual void | startDragItem (IlvGadgetItem *item) |
Is called when a drag-and-drop operation begins. More... | |
virtual void | startEdit (IlvGadgetItem *item) |
Is called when an item is edited. More... | |
Item holder class.
Library: ilvgadgt
IlvListGadgetItemHolder
is a specific IlvGadgetItemHolder
class that manages a list of items.
|
virtual |
Adds an item with a label to the holder list.
label
is copied. The item is created by calling the member function IlvGadgetItemHolder::createItem
.
label | The item label. |
data | The item client data. |
|
virtual |
Applies the specified function to all the items of the holder.
func | The function to be applied. |
arg | The argument that will be passed to the function func. |
IlvApplyGadgetItem
for details. IlvApplyGadgetItem
, recomputeAllItems
, getItemByName
. Reimplemented from IlvGadgetItemHolder.
|
virtual |
Compares a pair of items.
If no sorting function is provided, this method is called to compare each item pair. This function simply returns the result of strcmp
on the two item labels.
string1 | The label of the first item. |
string2 | The label of the second item. |
value1 | The client data of the first item. |
value2 | The client data of the second item. |
|
virtual |
|
pure virtual |
Empties the list.
Implemented in IlvAbstractMenu, IlvPopupMenu, IlvStringList, IlvToolBar, IlvComboBox, and IlvOptionMenu.
IlUShort IlvListGadgetItemHolder::getCardinal | ( | ) | const |
Returns the number of items stored in this holder.
IlShort IlvListGadgetItemHolder::getFirstSelectedItem | ( | ) | const |
Returns the index of the first selected item.
-1
if no item is selected. IlShort IlvListGadgetItemHolder::getIndex | ( | const IlvGadgetItem * | item, |
IlUShort | start = 0 , |
||
IlUShort | stop = (IlUShort)-1 |
||
) | const |
Returns the index of the specified item in the holder list.
-1
if the item is not in the holder list. item | The item to be retrieved. |
start | The index where to begin the search. |
stop | The index where to stop the search. The search doesn't includes the item of index stop. |
IlvGadgetItem* IlvListGadgetItemHolder::getItem | ( | IlUShort | index | ) | const |
Returns an item from its position in the holder.
index | The item position. |
index
th item. Returns 0
if index is not valid. Returns an item user data.
index | The item index. |
0
if there is none. IlvGadgetItem* const* IlvListGadgetItemHolder::getItems | ( | IlUShort & | count | ) | const |
const char* IlvListGadgetItemHolder::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. const char* const* IlvListGadgetItemHolder::getLabels | ( | IlUShort & | count | ) | const |
Returns an array of all the items labels.
count | The number of elements of the returned array. |
Returns the position of an item using its label.
label | The label of the searched item. |
start | The index where to begin the search. |
-1
if the label cannot be found.
|
virtual |
Returns the first selected item label.
Reimplemented in IlvComboBox.
Returns an array containing the indexes of the selected item.
count | The number of elements in the returned array. |
IlUShort
values that indicate the indexes of a selected item. The total number of selected items (and therefore, of valid values in the returned array) is returned in the count parameter. const char* const* IlvListGadgetItemHolder::getSelections | ( | IlUShort & | count | ) | const |
Returns an array of the selected items.
count | The number of elements in the returned array. |
count
strings that includes all the selected items. Returns an array of all the user data for the items.
count | The number of elements in the returned array. |
0
. The user must not modify or delete the returned array. Inserts an item with a bitmap at the given position in the holder list.
The specified bitmap is locked. The item is created by calling the member function IlvGadgetItemHolder::createItem
.
bitmap | The item picture. |
pos | The item position. If pos is -1 , the item is appended to the holder list. |
IlUShort IlvListGadgetItemHolder::insertGraphic | ( | IlvGraphic * | graphic, |
IlShort | pos = -1 |
||
) |
Inserts an item with a graphic as picture at a given position in the holder list.
The item is created by calling the member function IlvGadgetItemHolder::createItem
.
graphic | The item picture. |
pos | The item position. If pos is -1 , the item is appended to the holder list. |
IlUShort IlvListGadgetItemHolder::insertItem | ( | IlvGadgetItem * | item, |
IlShort | index = -1 |
||
) |
Inserts an item at a given position in the holder's list.
item | The item. |
index | The item position. If index is -1 , the item is appended to the holder list. |
|
virtual |
Inserts an item with a label at a given position in the holder list.
The item is created by calling the member function IlvGadgetItemHolder::createItem
.
pos | The item's position. |
label | The item label. |
data | The item client data. |
Specifies whether the item whose position is specified is selected.
index | The item index. |
IlTrue
if indexth item is selected. Removes an item from the holder.
index | The item position. |
destroy | A Boolean value specifying whether the item should be destroyed. |
void IlvListGadgetItemHolder::removeLabel | ( | IlUShort | index | ) |
Sets an item user data.
index | The item index. |
itemData | The item data. |
|
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 in IlvAbstractMenu, IlvStringList, and IlvComboBox.
Modifies the label of an item.
index | The item index. |
label | The new item label. |
copy | A Boolean value specifying whether a label should be copied. If the value is IlFalse |
getLabel
|
virtual |
Replaces the entire list of items.
Replaces the entire internal list of items to match the count labels provided in the parameter labels. Each item created is associated with its data read from the itemData array.
labels | The new items labels. |
itemData | The data associated with the items. |
count | The number of elements in the labels and itemData arrays. |
copy | A Boolean value specifying whether the labels should be copied. If the value is IlFalse |
|
virtual |
Replaces the entire list of items.
Replaces the entire internal list of items to match the count labels provided in the parameter labels.
labels | The new items labels. |
count | The number of elements in the labels. |
copy | A Boolean value specifying whether the labels should be copied. If the value is IlFalse |
|
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. |
Reimplemented in IlvStringList.
© 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.