Logo ROOT   6.14/05
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 "TQtGSIIncludes.h"
26 #include "TList.h"
27 
28 class TCanvas;
29 class TObject;
30 class TMethodArg;
31 class TQRootDialog;
32 
33 class TQCanvasMenu : public QObject {
34 #ifndef __CINT__
35  Q_OBJECT
36 #endif
37 private:
38  TQCanvasMenu(const TQCanvasMenu &c);
39  TQCanvasMenu& operator=(const TQCanvasMenu&) {return *this;}
40 
41 public:
42  TQCanvasMenu(QWidget* wparent = 0, TCanvas *canvas = 0);
43  TQCanvasMenu(QWidget* wparent, QWidget *tabWin, TCanvas *canvas) ;
44  virtual ~TQCanvasMenu();
45  void Popup(TObject *obj, double x, double y, QMouseEvent *e);
46  void Dialog(TObject *obj, TMethod* method);
47  char* CreateDialogTitle( TObject *object, TMethod *method );
48  char* CreateArgumentTitle(TMethodArg *argument);
49 
50 public slots:
51  void Execute(int id);
52 
53 protected:
54  TObject* fCurrObj; // current selected object
55  QMenu fMenu; // Qt popup menu
56  TList fMethods; // list of Root metheds associated with the selected object
57  TCanvas *fc; // pointer to the ROOT canvas
58  TQRootDialog *fDialog; // the TQRootDialog which is used to prompt for
59  //the arguments of an object's member function.
60  QWidget *fParent,*fTabWin; //parents widgets
61  double fMousePosX; // mouse position in user coordinate
62  double fMousePosY; // mouse position in user coordinate
63 
64  ClassDef(TQCanvasMenu,1) //interface to Qt based context sensitive popup menus
65 };
66 
67 #endif
double fMousePosX
Definition: TQCanvasMenu.h:61
TList fMethods
Definition: TQCanvasMenu.h:56
double fMousePosY
Definition: TQCanvasMenu.h:62
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:60
TQCanvasMenu & operator=(const TQCanvasMenu &)
Definition: TQCanvasMenu.h:39
QWidget * fTabWin
Definition: TQCanvasMenu.h:60
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:54
The Canvas class.
Definition: TCanvas.h:31
TQRootDialog * fDialog
Definition: TQCanvasMenu.h:58
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:57
#define c(i)
Definition: RSha256.hxx:101
void Dialog(TObject *obj, TMethod *method)
Create dialog object with OK and Cancel buttons.
char * CreateDialogTitle(TObject *object, TMethod *method)
Create title for dialog box retrieving argument values.