Logo ROOT   6.14/05
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 #include "TQtGSIIncludes.h"
29 #include "TVirtualPad.h"
30 
31 class TPad;
32 class TContextMenu;
33 class TControlBar;
34 class TCanvas;
35 class TQCanvasMenu;
36 class TBrowser;
37 
38 class TQRootCanvas : public QWidget
39 {
40 #ifndef __CINT__
41  Q_OBJECT
42 #endif
43 private:
44  TQRootCanvas(const TQRootCanvas &);
46 
47 public:
48 
49  TQRootCanvas( QWidget *wparent = 0, const char *name = 0 ,TCanvas *c=0);
50  TQRootCanvas( QWidget *wparent, QWidget* tabWin , const char *name = 0 ,TCanvas *c=0);
51  virtual ~TQRootCanvas();
52  TCanvas* GetCanvas() { return fCanvas;}
53  Int_t GetRootWid() { return fWid;}
55  QWidget* GetParent() { return fParent;}
56  QWidget* GetTabWin() { return fTabWin;}
57  virtual void dropEvent( QDropEvent *Event );
58  virtual void dragEnterEvent( QDragEnterEvent *e );
59 
60 #ifndef __CINT__
61 signals:
62  void SelectedPadChanged(TPad *);
63 #endif
64 public slots:
65  void cd(Int_t subpadnumber=0);
66  virtual void Browse(TBrowser *b);
67  void Clear(Option_t *option="");
68  void Close(Option_t *option="");
69  virtual void Draw(Option_t *option="");
70  virtual TObject *DrawClone(Option_t *option="");
71  virtual TObject *DrawClonePad();
72  virtual void EditorBar();
73  void EnterLeave(TPad *prevSelPad, TObject *prevSelObj);
74  void FeedbackMode(Bool_t set);
75  void Flush();
76  void UseCurrentStyle();
77  void ForceUpdate() ;
78  const char *GetDISPLAY();
81  Int_t GetEvent() ;
82  Int_t GetEventX() ;
83  Int_t GetEventY() ;
86  TObject *GetSelected() ;
95  Int_t GetCanvasID() ;
100  UInt_t GetWw() ;
101  UInt_t GetWh() ;
102  virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh);
103  virtual void HandleInput(EEventType button, Int_t x, Int_t y);
104  Bool_t HasMenuBar() ;
105  void Iconify() ;
106  Bool_t IsBatch() ;
107  Bool_t IsRetained() ;
108  virtual void ls(Option_t *option="") ;
109  void MoveOpaque(Int_t set=1);
110  Bool_t OpaqueMoving() ;
112  virtual void Paint(Option_t *option="");
113  virtual TPad *Pick(Int_t px, Int_t py, TObjLink *&pickobj) ;
114  virtual TPad *Pick(Int_t px, Int_t py, TObject *prevSelObj);
115  virtual void Resize(Option_t *option="");
116  void ResizeOpaque(Int_t set=1) ;
117  void SaveSource(const char *filename="", Option_t *option="");
118  virtual void SetCursor(ECursor cursor);
119  virtual void SetDoubleBuffer(Int_t mode=1);
120  void SetWindowPosition(Int_t x, Int_t y) ;
121  void SetWindowSize(UInt_t ww, UInt_t wh) ;
122  void SetCanvasSize(UInt_t ww, UInt_t wh);
123  void SetHighLightColor(Color_t col);
124  void SetSelected(TObject *obj) ;
125  void SetSelectedPad(TPad *pad) ;
126  void Show() ;
127  virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0);
128  void SetBatch(Bool_t batch=kTRUE);
129  void SetRetained(Bool_t retained=kTRUE);
130  void SetTitle(const char *title="");
131  virtual void ToggleEventStatus();
132  virtual void ToggleAutoExec();
133  virtual void Update();
134  //////////////////////////////////////////////////////////////////////
137 
138 protected:
139  virtual bool eventFilter( QObject *, QEvent * );
140  virtual void mousePressEvent( QMouseEvent *e );
141  virtual void mouseReleaseEvent( QMouseEvent *e );
142  virtual void resizeEvent( QResizeEvent *e );
143  virtual void paintEvent( QPaintEvent *e );
144  virtual void mouseDoubleClickEvent(QMouseEvent* e );
145  virtual void mouseMoveEvent(QMouseEvent *e);
146  virtual void leaveEvent(QEvent *e);
147  virtual void closeEvent( QCloseEvent * e);
148  ////////////////////////////////////
149  TQCanvasMenu *fContextMenu; // Qt Context menu for this canvas
150  TCanvas *fCanvas; // Root Canvas
151  Int_t fWid; // Windows Id of the Canvas
152  Bool_t fNeedResize; // Resize flag
153  Bool_t fIsCanvasOwned; // Ownership flag
154  QWidget *fParent,*fTabWin; // parent widgets
155 
156  ClassDef(TQRootCanvas,1) //interface to Qt eventloop to handle user input
157 };
158 
159 #endif
160 
161 
162 
163 
164 
165 
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:136
Bool_t HasMenuBar()
just a wrapper
Bool_t GetCanvasOwner()
Definition: TQRootCanvas.h:54
UInt_t GetWw()
just a wrapper
QWidget * fParent
Definition: TQRootCanvas.h:154
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:55
bool Bool_t
Definition: RtypesCore.h:59
Size_t GetXsizeUser()
just a wrapper
TCanvas * fCanvas
Definition: TQRootCanvas.h:150
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:154
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:152
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:320
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:52
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:56
Bool_t IsRetained()
just a wrapper
virtual void closeEvent(QCloseEvent *e)
Close.
Int_t GetRootWid()
Definition: TQRootCanvas.h:53
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:153
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
#define c(i)
Definition: RSha256.hxx:101
Bool_t OpaqueResizing()
just a wrapper
TQRootCanvas & operator=(const TQRootCanvas &)
TQCanvasMenu * fContextMenu
Definition: TQRootCanvas.h:149
TVirtualPad * GetSelectedPad()
just a wrapper
virtual void mouseDoubleClickEvent(QMouseEvent *e)
Handle mouse double click event.
const Bool_t kTRUE
Definition: RtypesCore.h:87
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
char name[80]
Definition: TGX11.cxx:109
Bool_t NeedsResize()
Definition: TQRootCanvas.h:135
void SaveSource(const char *filename="", Option_t *option="")
just a wrapper