Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

glutm/menu.h

Go to the documentation of this file.
00001 #ifndef GLUTM_MENU_H
00002 #define GLUTM_MENU_H
00003 
00004 /*
00005 
00006   GLT OpenGL C++ Toolkit (LGPL)
00007   Copyright (C) 2000-2002 Nigel Stewart  
00008 
00009   Email: nigels.com@gmail.com   
00010   WWW:   http://www.nigels.com/glt/
00011 
00012   This library is free software; you can redistribute it and/or
00013   modify it under the terms of the GNU Lesser General Public
00014   License as published by the Free Software Foundation; either
00015   version 2.1 of the License, or (at your option) any later version.
00016 
00017   This library is distributed in the hope that it will be useful,
00018   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020   Lesser General Public License for more details.
00021 
00022   You should have received a copy of the GNU Lesser General Public
00023   License along with this library; if not, write to the Free Software
00024   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 */
00027 
00033 #include <glutm/config.h>
00034 #include <glutm/glut.h>
00035 
00036 #ifdef WIN32
00037 #pragma warning(disable : 4786)     // Lengthy STL symbols
00038 #endif
00039 
00040 #include <string>
00041 #include <list>
00042 
00044 
00051 class GlutMenu
00052 {
00053 public:
00058     GlutMenu(int button = GLUT_LEFT_BUTTON);
00060     ~GlutMenu();
00061 
00063     void addEntry(const std::string &name,int value = -1);
00064 
00065     // 
00066     // Sub-menu management
00067     //
00068 
00073     GlutMenu &subMenu();
00074 
00076     void addEntry(const std::string &name,GlutMenu &menu);
00077 
00079     void reset();
00080 
00082     void attach();
00083 
00085     void detach();
00086 
00087 protected:
00088 
00090     int  _button;
00092     int  _menuID;
00093 
00095     void resetList();
00097     std::list<GlutMenu *> _subMenu;
00098 };
00099 
00100 #endif

Generated on Tue Nov 5 11:11:04 2002 for GLT by doxygen1.2.18