The IContainerControl::TextCursor class iterates through the container and finds objects containing a specified text string. You specify this text string when creating the IContainerControl::TextCursor object.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~TextCursor()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
TextCursor( const IContainerControl& container, const char* text, bool isCaseSensitive = true, bool isFirstInRecord = false, bool isExactMatch = false )
Constructs objects of this class by specifying a text string to search the container for. Optionally, you can specify that the search return any of the following:
When you construct a TextCursor, it is only valid for the objects shown in the currently displayed container view. For example, if you construct a TextCursor while the container is displaying the icon view and you want the application to iterate a TextCursor for children in a tree view, you must do the following:
If you create a details view TextCursor, it searches all the text columns for the specified string.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to position the text cursor.
![]() |
public:
virtual bool setToFirst()
Points to the first object in the container with the matching text. If there are no objects in the container, false is returned. This function validates a cursor that was set not valid as a result of adding or removing objects from the container.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToLast()
Points to the last object in the container with the matching text. If there is a last object, true is returned. Otherwise, false is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToNext()
Points to the next or first object in the container with the matching text. If the cursor does not point to an object, this function is the same as setToFirst. The cursor does not point to an object when it is initially created. In other words, setToNext on a new cursor is the same as setToFirst.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToPrevious()
Points to the previous or last object in the container.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to validate the cursor.
![]() |
public:
virtual TextCursor& invalidate()
Flags the cursor as not valid.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool isValid() const
Queries whether the cursor is pointing to a valid object. The cursor is not valid if any of the following occur:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The AIX release does not support this attribute because AIX does not support the ICnrDrawHandler.
Use these members to retrieve objects using a text cursor.
![]() |
public:
virtual IContainerObject* current() const
Returns the current object of this cursor.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerObject* first()
Points to and returns the first object in the container with the matching text. If there are no objects in the container, 0 is returned. This function validates a cursor that was set invalid as a result of adding or removing columns from the container.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerObject* last()
Points to and returns the last object in the container with matching text. Returns 0 if there is no object in the container. This function validates a cursor that was set invalid as a result of adding or removing an object from the container.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerObject* next()
Points to and returns the next or first object in the container with the matching text. If the cursor has reached the end of the list of objects in the container, 0 is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerObject* previous()
Points to and returns the previous or last object in the container with the matching text.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual TextCursor& setCurrent( const IContainerObject* currentObject )
Sets the cursor to point to the specified object.
Windows | OS/2 | AIX |
Yes | Yes | Yes |