#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 |
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.
1.2.18