The nested class IBaseListBox::Cursor defines objects that you can use to traverse through the items in a list box. In the same way that you can use a cursor to traverse through the objects in a collection, you can use a cursor to traverse through a list box, one item at a time.
Once you create a cursor, you can set the cursor to the first, last, or a
specific item in a list box. You can add, update, get, and delete list box
items based on the cursor's location in the list box.
Note:
You can construct and destruct objects of this class.
![]() |
public:
virtual ~Cursor()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
Cursor( const IBaseListBox& listbox, Filter type = selectedItems )
You can create objects of this class by providing the following:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to control cursor movement in the list box.
![]() |
public:
virtual bool setToFirst()
Points to the first list box item and validates the cursor. If the cursor is set successfully, true is returned. Otherwise, false is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToIndex(unsigned long index)
Points to the specified item and validates the cursor. If the cursor is set to the specified list box item, true is returned. Otherwise, false is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToLast()
Points to the last list box item and validates the cursor. If the cursor is set successfully, true is returned. Otherwise, false is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToNext()
Points to the next item in the list box. If the cursor is set to the next list box item, true is returned. If no more items exist, this function invalidates the cursor and false is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToPrevious()
Points to the previous item in the list box. If the cursor is set to the previous list box item, true is returned. If no previous item exists, this function invalidates the cursor and false is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to query or return information about the item to which the cursor is pointing.
![]() |
public:
virtual unsigned long asIndex() const
Returns the index of the item the cursor is pointing to.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual void invalidate()
Flags this cursor as not valid.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool isValid() const
Returns a boolean that indicates whether this cursor points to a valid item.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
enum Filter { selectedItems, allItems }
Use these enumerators to specify which items you want filtered:
Windows | OS/2 | AIX |
Yes | Yes | Yes |