ROOT
6.16/01
Reference Guide
gui
qtgsi
inc
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
c
#define c(i)
Definition:
RSha256.hxx:101
e
#define e(i)
Definition:
RSha256.hxx:103
ClassDef
#define ClassDef(name, id)
Definition:
Rtypes.h:324
TList.h
TQtGSIIncludes.h
TCanvas
The Canvas class.
Definition:
TCanvas.h:31
TList
A doubly linked list.
Definition:
TList.h:44
TMethodArg
Each ROOT method (see TMethod) has a linked list of its arguments.
Definition:
TMethodArg.h:31
TMethod
Each ROOT class (see TClass) has a linked list of methods.
Definition:
TMethod.h:38
TObject
Mother of all ROOT objects.
Definition:
TObject.h:37
TQCanvasMenu
Definition:
TQCanvasMenu.h:33
TQCanvasMenu::~TQCanvasMenu
virtual ~TQCanvasMenu()
dtor
Definition:
TQCanvasMenu.cxx:56
TQCanvasMenu::CreateArgumentTitle
char * CreateArgumentTitle(TMethodArg *argument)
Create string describing argument (for use in dialog box).
Definition:
TQCanvasMenu.cxx:78
TQCanvasMenu::fMousePosX
double fMousePosX
Definition:
TQCanvasMenu.h:61
TQCanvasMenu::operator=
TQCanvasMenu & operator=(const TQCanvasMenu &)
Definition:
TQCanvasMenu.h:39
TQCanvasMenu::fMousePosY
double fMousePosY
Definition:
TQCanvasMenu.h:62
TQCanvasMenu::TQCanvasMenu
TQCanvasMenu(const TQCanvasMenu &c)
TQCanvasMenu::fParent
QWidget * fParent
Definition:
TQCanvasMenu.h:60
TQCanvasMenu::Popup
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...
Definition:
TQCanvasMenu.cxx:103
TQCanvasMenu::fMethods
TList fMethods
Definition:
TQCanvasMenu.h:56
TQCanvasMenu::fDialog
TQRootDialog * fDialog
Definition:
TQCanvasMenu.h:58
TQCanvasMenu::fCurrObj
TObject * fCurrObj
Definition:
TQCanvasMenu.h:54
TQCanvasMenu::CreateDialogTitle
char * CreateDialogTitle(TObject *object, TMethod *method)
Create title for dialog box retrieving argument values.
Definition:
TQCanvasMenu.cxx:63
TQCanvasMenu::fTabWin
QWidget * fTabWin
Definition:
TQCanvasMenu.h:60
TQCanvasMenu::Dialog
void Dialog(TObject *obj, TMethod *method)
Create dialog object with OK and Cancel buttons.
Definition:
TQCanvasMenu.cxx:164
TQCanvasMenu::fMenu
QMenu fMenu
Definition:
TQCanvasMenu.h:55
TQCanvasMenu::Execute
void Execute(int id)
Slot defined to execute a method from a selected TObject using TObject::Execute() function.
Definition:
TQCanvasMenu.cxx:135
TQCanvasMenu::fc
TCanvas * fc
Definition:
TQCanvasMenu.h:57
TQRootDialog
Definition:
TQRootDialog.h:33
y
Double_t y[n]
Definition:
legend1.C:17
x
Double_t x[n]
Definition:
legend1.C:17