TQCanvasMenu.h

Go to the documentation of this file.
00001 // @(#)root/qtgsi:$Id: TQCanvasMenu.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Denis Bertini, M. AL-Turany  01/11/2000
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TQCanvasMenu
00013 #define ROOT_TQCanvasMenu
00014 
00015 ////////////////////////////////////////////////////////////////////////////////
00016 //
00017 // TQCanvasMenu
00018 //
00019 // This class provides an interface to Qt based context sensitive popup menus.
00020 // These menus pop up when the user hits the right mouse button, and
00021 // are destroyed when the menu pops downs.
00022 //
00023 ////////////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef __CINT__
00026 #include "qobject.h"
00027 # if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 3
00028 #  include <q3popupmenu.h>
00029 typedef Q3PopupMenu QPopupMenu;
00030 # else 
00031 class QPopupMenu;
00032 # endif
00033 #else
00034 class QPopupMenu;
00035 #endif
00036 
00037 #ifndef ROOT_TList
00038 #include "TList.h"
00039 #endif
00040 
00041 class TCanvas;
00042 class TObject;
00043 class TMethodArg;
00044 class TQRootDialog;
00045 
00046 class QObject;
00047 class QAction;
00048 class QMouseEvent;
00049 class QResizeEvent;
00050 class QPaintEvent;
00051 class QWidget;
00052 
00053 class TQCanvasMenu : public QObject {
00054 #ifndef __CINT__
00055    Q_OBJECT
00056 #endif
00057 private:
00058    TQCanvasMenu(const TQCanvasMenu &c);
00059    TQCanvasMenu& operator=(const TQCanvasMenu&) {return *this;} 
00060       
00061 public:
00062    TQCanvasMenu(QWidget* parent = 0, TCanvas *canvas = 0);
00063    TQCanvasMenu(QWidget* parent, QWidget *tabWin, TCanvas *canvas) ;
00064    virtual ~TQCanvasMenu();
00065    void Popup(TObject *obj, double x, double y, QMouseEvent *e);
00066    void Dialog(TObject *obj, TMethod* method);
00067    char* CreateDialogTitle( TObject *object, TMethod *method );
00068    char* CreateArgumentTitle(TMethodArg *argument);
00069 
00070 public slots:
00071    void Execute(int id);
00072 
00073 protected:
00074    TObject* fCurrObj;         // current selected object
00075    QPopupMenu  *fPopup;       // Qt popup menu
00076    TList fMethods;            // list of Root metheds associated with the selected object
00077    TCanvas *fc;               // pointer to the ROOT canvas
00078    TQRootDialog *fDialog;     // the TQRootDialog which is used to prompt for
00079                               //the arguments of an object's member function.
00080    QWidget *fParent,*fTabWin; //parents widgets
00081    double fMousePosX;         // mouse position in user coordinate
00082    double fMousePosY;         // mouse position in user coordinate
00083 
00084    ClassDef(TQCanvasMenu,1)  //interface to Qt based context sensitive popup menus
00085 };
00086    
00087 #endif

Generated on Tue Jul 5 14:22:20 2011 for ROOT_528-00b_version by  doxygen 1.5.1