15 #include "qpushbutton.h" 18 #if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4 19 # include "qnamespace.h" 21 # include "q3dragobject.h" 22 typedef Q3TextDrag QTextDrag;
37 : QWidget( parent, name ,WRepaintNoErase | WResizeNoErase ),
40 setUpdatesEnabled( kTRUE );
41 setMouseTracking(kTRUE);
44 setFocusPolicy( TabFocus );
45 setCursor( Qt::crossCursor );
51 fIsCanvasOwned =
kTRUE;
53 fCanvas=
new TCanvas(name,width(),height(),fWid);
65 parent->installEventFilter(
this );
72 setAcceptDrops(kTRUE);
79 : QWidget( tabWin, name ,WRepaintNoErase | WResizeNoErase ),
82 setUpdatesEnabled(
kTRUE );
83 setMouseTracking(
kTRUE);
85 setFocusPolicy( TabFocus );
86 setCursor( Qt::crossCursor );
105 parent->installEventFilter(
this );
115 setAcceptDrops(
TRUE);
124 if (e->state() & LeftButton) {
144 switch (e->button()) {
165 gROOT->SetSelectedPrimitive(selected);
167 gPad->AbsPixeltoY(
gPad->GetEventY()), e);
192 switch (e->button()) {
215 switch (e->button()) {
237 QWidget::resizeEvent( e );
272 if ( e->type() == QEvent::Close) {
277 if ( e->type() == QEvent::ChildRemoved ) {
286 if ( e->type() == QEvent::Paint) {
289 if ( e->type() == QEvent::Move) {
294 return QWidget::eventFilter( o, e );
304 if ( QTextDrag::canDecode(e))
316 QPoint Pos = Event->pos();
319 if (dragedObject!=0) {
322 dragedObject->
Draw();
327 std::cout <<
"object " <<
328 #if (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4 333 <<
" not found by ROOT" << std::endl;
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...
Option_t * GetSelectedOpt() const
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
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.
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
just a wrapper
virtual void SetCursor(ECursor cursor)
Set cursor.
void SetWindowPosition(Int_t x, Int_t y)
Int_t GetCanvasID()
just a wrapper
TVirtualPad * GetSelectedPad() const
virtual void ToggleEventStatus()
Toggle event statusbar.
Color_t GetHighLightColor()
just a wrapper
Bool_t GetAutoExec()
just a wrapper
void SetTitle(const char *title="")
Set canvas title.
Int_t GetCanvasID() const
Get canvas identifier.
Bool_t HasMenuBar()
just a wrapper
TObject * GetSelected() const
Get selected.
UInt_t GetWw()
just a wrapper
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual TObject * DrawClonePad()
Just a wrapper.
TVirtualPad * GetPadSave() const
Size_t GetYsizeUser() const
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.
virtual ~TQRootCanvas()
dtor
Bool_t GetShowEventStatus() const
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
Set the canvas scale in centimeters.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Size_t GetXsizeUser()
just a wrapper
virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
just a wrapper
Int_t GetEventY()
just a wrapper
Size_t GetYsizeUser()
just a wrapper
void Flush()
Flush canvas buffers.
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.
virtual TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj)
Search for an object at pixel position px,py.
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.
virtual void Browse(TBrowser *b)
Browse.
virtual void mouseMoveEvent(QMouseEvent *e)
Handle mouse move event.
virtual void leaveEvent(QEvent *e)
Handle leave event.
Int_t GetWindowTopY()
Returns current top y position of window on screen.
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.
virtual void Resize(Option_t *option="")
Recompute canvas parameters following a X11 Resize.
TQRootCanvas(const TQRootCanvas &)
UInt_t GetWindowHeight() const
UInt_t GetWw() const
Get Ww.
Bool_t OpaqueMoving()
just a wrapper
void Clear(Option_t *option="")
Remove all primitives from the canvas.
void SetSelectedPad(TPad *pad)
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.
void SaveSource(const char *filename="", Option_t *option="")
Save primitives in this canvas as a C++ macro file.
virtual void Update()
just a wrapper
virtual void ls(Option_t *option="") const
List all pads.
Bool_t OpaqueMoving() const
Is pad moving in opaque mode ?
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
Int_t GetEventX() const
Get X event.
void ForceUpdate()
just a wrapper
Int_t GetEvent() const
Get Event.
void SetRetained(Bool_t retained=kTRUE)
virtual Option_t * GetOption() const
Using a TBrowser one can browse all ROOT objects.
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.
Bool_t OpaqueResizing() const
Is pad resizing in opaque mode ?
UInt_t GetWh() const
Get Wh.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void Clear(Option_t *option="")
Just a wrapper.
The most important graphics class in the ROOT system.
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
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)
virtual void ToggleAutoExec()
Toggle pad auto execution of list of TExecs.
void Show()
just a wrapper
TObject * GetSelected()
just a wrapper
Int_t GetWindowTopY()
just a wrapper
Color_t GetHighLightColor() const
Get highlight color.
Int_t GetWindowTopX()
Returns current top x position of window on screen.
UInt_t GetWindowWidth()
just a wrapper
virtual void SetCursor(ECursor cursor)
just a wrapper
TContextMenu * GetContextMenu() const
UInt_t GetWindowWidth() const
Bool_t IsBatch()
just a wrapper
const char * GetDISPLAY() const
Wrapper around a TObject so it can be stored in a TList.
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.
Bool_t IsBatch() const
Is pad in batch mode ?
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
Size_t GetXsizeUser() const
void SetWindowSize(UInt_t ww, UInt_t wh)
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.
Bool_t IsRetained()
just a wrapper
virtual void closeEvent(QCloseEvent *e)
Close.
Int_t GetEventY() const
Get Y event.
Mother of all ROOT objects.
void UseCurrentStyle()
Force a copy of current style for all objects in canvas.
virtual void mousePressEvent(QMouseEvent *e)
Handle mouse button press event.
void cd(Int_t subpadnumber=0)
Just a wrapper.
void SelectedPadChanged(TPad *)
virtual void Draw(Option_t *option="")
Draw a canvas.
TObject * GetObject() const
virtual void SetDoubleBuffer(Int_t mode=1)
Set Double Buffer On/Off.
virtual void ToggleEventStatus()
just a wrapper
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...
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)
void SetSelected(TObject *obj)
Set selected canvas.
Int_t GetEventX()
just a wrapper
void SetSelectedPad(TPad *pad)
just a wrapper
Bool_t HasMenuBar() const
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
void Close(Option_t *option="")
Close canvas.
virtual void EditorBar()
Get editor bar.
Bool_t OpaqueResizing()
just a wrapper
Bool_t IsRetained() const
Is pad retained ?
void SetBatch(Bool_t batch=kTRUE)
Toggle batch mode.
TQCanvasMenu * fContextMenu
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
TVirtualPad * GetSelectedPad()
just a wrapper
virtual void Update()
Update canvas pad buffers.
Int_t GetDoubleBuffer() const
virtual void mouseDoubleClickEvent(QMouseEvent *e)
Handle mouse double click event.
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
void SaveSource(const char *filename="", Option_t *option="")
just a wrapper
void SetHighLightColor(Color_t col)