IMenu::Cursor

The IMenu::Cursor class creates and manages the cursor for menu items. You can add or update items anywhere in a menu structure using this class.


IMenu::Cursor - Member Functions and Data by Group

Constructors & Destructor

You can only construct objects of this class from an object of the IMenu class and an optional submenu ID. The submenu defaults to 0 for the top-level menu items. You can also destruct objects of this class.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
Cursor
public:
Cursor(const IMenu& menu, unsigned long forSubmenuId = 0)

Use this function to construct a cursor object for a menu.

You can define a cursor for a submenu using forSubmenuId to specify the identifier of the submenu.

Exception

IInvalidRequest The menu item identifier is invalid. Verify that the identifier represents an item in the menu.
IInvalidRequest The menu is not valid. A valid menu object must be provided.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Cursor Movement

Use cursor movement members to move the cursor across the IMenu object.


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

Points to the first menu item. If successful, true is returned. If the menu is empty, the cursor is invalidated and false is returned.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

Points to the last menu item. If successful, true is returned.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

Points to the next menu item. If there is none, the cursor is invalidated. If successful, true is returned.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

Points to the previous menu item. If there is none, the cursor is invalidated. If successful, true is returned.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Cursor Validation

Use cursor validation members to determine if the cursor is valid or to invalidate it. The cursor must be valid in order to use it to access an item.


[view class]
invalidate
public:
virtual void invalidate()

Flags the cursor as invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isValid
public:
virtual bool isValid() const

Queries whether this cursor points to a valid menu item.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IMenu::Cursor - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data