OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Modifying Menu Objects

After you create a menu object, you can use TMenu member functions to modify it.

The table that follows lists the member functions you can call to modify menu objects.

After modifying the menu object, call the window object's TWindow::DrawMenuBar() member function to update the menu bar with the changes you have made.

TMenu member functionDescription
Adding menu items
TMenu::AppendMenu(uint, uint, const char*)Adds a menu item to the end of the menu.
TMenu::AppendMenu(uint, uint, const TBitmap&)Adds a bitmap as a menu item at the end of the menu.
TMenu::InsertMenu(uint, uint, uint, const char*)Adds a menu item to the menu after the menu item of the given ID.
TMenu::InsertMenu(uint, uint, uint, const TBitmap&)Adds a bitmap as a menu item after the menu item of the given ID.
Modifying menu items
TMenu::ModifyMenu(uint, uint, uint, const char*)Changes the given menu item.
TMenu::ModifyMenu(uint, uint, uint, const TBitmap&)Changes the given menu item to a bitmap.
Enabling and disabling menu items
TMenu::EnableMenuItem(uint, uint)Enables or disables the given menu item.
Deleting and removing menu items
TMenu::DeleteMenu(uint, uint)Removes the menu item from the menu it is a part of. Deletes it if it is a popup menu.
TMenu::RemoveMenu(uint, uint)Removes the menu item from the menu but not from memory.
Checking menu items
TMenu::CheckMenuItem(uint, uint)Check or unchecks the menu item.
TMenu::SetMenuItemBitmaps(uint, uint, const TBitmap*, const TBitmap*) Specifies the bitmap to be displayed when the given menu item is checked and unchecked.
Displaying pop-up menus
TMenu::TrackPopupMenu(uint, int, int, int, HWND, TRect*) Displays the menu as a pop-up menu at the given location on the specified window.
TMenu::TrackPopupMenu(uint, TPoint&, int, HWND, Trect*)

See Also