Logo ROOT   6.16/01
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
31class TPad;
32class TContextMenu;
33class TControlBar;
34class TCanvas;
35class TQCanvasMenu;
36class TBrowser;
37
38class TQRootCanvas : public QWidget
39{
40#ifndef __CINT__
41 Q_OBJECT
42#endif
43private:
46
47public:
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();
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__
61signals:
63#endif
64public 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() ;
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);
105 void Iconify() ;
106 Bool_t IsBatch() ;
108 virtual void ls(Option_t *option="") ;
109 void MoveOpaque(Int_t set=1);
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);
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
138protected:
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
EEventType
Definition: Buttons.h:15
#define b(i)
Definition: RSha256.hxx:100
#define c(i)
Definition: RSha256.hxx:101
#define e(i)
Definition: RSha256.hxx:103
int Int_t
Definition: RtypesCore.h:41
float Size_t
Definition: RtypesCore.h:83
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
short Color_t
Definition: RtypesCore.h:79
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
ECursor
Definition: TVirtualX.h:44
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
The Canvas class.
Definition: TCanvas.h:31
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
Definition: TControlBar.h:22
Mother of all ROOT objects.
Definition: TObject.h:37
The most important graphics class in the ROOT system.
Definition: TPad.h:29
virtual void dragEnterEvent(QDragEnterEvent *e)
Entering a drag event.
virtual void resizeEvent(QResizeEvent *e)
Call QWidget resize and inform the ROOT Canvas.
Int_t GetWindowTopX()
just a wrapper
void SetSelected(TObject *obj)
just a wrapper
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
just a wrapper
void cd(Int_t subpadnumber=0)
Just a wrapper.
void Flush()
just a wrapper
Bool_t fIsCanvasOwned
Definition: TQRootCanvas.h:153
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
just a wrapper
virtual void leaveEvent(QEvent *e)
Handle leave event.
TObject * GetSelected()
just a wrapper
QWidget * fParent
Definition: TQRootCanvas.h:154
void SetHighLightColor(Color_t col)
just a wrapper
Int_t GetEventY()
just a wrapper
Size_t GetYsizeUser()
just a wrapper
virtual void EditorBar()
Just a wrapper.
virtual TObject * DrawClone(Option_t *option="")
Just a wrapper.
TQRootCanvas & operator=(const TQRootCanvas &)
virtual void SetCursor(ECursor cursor)
just a wrapper
QWidget * GetTabWin()
Definition: TQRootCanvas.h:56
virtual void mouseDoubleClickEvent(QMouseEvent *e)
Handle mouse double click event.
virtual TObject * DrawClonePad()
Just a wrapper.
void SelectedPadChanged(TPad *)
Option_t * GetSelectedOpt()
just a wrapper
void Show()
just a wrapper
virtual void dropEvent(QDropEvent *Event)
Start a drop, for now only histogram objects can be drwon by droping.
void MoveOpaque(Int_t set=1)
just a wrapper
QWidget * fTabWin
Definition: TQRootCanvas.h:154
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
just a wrapper
UInt_t GetWh()
just a wrapper
Bool_t IsBatch()
just a wrapper
virtual void SetDoubleBuffer(Int_t mode=1)
just a wrapper
void SetBatch(Bool_t batch=kTRUE)
just a wrapper
Bool_t IsRetained()
just a wrapper
Bool_t HasMenuBar()
just a wrapper
Bool_t NeedsResize()
Definition: TQRootCanvas.h:135
TVirtualPad * GetPadSave()
just a wrapper
virtual void mouseReleaseEvent(QMouseEvent *e)
Handle mouse button release event.
void SetTitle(const char *title="")
just a wrapper
virtual bool eventFilter(QObject *, QEvent *)
Filtering of QWidget Events for ressource management.
UInt_t GetWindowWidth()
just a wrapper
void Close(Option_t *option="")
Just a wrapper.
virtual void ToggleAutoExec()
just a wrapper
virtual void Paint(Option_t *option="")
just a wrapper
void SaveSource(const char *filename="", Option_t *option="")
just a wrapper
void ResizeOpaque(Int_t set=1)
just a wrapper
void Clear(Option_t *option="")
Just a wrapper.
void SetWindowSize(UInt_t ww, UInt_t wh)
just a wrapper
TVirtualPad * GetSelectedPad()
just a wrapper
void ForceUpdate()
just a wrapper
virtual void Draw(Option_t *option="")
Just a wrapper.
TQRootCanvas(const TQRootCanvas &)
Size_t GetXsizeUser()
just a wrapper
Size_t GetXsizeReal()
just a wrapper
virtual void ToggleEventStatus()
just a wrapper
void Iconify()
just a wrapper
Bool_t OpaqueMoving()
just a wrapper
UInt_t GetWw()
just a wrapper
virtual void closeEvent(QCloseEvent *e)
Close.
TQCanvasMenu * fContextMenu
Definition: TQRootCanvas.h:149
void SetCanvasSize(UInt_t ww, UInt_t wh)
just a wrapper
void FeedbackMode(Bool_t set)
just a wrapper
Int_t GetEvent()
just a wrapper
void SetWindowPosition(Int_t x, Int_t y)
just a wrapper
void SetSelectedPad(TPad *pad)
just a wrapper
virtual void Update()
just a wrapper
virtual void paintEvent(QPaintEvent *e)
Handle paint event of Qt.
Bool_t GetCanvasOwner()
Definition: TQRootCanvas.h:54
Int_t GetRootWid()
Definition: TQRootCanvas.h:53
virtual void mousePressEvent(QMouseEvent *e)
Handle mouse button press event.
void SetRetained(Bool_t retained=kTRUE)
just a wrapper
void SetNeedsResize(Bool_t yes)
Definition: TQRootCanvas.h:136
Size_t GetYsizeReal()
just a wrapper
virtual void Resize(Option_t *option="")
just a wrapper
QWidget * GetParent()
Definition: TQRootCanvas.h:55
virtual ~TQRootCanvas()
dtor
Bool_t fNeedResize
Definition: TQRootCanvas.h:152
Int_t GetDoubleBuffer()
just a wrapper
virtual TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj)
just a wrapper
virtual void ls(Option_t *option="")
just a wrapper
Int_t GetCanvasID()
just a wrapper
Bool_t GetShowEventStatus()
just a wrapper
UInt_t GetWindowHeight()
just a wrapper
void UseCurrentStyle()
just a wrapper
Int_t GetWindowTopY()
just a wrapper
const char * GetDISPLAY()
just a wrapper
Int_t GetEventX()
just a wrapper
Color_t GetHighLightColor()
just a wrapper
TCanvas * fCanvas
Definition: TQRootCanvas.h:150
Bool_t OpaqueResizing()
just a wrapper
virtual void Browse(TBrowser *b)
Just a wrapper.
virtual void mouseMoveEvent(QMouseEvent *e)
Handle mouse move event.
virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
just a wrapper
Bool_t GetAutoExec()
just a wrapper
TContextMenu * GetContextMenu()
just a wrapper
TCanvas * GetCanvas()
Definition: TQRootCanvas.h:52
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17