Logo ROOT   6.10/09
Reference Guide
TQRootCanvas.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_TQRootCanvas
13 #define ROOT_TQRootCanvas
14 
15 ///////////////////////////////////////////////////////////////////////
16 //
17 // TQRootCanvas
18 //
19 // This canvas uses Qt eventloop to handle user input.
20 //
21 // @short Graphic Qt Widget based Canvas
22 //
23 // @authors Denis Bertini <d.bertini@gsi.de>
24 // M. AL-Turany <m.al-turany@gsi.de>
25 //version 2.0
26 //////////////////////////////////////////////////////////////////////
27 
28 #ifndef __CINT__
29 #include "qwidget.h"
30 #include "qstring.h"
31 #if !(QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 3
32 # include "qdragobject.h"
33 #endif
34 #endif
35 
36 #include "TVirtualPad.h"
37 
38 
39 class QAction;
40 class QMouseEvent;
41 class QResizeEvent;
42 class QPaintEvent;
43 
44 class TPad;
45 class TContextMenu;
46 class TControlBar;
47 class TCanvas;
48 class TQCanvasMenu;
49 class TBrowser;
50 class QWidget;
51 class QDropEvent;
52 class QDragEnterEvent;
53 class QCloseEvent;
54 class QEvent;
55 class QObject;
56 
57 class TQRootCanvas : public QWidget
58 {
59 #ifndef __CINT__
60  Q_OBJECT
61 #endif
62 private:
63  TQRootCanvas(const TQRootCanvas &);
65 
66 public:
67 
68  TQRootCanvas( QWidget *parent = 0, const char *name = 0 ,TCanvas *c=0);
69  TQRootCanvas( QWidget *parent, QWidget* tabWin , const char *name = 0 ,TCanvas *c=0);
70  virtual ~TQRootCanvas();
71  TCanvas* GetCanvas() { return fCanvas;}
72  Int_t GetRootWid() { return fWid;}
74  QWidget* GetParent() { return fParent;}
75  QWidget* GetTabWin() { return fTabWin;}
76  virtual void dropEvent( QDropEvent *Event );
77  virtual void dragEnterEvent( QDragEnterEvent *e );
78 
79 #ifndef __CINT__
80 signals:
81  void SelectedPadChanged(TPad *);
82 #endif
83 public slots:
84  void cd(Int_t subpadnumber=0);
85  virtual void Browse(TBrowser *b);
86  void Clear(Option_t *option="");
87  void Close(Option_t *option="");
88  virtual void Draw(Option_t *option="");
89  virtual TObject *DrawClone(Option_t *option="");
90  virtual TObject *DrawClonePad();
91  virtual void EditorBar();
92  void EnterLeave(TPad *prevSelPad, TObject *prevSelObj);
93  void FeedbackMode(Bool_t set);
94  void Flush();
95  void UseCurrentStyle();
96  void ForceUpdate() ;
97  const char *GetDISPLAY();
100  Int_t GetEvent() ;
101  Int_t GetEventX() ;
102  Int_t GetEventY() ;
105  TObject *GetSelected() ;
109  Bool_t GetAutoExec() ;
110  Size_t GetXsizeUser() ;
111  Size_t GetYsizeUser() ;
112  Size_t GetXsizeReal() ;
113  Size_t GetYsizeReal() ;
114  Int_t GetCanvasID() ;
119  UInt_t GetWw() ;
120  UInt_t GetWh() ;
121  virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh);
122  virtual void HandleInput(EEventType button, Int_t x, Int_t y);
123  Bool_t HasMenuBar() ;
124  void Iconify() ;
125  Bool_t IsBatch() ;
126  Bool_t IsRetained() ;
127  virtual void ls(Option_t *option="") ;
128  void MoveOpaque(Int_t set=1);
129  Bool_t OpaqueMoving() ;
131  virtual void Paint(Option_t *option="");
132  virtual TPad *Pick(Int_t px, Int_t py, TObjLink *&pickobj) ;
133  virtual TPad *Pick(Int_t px, Int_t py, TObject *prevSelObj);
134  virtual void Resize(Option_t *option="");
135  void ResizeOpaque(Int_t set=1) ;
136  void SaveSource(const char *filename="", Option_t *option="");
137  virtual void SetCursor(ECursor cursor);
138  virtual void SetDoubleBuffer(Int_t mode=1);
139  void SetWindowPosition(Int_t x, Int_t y) ;
140  void SetWindowSize(UInt_t ww, UInt_t wh) ;
141  void SetCanvasSize(UInt_t ww, UInt_t wh);
142  void SetHighLightColor(Color_t col);
143  void SetSelected(TObject *obj) ;
144  void SetSelectedPad(TPad *pad) ;
145  void Show() ;
146  virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0);
147  void SetBatch(Bool_t batch=kTRUE);
148  void SetRetained(Bool_t retained=kTRUE);
149  void SetTitle(const char *title="");
150  virtual void ToggleEventStatus();
151  virtual void ToggleAutoExec();
152  virtual void Update();
153  //////////////////////////////////////////////////////////////////////
156 
157 protected:
158  virtual bool eventFilter( QObject *, QEvent * );
159  virtual void mousePressEvent( QMouseEvent *e );
160  virtual void mouseReleaseEvent( QMouseEvent *e );
161  virtual void resizeEvent( QResizeEvent *e );
162  virtual void paintEvent( QPaintEvent *e );
163  virtual void mouseDoubleClickEvent(QMouseEvent* e );
164  virtual void mouseMoveEvent(QMouseEvent *e);
165  virtual void leaveEvent(QEvent *e);
166  virtual void closeEvent( QCloseEvent * e);
167  ////////////////////////////////////
168  TQCanvasMenu *fContextMenu; // Qt Context menu for this canvas
169  TCanvas *fCanvas; // Root Canvas
170  Int_t fWid; // Windows Id of the Canvas
171  Bool_t fNeedResize; // Resize flag
172  Bool_t fIsCanvasOwned; // Ownership flag
173  QWidget *fParent,*fTabWin; // parent widgets
174 
175  ClassDef(TQRootCanvas,1) //interface to Qt eventloop to handle user input
176 };
177 
178 #endif
179 
180 
181 
182 
183 
184 
void Close(Option_t *option="")
Just a wrapper.
virtual void SetDoubleBuffer(Int_t mode=1)
just a wrapper
Size_t GetXsizeReal()
just a wrapper
const char * GetDISPLAY()
just a wrapper
Int_t GetEvent()
just a wrapper
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
Definition: TControlBar.h:22
void SetSelected(TObject *obj)
just a wrapper
virtual void ToggleAutoExec()
just a wrapper
void Iconify()
just a wrapper
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
just a wrapper
Int_t GetCanvasID()
just a wrapper
Color_t GetHighLightColor()
just a wrapper
Bool_t GetAutoExec()
just a wrapper
float Float_t
Definition: RtypesCore.h:53
float Size_t
Definition: RtypesCore.h:83
const char Option_t
Definition: RtypesCore.h:62
void SetNeedsResize(Bool_t yes)
Definition: TQRootCanvas.h:155
Bool_t HasMenuBar()
just a wrapper
Bool_t GetCanvasOwner()
Definition: TQRootCanvas.h:73
UInt_t GetWw()
just a wrapper
QWidget * fParent
Definition: TQRootCanvas.h:173
EEventType
Definition: Buttons.h:15
virtual TObject * DrawClonePad()
Just a wrapper.
virtual void ls(Option_t *option="")
just a wrapper
void MoveOpaque(Int_t set=1)
just a wrapper
void Flush()
just a wrapper
virtual ~TQRootCanvas()
dtor
int Int_t
Definition: RtypesCore.h:41
QWidget * GetParent()
Definition: TQRootCanvas.h:74
bool Bool_t
Definition: RtypesCore.h:59
Size_t GetXsizeUser()
just a wrapper
TCanvas * fCanvas
Definition: TQRootCanvas.h:169
virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
just a wrapper
Int_t GetEventY()
just a wrapper
ECursor
Definition: TVirtualX.h:44
Size_t GetYsizeUser()
just a wrapper
void SetWindowPosition(Int_t x, Int_t y)
just a wrapper
virtual void mouseReleaseEvent(QMouseEvent *e)
Handle mouse button release event.
virtual void paintEvent(QPaintEvent *e)
Handle paint event of Qt.
QWidget * fTabWin
Definition: TQRootCanvas.h:173
Option_t * GetSelectedOpt()
just a wrapper
void SetWindowSize(UInt_t ww, UInt_t wh)
just a wrapper
virtual void EditorBar()
Just a wrapper.
virtual void mouseMoveEvent(QMouseEvent *e)
Handle mouse move event.
Bool_t fNeedResize
Definition: TQRootCanvas.h:171
Double_t x[n]
Definition: legend1.C:17
virtual void leaveEvent(QEvent *e)
Handle leave event.
virtual void Paint(Option_t *option="")
just a wrapper
virtual void Resize(Option_t *option="")
just a wrapper
#define ClassDef(name, id)
Definition: Rtypes.h:297
TQRootCanvas(const TQRootCanvas &)
Bool_t OpaqueMoving()
just a wrapper
void UseCurrentStyle()
just a wrapper
Size_t GetYsizeReal()
just a wrapper
Bool_t GetShowEventStatus()
just a wrapper
TContextMenu * GetContextMenu()
just a wrapper
virtual void dragEnterEvent(QDragEnterEvent *e)
Entering a drag event.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:49
TCanvas * GetCanvas()
Definition: TQRootCanvas.h:71
virtual void Update()
just a wrapper
short Color_t
Definition: RtypesCore.h:79
void SetRetained(Bool_t retained=kTRUE)
just a wrapper
Int_t GetWindowTopX()
just a wrapper
virtual TObject * DrawClone(Option_t *option="")
Just a wrapper.
void ForceUpdate()
just a wrapper
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
void FeedbackMode(Bool_t set)
just a wrapper
virtual TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj)
just a wrapper
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
void Clear(Option_t *option="")
Just a wrapper.
unsigned int UInt_t
Definition: RtypesCore.h:42
The most important graphics class in the ROOT system.
Definition: TPad.h:29
void SetTitle(const char *title="")
just a wrapper
void ResizeOpaque(Int_t set=1)
just a wrapper
void SetBatch(Bool_t batch=kTRUE)
just a wrapper
void SetCanvasSize(UInt_t ww, UInt_t wh)
just a wrapper
virtual void dropEvent(QDropEvent *Event)
Start a drop, for now only histogram objects can be drwon by droping.
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
just a wrapper
void Show()
just a wrapper
TObject * GetSelected()
just a wrapper
Int_t GetWindowTopY()
just a wrapper
The Canvas class.
Definition: TCanvas.h:31
UInt_t GetWindowWidth()
just a wrapper
virtual void SetCursor(ECursor cursor)
just a wrapper
Bool_t IsBatch()
just a wrapper
virtual void Draw(Option_t *option="")
Just a wrapper.
Double_t y[n]
Definition: legend1.C:17
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
just a wrapper
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
QWidget * GetTabWin()
Definition: TQRootCanvas.h:75
Bool_t IsRetained()
just a wrapper
virtual void closeEvent(QCloseEvent *e)
Close.
Int_t GetRootWid()
Definition: TQRootCanvas.h:72
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void mousePressEvent(QMouseEvent *e)
Handle mouse button press event.
void cd(Int_t subpadnumber=0)
Just a wrapper.
void SelectedPadChanged(TPad *)
Bool_t fIsCanvasOwned
Definition: TQRootCanvas.h:172
virtual void ToggleEventStatus()
just a wrapper
void SetHighLightColor(Color_t col)
just a wrapper
virtual void Browse(TBrowser *b)
Just a wrapper.
virtual bool eventFilter(QObject *, QEvent *)
Filtering of QWidget Events for ressource management.
Int_t GetEventX()
just a wrapper
void SetSelectedPad(TPad *pad)
just a wrapper
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Bool_t OpaqueResizing()
just a wrapper
TQRootCanvas & operator=(const TQRootCanvas &)
TQCanvasMenu * fContextMenu
Definition: TQRootCanvas.h:168
TVirtualPad * GetSelectedPad()
just a wrapper
virtual void mouseDoubleClickEvent(QMouseEvent *e)
Handle mouse double click event.
const Bool_t kTRUE
Definition: RtypesCore.h:91
virtual void resizeEvent(QResizeEvent *e)
Call QWidget resize and inform the ROOT Canvas.
Int_t GetDoubleBuffer()
just a wrapper
TVirtualPad * GetPadSave()
just a wrapper
UInt_t GetWh()
just a wrapper
UInt_t GetWindowHeight()
just a wrapper
Bool_t NeedsResize()
Definition: TQRootCanvas.h:154
void SaveSource(const char *filename="", Option_t *option="")
just a wrapper