TQRootCanvas.cxx

Go to the documentation of this file.
00001 // @(#)root/qtgsi:$Id: TQRootCanvas.cxx 33896 2010-06-15 08:02:13Z bellenot $
00002 // Author: Denis Bertini, M. Al-Turany  01/11/2000
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "Riostream.h"
00013 #include "qevent.h"
00014 #include "qdialog.h"
00015 #include "qpushbutton.h"
00016 #include "qlabel.h"
00017 #include "qpainter.h"
00018 #if  (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
00019 # include "qnamespace.h"
00020 using namespace Qt;
00021 # include "q3dragobject.h"
00022 typedef Q3TextDrag QTextDrag;
00023 #endif
00024 
00025 #include "TQRootCanvas.h"
00026 #include "TROOT.h"
00027 #include "TClass.h"
00028 #include "TCanvas.h"
00029 #include "TQCanvasMenu.h"
00030 
00031 ClassImp(TQRootCanvas)
00032 
00033 //______________________________________________________________________________
00034 TQRootCanvas::TQRootCanvas( QWidget *parent, const char *name, TCanvas *c )
00035   : QWidget( parent, name ,WRepaintNoErase | WResizeNoErase ),
00036         fNeedResize(kTRUE)
00037 {
00038    // set defaults
00039    setUpdatesEnabled( kTRUE );
00040    setMouseTracking(kTRUE);
00041 
00042    //  setBackgroundMode( NoBackground );
00043    setFocusPolicy( TabFocus );
00044    setCursor( Qt::crossCursor );
00045 
00046    // add the Qt::WinId to TGX11 interface
00047    fWid=gVirtualX->AddWindow((ULong_t)winId(),100,30);
00048    if (c == 0) {
00049       fIsCanvasOwned = kTRUE;
00050       // Window_t win=gVirtualX->GetWindowID(fWid);
00051       fCanvas=new TCanvas(name,width(),height(),fWid);
00052    }
00053    else {
00054       fIsCanvasOwned= kFALSE;
00055       fCanvas=c;
00056    }
00057    // create the context menu
00058    fContextMenu = new TQCanvasMenu( parent, fCanvas );
00059 
00060    // test here all the events sent to the QWidget
00061    // has a parent widget then install filter
00062    if ( parent ) {
00063       parent->installEventFilter( this );
00064       fParent = parent;
00065    }
00066    else
00067       fParent=0;
00068 
00069    // drag and drop suppurt  (M. Al-Turany)
00070    setAcceptDrops(kTRUE);
00071 }
00072 
00073 //______________________________________________________________________________
00074 TQRootCanvas::TQRootCanvas( QWidget *parent, QWidget* tabWin, const char *name, TCanvas *c )
00075   : QWidget( tabWin, name ,WRepaintNoErase | WResizeNoErase ),
00076     fNeedResize(kTRUE)
00077 {
00078    // set defaults
00079    setUpdatesEnabled( kTRUE );
00080    setMouseTracking(kTRUE);
00081 
00082    setFocusPolicy( TabFocus );
00083    setCursor( Qt::crossCursor );
00084 
00085    // add the Qt::WinId to TGX11 interface
00086    fWid=gVirtualX->AddWindow((ULong_t)winId(),100,30);
00087    if (c == 0) {
00088       fIsCanvasOwned = kTRUE;
00089       fCanvas=new TCanvas(name,width(),height(),fWid);
00090    }
00091    else {
00092       fIsCanvasOwned= kFALSE;
00093       fCanvas=c;
00094    }
00095    // create the context menu
00096    fContextMenu = new TQCanvasMenu( parent, tabWin, fCanvas );
00097 
00098    // test here all the events sent to the QWidget
00099    // has a parent widget then install filter
00100    if ( parent ) {
00101       parent->installEventFilter( this );
00102       fParent = parent;
00103    }
00104    else
00105       fParent=0;
00106 
00107    if ( tabWin )
00108       fTabWin = tabWin;
00109 
00110    // drag and drop suppurt  (M. Al-Turany)
00111    setAcceptDrops(TRUE);
00112 }
00113 
00114 //______________________________________________________________________________
00115 void TQRootCanvas::mouseMoveEvent(QMouseEvent *e)
00116 {
00117    // Handle mouse move event.
00118 
00119    if (fCanvas) {
00120       if (e->state() & LeftButton) {
00121          fCanvas->HandleInput(kButton1Motion, e->x(), e->y());
00122       }
00123       else {
00124          fCanvas->HandleInput(kMouseMotion, e->x(), e->y());
00125       }
00126    }
00127 }
00128 
00129 //______________________________________________________________________________
00130 void TQRootCanvas::mousePressEvent( QMouseEvent *e )
00131 {
00132    // Handle mouse button press event.
00133 
00134    TPad *pad=0;
00135    TObjLink *pickobj=0;
00136    TObject *selected=0;
00137    Int_t px=e->x();
00138    Int_t py=e->y();
00139    TString selectedOpt;
00140    switch (e->button()) {
00141       case LeftButton :
00142          fCanvas->HandleInput(kButton1Down, e->x(), e->y());
00143          break;
00144       case RightButton :
00145          selected=fCanvas->GetSelected();
00146          pad = fCanvas->Pick(px, py, pickobj);
00147          if (pad) {
00148             if (!pickobj) {
00149                fCanvas->SetSelected(pad); selected=pad;
00150                selectedOpt = "";
00151             }
00152             else {
00153                if (!selected) {
00154                   selected    = pickobj->GetObject();
00155                   selectedOpt = pickobj->GetOption();
00156                }
00157             }
00158             pad->cd();
00159             fCanvas->SetSelectedPad(pad);
00160          }
00161          gROOT->SetSelectedPrimitive(selected);
00162          fContextMenu->Popup(selected, gPad->AbsPixeltoX(gPad->GetEventX()), 
00163                              gPad->AbsPixeltoY(gPad->GetEventY()), e);
00164 
00165          break;
00166       case MidButton :
00167          pad = fCanvas->Pick(px, py, pickobj);  // get the selected pad and emit a Qt-Signal
00168          emit SelectedPadChanged(pad);          // that inform the Qt-world that tha pad is changed
00169                                                 // and give the pointer to the new pad as argument
00170                                                 // of the signal (M. Al-Turany)
00171          fCanvas->HandleInput(kButton2Down, e->x(), e->y());
00172 
00173          break;
00174 
00175       case  NoButton :
00176          break;
00177       default:
00178          break;
00179    }
00180 
00181 }
00182 
00183 //______________________________________________________________________________
00184 void TQRootCanvas::mouseReleaseEvent( QMouseEvent *e )
00185 {
00186    // Handle mouse button release event.
00187 
00188    switch (e->button()) {
00189       case LeftButton :
00190          fCanvas->HandleInput(kButton1Up, e->x(), e->y());
00191          break;
00192       case RightButton :
00193          fCanvas->HandleInput(kButton3Up, e->x(), e->y());
00194          break;
00195       case MidButton :
00196          fCanvas->HandleInput(kButton2Up, e->x(), e->y());
00197          break;
00198       case  NoButton :
00199          break;
00200       default:
00201          break;
00202    }
00203 
00204 }
00205 
00206 //______________________________________________________________________________
00207 void TQRootCanvas::mouseDoubleClickEvent( QMouseEvent *e )
00208 {
00209    // Handle mouse double click event.
00210 
00211    switch (e->button()) {
00212       case LeftButton :
00213          fCanvas->HandleInput(kButton1Double, e->x(), e->y());
00214          break;
00215       case RightButton :
00216          fCanvas->HandleInput(kButton3Double, e->x(), e->y());
00217          break;
00218       case MidButton :
00219          fCanvas->HandleInput(kButton2Double, e->x(), e->y());
00220          break;
00221       case  NoButton :
00222          break;
00223       default:
00224          break;
00225    }
00226 }
00227 
00228 //______________________________________________________________________________
00229 void TQRootCanvas::resizeEvent( QResizeEvent *e )
00230 {
00231    // Call QWidget resize and inform the ROOT Canvas.
00232 
00233    QWidget::resizeEvent( e );
00234    fNeedResize=kTRUE;
00235 }
00236 
00237 //______________________________________________________________________________
00238 void TQRootCanvas::paintEvent( QPaintEvent * )
00239 {
00240    // Handle paint event of Qt.
00241 
00242    if (fCanvas) {
00243       QPainter p;
00244       p.begin( this);
00245       p.end();
00246       if (fNeedResize) {
00247          fCanvas->Resize();
00248          fNeedResize=kFALSE;
00249       }
00250       fCanvas->Update();
00251    }
00252 }
00253 
00254 //______________________________________________________________________________
00255 void TQRootCanvas::leaveEvent( QEvent * /*e*/ )
00256 {
00257    // Handle leave event.
00258 
00259    if (fCanvas) fCanvas->HandleInput(kMouseLeave, 0, 0);
00260 }
00261 
00262 //______________________________________________________________________________
00263 Bool_t TQRootCanvas ::eventFilter( QObject *o, QEvent *e )
00264 {
00265    // Filtering of QWidget Events
00266    // for ressource management
00267 
00268    if ( e->type() == QEvent::Close) {  // close
00269       if (fCanvas && (fIsCanvasOwned== kFALSE) ) {
00270          delete fCanvas;
00271          fCanvas=0;
00272       }
00273       if ( e->type() == QEvent::ChildRemoved ) {  // child is removed
00274       }
00275       return FALSE;                        // eat event
00276    }
00277 
00278    if ( e->type() == QEvent::Destroy) {  // destroy
00279       return FALSE;
00280    }
00281 
00282    if ( e->type() == QEvent::Paint) {  // Paint
00283       return FALSE;
00284    }
00285    if ( e->type() == QEvent::Move) {  // Paint
00286       return FALSE;
00287    }
00288 
00289    // standard event processing
00290    return QWidget::eventFilter( o, e );
00291 }
00292 
00293 ////////////////////////////////////// drag and drop support
00294 
00295 //______________________________________________________________________________
00296 void TQRootCanvas::dragEnterEvent( QDragEnterEvent *e )
00297 {
00298    // Entering a drag event.
00299 
00300    if ( QTextDrag::canDecode(e))
00301       e->accept();
00302 }
00303 
00304 //______________________________________________________________________________
00305 void TQRootCanvas::dropEvent( QDropEvent *Event )
00306 {
00307    // Start a drop, for now only histogram objects can be drwon by droping.
00308 
00309    QString str;
00310    if ( QTextDrag::decode( Event, str ) ) {
00311       TObject *dragedObject = gROOT->FindObject(str);
00312       QPoint Pos = Event->pos();
00313       TObject *object=0;
00314       TPad *pad = fCanvas->Pick(Pos.x(), Pos.y(), object);
00315       if (dragedObject!=0) {
00316          if (dragedObject->InheritsFrom("TH1")) {
00317             pad->cd();
00318             dragedObject->Draw();
00319             pad->Update();
00320          }
00321       }
00322       else
00323         cout << "object " << 
00324 #if  (QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 4
00325           str.data() 
00326 #else 
00327           str
00328 #endif
00329              <<  " not found by ROOT" << endl;
00330    }
00331 }
00332 
00333 /////////////////////////////////////End Drag and drop Support (Mohammad Al-Turany)
00334 
00335 //______________________________________________________________________________
00336 void TQRootCanvas::cd(Int_t subpadnumber)
00337 {
00338    // Just a wrapper
00339 
00340    fCanvas->cd(subpadnumber);
00341 }
00342 
00343 //______________________________________________________________________________
00344 void TQRootCanvas::Browse(TBrowser *b)
00345 {
00346    // Just a wrapper.
00347 
00348    fCanvas->Browse(b);
00349 }
00350 
00351 //______________________________________________________________________________
00352 void TQRootCanvas::Clear(Option_t *option)
00353 {
00354    // Just a wrapper.
00355 
00356    fCanvas->Clear(option);
00357 }
00358 
00359 //______________________________________________________________________________
00360 void TQRootCanvas::Close(Option_t *option)
00361 {
00362    // Just a wrapper.
00363 
00364    fCanvas->Close(option);
00365 }
00366 
00367 //______________________________________________________________________________
00368 void TQRootCanvas::Draw(Option_t *option)
00369 {
00370    // Just a wrapper.
00371 
00372    fCanvas->Draw(option);
00373 }
00374 
00375 //______________________________________________________________________________
00376 TObject *TQRootCanvas::DrawClone(Option_t *option)
00377 {
00378    // Just a wrapper.
00379 
00380    return  fCanvas->DrawClone(option);
00381 }
00382 
00383 //______________________________________________________________________________
00384 TObject *TQRootCanvas::DrawClonePad()
00385 {
00386    // Just a wrapper.
00387 
00388    return  fCanvas->DrawClonePad();
00389 }
00390 
00391 //______________________________________________________________________________
00392 void TQRootCanvas::EditorBar()
00393 {
00394    // Just a wrapper.
00395 
00396    fCanvas->EditorBar();
00397 }
00398 
00399 //______________________________________________________________________________
00400 void TQRootCanvas::EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
00401 {
00402    // just a wrapper
00403    fCanvas->EnterLeave(prevSelPad, prevSelObj);
00404 }
00405 
00406 //______________________________________________________________________________
00407 void TQRootCanvas::FeedbackMode(Bool_t set)
00408 {
00409    // just a wrapper
00410    fCanvas->FeedbackMode(set);
00411 }
00412 
00413 //______________________________________________________________________________
00414 void TQRootCanvas::Flush()
00415 {
00416    // just a wrapper
00417    fCanvas->Flush();
00418 }
00419 
00420 //______________________________________________________________________________
00421 void TQRootCanvas::UseCurrentStyle()
00422 {
00423    // just a wrapper
00424    fCanvas->UseCurrentStyle();
00425 }
00426 
00427 //______________________________________________________________________________
00428 void TQRootCanvas::ForceUpdate()
00429 {
00430    // just a wrapper
00431    fCanvas->ForceUpdate() ;
00432 }
00433 
00434 //______________________________________________________________________________
00435 const char *TQRootCanvas::GetDISPLAY()
00436 {
00437    // just a wrapper
00438    return fCanvas->GetDISPLAY() ;
00439 }
00440 
00441 //______________________________________________________________________________
00442 TContextMenu *TQRootCanvas::GetContextMenu()
00443 {
00444    // just a wrapper
00445    return  fCanvas->GetContextMenu() ;
00446 }
00447 
00448 //______________________________________________________________________________
00449 Int_t TQRootCanvas::GetDoubleBuffer()
00450 {
00451    // just a wrapper
00452    return fCanvas->GetDoubleBuffer();
00453 }
00454 
00455 //______________________________________________________________________________
00456 Int_t TQRootCanvas::GetEvent()
00457 {
00458    // just a wrapper
00459    return fCanvas->GetEvent();
00460 }
00461 
00462 //______________________________________________________________________________
00463 Int_t TQRootCanvas::GetEventX()
00464 {
00465    // just a wrapper
00466    return fCanvas->GetEventX() ;
00467 }
00468 
00469 //______________________________________________________________________________
00470 Int_t TQRootCanvas::GetEventY()
00471 {
00472    // just a wrapper
00473    return fCanvas->GetEventY() ;
00474 }
00475 
00476 //______________________________________________________________________________
00477 Color_t TQRootCanvas::GetHighLightColor()
00478 {
00479    // just a wrapper
00480    return fCanvas->GetHighLightColor() ;
00481 }
00482 
00483 //______________________________________________________________________________
00484 TVirtualPad *TQRootCanvas::GetPadSave()
00485 {
00486    // just a wrapper
00487    return fCanvas->GetPadSave();
00488 }
00489 
00490 //______________________________________________________________________________
00491 TObject *TQRootCanvas::GetSelected()
00492 {
00493    // just a wrapper
00494    return fCanvas->GetSelected() ;
00495 }
00496 
00497 //______________________________________________________________________________
00498 Option_t *TQRootCanvas::GetSelectedOpt()
00499 {
00500    // just a wrapper
00501    return fCanvas->GetSelectedOpt();
00502 }
00503 
00504 //______________________________________________________________________________
00505 TVirtualPad *TQRootCanvas::GetSelectedPad()
00506 {
00507    // just a wrapper
00508    return fCanvas->GetSelectedPad();
00509 }
00510 
00511 //______________________________________________________________________________
00512 Bool_t TQRootCanvas::GetShowEventStatus()
00513 {
00514    // just a wrapper
00515    return fCanvas->GetShowEventStatus() ;
00516 }
00517 
00518 //______________________________________________________________________________
00519 Bool_t TQRootCanvas::GetAutoExec()
00520 {
00521    // just a wrapper
00522    return fCanvas->GetAutoExec();
00523 }
00524 
00525 //______________________________________________________________________________
00526 Size_t TQRootCanvas::GetXsizeUser()
00527 {
00528    // just a wrapper
00529    return fCanvas->GetXsizeUser();
00530 }
00531 
00532 //______________________________________________________________________________
00533 Size_t TQRootCanvas::GetYsizeUser()
00534 {
00535    // just a wrapper
00536    return fCanvas->GetYsizeUser();
00537 }
00538 
00539 //______________________________________________________________________________
00540 Size_t TQRootCanvas::GetXsizeReal()
00541 {
00542    // just a wrapper
00543    return fCanvas->GetXsizeReal();
00544 }
00545 
00546 //______________________________________________________________________________
00547 Size_t TQRootCanvas::GetYsizeReal()
00548 {
00549    // just a wrapper
00550    return fCanvas->GetYsizeReal();
00551 }
00552 
00553 //______________________________________________________________________________
00554 Int_t TQRootCanvas::GetCanvasID()
00555 {
00556    // just a wrapper
00557    return fCanvas->GetCanvasID();
00558 }
00559 
00560 //______________________________________________________________________________
00561 Int_t TQRootCanvas::GetWindowTopX()
00562 {
00563    // just a wrapper
00564    return fCanvas->GetWindowTopX();
00565 }
00566 
00567 //______________________________________________________________________________
00568 Int_t TQRootCanvas::GetWindowTopY()
00569 {
00570    // just a wrapper
00571    return fCanvas->GetWindowTopY();
00572 }
00573 
00574 //______________________________________________________________________________
00575 UInt_t TQRootCanvas::GetWindowWidth()
00576 {
00577    // just a wrapper
00578    return fCanvas->GetWindowWidth() ;
00579 }
00580 
00581 //______________________________________________________________________________
00582 UInt_t TQRootCanvas::GetWindowHeight()
00583 {
00584    // just a wrapper
00585    return fCanvas->GetWindowHeight();
00586 }
00587 
00588 //______________________________________________________________________________
00589 UInt_t TQRootCanvas::GetWw()
00590 {
00591    // just a wrapper
00592    return fCanvas->GetWw();
00593 }
00594 
00595 //______________________________________________________________________________
00596 UInt_t TQRootCanvas::GetWh()
00597 {
00598    // just a wrapper
00599    return fCanvas->GetWh() ;
00600 }
00601 
00602 //______________________________________________________________________________
00603 void TQRootCanvas::GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh)
00604 {
00605    // just a wrapper
00606    fCanvas->GetCanvasPar(wtopx, wtopy, ww, wh);
00607 }
00608 
00609 //______________________________________________________________________________
00610 void TQRootCanvas::HandleInput(EEventType button, Int_t x, Int_t y)
00611 {
00612    // just a wrapper
00613    fCanvas->HandleInput(button, x, y);
00614 }
00615 
00616 //______________________________________________________________________________
00617 Bool_t TQRootCanvas::HasMenuBar()
00618 {
00619    // just a wrapper
00620    return fCanvas->HasMenuBar() ;
00621 }
00622 
00623 //______________________________________________________________________________
00624 void TQRootCanvas::Iconify()
00625 {
00626    // just a wrapper
00627    fCanvas->Iconify();
00628 }
00629 
00630 //______________________________________________________________________________
00631 Bool_t TQRootCanvas::IsBatch()
00632 {
00633    // just a wrapper
00634    return fCanvas->IsBatch() ;
00635 }
00636 
00637 //______________________________________________________________________________
00638 Bool_t TQRootCanvas::IsRetained()
00639 {
00640    // just a wrapper
00641    return fCanvas->IsRetained();
00642 }
00643 
00644 //______________________________________________________________________________
00645 void TQRootCanvas::ls(Option_t *option)
00646 {
00647    // just a wrapper
00648    fCanvas->ls(option);
00649 }
00650 
00651 //______________________________________________________________________________
00652 void TQRootCanvas::MoveOpaque(Int_t set)
00653 {
00654    // just a wrapper
00655    fCanvas->MoveOpaque(set);
00656 }
00657 
00658 //______________________________________________________________________________
00659 Bool_t TQRootCanvas::OpaqueMoving()
00660 {
00661    // just a wrapper
00662    return fCanvas->OpaqueMoving();
00663 }
00664 
00665 //______________________________________________________________________________
00666 Bool_t TQRootCanvas::OpaqueResizing()
00667 {
00668    // just a wrapper
00669    return fCanvas->OpaqueResizing();
00670 }
00671 
00672 //______________________________________________________________________________
00673 void TQRootCanvas::Paint(Option_t *option)
00674 {
00675    // just a wrapper
00676    fCanvas->Paint(option);
00677 }
00678 
00679 //______________________________________________________________________________
00680 TPad *TQRootCanvas::Pick(Int_t px, Int_t py, TObjLink *&pickobj)
00681 {
00682    // just a wrapper
00683    return fCanvas->Pick(px, py, pickobj);
00684 }
00685 
00686 //______________________________________________________________________________
00687 TPad *TQRootCanvas::Pick(Int_t px, Int_t py, TObject *prevSelObj)
00688 {
00689    // just a wrapper
00690    return fCanvas->Pick(px, py, prevSelObj);
00691 }
00692 
00693 //______________________________________________________________________________
00694 void TQRootCanvas::Resize(Option_t *option)
00695 {
00696    // just a wrapper
00697    fCanvas->Resize(option);
00698 }
00699 
00700 //______________________________________________________________________________
00701 void TQRootCanvas::ResizeOpaque(Int_t set)
00702 {
00703    // just a wrapper
00704    fCanvas->ResizeOpaque(set);
00705 }
00706 
00707 //______________________________________________________________________________
00708 void TQRootCanvas::SaveSource(const char *filename, Option_t *option)
00709 {
00710    // just a wrapper
00711    fCanvas->SaveSource(filename, option);
00712 }
00713 
00714 //______________________________________________________________________________
00715 void TQRootCanvas::SetCursor(ECursor cursor)
00716 {
00717    // just a wrapper
00718    fCanvas->SetCursor(cursor);
00719 }
00720 
00721 //______________________________________________________________________________
00722 void TQRootCanvas::SetDoubleBuffer(Int_t mode)
00723 {
00724    // just a wrapper
00725    fCanvas->SetDoubleBuffer(mode);
00726 }
00727 
00728 //______________________________________________________________________________
00729 void TQRootCanvas::SetWindowPosition(Int_t x, Int_t y)
00730 {
00731    // just a wrapper
00732    fCanvas->SetWindowPosition(x, y) ;
00733 }
00734 
00735 //______________________________________________________________________________
00736 void TQRootCanvas::SetWindowSize(UInt_t ww, UInt_t wh)
00737 {
00738    // just a wrapper
00739    fCanvas->SetWindowSize(ww,wh) ;
00740 }
00741 
00742 //______________________________________________________________________________
00743 void TQRootCanvas::SetCanvasSize(UInt_t ww, UInt_t wh)
00744 {
00745    // just a wrapper
00746    fCanvas->SetCanvasSize(ww, wh);
00747 }
00748 
00749 //______________________________________________________________________________
00750 void TQRootCanvas::SetHighLightColor(Color_t col)
00751 {
00752    // just a wrapper
00753    fCanvas->SetHighLightColor(col);
00754 }
00755 
00756 //______________________________________________________________________________
00757 void TQRootCanvas::SetSelected(TObject *obj)
00758 {
00759    // just a wrapper
00760    fCanvas->SetSelected(obj);
00761 }
00762 
00763 //______________________________________________________________________________
00764 void TQRootCanvas::SetSelectedPad(TPad *pad)
00765 {
00766    // just a wrapper
00767    fCanvas->SetSelectedPad(pad);
00768 }
00769 
00770 //______________________________________________________________________________
00771 void TQRootCanvas::Show()
00772 {
00773    // just a wrapper
00774    fCanvas->Show() ;
00775 }
00776 
00777 //______________________________________________________________________________
00778 void TQRootCanvas::Size(Float_t xsizeuser, Float_t ysizeuser)
00779 {
00780    // just a wrapper
00781    fCanvas->Size(xsizeuser, ysizeuser);
00782 }
00783 
00784 //______________________________________________________________________________
00785 void TQRootCanvas::SetBatch(Bool_t batch)
00786 {
00787    // just a wrapper
00788    fCanvas->SetBatch(batch);
00789 }
00790 
00791 //______________________________________________________________________________
00792 void TQRootCanvas::SetRetained(Bool_t retained)
00793 {
00794   // just a wrapper
00795    fCanvas->SetRetained(retained);
00796 }
00797 
00798 //______________________________________________________________________________
00799 void TQRootCanvas::SetTitle(const char *title)
00800 {
00801    // just a wrapper
00802    fCanvas->SetTitle(title);
00803 }
00804 
00805 //______________________________________________________________________________
00806 void TQRootCanvas::ToggleEventStatus()
00807 {
00808    // just a wrapper
00809    fCanvas->ToggleEventStatus();
00810 }
00811 
00812 //______________________________________________________________________________
00813 void TQRootCanvas::ToggleAutoExec()
00814 {
00815    // just a wrapper
00816    fCanvas->ToggleAutoExec();
00817 }
00818 
00819 //______________________________________________________________________________
00820 void TQRootCanvas::Update()
00821 {
00822    // just a wrapper
00823    fCanvas->Update();
00824 }
00825 
00826 //______________________________________________________________________________
00827 void  TQRootCanvas::closeEvent( QCloseEvent * e)
00828 {
00829    // Close.
00830 
00831    if ( fIsCanvasOwned ) {
00832       delete fCanvas;
00833       fCanvas = 0;
00834    }
00835    e->accept();
00836    return;
00837 }
00838 
00839 //______________________________________________________________________________
00840 TQRootCanvas::~TQRootCanvas()
00841 {
00842    // dtor
00843 
00844    if (fContextMenu) {
00845       delete fContextMenu;
00846       fContextMenu=0;
00847    }
00848    if ( fIsCanvasOwned && fCanvas ) {
00849       delete fCanvas;
00850       fCanvas = 0;
00851    }
00852 }
00853 
00854 
00855 

Generated on Tue Jul 5 14:22:20 2011 for ROOT_528-00b_version by  doxygen 1.5.1