TQRootCanvas.h

Go to the documentation of this file.
00001 // @(#)root/qtgsi:$Id: TQRootCanvas.h 20882 2007-11-19 11:31:26Z rdm $
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 #ifndef ROOT_TQRootCanvas
00013 #define ROOT_TQRootCanvas
00014 
00015 ///////////////////////////////////////////////////////////////////////
00016 //
00017 // TQRootCanvas
00018 //
00019 // This canvas uses Qt eventloop to handle user input.
00020 //
00021 // @short Graphic Qt Widget based Canvas
00022 //
00023 // @authors Denis Bertini <d.bertini@gsi.de>
00024 //         M. AL-Turany  <m.al-turany@gsi.de>
00025 //version 2.0
00026 //////////////////////////////////////////////////////////////////////
00027 
00028 #ifndef __CINT__
00029 #include "qwidget.h"
00030 #include "qstring.h"
00031 #if !(QT_VERSION > 0x039999) // Added by cholm@nbi.dk - for Qt 3
00032 # include "qdragobject.h"
00033 #endif
00034 #endif
00035 
00036 #ifndef ROOT_TVirtualPad
00037 #include "TVirtualPad.h"
00038 #endif
00039 
00040 
00041 class QAction;
00042 class QMouseEvent;
00043 class QResizeEvent;
00044 class QPaintEvent;
00045 
00046 class TPad;
00047 class TContextMenu;
00048 class TControlBar;
00049 class TCanvas;
00050 class TQCanvasMenu;
00051 class TBrowser;
00052 class QWidget;
00053 class QDropEvent;
00054 class QDragEnterEvent;
00055 class QCloseEvent;
00056 class QEvent;
00057 
00058 class TQRootCanvas : public QWidget
00059 {
00060 #ifndef __CINT__
00061    Q_OBJECT
00062 #endif
00063 private:
00064    TQRootCanvas(const TQRootCanvas &);
00065    TQRootCanvas& operator=(const TQRootCanvas &);
00066       
00067 public:
00068 
00069    TQRootCanvas( QWidget *parent = 0, const char *name = 0 ,TCanvas *c=0);
00070    TQRootCanvas( QWidget *parent, QWidget* tabWin , const char *name = 0 ,TCanvas *c=0);
00071    virtual ~TQRootCanvas();
00072    TCanvas* GetCanvas() { return fCanvas;}
00073    Int_t GetRootWid() { return fWid;}
00074    Bool_t GetCanvasOwner(){ return fIsCanvasOwned; }
00075    QWidget* GetParent() { return fParent;}
00076    QWidget* GetTabWin() { return fTabWin;}
00077    virtual void dropEvent( QDropEvent *Event );
00078    virtual void dragEnterEvent( QDragEnterEvent *e );
00079 
00080 #ifndef __CINT__
00081 signals:
00082    void SelectedPadChanged(TPad *);
00083 #endif
00084 public slots:
00085    void              cd(Int_t subpadnumber=0);
00086    virtual void      Browse(TBrowser *b);
00087    void              Clear(Option_t *option="");
00088    void              Close(Option_t *option="");
00089    virtual void      Draw(Option_t *option="");
00090    virtual TObject  *DrawClone(Option_t *option="");
00091    virtual TObject  *DrawClonePad();
00092    virtual void      EditorBar();
00093    void              EnterLeave(TPad *prevSelPad, TObject *prevSelObj);
00094    void              FeedbackMode(Bool_t set);
00095    void              Flush();
00096    void              UseCurrentStyle();
00097    void              ForceUpdate() ;
00098    const char       *GetDISPLAY();
00099    TContextMenu     *GetContextMenu() ;
00100    Int_t             GetDoubleBuffer() ;
00101    Int_t             GetEvent()  ;
00102    Int_t             GetEventX() ;
00103    Int_t             GetEventY() ;
00104    Color_t           GetHighLightColor() ;
00105    TVirtualPad      *GetPadSave() ;
00106    TObject          *GetSelected() ;
00107    Option_t         *GetSelectedOpt() ;
00108    TVirtualPad      *GetSelectedPad()  ;
00109    Bool_t            GetShowEventStatus() ;
00110    Bool_t            GetAutoExec() ;
00111    Size_t            GetXsizeUser()  ;
00112    Size_t            GetYsizeUser()  ;
00113    Size_t            GetXsizeReal()  ;
00114    Size_t            GetYsizeReal()  ;
00115    Int_t             GetCanvasID()  ;
00116    Int_t             GetWindowTopX();
00117    Int_t             GetWindowTopY();
00118    UInt_t            GetWindowWidth() ;
00119    UInt_t            GetWindowHeight()  ;
00120    UInt_t            GetWw() ;
00121    UInt_t            GetWh() ;
00122    virtual void      GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh);
00123    virtual void      HandleInput(EEventType button, Int_t x, Int_t y);
00124    Bool_t            HasMenuBar()  ;
00125    void              Iconify() ;
00126    Bool_t            IsBatch() ;
00127    Bool_t            IsRetained() ;
00128    virtual void      ls(Option_t *option="") ;
00129    void              MoveOpaque(Int_t set=1);
00130    Bool_t            OpaqueMoving() ;
00131    Bool_t            OpaqueResizing() ;
00132    virtual void      Paint(Option_t *option="");
00133    virtual TPad     *Pick(Int_t px, Int_t py, TObjLink *&pickobj) ;
00134    virtual TPad     *Pick(Int_t px, Int_t py, TObject *prevSelObj);
00135    virtual void      Resize(Option_t *option="");
00136    void              ResizeOpaque(Int_t set=1) ;
00137    void              SaveSource(const char *filename="", Option_t *option="");
00138    virtual void      SetCursor(ECursor cursor);
00139    virtual void      SetDoubleBuffer(Int_t mode=1);
00140    void              SetWindowPosition(Int_t x, Int_t y) ;
00141    void              SetWindowSize(UInt_t ww, UInt_t wh) ;
00142    void              SetCanvasSize(UInt_t ww, UInt_t wh);
00143    void              SetHighLightColor(Color_t col);
00144    void              SetSelected(TObject *obj) ;
00145    void              SetSelectedPad(TPad *pad) ;
00146    void              Show() ;
00147    virtual void     Size(Float_t xsizeuser=0, Float_t ysizeuser=0);
00148    void              SetBatch(Bool_t batch=kTRUE);
00149    void              SetRetained(Bool_t retained=kTRUE);
00150    void              SetTitle(const char *title="");
00151    virtual void      ToggleEventStatus();
00152    virtual void      ToggleAutoExec();
00153    virtual void      Update();
00154    //////////////////////////////////////////////////////////////////////
00155    Bool_t NeedsResize(){return fNeedResize;}
00156    void SetNeedsResize(Bool_t yes) {fNeedResize=yes;}
00157 
00158 protected:
00159    virtual bool eventFilter( QObject *, QEvent * );
00160    virtual void mousePressEvent( QMouseEvent *e );
00161    virtual void mouseReleaseEvent( QMouseEvent *e );
00162    virtual void resizeEvent( QResizeEvent *e );
00163    virtual void paintEvent( QPaintEvent *e );
00164    virtual void mouseDoubleClickEvent(QMouseEvent* e );
00165    virtual void mouseMoveEvent(QMouseEvent *e);
00166    virtual void leaveEvent(QEvent *e);
00167    virtual void  closeEvent( QCloseEvent * e);
00168    ////////////////////////////////////
00169    TQCanvasMenu *fContextMenu;   // Qt Context menu for this canvas
00170    TCanvas *fCanvas;             // Root Canvas
00171    Int_t fWid;                   // Windows Id of the Canvas
00172    Bool_t fNeedResize;           // Resize flag
00173    Bool_t fIsCanvasOwned;        // Ownership flag
00174    QWidget *fParent,*fTabWin;    // parent widgets
00175    
00176    ClassDef(TQRootCanvas,1)  //interface to Qt eventloop to handle user input
00177 };
00178 
00179 #endif
00180 
00181 
00182 
00183 
00184 
00185 

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