| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2004 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: qtpopupmenu.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // $Date: 2007-08-09 09:51:16 +0200 (Thu, 09 Aug 2007) $ 00020 // $Revision: 6014 $ 00021 // $State$ 00022 // $Author: Konstantin_Baumann $ 00023 // 00024 // $Log$ 00025 // Revision 1.3 2004/11/09 15:05:55 kirsch 00026 // further changes to class comments due to doxygen 00027 // 00028 // Revision 1.2 2004/04/22 15:52:08 kirsch 00029 // added newline at the end of file ( fixes gcc warning ) 00030 // 00031 // Revision 1.1 2004/03/12 13:00:54 grabs 00032 // added QtPopupMenu, which allows the use of context menus without mocing and with vrs callbacks 00033 // 00034 00035 00036 #ifndef VRS_QT_QTPOPUPMENU_H 00037 #define VRS_QT_QTPOPUPMENU_H 00038 00039 #include <qpopupmenu.h> 00040 #include <qguardedptr.h> 00041 #include <vrs/callback.h> 00042 #include <vrs/qt3/qtcanvas.h> 00043 00044 namespace VRS{ 00045 00046 class VRS_QT3_API QtPopupMenu: public QPopupMenu{ 00047 Q_OBJECT 00048 public: 00049 QtPopupMenu(QWidget*parent, Callback1<int>*reactions, const char* name=0); 00050 /*<! 00051 easiest way of using: 00052 (an enum for entries would be a good idea) 00053 \code 00054 static void menu(int entry) { switch(entry) { ... } } 00055 QtPopupMenu* qmenu=new QtPopupMenu(qtcanvas,new VRS::FunctionCallback1<int>(menu)); 00056 qmenu->insertItem("OpenGL info", FILE_OPENGLINFO); 00057 qtcanvas->setContextMenu(qmenu); 00058 \endcode 00059 */ 00060 00061 public slots: 00062 virtual void react(int id); 00063 00064 private: 00065 00066 SO<Callback1<int> > reactions_; 00067 }; 00068 00069 } //namespace VRS 00070 00071 00072 #endif //VRS_QT_QTPOPUPMENU_H 00073 00074