Logo ROOT   6.16/01
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
28class TCanvas;
29class TObject;
30class TMethodArg;
31class TQRootDialog;
32
33class TQCanvasMenu : public QObject {
34#ifndef __CINT__
35 Q_OBJECT
36#endif
37private:
39 TQCanvasMenu& operator=(const TQCanvasMenu&) {return *this;}
40
41public:
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
50public slots:
51 void Execute(int id);
52
53protected:
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
#define c(i)
Definition: RSha256.hxx:101
#define e(i)
Definition: RSha256.hxx:103
#define ClassDef(name, id)
Definition: Rtypes.h:324
The Canvas class.
Definition: TCanvas.h:31
A doubly linked list.
Definition: TList.h:44
Each ROOT method (see TMethod) has a linked list of its arguments.
Definition: TMethodArg.h:31
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:38
Mother of all ROOT objects.
Definition: TObject.h:37
virtual ~TQCanvasMenu()
dtor
char * CreateArgumentTitle(TMethodArg *argument)
Create string describing argument (for use in dialog box).
double fMousePosX
Definition: TQCanvasMenu.h:61
TQCanvasMenu & operator=(const TQCanvasMenu &)
Definition: TQCanvasMenu.h:39
double fMousePosY
Definition: TQCanvasMenu.h:62
TQCanvasMenu(const TQCanvasMenu &c)
QWidget * fParent
Definition: TQCanvasMenu.h:60
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...
TList fMethods
Definition: TQCanvasMenu.h:56
TQRootDialog * fDialog
Definition: TQCanvasMenu.h:58
TObject * fCurrObj
Definition: TQCanvasMenu.h:54
char * CreateDialogTitle(TObject *object, TMethod *method)
Create title for dialog box retrieving argument values.
QWidget * fTabWin
Definition: TQCanvasMenu.h:60
void Dialog(TObject *obj, TMethod *method)
Create dialog object with OK and Cancel buttons.
void Execute(int id)
Slot defined to execute a method from a selected TObject using TObject::Execute() function.
TCanvas * fc
Definition: TQCanvasMenu.h:57
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17