Logo ROOT   6.10/09
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 "Riostream.h"
13 #include "qevent.h"
14 #include "qdialog.h"
15 #include "qpushbutton.h"
16 #include "qlabel.h"
17 #include "qpainter.h"
18 #if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
19 # include "qnamespace.h"
20 using namespace Qt;
21 # include "q3dragobject.h"
22 typedef Q3TextDrag QTextDrag;
23 #endif
24 
25 #include "TQRootCanvas.h"
26 #include "TROOT.h"
27 #include "TClass.h"
28 #include "TCanvas.h"
29 #include "TQCanvasMenu.h"
30 
32 
33 ////////////////////////////////////////////////////////////////////////////////
34 /// set defaults
35 
36 TQRootCanvas::TQRootCanvas( QWidget *parent, const char *name, TCanvas *c )
37  : QWidget( parent, name ,WRepaintNoErase | WResizeNoErase ),
38  fNeedResize(kTRUE)
39 {
40  setUpdatesEnabled( kTRUE );
41  setMouseTracking(kTRUE);
42 
43  // setBackgroundMode( NoBackground );
44  setFocusPolicy( TabFocus );
45  setCursor( Qt::crossCursor );
46 
47  fTabWin = 0;
48  // add the Qt::WinId to TGX11 interface
49  fWid=gVirtualX->AddWindow((ULong_t)winId(),100,30);
50  if (c == 0) {
51  fIsCanvasOwned = kTRUE;
52  // Window_t win=gVirtualX->GetWindowID(fWid);
53  fCanvas=new TCanvas(name,width(),height(),fWid);
54  }
55  else {
56  fIsCanvasOwned= kFALSE;
57  fCanvas=c;
58  }
59  // create the context menu
60  fContextMenu = new TQCanvasMenu( parent, fCanvas );
61 
62  // test here all the events sent to the QWidget
63  // has a parent widget then install filter
64  if ( parent ) {
65  parent->installEventFilter( this );
66  fParent = parent;
67  }
68  else
69  fParent=0;
70 
71  // drag and drop suppurt (M. Al-Turany)
72  setAcceptDrops(kTRUE);
73 }
74 
75 ////////////////////////////////////////////////////////////////////////////////
76 /// set defaults
77 
78 TQRootCanvas::TQRootCanvas( QWidget *parent, QWidget* tabWin, const char *name, TCanvas *c )
79  : QWidget( tabWin, name ,WRepaintNoErase | WResizeNoErase ),
80  fNeedResize(kTRUE)
81 {
82  setUpdatesEnabled( kTRUE );
83  setMouseTracking(kTRUE);
84 
85  setFocusPolicy( TabFocus );
86  setCursor( Qt::crossCursor );
87 
88  fTabWin = 0;
89  // add the Qt::WinId to TGX11 interface
90  fWid=gVirtualX->AddWindow((ULong_t)winId(),100,30);
91  if (c == 0) {
93  fCanvas=new TCanvas(name,width(),height(),fWid);
94  }
95  else {
97  fCanvas=c;
98  }
99  // create the context menu
100  fContextMenu = new TQCanvasMenu( parent, tabWin, fCanvas );
101 
102  // test here all the events sent to the QWidget
103  // has a parent widget then install filter
104  if ( parent ) {
105  parent->installEventFilter( this );
106  fParent = parent;
107  }
108  else
109  fParent=0;
110 
111  if ( tabWin )
112  fTabWin = tabWin;
113 
114  // drag and drop suppurt (M. Al-Turany)
115  setAcceptDrops(TRUE);
116 }
117 
118 ////////////////////////////////////////////////////////////////////////////////
119 /// Handle mouse move event.
120 
121 void TQRootCanvas::mouseMoveEvent(QMouseEvent *e)
122 {
123  if (fCanvas) {
124  if (e->state() & LeftButton) {
125  fCanvas->HandleInput(kButton1Motion, e->x(), e->y());
126  }
127  else {
128  fCanvas->HandleInput(kMouseMotion, e->x(), e->y());
129  }
130  }
131 }
132 
133 ////////////////////////////////////////////////////////////////////////////////
134 /// Handle mouse button press event.
135 
136 void TQRootCanvas::mousePressEvent( QMouseEvent *e )
137 {
138  TPad *pad=0;
139  TObjLink *pickobj=0;
140  TObject *selected=0;
141  Int_t px=e->x();
142  Int_t py=e->y();
143  TString selectedOpt;
144  switch (e->button()) {
145  case LeftButton :
146  fCanvas->HandleInput(kButton1Down, e->x(), e->y());
147  break;
148  case RightButton :
149  selected=fCanvas->GetSelected();
150  pad = fCanvas->Pick(px, py, pickobj);
151  if (pad) {
152  if (!pickobj) {
153  fCanvas->SetSelected(pad); selected=pad;
154  selectedOpt = "";
155  }
156  else {
157  if (!selected) {
158  selected = pickobj->GetObject();
159  selectedOpt = pickobj->GetOption();
160  }
161  }
162  pad->cd();
163  fCanvas->SetSelectedPad(pad);
164  }
165  gROOT->SetSelectedPrimitive(selected);
166  fContextMenu->Popup(selected, gPad->AbsPixeltoX(gPad->GetEventX()),
167  gPad->AbsPixeltoY(gPad->GetEventY()), e);
168 
169  break;
170  case MidButton :
171  pad = fCanvas->Pick(px, py, pickobj); // get the selected pad and emit a Qt-Signal
172  emit SelectedPadChanged(pad); // that inform the Qt-world that tha pad is changed
173  // and give the pointer to the new pad as argument
174  // of the signal (M. Al-Turany)
175  fCanvas->HandleInput(kButton2Down, e->x(), e->y());
176 
177  break;
178 
179  case NoButton :
180  break;
181  default:
182  break;
183  }
184 
185 }
186 
187 ////////////////////////////////////////////////////////////////////////////////
188 /// Handle mouse button release event.
189 
190 void TQRootCanvas::mouseReleaseEvent( QMouseEvent *e )
191 {
192  switch (e->button()) {
193  case LeftButton :
194  fCanvas->HandleInput(kButton1Up, e->x(), e->y());
195  break;
196  case RightButton :
197  fCanvas->HandleInput(kButton3Up, e->x(), e->y());
198  break;
199  case MidButton :
200  fCanvas->HandleInput(kButton2Up, e->x(), e->y());
201  break;
202  case NoButton :
203  break;
204  default:
205  break;
206  }
207 
208 }
209 
210 ////////////////////////////////////////////////////////////////////////////////
211 /// Handle mouse double click event.
212 
214 {
215  switch (e->button()) {
216  case LeftButton :
217  fCanvas->HandleInput(kButton1Double, e->x(), e->y());
218  break;
219  case RightButton :
220  fCanvas->HandleInput(kButton3Double, e->x(), e->y());
221  break;
222  case MidButton :
223  fCanvas->HandleInput(kButton2Double, e->x(), e->y());
224  break;
225  case NoButton :
226  break;
227  default:
228  break;
229  }
230 }
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// Call QWidget resize and inform the ROOT Canvas.
234 
235 void TQRootCanvas::resizeEvent( QResizeEvent *e )
236 {
237  QWidget::resizeEvent( e );
239 }
240 
241 ////////////////////////////////////////////////////////////////////////////////
242 /// Handle paint event of Qt.
243 
244 void TQRootCanvas::paintEvent( QPaintEvent * )
245 {
246  if (fCanvas) {
247  QPainter p;
248  p.begin( this);
249  p.end();
250  if (fNeedResize) {
251  fCanvas->Resize();
253  }
254  fCanvas->Update();
255  }
256 }
257 
258 ////////////////////////////////////////////////////////////////////////////////
259 /// Handle leave event.
260 
261 void TQRootCanvas::leaveEvent( QEvent * /*e*/ )
262 {
263  if (fCanvas) fCanvas->HandleInput(kMouseLeave, 0, 0);
264 }
265 
266 ////////////////////////////////////////////////////////////////////////////////
267 /// Filtering of QWidget Events
268 /// for ressource management
269 
270 Bool_t TQRootCanvas ::eventFilter( QObject *o, QEvent *e )
271 {
272  if ( e->type() == QEvent::Close) { // close
273  if (fCanvas && (fIsCanvasOwned== kFALSE) ) {
274  delete fCanvas;
275  fCanvas=0;
276  }
277  if ( e->type() == QEvent::ChildRemoved ) { // child is removed
278  }
279  return FALSE; // eat event
280  }
281 
282  if ( e->type() == QEvent::Destroy) { // destroy
283  return FALSE;
284  }
285 
286  if ( e->type() == QEvent::Paint) { // Paint
287  return FALSE;
288  }
289  if ( e->type() == QEvent::Move) { // Paint
290  return FALSE;
291  }
292 
293  // standard event processing
294  return QWidget::eventFilter( o, e );
295 }
296 
297 ////////////////////////////////////// drag and drop support
298 
299 ////////////////////////////////////////////////////////////////////////////////
300 /// Entering a drag event.
301 
302 void TQRootCanvas::dragEnterEvent( QDragEnterEvent *e )
303 {
304  if ( QTextDrag::canDecode(e))
305  e->accept();
306 }
307 
308 ////////////////////////////////////////////////////////////////////////////////
309 /// Start a drop, for now only histogram objects can be drwon by droping.
310 
311 void TQRootCanvas::dropEvent( QDropEvent *Event )
312 {
313  QString str;
314  if ( QTextDrag::decode( Event, str ) ) {
315  TObject *dragedObject = gROOT->FindObject(str);
316  QPoint Pos = Event->pos();
317  TObject *object=0;
318  TPad *pad = fCanvas->Pick(Pos.x(), Pos.y(), object);
319  if (dragedObject!=0) {
320  if (dragedObject->InheritsFrom("TH1")) {
321  pad->cd();
322  dragedObject->Draw();
323  pad->Update();
324  }
325  }
326  else
327  std::cout << "object " <<
328 #if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
329  str.data()
330 #else
331  str
332 #endif
333  << " not found by ROOT" << std::endl;
334  }
335 }
336 
337 /////////////////////////////////////End Drag and drop Support (Mohammad Al-Turany)
338 
339 ////////////////////////////////////////////////////////////////////////////////
340 /// Just a wrapper
341 
342 void TQRootCanvas::cd(Int_t subpadnumber)
343 {
344  fCanvas->cd(subpadnumber);
345 }
346 
347 ////////////////////////////////////////////////////////////////////////////////
348 /// Just a wrapper.
349 
351 {
352  fCanvas->Browse(b);
353 }
354 
355 ////////////////////////////////////////////////////////////////////////////////
356 /// Just a wrapper.
357 
359 {
360  fCanvas->Clear(option);
361 }
362 
363 ////////////////////////////////////////////////////////////////////////////////
364 /// Just a wrapper.
365 
367 {
368  fCanvas->Close(option);
369 }
370 
371 ////////////////////////////////////////////////////////////////////////////////
372 /// Just a wrapper.
373 
375 {
376  fCanvas->Draw(option);
377 }
378 
379 ////////////////////////////////////////////////////////////////////////////////
380 /// Just a wrapper.
381 
383 {
384  return fCanvas->DrawClone(option);
385 }
386 
387 ////////////////////////////////////////////////////////////////////////////////
388 /// Just a wrapper.
389 
391 {
392  return fCanvas->DrawClonePad();
393 }
394 
395 ////////////////////////////////////////////////////////////////////////////////
396 /// Just a wrapper.
397 
399 {
400  fCanvas->EditorBar();
401 }
402 
403 ////////////////////////////////////////////////////////////////////////////////
404 /// just a wrapper
405 
406 void TQRootCanvas::EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
407 {
408  fCanvas->EnterLeave(prevSelPad, prevSelObj);
409 }
410 
411 ////////////////////////////////////////////////////////////////////////////////
412 /// just a wrapper
413 
415 {
416  fCanvas->FeedbackMode(set);
417 }
418 
419 ////////////////////////////////////////////////////////////////////////////////
420 /// just a wrapper
421 
423 {
424  fCanvas->Flush();
425 }
426 
427 ////////////////////////////////////////////////////////////////////////////////
428 /// just a wrapper
429 
431 {
433 }
434 
435 ////////////////////////////////////////////////////////////////////////////////
436 /// just a wrapper
437 
439 {
440  fCanvas->ForceUpdate() ;
441 }
442 
443 ////////////////////////////////////////////////////////////////////////////////
444 /// just a wrapper
445 
447 {
448  return fCanvas->GetDISPLAY() ;
449 }
450 
451 ////////////////////////////////////////////////////////////////////////////////
452 /// just a wrapper
453 
455 {
456  return fCanvas->GetContextMenu() ;
457 }
458 
459 ////////////////////////////////////////////////////////////////////////////////
460 /// just a wrapper
461 
463 {
464  return fCanvas->GetDoubleBuffer();
465 }
466 
467 ////////////////////////////////////////////////////////////////////////////////
468 /// just a wrapper
469 
471 {
472  return fCanvas->GetEvent();
473 }
474 
475 ////////////////////////////////////////////////////////////////////////////////
476 /// just a wrapper
477 
479 {
480  return fCanvas->GetEventX() ;
481 }
482 
483 ////////////////////////////////////////////////////////////////////////////////
484 /// just a wrapper
485 
487 {
488  return fCanvas->GetEventY() ;
489 }
490 
491 ////////////////////////////////////////////////////////////////////////////////
492 /// just a wrapper
493 
495 {
496  return fCanvas->GetHighLightColor() ;
497 }
498 
499 ////////////////////////////////////////////////////////////////////////////////
500 /// just a wrapper
501 
503 {
504  return fCanvas->GetPadSave();
505 }
506 
507 ////////////////////////////////////////////////////////////////////////////////
508 /// just a wrapper
509 
511 {
512  return fCanvas->GetSelected() ;
513 }
514 
515 ////////////////////////////////////////////////////////////////////////////////
516 /// just a wrapper
517 
519 {
520  return fCanvas->GetSelectedOpt();
521 }
522 
523 ////////////////////////////////////////////////////////////////////////////////
524 /// just a wrapper
525 
527 {
528  return fCanvas->GetSelectedPad();
529 }
530 
531 ////////////////////////////////////////////////////////////////////////////////
532 /// just a wrapper
533 
535 {
536  return fCanvas->GetShowEventStatus() ;
537 }
538 
539 ////////////////////////////////////////////////////////////////////////////////
540 /// just a wrapper
541 
543 {
544  return fCanvas->GetAutoExec();
545 }
546 
547 ////////////////////////////////////////////////////////////////////////////////
548 /// just a wrapper
549 
551 {
552  return fCanvas->GetXsizeUser();
553 }
554 
555 ////////////////////////////////////////////////////////////////////////////////
556 /// just a wrapper
557 
559 {
560  return fCanvas->GetYsizeUser();
561 }
562 
563 ////////////////////////////////////////////////////////////////////////////////
564 /// just a wrapper
565 
567 {
568  return fCanvas->GetXsizeReal();
569 }
570 
571 ////////////////////////////////////////////////////////////////////////////////
572 /// just a wrapper
573 
575 {
576  return fCanvas->GetYsizeReal();
577 }
578 
579 ////////////////////////////////////////////////////////////////////////////////
580 /// just a wrapper
581 
583 {
584  return fCanvas->GetCanvasID();
585 }
586 
587 ////////////////////////////////////////////////////////////////////////////////
588 /// just a wrapper
589 
591 {
592  return fCanvas->GetWindowTopX();
593 }
594 
595 ////////////////////////////////////////////////////////////////////////////////
596 /// just a wrapper
597 
599 {
600  return fCanvas->GetWindowTopY();
601 }
602 
603 ////////////////////////////////////////////////////////////////////////////////
604 /// just a wrapper
605 
607 {
608  return fCanvas->GetWindowWidth() ;
609 }
610 
611 ////////////////////////////////////////////////////////////////////////////////
612 /// just a wrapper
613 
615 {
616  return fCanvas->GetWindowHeight();
617 }
618 
619 ////////////////////////////////////////////////////////////////////////////////
620 /// just a wrapper
621 
623 {
624  return fCanvas->GetWw();
625 }
626 
627 ////////////////////////////////////////////////////////////////////////////////
628 /// just a wrapper
629 
631 {
632  return fCanvas->GetWh() ;
633 }
634 
635 ////////////////////////////////////////////////////////////////////////////////
636 /// just a wrapper
637 
638 void TQRootCanvas::GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
639 {
640  fCanvas->GetCanvasPar(wtopx, wtopy, ww, wh);
641 }
642 
643 ////////////////////////////////////////////////////////////////////////////////
644 /// just a wrapper
645 
647 {
648  fCanvas->HandleInput(button, x, y);
649 }
650 
651 ////////////////////////////////////////////////////////////////////////////////
652 /// just a wrapper
653 
655 {
656  return fCanvas->HasMenuBar() ;
657 }
658 
659 ////////////////////////////////////////////////////////////////////////////////
660 /// just a wrapper
661 
663 {
664  fCanvas->Iconify();
665 }
666 
667 ////////////////////////////////////////////////////////////////////////////////
668 /// just a wrapper
669 
671 {
672  return fCanvas->IsBatch() ;
673 }
674 
675 ////////////////////////////////////////////////////////////////////////////////
676 /// just a wrapper
677 
679 {
680  return fCanvas->IsRetained();
681 }
682 
683 ////////////////////////////////////////////////////////////////////////////////
684 /// just a wrapper
685 
687 {
688  fCanvas->ls(option);
689 }
690 
691 ////////////////////////////////////////////////////////////////////////////////
692 /// just a wrapper
693 
695 {
696  fCanvas->MoveOpaque(set);
697 }
698 
699 ////////////////////////////////////////////////////////////////////////////////
700 /// just a wrapper
701 
703 {
704  return fCanvas->OpaqueMoving();
705 }
706 
707 ////////////////////////////////////////////////////////////////////////////////
708 /// just a wrapper
709 
711 {
712  return fCanvas->OpaqueResizing();
713 }
714 
715 ////////////////////////////////////////////////////////////////////////////////
716 /// just a wrapper
717 
719 {
720  fCanvas->Paint(option);
721 }
722 
723 ////////////////////////////////////////////////////////////////////////////////
724 /// just a wrapper
725 
727 {
728  return fCanvas->Pick(px, py, pickobj);
729 }
730 
731 ////////////////////////////////////////////////////////////////////////////////
732 /// just a wrapper
733 
735 {
736  return fCanvas->Pick(px, py, prevSelObj);
737 }
738 
739 ////////////////////////////////////////////////////////////////////////////////
740 /// just a wrapper
741 
743 {
744  fCanvas->Resize(option);
745 }
746 
747 ////////////////////////////////////////////////////////////////////////////////
748 /// just a wrapper
749 
751 {
752  fCanvas->ResizeOpaque(set);
753 }
754 
755 ////////////////////////////////////////////////////////////////////////////////
756 /// just a wrapper
757 
758 void TQRootCanvas::SaveSource(const char *filename, Option_t *option)
759 {
760  fCanvas->SaveSource(filename, option);
761 }
762 
763 ////////////////////////////////////////////////////////////////////////////////
764 /// just a wrapper
765 
767 {
768  fCanvas->SetCursor(cursor);
769 }
770 
771 ////////////////////////////////////////////////////////////////////////////////
772 /// just a wrapper
773 
775 {
776  fCanvas->SetDoubleBuffer(mode);
777 }
778 
779 ////////////////////////////////////////////////////////////////////////////////
780 /// just a wrapper
781 
783 {
784  fCanvas->SetWindowPosition(x, y) ;
785 }
786 
787 ////////////////////////////////////////////////////////////////////////////////
788 /// just a wrapper
789 
791 {
792  fCanvas->SetWindowSize(ww,wh) ;
793 }
794 
795 ////////////////////////////////////////////////////////////////////////////////
796 /// just a wrapper
797 
799 {
800  fCanvas->SetCanvasSize(ww, wh);
801 }
802 
803 ////////////////////////////////////////////////////////////////////////////////
804 /// just a wrapper
805 
807 {
809 }
810 
811 ////////////////////////////////////////////////////////////////////////////////
812 /// just a wrapper
813 
815 {
816  fCanvas->SetSelected(obj);
817 }
818 
819 ////////////////////////////////////////////////////////////////////////////////
820 /// just a wrapper
821 
823 {
824  fCanvas->SetSelectedPad(pad);
825 }
826 
827 ////////////////////////////////////////////////////////////////////////////////
828 /// just a wrapper
829 
831 {
832  fCanvas->Show() ;
833 }
834 
835 ////////////////////////////////////////////////////////////////////////////////
836 /// just a wrapper
837 
838 void TQRootCanvas::Size(Float_t xsizeuser, Float_t ysizeuser)
839 {
840  fCanvas->Size(xsizeuser, ysizeuser);
841 }
842 
843 ////////////////////////////////////////////////////////////////////////////////
844 /// just a wrapper
845 
847 {
848  fCanvas->SetBatch(batch);
849 }
850 
851 ////////////////////////////////////////////////////////////////////////////////
852 /// just a wrapper
853 
855 {
856  fCanvas->SetRetained(retained);
857 }
858 
859 ////////////////////////////////////////////////////////////////////////////////
860 /// just a wrapper
861 
862 void TQRootCanvas::SetTitle(const char *title)
863 {
864  fCanvas->SetTitle(title);
865 }
866 
867 ////////////////////////////////////////////////////////////////////////////////
868 /// just a wrapper
869 
871 {
873 }
874 
875 ////////////////////////////////////////////////////////////////////////////////
876 /// just a wrapper
877 
879 {
881 }
882 
883 ////////////////////////////////////////////////////////////////////////////////
884 /// just a wrapper
885 
887 {
888  fCanvas->Update();
889 }
890 
891 ////////////////////////////////////////////////////////////////////////////////
892 /// Close.
893 
894 void TQRootCanvas::closeEvent( QCloseEvent * e)
895 {
896  if ( fIsCanvasOwned ) {
897  delete fCanvas;
898  fCanvas = 0;
899  }
900  e->accept();
901  return;
902 }
903 
904 ////////////////////////////////////////////////////////////////////////////////
905 /// dtor
906 
908 {
909  if (fContextMenu) {
910  delete fContextMenu;
911  fContextMenu=0;
912  }
913  if ( fIsCanvasOwned && fCanvas ) {
914  delete fCanvas;
915  fCanvas = 0;
916  }
917 }
918 
919 
920 
void Close(Option_t *option="")
Just a wrapper.
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
Generate kMouseEnter and kMouseLeave events depending on the previously selected object and the curre...
Definition: TCanvas.cxx:1007
Option_t * GetSelectedOpt() const
Definition: TCanvas.h:151
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
Definition: TCanvas.cxx:1062
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
void SetSelected(TObject *obj)
just a wrapper
virtual void ToggleAutoExec()
just a wrapper
void Iconify()
just a wrapper
void MoveOpaque(Int_t set=1)
Set option to move objects/pads in a canvas.
Definition: TCanvas.cxx:1454
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
just a wrapper
virtual void SetCursor(ECursor cursor)
Set cursor.
Definition: TCanvas.cxx:1877
void SetWindowPosition(Int_t x, Int_t y)
Definition: TCanvas.h:203
Int_t GetCanvasID()
just a wrapper
TVirtualPad * GetSelectedPad() const
Definition: TCanvas.h:152
virtual void ToggleEventStatus()
Toggle event statusbar.
Definition: TCanvas.cxx:2150
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
void SetTitle(const char *title="")
Set canvas title.
Definition: TCanvas.cxx:1942
const char Option_t
Definition: RtypesCore.h:62
Int_t GetCanvasID() const
Get canvas identifier.
Definition: TCanvas.h:163
Bool_t HasMenuBar()
just a wrapper
TObject * GetSelected() const
Get selected.
Definition: TCanvas.h:147
UInt_t GetWw()
just a wrapper
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:679
QWidget * fParent
Definition: TQRootCanvas.h:173
EEventType
Definition: Buttons.h:15
virtual TObject * DrawClonePad()
Just a wrapper.
TVirtualPad * GetPadSave() const
Definition: TCanvas.h:145
#define gROOT
Definition: TROOT.h:375
Size_t GetYsizeUser() const
Definition: TCanvas.h:160
virtual void ls(Option_t *option="")
just a wrapper
void MoveOpaque(Int_t set=1)
just a wrapper
void Flush()
just a wrapper
virtual void Update()
Update pad.
Definition: TPad.cxx:2786
virtual ~TQRootCanvas()
dtor
Bool_t GetShowEventStatus() const
Definition: TCanvas.h:154
int Int_t
Definition: RtypesCore.h:41
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
Set the canvas scale in centimeters.
Definition: TCanvas.cxx:1968
bool Bool_t
Definition: RtypesCore.h:59
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:202
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
void Iconify()
Definition: TCanvas.h:175
Size_t GetYsizeUser()
just a wrapper
void Flush()
Flush canvas buffers.
Definition: TCanvas.cxx:1076
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
virtual TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj)
Search for an object at pixel position px,py.
Definition: TCanvas.h:186
Option_t * GetSelectedOpt()
just a wrapper
void SetWindowSize(UInt_t ww, UInt_t wh)
just a wrapper
virtual void EditorBar()
Just a wrapper.
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:565
virtual void Browse(TBrowser *b)
Browse.
Definition: TCanvas.cxx:645
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.
Int_t GetWindowTopY()
Returns current top y position of window on screen.
Definition: TCanvas.cxx:1146
virtual void Paint(Option_t *option="")
just a wrapper
virtual void Resize(Option_t *option="")
just a wrapper
virtual void Paint(Option_t *option="")
Paint canvas.
Definition: TCanvas.cxx:1462
virtual void Resize(Option_t *option="")
Recompute canvas parameters following a X11 Resize.
Definition: TCanvas.cxx:1554
TQRootCanvas(const TQRootCanvas &)
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...
UInt_t GetWindowHeight() const
Definition: TCanvas.h:168
UInt_t GetWw() const
Get Ww.
Definition: TCanvas.h:169
Bool_t OpaqueMoving()
just a wrapper
void Clear(Option_t *option="")
Remove all primitives from the canvas.
Definition: TCanvas.cxx:698
void SetSelectedPad(TPad *pad)
Definition: TCanvas.h:210
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
void SaveSource(const char *filename="", Option_t *option="")
Save primitives in this canvas as a C++ macro file.
Definition: TCanvas.cxx:1702
virtual void Update()
just a wrapper
virtual void ls(Option_t *option="") const
List all pads.
Definition: TCanvas.cxx:1411
short Color_t
Definition: RtypesCore.h:79
Bool_t OpaqueMoving() const
Is pad moving in opaque mode ?
Definition: TCanvas.h:183
void SetRetained(Bool_t retained=kTRUE)
just a wrapper
Int_t GetWindowTopX()
just a wrapper
virtual TObject * DrawClone(Option_t *option="")
Just a wrapper.
Size_t GetYsizeReal() const
Definition: TCanvas.h:162
Int_t GetEventX() const
Get X event.
Definition: TCanvas.h:142
void ForceUpdate()
just a wrapper
Int_t GetEvent() const
Get Event.
Definition: TCanvas.h:141
void SetRetained(Bool_t retained=kTRUE)
Definition: TCanvas.h:217
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
void ResizeOpaque(Int_t set=1)
Set option to resize objects/pads in a canvas.
Definition: TCanvas.cxx:1638
Bool_t OpaqueResizing() const
Is pad resizing in opaque mode ?
Definition: TCanvas.h:184
UInt_t GetWh() const
Get Wh.
Definition: TCanvas.h:170
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:436
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
Size_t GetXsizeReal() const
Definition: TCanvas.h:161
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
#define decode(ptr, otri)
Definition: triangle.c:912
virtual void ToggleAutoExec()
Toggle pad auto execution of list of TExecs.
Definition: TCanvas.cxx:2141
void Show()
just a wrapper
TObject * GetSelected()
just a wrapper
#define gVirtualX
Definition: TVirtualX.h:350
Int_t GetWindowTopY()
just a wrapper
Color_t GetHighLightColor() const
Get highlight color.
Definition: TCanvas.h:144
const Bool_t kFALSE
Definition: RtypesCore.h:92
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Definition: TCanvas.cxx:1135
The Canvas class.
Definition: TCanvas.h:31
UInt_t GetWindowWidth()
just a wrapper
#define ClassImp(name)
Definition: Rtypes.h:336
virtual void SetCursor(ECursor cursor)
just a wrapper
TContextMenu * GetContextMenu() const
Definition: TCanvas.h:139
UInt_t GetWindowWidth() const
Definition: TCanvas.h:167
Bool_t IsBatch()
just a wrapper
const char * GetDISPLAY() const
Definition: TCanvas.h:138
#define TRUE
virtual void Draw(Option_t *option="")
Just a wrapper.
void SetCanvasSize(UInt_t ww, UInt_t wh)
Set Width and Height of canvas to ww and wh respectively.
Definition: TCanvas.cxx:1864
Bool_t IsBatch() const
Is pad in batch mode ?
Definition: TCanvas.h:176
unsigned long ULong_t
Definition: RtypesCore.h:51
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
Size_t GetXsizeUser() const
Definition: TCanvas.h:159
void SetWindowSize(UInt_t ww, UInt_t wh)
Definition: TCanvas.h:204
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:864
Bool_t IsRetained()
just a wrapper
virtual void closeEvent(QCloseEvent *e)
Close.
Int_t GetEventY() const
Get Y event.
Definition: TCanvas.h:143
Mother of all ROOT objects.
Definition: TObject.h:37
void UseCurrentStyle()
Force a copy of current style for all objects in canvas.
Definition: TCanvas.cxx:1110
virtual void mousePressEvent(QMouseEvent *e)
Handle mouse button press event.
void ForceUpdate()
Definition: TCanvas.h:137
void cd(Int_t subpadnumber=0)
Just a wrapper.
void SelectedPadChanged(TPad *)
virtual void Draw(Option_t *option="")
Draw a canvas.
Definition: TCanvas.cxx:817
virtual void SetDoubleBuffer(Int_t mode=1)
Set Double Buffer On/Off.
Definition: TCanvas.cxx:1886
Bool_t fIsCanvasOwned
Definition: TQRootCanvas.h:172
virtual void ToggleEventStatus()
just a wrapper
#define FALSE
void SetHighLightColor(Color_t col)
just a wrapper
virtual TObject * DrawClonePad()
Draw a clone of this canvas into the current pad In an interactive session, select the destination/cu...
Definition: TCanvas.cxx:890
virtual void Browse(TBrowser *b)
Just a wrapper.
virtual bool eventFilter(QObject *, QEvent *)
Filtering of QWidget Events for ressource management.
virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
Definition: TCanvas.h:171
void SetSelected(TObject *obj)
Set selected canvas.
Definition: TCanvas.cxx:1933
Int_t GetEventX()
just a wrapper
void SetSelectedPad(TPad *pad)
just a wrapper
Bool_t HasMenuBar() const
Definition: TCanvas.h:174
void Show()
Definition: TCanvas.h:212
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
void Close(Option_t *option="")
Close canvas.
Definition: TCanvas.cxx:749
virtual void EditorBar()
Get editor bar.
Definition: TCanvas.cxx:972
#define gPad
Definition: TVirtualPad.h:284
Bool_t OpaqueResizing()
just a wrapper
Bool_t IsRetained() const
Is pad retained ?
Definition: TCanvas.h:180
void SetBatch(Bool_t batch=kTRUE)
Toggle batch mode.
Definition: TCanvas.cxx:1848
TQCanvasMenu * fContextMenu
Definition: TQRootCanvas.h:168
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
Definition: TCanvas.cxx:1159
TVirtualPad * GetSelectedPad()
just a wrapper
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2208
Int_t GetDoubleBuffer() const
Definition: TCanvas.h:140
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 GetAutoExec() const
Definition: TCanvas.h:158
void SaveSource(const char *filename="", Option_t *option="")
just a wrapper
void SetHighLightColor(Color_t col)
Definition: TCanvas.h:207