Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

wkgl::MenuBar Class Reference

This class allows you to place a menu bar on a window. More...

#include <MenuBar.h>

Inheritance diagram for wkgl::MenuBar:

wkgl::Menu wkgl::MenuItem wkgl::CallBack List of all members.

Public Methods

 MenuBar (Window *owner)
 Creates a menu bar.

virtual BOOL create (MenuItem *parent)
 Creates the menu bar and its menus and menu items.

virtual BOOL callBack (Component *com, UINT message, WPARAM wParam, LPARAM lParam)
 Implement this method to have a callback in your class.

virtual void append (MenuItem *mitem)
 Appends the given menu item to the menu.

virtual HMENU getMenuHandle ()
 Returns the system handle for this item.

virtual UINT getCommand ()
 Returns the command identifier of this item.

virtual char * getLabelText ()
 Returns the label of this item.

virtual BOOL fireMenuEvents (UINT message)
 Calls all the callbacks found in MenuItem::mcallbacks.

virtual void addMenuCallBack (MENUCALLBACK mcallback)
 Adds a menu callback.


Protected Attributes

Windowowner
 The owner of this menu bar.

std::vector< MenuItem * > child_items
 The menu items that have been appended into this menu.

HMENU hmenu
 The system handle to the menu item, can be NULL.

Stringlabel
 The label of the menu.

UINT command
 The command id of the menu.

std::vector< MENUCALLBACKmcallbacks
 The callbacks to use for this item.


Static Protected Attributes

std::vector< MENUITEM * > reg_menu_items
 A list of all menu items.

UINT command_inc = 40001
 Increments for every item created.


Detailed Description

This class allows you to place a menu bar on a window.

Author:
Micheal Nooner A menu bar consists of a horizontal line of menus and/or menu items. To make a menu bar show up you must call Window::setMenuBar().


Constructor & Destructor Documentation

MenuBar::MenuBar Window   owner
 

Creates a menu bar.

Parameters:
owner  The window that this menu bar should recieve events from. Note that this window need not show the menu bar, the menu bar only looks for messages from it.


Member Function Documentation

void MenuItem::addMenuCallBack MENUCALLBACK    mcallback [virtual, inherited]
 

Adds a menu callback.

Parameters:
mcallback  Adds it to the callbacks list.

void Menu::append MenuItem   mitem [virtual, inherited]
 

Appends the given menu item to the menu.

Parameters:
mitem  The item to add to the menu.

BOOL MenuBar::callBack Component   com,
UINT    message,
WPARAM    wParam,
LPARAM    lParam
[virtual]
 

Implement this method to have a callback in your class.

Parameters:
com  A pointer to the component that generated the message.
message  The windows integer event.
wParam  contain information about the event, see windows docs.
lParam  contain information about the event, see windows docs.
Returns:
TRUE if the event was handled, FALSE otherwise.

Reimplemented from wkgl::Menu.

BOOL MenuBar::create MenuItem   parent [virtual]
 

Creates the menu bar and its menus and menu items.

Parameters:
parent  Ignored, should be NULL.
Returns:
TRUE if the menu bar and its menus and menu items are created correctly.

Reimplemented from wkgl::Menu.

BOOL MenuItem::fireMenuEvents UINT    message [virtual, inherited]
 

Calls all the callbacks found in MenuItem::mcallbacks.

Parameters:
message  The message to pass to the callbacks.
Returns:
TRUE if the event was handled at least once.

UINT MenuItem::getCommand   [virtual, inherited]
 

Returns the command identifier of this item.

Returns:
The system command id for this item.

char * MenuItem::getLabelText   [virtual, inherited]
 

Returns the label of this item.

Returns:
The label for this item.

HMENU MenuItem::getMenuHandle   [virtual, inherited]
 

Returns the system handle for this item.

Returns:
The system handle for this item.


Member Data Documentation

std::vector<MenuItem*> wkgl::Menu::child_items [protected, inherited]
 

The menu items that have been appended into this menu.

UINT wkgl::MenuItem::command [protected, inherited]
 

The command id of the menu.

UINT MenuItem::command_inc = 40001 [static, protected, inherited]
 

Increments for every item created.

HMENU wkgl::MenuItem::hmenu [protected, inherited]
 

The system handle to the menu item, can be NULL.

String* wkgl::MenuItem::label [protected, inherited]
 

The label of the menu.

std::vector<MENUCALLBACK> wkgl::MenuItem::mcallbacks [protected, inherited]
 

The callbacks to use for this item.

Window* wkgl::MenuBar::owner [protected]
 

The owner of this menu bar.

std::vector< MENUITEM * > Menu::reg_menu_items [static, protected, inherited]
 

A list of all menu items.


The documentation for this class was generated from the following files:
Generated on Tue Apr 29 03:18:57 2003 for GuiLib by doxygen1.2.18