IContainerControl::TextCursor

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.


IContainerControl::TextCursor - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~TextCursor
public:
virtual ~TextCursor()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
TextCursor
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Cursor Movement

Use these members to position the text cursor.


[view class]
setToFirst
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setToLast
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setToNext
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setToPrevious
public:
virtual bool setToPrevious()

Points to the previous or last object in the container.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Cursor Validation

Use these members to validate the cursor.


[view class]
invalidate
public:
virtual TextCursor& invalidate()

Flags the cursor as not valid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isValid
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:

For example, calling setToNext when the cursor is pointing to the last object in the container causes the cursor to be not valid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations

The AIX release does not support this attribute because AIX does not support the ICnrDrawHandler.


Object Retrieval

Use these members to retrieve objects using a text cursor.


[view class]
current
public:
virtual IContainerObject* current() const

Returns the current object of this cursor.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
first
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
last
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
next
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
previous
public:
virtual IContainerObject* previous()

Points to and returns the previous or last object in the container with the matching text.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setCurrent
public:
virtual TextCursor& setCurrent( const IContainerObject* currentObject )

Sets the cursor to point to the specified object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IContainerControl::TextCursor - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data