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.
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.
![]() |
public:
virtual ~Cursor()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
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. |
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use cursor movement members to move the cursor across the IMenu object.
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToLast()
Points to the last menu item. If successful, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToNext()
Points to the next menu item. If there is none, the cursor is invalidated. If successful, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToPrevious()
Points to the previous menu item. If there is none, the cursor is invalidated. If successful, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
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.
![]() |
public:
virtual void invalidate()
Flags the cursor as invalid.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool isValid() const
Queries whether this cursor points to a valid menu item.
Windows | OS/2 | AIX |
Yes | Yes | Yes |