00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TQROOTCANVAS_H
00017 #define TQROOTCANVAS_H
00018
00019 using namespace std;
00020
00021 #include "qwidget.h"
00022 #include "qstring.h"
00023 #include "tqcanvasmenu.h"
00024 #include "TApplication.h"
00025 #include "TSeqCollection.h"
00026 #include "TROOT.h"
00027 #include "qdragobject.h"
00028 #include "Rtypes.h"
00029 #include "Gtypes.h"
00030 #include "TButton.h"
00031
00032 class QAction;
00033 class QMouseEvent;
00034 class QResizeEvent;
00035 class QPaintEvent;
00036 class TPad;
00037 class TContextMenu;
00038 class TControlBar;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 class TQRootCanvas : public QWidget
00051 {
00052 Q_OBJECT
00053
00054 public:
00055 TQRootCanvas( QWidget *parent = 0, const char *name = 0 ,TCanvas *c=0);
00056 TQRootCanvas( QWidget *parent = 0, QWidget* tabWin = 0 , const char *name = 0 ,TCanvas *c=0);
00057
00058 virtual ~TQRootCanvas();
00059
00060 TCanvas* getCanvas() { return fCanvas;}
00061 int getRootWid() { return wid;}
00062 bool getCanvasOwner(){ return isCanvasOwned; }
00063 QWidget* getParent() { return fParent;}
00064 QWidget* getTabWin() { return fTabWin;}
00065 virtual void dropEvent( QDropEvent *Event );
00066 virtual void dragEnterEvent( QDragEnterEvent *e );
00067
00068 signals:
00069 void SelectedPadChanged(TPad *);
00070
00071
00072 public slots:
00073
00074
00075 void cd(Int_t subpadnumber=0);
00076 virtual void Browse(TBrowser *b);
00077 void Clear(Option_t *option="");
00078 void Close(Option_t *option="");
00079 virtual void Draw(Option_t *option="");
00080 virtual TObject *DrawClone(Option_t *option="");
00081 virtual TObject *DrawClonePad();
00082 virtual void EditorBar();
00083 void EnterLeave(TPad *prevSelPad, TObject *prevSelObj);
00084 void FeedbackMode(Bool_t set);
00085 void Flush();
00086 void UseCurrentStyle();
00087 void ForceUpdate() ;
00088 const char *GetDISPLAY();
00089 TContextMenu *GetContextMenu() ;
00090 Int_t GetDoubleBuffer() ;
00091 TControlBar *GetEditorBar() ;
00092 Int_t GetEvent() ;
00093 Int_t GetEventX() ;
00094 Int_t GetEventY() ;
00095 Color_t GetHighLightColor() ;
00096 virtual void GetPadDivision(Int_t xdivision=1, Int_t ydivision=1);
00097 TVirtualPad *GetPadSave() ;
00098 TObject *GetSelected() ;
00099 Option_t *GetSelectedOpt() ;
00100 TVirtualPad *GetSelectedPad() ;
00101 Bool_t GetShowEventStatus() ;
00102 Bool_t GetAutoExec() ;
00103 Size_t GetXsizeUser() ;
00104 Size_t GetYsizeUser() ;
00105 Size_t GetXsizeReal() ;
00106 Size_t GetYsizeReal() ;
00107 Int_t GetCanvasID() ;
00108 Int_t GetWindowTopX();
00109 Int_t GetWindowTopY();
00110 UInt_t GetWindowWidth() ;
00111 UInt_t GetWindowHeight() ;
00112 UInt_t GetWw() ;
00113 UInt_t GetWh() ;
00114 virtual void GetCanvasPar(Int_t &wtopx, Int_t &wtopy, UInt_t &ww, UInt_t &wh);
00115 virtual void HandleInput(EEventType button, Int_t x, Int_t y);
00116 Bool_t HasMenuBar() ;
00117 void Iconify() ;
00118 Bool_t IsBatch() ;
00119 Bool_t IsRetained() ;
00120 virtual void ls(Option_t *option="") ;
00121 void MoveOpaque(Int_t set=1);
00122 Bool_t OpaqueMoving() ;
00123 Bool_t OpaqueResizing() ;
00124 virtual void Paint(Option_t *option="");
00125 virtual TPad *Pick(Int_t px, Int_t py, TObjLink *&pickobj) ;
00126 virtual TPad *Pick(Int_t px, Int_t py, TObject *prevSelObj);
00127 virtual void Resize(Option_t *option="");
00128 void ResizeOpaque(Int_t set=1) ;
00129 void SaveSource(const char *filename="", Option_t *option="");
00130 virtual void SetCursor(ECursor cursor);
00131 virtual void SetDoubleBuffer(Int_t mode=1);
00132 void SetWindowPosition(Int_t x, Int_t y) ;
00133 void SetWindowSize(UInt_t ww, UInt_t wh) ;
00134 void SetCanvasSize(UInt_t ww, UInt_t wh);
00135 void SetHighLightColor(Color_t col);
00136 void SetSelected(TObject *obj) ;
00137 void SetSelectedPad(TPad *pad) ;
00138 void Show() ;
00139 virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0);
00140 void SetBatch(Bool_t batch=kTRUE);
00141 void SetRetained(Bool_t retained=kTRUE);
00142 void SetTitle(const char *title="");
00143 virtual void ToggleEventStatus();
00144 virtual void ToggleAutoExec();
00145 virtual void Update();
00146
00148 bool NeedsResize(){return needResize;}
00149 void SetNeedsResize(bool yes) {needResize=yes;}
00150
00151
00152
00153 protected:
00154 virtual bool eventFilter( QObject *, QEvent * );
00155 virtual void mousePressEvent( QMouseEvent *e );
00156 virtual void mouseReleaseEvent( QMouseEvent *e );
00157 virtual void resizeEvent( QResizeEvent *e );
00158 virtual void paintEvent( QPaintEvent *e );
00159 virtual void mouseDoubleClickEvent(QMouseEvent* e );
00160 virtual void mouseMoveEvent(QMouseEvent *e);
00161 virtual void leaveEvent(QEvent *e);
00162 virtual void closeEvent( QCloseEvent * e);
00164 TQCanvasMenu *fContextMenu;
00165 TCanvas *fCanvas;
00166 Int_t wid;
00167 bool needResize;
00168 bool isCanvasOwned;
00169 QWidget *fParent,*fTabWin;
00170 };
00171
00172 #endif
00173
00174
00175
00176
00177
00178
00179
00180