Logo ROOT   6.12/07
Reference Guide
TQCanvasMenu.h
Go to the documentation of this file.
1 // @(#)root/qtgsi:$Id$
2 // Author: Denis Bertini, M. AL-Turany 01/11/2000
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TQCanvasMenu
13 #define ROOT_TQCanvasMenu
14 
15 ////////////////////////////////////////////////////////////////////////////////
16 //
17 // TQCanvasMenu
18 //
19 // This class provides an interface to Qt based context sensitive popup menus.
20 // These menus pop up when the user hits the right mouse button, and
21 // are destroyed when the menu pops downs.
22 //
23 ////////////////////////////////////////////////////////////////////////////////
24 
25 #include "qobject.h"
26 
27 #include "TList.h"
28 
29 class TCanvas;
30 class TObject;
31 class TMethodArg;
32 class TQRootDialog;
33 
34 #if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
35 class Q3PopupMenu;
36 typedef Q3PopupMenu QPopupMenu;
37 #else
38 class QPopupMenu;
39 #endif
40 
41 class QAction;
42 class QMouseEvent;
43 class QObject;
44 class QPaintEvent;
45 class QResizeEvent;
46 class QWidget;
47 
48 class TQCanvasMenu : public QObject {
49 #ifndef __CINT__
50  Q_OBJECT
51 #endif
52 private:
53  TQCanvasMenu(const TQCanvasMenu &c);
54  TQCanvasMenu& operator=(const TQCanvasMenu&) {return *this;}
55 
56 public:
57  TQCanvasMenu(QWidget* parent = 0, TCanvas *canvas = 0);
58  TQCanvasMenu(QWidget* parent, QWidget *tabWin, TCanvas *canvas) ;
59  virtual ~TQCanvasMenu();
60  void Popup(TObject *obj, double x, double y, QMouseEvent *e);
61  void Dialog(TObject *obj, TMethod* method);
62  char* CreateDialogTitle( TObject *object, TMethod *method );
63  char* CreateArgumentTitle(TMethodArg *argument);
64 
65 public slots:
66  void Execute(int id);
67 
68 protected:
69  TObject* fCurrObj; // current selected object
70  QPopupMenu *fPopup; // Qt popup menu
71  TList fMethods; // list of Root metheds associated with the selected object
72  TCanvas *fc; // pointer to the ROOT canvas
73  TQRootDialog *fDialog; // the TQRootDialog which is used to prompt for
74  //the arguments of an object's member function.
75  QWidget *fParent,*fTabWin; //parents widgets
76  double fMousePosX; // mouse position in user coordinate
77  double fMousePosY; // mouse position in user coordinate
78 
79  ClassDef(TQCanvasMenu,1) //interface to Qt based context sensitive popup menus
80 };
81 
82 #endif
double fMousePosX
Definition: TQCanvasMenu.h:76
TList fMethods
Definition: TQCanvasMenu.h:71
double fMousePosY
Definition: TQCanvasMenu.h:77
char * CreateArgumentTitle(TMethodArg *argument)
Create string describing argument (for use in dialog box).
Each ROOT method (see TMethod) has a linked list of its arguments.
Definition: TMethodArg.h:31
virtual ~TQCanvasMenu()
dtor
TQCanvasMenu(const TQCanvasMenu &c)
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
void Popup(TObject *obj, double x, double y, QMouseEvent *e)
Perform the corresponding selected TObject popup in the position defined by x, y coordinates (in user...
QWidget * fParent
Definition: TQCanvasMenu.h:75
TQCanvasMenu & operator=(const TQCanvasMenu &)
Definition: TQCanvasMenu.h:54
QWidget * fTabWin
Definition: TQCanvasMenu.h:75
A doubly linked list.
Definition: TList.h:44
void Execute(int id)
Slot defined to execute a method from a selected TObject using TObject::Execute() function...
TObject * fCurrObj
Definition: TQCanvasMenu.h:69
The Canvas class.
Definition: TCanvas.h:31
TQRootDialog * fDialog
Definition: TQCanvasMenu.h:73
Double_t y[n]
Definition: legend1.C:17
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
Mother of all ROOT objects.
Definition: TObject.h:37
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:38
TCanvas * fc
Definition: TQCanvasMenu.h:72
void Dialog(TObject *obj, TMethod *method)
Create dialog object with OK and Cancel buttons.
QPopupMenu * fPopup
Definition: TQCanvasMenu.h:70
char * CreateDialogTitle(TObject *object, TMethod *method)
Create title for dialog box retrieving argument values.