### IContainerControl::ObjectCursor

  The IContainerControl::ObjectCursor class iterates the container by finding objects based on the selection criteria established during construction of the cursor. The cursor become undefined when objects are added or removed from the container.

### IContainerControl::ObjectCursor - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~ObjectCursor

      public:
      virtual ~ObjectCursor()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

ObjectCursor

  Construct an object of this class to iterate objects in the container.

  Overload 1

      public:
      ObjectCursor( const IContainerControl& container,
                    const IContainerObject* parentObject,
                    bool allDescendents = false )

  Construct an object of this class to iterate all objects having the specified object as a parent. Optionally, you can specify whether to iterate just the immediate child objects or all descendents of the specified parent.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 2

      public:
      ObjectCursor( const IContainerControl& container,
                    IContainerObject::Emphasis emphasis = IContainerObject::none,
                    EnumerationOrder enumeration = itemOrder )

  Construct an object of this class to iterate all records either in the container or by meeting the emphasis selection criteria. Optionally, you can specify whether to iterate records in item order (the default) or Z-order.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Cursor Movement

Use these members to control cursor movement based on the type of objects indicated in the construction of the cursor.

setToFirst

      public:
      virtual bool setToFirst()

  Points to the first object in the container. If there are no objects in the container, false is returned. This function validates a cursor that was set invalid as a result of adding or removing objects from the container.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

setToLast

      public:
      virtual bool setToLast()

  Points to the last object in the container. If there is a last object, true is returned. Otherwise, false is returned.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

setToNext

      public:
      virtual bool setToNext()

  Points to the next object in the container. 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

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.

invalidate

      public:
      virtual ObjectCursor& invalidate()

  Flags the cursor as not valid.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

isValid

      public:
      virtual bool isValid() const

  Queries whether the cursor is valid. The cursor is not valid if any of the following occur:

  - You add a column after you created the cursor.
  - You remove a column after you created the cursor.
  - The last operation on the cursor put it into an undefined state.
  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

### Object Retrieval

Use these members to retrieve objects.

current

      public:
      virtual IContainerObject* current() const

  Returns the current object of this cursor.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

first

      public:
      virtual IContainerObject* first()

  Points to and returns the first object in the container that meets the criteria established during the construction of the cursor. 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

last

      public:
      virtual IContainerObject* last()

  Points to and returns the last object in the container. Returns 0 if there are no objects in the container. This function validates a cursor that was set invalid as a result of adding or removing objects from the container.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

next

      public:
      virtual IContainerObject* next()

  Points to and returns the next or first object in the container. 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

previous

      public:
      virtual IContainerObject* previous()

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

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

setCurrent

      public:
      virtual ObjectCursor&
        setCurrent( const IContainerObject* currentObject )

  Sets the cursor to point to the specified object and validates the cursor. This function does not check for visibility.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### IContainerControl::ObjectCursor - Inherited Member Functions and Data

#### Inherited Public Functions

  - None

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  - None

#### Inherited Protected Data

  - None