diff options
author | Brian Paul <[email protected]> | 1999-09-16 22:45:24 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 1999-09-16 22:45:24 +0000 |
commit | 4811b7c7e02c0612975a8526f8ebba49ece0e72b (patch) | |
tree | d039cf9b6dd2a9d4fb47b856f1f89adec4ff81f8 /src/glut/beos/glutMenu.h | |
parent | b9e8741c8f0e5d683df4be09a232aa722589645e (diff) |
initial check-in
Diffstat (limited to 'src/glut/beos/glutMenu.h')
-rw-r--r-- | src/glut/beos/glutMenu.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/glut/beos/glutMenu.h b/src/glut/beos/glutMenu.h new file mode 100644 index 00000000000..f61b9aaaf76 --- /dev/null +++ b/src/glut/beos/glutMenu.h @@ -0,0 +1,79 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. All rights reserved. + * + * FILE: glutMenu.h + * + * DESCRIPTION: the GlutMenu class is a simple popup menu + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include <GL/glut.h> +#include <Menu.h> +#include <MenuItem.h> + +/*********************************************************** + * Definitions + ***********************************************************/ +const int32 MENU_ITEM = 'menu'; + +/*********************************************************** + * CLASS: GlutMenu + ***********************************************************/ +class GlutMenuItem; +class GlutPopUp; +class GlutMenu { +public: + GlutMenu(int n_id, GLUTselectCB n_select) { + id = n_id; + select = n_select; + list = 0; + num = 0; + } + ~GlutMenu(); + BMenu *CreateBMenu(bool toplevel=true); // construct BPopUpMenu + + // public data + int id; + GLUTselectCB select; // callback function + GlutMenuItem *list; // list of menu items + int num; // number of items +}; + +/*********************************************************** + * CLASS: GlutMenuItem + ***********************************************************/ +class GlutMenuItem { +public: + GlutMenuItem(GlutMenu *n_menu, bool n_trig, int n_value, const char *n_label); + + // public data + GlutMenu *menu; // parent menu + bool isTrigger; // are we a submenu? + int value; // value to send, or submenu id if isTrigger + char *label; // strdup'ed label string + GlutMenuItem *next; // next menu entry on list +}; + +/*********************************************************** + * CLASS: GlutPopUp + ***********************************************************/ +class GlutPopUp : public BPopUpMenu { +public: + GlutPopUp(int m) : BPopUpMenu(0, false, false) { menu = m;} + + BPoint point; // point to start menu + GlutWindow *win; // pointer to my window + int menu; // my menu number +}; + +/*********************************************************** + * CLASS: GlutBMenuItem + ***********************************************************/ +class GlutBMenuItem : public BMenuItem { +public: + GlutBMenuItem(const char *name) : BMenuItem(name, 0) {} + GlutBMenuItem(BMenu* menu) : BMenuItem(menu) {} + int menu, value; +}; |