Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

Menu.H File Reference

Define GLUT popup menus with callbacks simulated as keyboard events. More...

#include <GL/glut.h>
#include <map>
#include <KeyBoard.H>
#include <ControlGroup.H>
#include <UserInterface.H>

Go to the source code of this file.

Namespaces

namespace  xchen


Detailed Description

Define GLUT popup menus with callbacks simulated as keyboard events.

Use AddItem(doc-str, callback, hot-key, [converted-key]) to register a menu item.

When the registered item is clicked, the 'hot-key', or an auto-generated key if it is not given, is sent to the embedded KeyBorad object, which will call 'callback' with 'converted-key', which ususally is item_id or menu_id*MAX_ITEM + item_id as the parameter. The 'converted-key', however, does not necessary related to menu-item-id, and can actually be customized to specific requirement as in the implementation of ControlGroup.

If the hot-key, or the auto-generated-key (usually non printing though), is pressed, the 'callback' of this menu item is also called with the menu item id as the parameter, together with x and y positions of key event.

Author:
Xianming Chen
Computer Science Department
University of Utah
Date:
4 Jan 2004

Generated on Wed Apr 7 21:40:50 2004 by doxygen1.2.18