Logo ROOT   6.16/01
Reference Guide
TQRootCanvas.cxx
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#include "TQRootCanvas.h"
13#include "TQCanvasMenu.h"
14
15#include "Riostream.h"
16#include "TCanvas.h"
17#include "TClass.h"
18#include "TROOT.h"
19
20using namespace Qt;
21
23
24////////////////////////////////////////////////////////////////////////////////
25/// set defaults
26
27TQRootCanvas::TQRootCanvas(QWidget *wparent, const char *name, TCanvas *c)
28 : QWidget(wparent), fNeedResize(kTRUE)
29{
30 setUpdatesEnabled( kTRUE );
31 setMouseTracking(kTRUE);
32
33 // setBackgroundMode( NoBackground );
34 setFocusPolicy( TabFocus );
35 setCursor( Qt::CrossCursor );
36
37 fTabWin = 0;
38 // add the Qt::WinId to TGX11 interface
39 fWid=gVirtualX->AddWindow((ULong_t)winId(),100,30);
40 if (c == 0) {
42 // Window_t win=gVirtualX->GetWindowID(fWid);
43 fCanvas=new TCanvas(name,width(),height(),fWid);
44 }
45 else {
47 fCanvas=c;
48 }
49 // create the context menu
50 fContextMenu = new TQCanvasMenu( wparent, fCanvas );
51
52 // test here all the events sent to the QWidget
53 // has a parent widget then install filter
54 if ( wparent ) {
55 wparent->installEventFilter( this );
56 fParent = wparent;
57 }
58 else
59 fParent=0;
60
61 // drag and drop suppurt (M. Al-Turany)
62 setAcceptDrops(kTRUE);
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// set defaults
67
68TQRootCanvas::TQRootCanvas(QWidget *wparent, QWidget* tabWin, const char *name, TCanvas *c)
69 : QWidget(tabWin), fNeedResize(kTRUE)
70{
71 setUpdatesEnabled( kTRUE );
72 setMouseTracking(kTRUE);
73
74 setFocusPolicy( TabFocus );
75 setCursor( Qt::CrossCursor );
76
77 fTabWin = 0;
78 // add the Qt::WinId to TGX11 interface
79 fWid=gVirtualX->AddWindow((ULong_t)winId(),100,30);
80 if (c == 0) {
82 fCanvas=new TCanvas(name,width(),height(),fWid);
83 }
84 else {
86 fCanvas=c;
87 }
88 // create the context menu
89 fContextMenu = new TQCanvasMenu( wparent, tabWin, fCanvas );
90
91 // test here all the events sent to the QWidget
92 // has a parent widget then install filter
93 if ( wparent ) {
94 wparent->installEventFilter( this );
95 fParent = wparent;
96 }
97 else
98 fParent=0;
99
100 if ( tabWin )
101 fTabWin = tabWin;
102
103 // drag and drop suppurt (M. Al-Turany)
104 setAcceptDrops(TRUE);
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Handle mouse move event.
109
111{
112 if (!fCanvas)
113 return;
114
115 bool buttonDown = e->buttons() & Qt::LeftButton;
116 fCanvas->HandleInput(buttonDown ? kButton1Motion : kMouseMotion, e->x(), e->y());
117}
118
119////////////////////////////////////////////////////////////////////////////////
120/// Handle mouse button press event.
121
123{
124 TPad *pad=0;
125 TObjLink *pickobj=0;
126 TObject *selected=0;
127 Int_t px=e->x();
128 Int_t py=e->y();
129 TString selectedOpt;
130 switch (e->button()) {
131 case Qt::LeftButton:
132 fCanvas->HandleInput(kButton1Down, e->x(), e->y());
133 break;
134 case Qt::RightButton:
135 selected=fCanvas->GetSelected();
136 pad = fCanvas->Pick(px, py, pickobj);
137 if (pad) {
138 if (!pickobj) {
139 fCanvas->SetSelected(pad); selected=pad;
140 selectedOpt = "";
141 }
142 else {
143 if (!selected) {
144 selected = pickobj->GetObject();
145 selectedOpt = pickobj->GetOption();
146 }
147 }
148 pad->cd();
150 }
151 gROOT->SetSelectedPrimitive(selected);
152 fContextMenu->Popup(selected, gPad->AbsPixeltoX(gPad->GetEventX()),
153 gPad->AbsPixeltoY(gPad->GetEventY()), e);
154
155 break;
156 case Qt::MidButton:
157 pad = fCanvas->Pick(px, py, pickobj); // get the selected pad and emit a Qt-Signal
158 emit SelectedPadChanged(pad); // that inform the Qt-world that tha pad is changed
159 // and give the pointer to the new pad as argument
160 // of the signal (M. Al-Turany)
161 fCanvas->HandleInput(kButton2Down, e->x(), e->y());
162 break;
163
164 default:
165 break;
166 }
167}
168
169////////////////////////////////////////////////////////////////////////////////
170/// Handle mouse button release event.
171
173{
174 switch (e->button()) {
175 case LeftButton :
176 fCanvas->HandleInput(kButton1Up, e->x(), e->y());
177 break;
178 case RightButton :
179 fCanvas->HandleInput(kButton3Up, e->x(), e->y());
180 break;
181 case MidButton :
182 fCanvas->HandleInput(kButton2Up, e->x(), e->y());
183 break;
184 case NoButton :
185 break;
186 default:
187 break;
188 }
189
190}
191
192////////////////////////////////////////////////////////////////////////////////
193/// Handle mouse double click event.
194
196{
197 switch (e->button()) {
198 case LeftButton :
199 fCanvas->HandleInput(kButton1Double, e->x(), e->y());
200 break;
201 case RightButton :
202 fCanvas->HandleInput(kButton3Double, e->x(), e->y());
203 break;
204 case MidButton :
205 fCanvas->HandleInput(kButton2Double, e->x(), e->y());
206 break;
207 case NoButton :
208 break;
209 default:
210 break;
211 }
212}
213
214////////////////////////////////////////////////////////////////////////////////
215/// Call QWidget resize and inform the ROOT Canvas.
216
217void TQRootCanvas::resizeEvent( QResizeEvent *e )
218{
219 QWidget::resizeEvent( e );
221}
222
223////////////////////////////////////////////////////////////////////////////////
224/// Handle paint event of Qt.
225
226void TQRootCanvas::paintEvent( QPaintEvent * )
227{
228 if (fCanvas) {
229 QPainter p;
230 p.begin( this);
231 p.end();
232 if (fNeedResize) {
233 fCanvas->Resize();
235 }
236 fCanvas->Update();
237 }
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Handle leave event.
242
243void TQRootCanvas::leaveEvent( QEvent * /*e*/ )
244{
246}
247
248////////////////////////////////////////////////////////////////////////////////
249/// Filtering of QWidget Events
250/// for ressource management
251
252Bool_t TQRootCanvas ::eventFilter( QObject *o, QEvent *e )
253{
254 if ( e->type() == QEvent::Close) { // close
255 if (fCanvas && (fIsCanvasOwned== kFALSE) ) {
256 delete fCanvas;
257 fCanvas=0;
258 }
259 if ( e->type() == QEvent::ChildRemoved ) { // child is removed
260 }
261 return FALSE; // eat event
262 }
263
264 if ( e->type() == QEvent::Destroy) { // destroy
265 return FALSE;
266 }
267
268 if ( e->type() == QEvent::Paint) { // Paint
269 return FALSE;
270 }
271 if ( e->type() == QEvent::Move) { // Paint
272 return FALSE;
273 }
274
275 // standard event processing
276 return QWidget::eventFilter( o, e );
277}
278
279////////////////////////////////////// drag and drop support
280
281////////////////////////////////////////////////////////////////////////////////
282/// Entering a drag event.
283
284void TQRootCanvas::dragEnterEvent(QDragEnterEvent *e)
285{
286 if (e->mimeData()->hasText())
287 e->acceptProposedAction();
288}
289
290////////////////////////////////////////////////////////////////////////////////
291/// Start a drop, for now only histogram objects can be drwon by droping.
292
293void TQRootCanvas::dropEvent(QDropEvent *e)
294{
295 if (e->mimeData()->hasText()) {
296 const char *name = e->mimeData()->text().toAscii().data();
297 TObject *dragedObject = gROOT->FindObject(name);
298 QPoint Pos = e->pos();
299 TObject *object=0;
300 TPad *pad = fCanvas->Pick(Pos.x(), Pos.y(), object);
301 if (dragedObject!=0) {
302 if (dragedObject->InheritsFrom("TH1")) {
303 pad->cd();
304 dragedObject->Draw();
305 pad->Update();
306 }
307 } else {
308 std::cout << "object " << name << " not found by ROOT" << std::endl;
309 }
310 }
311 e->acceptProposedAction();
312}
313
314/////////////////////////////////////End Drag and drop Support (Mohammad Al-Turany)
315
316////////////////////////////////////////////////////////////////////////////////
317/// Just a wrapper
318
319void TQRootCanvas::cd(Int_t subpadnumber)
320{
321 fCanvas->cd(subpadnumber);
322}
323
324////////////////////////////////////////////////////////////////////////////////
325/// Just a wrapper.
326
328{
329 fCanvas->Browse(b);
330}
331
332////////////////////////////////////////////////////////////////////////////////
333/// Just a wrapper.
334
336{
337 fCanvas->Clear(option);
338}
339
340////////////////////////////////////////////////////////////////////////////////
341/// Just a wrapper.
342
344{
345 fCanvas->Close(option);
346}
347
348////////////////////////////////////////////////////////////////////////////////
349/// Just a wrapper.
350
352{
353 fCanvas->Draw(option);
354}
355
356////////////////////////////////////////////////////////////////////////////////
357/// Just a wrapper.
358
360{
361 return fCanvas->DrawClone(option);
362}
363
364////////////////////////////////////////////////////////////////////////////////
365/// Just a wrapper.
366
368{
369 return fCanvas->DrawClonePad();
370}
371
372////////////////////////////////////////////////////////////////////////////////
373/// Just a wrapper.
374
376{
378}
379
380////////////////////////////////////////////////////////////////////////////////
381/// just a wrapper
382
383void TQRootCanvas::EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
384{
385 fCanvas->EnterLeave(prevSelPad, prevSelObj);
386}
387
388////////////////////////////////////////////////////////////////////////////////
389/// just a wrapper
390
392{
393 fCanvas->FeedbackMode(set);
394}
395
396////////////////////////////////////////////////////////////////////////////////
397/// just a wrapper
398
400{
401 fCanvas->Flush();
402}
403
404////////////////////////////////////////////////////////////////////////////////
405/// just a wrapper
406
408{
410}
411
412////////////////////////////////////////////////////////////////////////////////
413/// just a wrapper
414
416{
418}
419
420////////////////////////////////////////////////////////////////////////////////
421/// just a wrapper
422
424{
425 return fCanvas->GetDISPLAY() ;
426}
427
428////////////////////////////////////////////////////////////////////////////////
429/// just a wrapper
430
432{
433 return fCanvas->GetContextMenu() ;
434}
435
436////////////////////////////////////////////////////////////////////////////////
437/// just a wrapper
438
440{
441 return fCanvas->GetDoubleBuffer();
442}
443
444////////////////////////////////////////////////////////////////////////////////
445/// just a wrapper
446
448{
449 return fCanvas->GetEvent();
450}
451
452////////////////////////////////////////////////////////////////////////////////
453/// just a wrapper
454
456{
457 return fCanvas->GetEventX() ;
458}
459
460////////////////////////////////////////////////////////////////////////////////
461/// just a wrapper
462
464{
465 return fCanvas->GetEventY() ;
466}
467
468////////////////////////////////////////////////////////////////////////////////
469/// just a wrapper
470
472{
473 return fCanvas->GetHighLightColor() ;
474}
475
476////////////////////////////////////////////////////////////////////////////////
477/// just a wrapper
478
480{
481 return fCanvas->GetPadSave();
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// just a wrapper
486
488{
489 return fCanvas->GetSelected() ;
490}
491
492////////////////////////////////////////////////////////////////////////////////
493/// just a wrapper
494
496{
497 return fCanvas->GetSelectedOpt();
498}
499
500////////////////////////////////////////////////////////////////////////////////
501/// just a wrapper
502
504{
505 return fCanvas->GetSelectedPad();
506}
507
508////////////////////////////////////////////////////////////////////////////////
509/// just a wrapper
510
512{
513 return fCanvas->GetShowEventStatus() ;
514}
515
516////////////////////////////////////////////////////////////////////////////////
517/// just a wrapper
518
520{
521 return fCanvas->GetAutoExec();
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// just a wrapper
526
528{
529 return fCanvas->GetXsizeUser();
530}
531
532////////////////////////////////////////////////////////////////////////////////
533/// just a wrapper
534
536{
537 return fCanvas->GetYsizeUser();
538}
539
540////////////////////////////////////////////////////////////////////////////////
541/// just a wrapper
542
544{
545 return fCanvas->GetXsizeReal();
546}
547
548////////////////////////////////////////////////////////////////////////////////
549/// just a wrapper
550
552{
553 return fCanvas->GetYsizeReal();
554}
555
556////////////////////////////////////////////////////////////////////////////////
557/// just a wrapper
558
560{
561 return fCanvas->GetCanvasID();
562}
563
564////////////////////////////////////////////////////////////////////////////////
565/// just a wrapper
566
568{
569 return fCanvas->GetWindowTopX();
570}
571
572////////////////////////////////////////////////////////////////////////////////
573/// just a wrapper
574
576{
577 return fCanvas->GetWindowTopY();
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// just a wrapper
582
584{
585 return fCanvas->GetWindowWidth() ;
586}
587
588////////////////////////////////////////////////////////////////////////////////
589/// just a wrapper
590
592{
593 return fCanvas->GetWindowHeight();
594}
595
596////////////////////////////////////////////////////////////////////////////////
597/// just a wrapper
598
600{
601 return fCanvas->GetWw();
602}
603
604////////////////////////////////////////////////////////////////////////////////
605/// just a wrapper
606
608{
609 return fCanvas->GetWh() ;
610}
611
612////////////////////////////////////////////////////////////////////////////////
613/// just a wrapper
614
615void TQRootCanvas::GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
616{
617 fCanvas->GetCanvasPar(wtopx, wtopy, ww, wh);
618}
619
620////////////////////////////////////////////////////////////////////////////////
621/// just a wrapper
622
624{
625 fCanvas->HandleInput(button, ix, iy);
626}
627
628////////////////////////////////////////////////////////////////////////////////
629/// just a wrapper
630
632{
633 return fCanvas->HasMenuBar() ;
634}
635
636////////////////////////////////////////////////////////////////////////////////
637/// just a wrapper
638
640{
641 fCanvas->Iconify();
642}
643
644////////////////////////////////////////////////////////////////////////////////
645/// just a wrapper
646
648{
649 return fCanvas->IsBatch() ;
650}
651
652////////////////////////////////////////////////////////////////////////////////
653/// just a wrapper
654
656{
657 return fCanvas->IsRetained();
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// just a wrapper
662
664{
665 fCanvas->ls(option);
666}
667
668////////////////////////////////////////////////////////////////////////////////
669/// just a wrapper
670
672{
673 fCanvas->MoveOpaque(set);
674}
675
676////////////////////////////////////////////////////////////////////////////////
677/// just a wrapper
678
680{
681 return fCanvas->OpaqueMoving();
682}
683
684////////////////////////////////////////////////////////////////////////////////
685/// just a wrapper
686
688{
689 return fCanvas->OpaqueResizing();
690}
691
692////////////////////////////////////////////////////////////////////////////////
693/// just a wrapper
694
696{
697 fCanvas->Paint(option);
698}
699
700////////////////////////////////////////////////////////////////////////////////
701/// just a wrapper
702
704{
705 return fCanvas->Pick(px, py, pickobj);
706}
707
708////////////////////////////////////////////////////////////////////////////////
709/// just a wrapper
710
712{
713 return fCanvas->Pick(px, py, prevSelObj);
714}
715
716////////////////////////////////////////////////////////////////////////////////
717/// just a wrapper
718
720{
721 fCanvas->Resize(option);
722}
723
724////////////////////////////////////////////////////////////////////////////////
725/// just a wrapper
726
728{
729 fCanvas->ResizeOpaque(set);
730}
731
732////////////////////////////////////////////////////////////////////////////////
733/// just a wrapper
734
735void TQRootCanvas::SaveSource(const char *filename, Option_t *option)
736{
737 fCanvas->SaveSource(filename, option);
738}
739
740////////////////////////////////////////////////////////////////////////////////
741/// just a wrapper
742
744{
746}
747
748////////////////////////////////////////////////////////////////////////////////
749/// just a wrapper
750
752{
754}
755
756////////////////////////////////////////////////////////////////////////////////
757/// just a wrapper
758
760{
761 fCanvas->SetWindowPosition(ix, iy) ;
762}
763
764////////////////////////////////////////////////////////////////////////////////
765/// just a wrapper
766
768{
769 fCanvas->SetWindowSize(ww,wh) ;
770}
771
772////////////////////////////////////////////////////////////////////////////////
773/// just a wrapper
774
776{
777 fCanvas->SetCanvasSize(ww, wh);
778}
779
780////////////////////////////////////////////////////////////////////////////////
781/// just a wrapper
782
784{
786}
787
788////////////////////////////////////////////////////////////////////////////////
789/// just a wrapper
790
792{
793 fCanvas->SetSelected(obj);
794}
795
796////////////////////////////////////////////////////////////////////////////////
797/// just a wrapper
798
800{
802}
803
804////////////////////////////////////////////////////////////////////////////////
805/// just a wrapper
806
808{
809 fCanvas->Show() ;
810}
811
812////////////////////////////////////////////////////////////////////////////////
813/// just a wrapper
814
815void TQRootCanvas::Size(Float_t xsizeuser, Float_t ysizeuser)
816{
817 fCanvas->Size(xsizeuser, ysizeuser);
818}
819
820////////////////////////////////////////////////////////////////////////////////
821/// just a wrapper
822
824{
825 fCanvas->SetBatch(batch);
826}
827
828////////////////////////////////////////////////////////////////////////////////
829/// just a wrapper
830
832{
833 fCanvas->SetRetained(retained);
834}
835
836////////////////////////////////////////////////////////////////////////////////
837/// just a wrapper
838
839void TQRootCanvas::SetTitle(const char *title)
840{
841 fCanvas->SetTitle(title);
842}
843
844////////////////////////////////////////////////////////////////////////////////
845/// just a wrapper
846
848{
850}
851
852////////////////////////////////////////////////////////////////////////////////
853/// just a wrapper
854
856{
858}
859
860////////////////////////////////////////////////////////////////////////////////
861/// just a wrapper
862
864{
865 fCanvas->Update();
866}
867
868////////////////////////////////////////////////////////////////////////////////
869/// Close.
870
871void TQRootCanvas::closeEvent( QCloseEvent * e)
872{
873 if ( fIsCanvasOwned ) {
874 delete fCanvas;
875 fCanvas = 0;
876 }
877 e->accept();
878 return;
879}
880
881////////////////////////////////////////////////////////////////////////////////
882/// dtor
883
885{
886 if (fContextMenu) {
887 delete fContextMenu;
888 fContextMenu=0;
889 }
890 if ( fIsCanvasOwned && fCanvas ) {
891 delete fCanvas;
892 fCanvas = 0;
893 }
894}
895
896
897
EEventType
Definition: Buttons.h:15
@ kMouseMotion
Definition: Buttons.h:23
@ kButton3Up
Definition: Buttons.h:19
@ kButton2Down
Definition: Buttons.h:17
@ kButton2Double
Definition: Buttons.h:24
@ kButton1Double
Definition: Buttons.h:24
@ kButton3Double
Definition: Buttons.h:24
@ kButton1Motion
Definition: Buttons.h:20
@ kButton1Up
Definition: Buttons.h:19
@ kButton2Up
Definition: Buttons.h:19
@ kMouseLeave
Definition: Buttons.h:23
@ kButton1Down
Definition: Buttons.h:17
#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
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
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 ClassImp(name)
Definition: Rtypes.h:363
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gROOT
Definition: TROOT.h:410
#define gPad
Definition: TVirtualPad.h:286
#define gVirtualX
Definition: TVirtualX.h:345
ECursor
Definition: TVirtualX.h:44
#define TRUE
#define FALSE
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
The Canvas class.
Definition: TCanvas.h:31
Bool_t IsRetained() const
Is pad retained ?
Definition: TCanvas.h:181
void SetWindowSize(UInt_t ww, UInt_t wh)
Definition: TCanvas.h:207
UInt_t GetWindowHeight() const
Definition: TCanvas.h:168
virtual void EditorBar()
Get editor bar.
Definition: TCanvas.cxx:986
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
Generate kMouseEnter and kMouseLeave events depending on the previously selected object and the curre...
Definition: TCanvas.cxx:1021
UInt_t GetWh() const
Get Wh.
Definition: TCanvas.h:170
virtual void ToggleAutoExec()
Toggle pad auto execution of list of TExecs.
Definition: TCanvas.cxx:2219
void SetCanvasSize(UInt_t ww, UInt_t wh)
Set Width and Height of canvas to ww and wh respectively.
Definition: TCanvas.cxx:1916
void SetSelectedPad(TPad *pad)
Definition: TCanvas.h:219
Bool_t OpaqueResizing() const
Is pad resizing in opaque mode ?
Definition: TCanvas.h:186
void SetHighLightColor(Color_t col)
Definition: TCanvas.h:216
virtual void Draw(Option_t *option="")
Draw a canvas.
Definition: TCanvas.cxx:831
void Iconify()
Definition: TCanvas.h:176
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition: TCanvas.cxx:1149
virtual void ToggleEventStatus()
Toggle event statusbar.
Definition: TCanvas.cxx:2228
virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
Definition: TCanvas.h:171
virtual void SetDoubleBuffer(Int_t mode=1)
Set Double Buffer On/Off.
Definition: TCanvas.cxx:1938
void Clear(Option_t *option="")
Remove all primitives from the canvas.
Definition: TCanvas.cxx:712
virtual void Paint(Option_t *option="")
Paint canvas.
Definition: TCanvas.cxx:1476
Bool_t HasMenuBar() const
Definition: TCanvas.h:174
virtual void Resize(Option_t *option="")
Recompute canvas parameters following a X11 Resize.
Definition: TCanvas.cxx:1601
Int_t GetEventY() const
Get Y event.
Definition: TCanvas.h:143
Color_t GetHighLightColor() const
Get highlight color.
Definition: TCanvas.h:144
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this canvas A new canvas is created that is a clone of this canvas.
Definition: TCanvas.cxx:878
void SetSelected(TObject *obj)
Set selected canvas.
Definition: TCanvas.cxx:1985
void SaveSource(const char *filename="", Option_t *option="")
Save primitives in this canvas as a C++ macro file.
Definition: TCanvas.cxx:1749
Int_t GetEvent() const
Get Event.
Definition: TCanvas.h:141
Size_t GetXsizeUser() const
Definition: TCanvas.h:159
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
Set the canvas scale in centimeters.
Definition: TCanvas.cxx:2020
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
Definition: TCanvas.cxx:1173
Size_t GetXsizeReal() const
Definition: TCanvas.h:161
Int_t GetEventX() const
Get X event.
Definition: TCanvas.h:142
Bool_t IsBatch() const
Is pad in batch mode ?
Definition: TCanvas.h:177
virtual void ls(Option_t *option="") const
List all pads.
Definition: TCanvas.cxx:1425
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition: TCanvas.cxx:1160
void Show()
Definition: TCanvas.h:221
Int_t GetCanvasID() const
Get canvas identifier.
Definition: TCanvas.h:163
Bool_t OpaqueMoving() const
Is pad moving in opaque mode ?
Definition: TCanvas.h:185
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2286
Bool_t GetAutoExec() const
Definition: TCanvas.h:158
TVirtualPad * GetSelectedPad() const
Definition: TCanvas.h:152
void UseCurrentStyle()
Force a copy of current style for all objects in canvas.
Definition: TCanvas.cxx:1124
void SetTitle(const char *title="")
Set canvas title.
Definition: TCanvas.cxx:1994
virtual void SetCursor(ECursor cursor)
Set cursor.
Definition: TCanvas.cxx:1929
TVirtualPad * GetPadSave() const
Definition: TCanvas.h:145
const char * GetDISPLAY() const
Definition: TCanvas.h:138
UInt_t GetWindowWidth() const
Definition: TCanvas.h:167
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
Definition: TCanvas.cxx:1076
Size_t GetYsizeUser() const
Definition: TCanvas.h:160
UInt_t GetWw() const
Get Ww.
Definition: TCanvas.h:169
TObject * GetSelected() const
Get selected.
Definition: TCanvas.h:147
void Close(Option_t *option="")
Close canvas.
Definition: TCanvas.cxx:763
TContextMenu * GetContextMenu() const
Definition: TCanvas.h:139
Size_t GetYsizeReal() const
Definition: TCanvas.h:162
void Flush()
Flush canvas buffers.
Definition: TCanvas.cxx:1090
virtual void Browse(TBrowser *b)
Browse.
Definition: TCanvas.cxx:659
Option_t * GetSelectedOpt() const
Definition: TCanvas.h:151
void ForceUpdate()
Definition: TCanvas.h:137
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:693
void MoveOpaque(Int_t set=1)
Set option to move objects/pads in a canvas.
Definition: TCanvas.cxx:1468
Int_t GetDoubleBuffer() const
Definition: TCanvas.h:140
void SetWindowPosition(Int_t x, Int_t y)
Definition: TCanvas.h:206
Bool_t GetShowEventStatus() const
Definition: TCanvas.h:154
virtual TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj)
Search for an object at pixel position px,py.
Definition: TCanvas.h:188
void ResizeOpaque(Int_t set=1)
Set option to resize objects/pads in a canvas.
Definition: TCanvas.cxx:1685
void SetRetained(Bool_t retained=kTRUE)
Definition: TCanvas.h:226
virtual TObject * DrawClonePad()
Draw a clone of this canvas into the current pad In an interactive session, select the destination/cu...
Definition: TCanvas.cxx:904
void SetBatch(Bool_t batch=kTRUE)
Toggle batch mode.
Definition: TCanvas.cxx:1900
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:195
The most important graphics class in the ROOT system.
Definition: TPad.h:29
virtual void Update()
Update pad.
Definition: TPad.cxx:2815
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:594
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...
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.
virtual void SetCursor(ECursor cursor)
just a wrapper
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
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.
virtual void mousePressEvent(QMouseEvent *e)
Handle mouse button press event.
void SetRetained(Bool_t retained=kTRUE)
just a wrapper
Size_t GetYsizeReal()
just a wrapper
virtual void Resize(Option_t *option="")
just a wrapper
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
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50