Warning, file /include/root/TRootCanvas.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_TRootCanvas
0014 #define ROOT_TRootCanvas
0015
0016
0017 #include "TCanvasImp.h"
0018 #include "TGFrame.h"
0019
0020 class TGCanvas;
0021 class TGMenuBar;
0022 class TGPopupMenu;
0023 class TGLayoutHints;
0024 class TGStatusBar;
0025 class TRootContainer;
0026 class TGToolBar;
0027 class TGHorizontal3DLine;
0028 class TGVertical3DLine;
0029 class TVirtualPadEditor;
0030 class TGDockableFrame;
0031 class TGDNDManager;
0032 class TGToolTip;
0033
0034 class TRootCanvas : public TGMainFrame, public TCanvasImp {
0035
0036 friend class TRootContainer;
0037
0038 private:
0039 TGCanvas *fCanvasWindow;
0040 TRootContainer *fCanvasContainer;
0041 TGMenuBar *fMenuBar;
0042 TGPopupMenu *fFileMenu;
0043 TGPopupMenu *fFileSaveMenu;
0044 TGPopupMenu *fEditMenu;
0045 TGPopupMenu *fEditClearMenu;
0046 TGPopupMenu *fViewMenu;
0047 TGPopupMenu *fViewWithMenu;
0048 TGPopupMenu *fOptionMenu;
0049 TGPopupMenu *fToolsMenu;
0050 TGPopupMenu *fHelpMenu;
0051 TGLayoutHints *fMenuBarLayout;
0052 TGLayoutHints *fMenuBarItemLayout;
0053 TGLayoutHints *fMenuBarHelpLayout;
0054 TGLayoutHints *fCanvasLayout;
0055 TGStatusBar *fStatusBar;
0056 TGLayoutHints *fStatusBarLayout;
0057
0058 TGCompositeFrame *fEditorFrame;
0059 TGLayoutHints *fEditorLayout;
0060 TGCompositeFrame *fMainFrame;
0061 TGLayoutHints *fToolBarLayout;
0062 TGToolBar *fToolBar;
0063 TGHorizontal3DLine *fToolBarSep;
0064 TGLayoutHints *fMainFrameLayout;
0065 TGVertical3DLine *fVertical1;
0066 TGVertical3DLine *fVertical2;
0067 TGHorizontal3DLine *fHorizontal1;
0068 TGLayoutHints *fVertical1Layout;
0069 TGLayoutHints *fVertical2Layout;
0070 TGLayoutHints *fHorizontal1Layout;
0071 TGDockableFrame *fToolDock;
0072 TGLayoutHints *fDockLayout;
0073 const TGPicture *fIconPic;
0074 TGToolTip *fToolTip;
0075
0076 TVirtualPadEditor *fEditor;
0077 Bool_t fEmbedded;
0078 Int_t fCanvasID;
0079 Bool_t fAutoFit;
0080 Int_t fButton;
0081
0082 TRootCanvas(const TRootCanvas&) = delete;
0083 TRootCanvas& operator=(const TRootCanvas&) = delete;
0084
0085 void CreateCanvas(const char *name);
0086 void CreateEditor();
0087
0088 Bool_t HandleContainerButton(Event_t *ev);
0089 Bool_t HandleContainerDoubleClick(Event_t *ev);
0090 Bool_t HandleContainerConfigure(Event_t *ev);
0091 Bool_t HandleContainerKey(Event_t *ev);
0092 Bool_t HandleContainerMotion(Event_t *ev);
0093 Bool_t HandleContainerExpose(Event_t *ev);
0094 Bool_t HandleContainerCrossing(Event_t *ev);
0095
0096 Bool_t HandleDNDDrop(TDNDData *data) override;
0097 Atom_t HandleDNDPosition(Int_t x, Int_t y, Atom_t action,
0098 Int_t xroot, Int_t yroot) override;
0099 Atom_t HandleDNDEnter(Atom_t * typelist) override;
0100 Bool_t HandleDNDLeave() override;
0101
0102 public:
0103 TRootCanvas(TCanvas *c = nullptr, const char *name = "ROOT Canvas", UInt_t width = 500, UInt_t height = 300);
0104 TRootCanvas(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height);
0105 ~TRootCanvas() override;
0106
0107 void AdjustSize();
0108 void Close() override;
0109 void ForceUpdate() override { Layout(); }
0110 void FitCanvas();
0111 void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected);
0112 UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h) override;
0113 UInt_t GetCwidth() const;
0114 UInt_t GetCheight() const;
0115 void Iconify() override { IconifyWindow(); }
0116 Int_t InitWindow() override;
0117 void PrintCanvas();
0118 void RaiseWindow() override;
0119 void SetWindowPosition(Int_t x, Int_t y) override;
0120 void SetWindowSize(UInt_t w, UInt_t h) override;
0121 void SetWindowTitle(const char *newTitle) override;
0122 void SetCanvasSize(UInt_t w, UInt_t h) override;
0123 void SetStatusText(const char *txt = nullptr, Int_t partidx = 0) override;
0124
0125 void Show() override { MapRaised(); }
0126 void ShowMenuBar(Bool_t show = kTRUE) override;
0127 void ShowStatusBar(Bool_t show = kTRUE) override;
0128 void ShowEditor(Bool_t show = kTRUE) override;
0129 void ShowToolBar(Bool_t show = kTRUE) override;
0130 void ShowToolTips(Bool_t show = kTRUE) override;
0131
0132 Bool_t HasEditor() const override;
0133 Bool_t HasMenuBar() const override;
0134 Bool_t HasStatusBar() const override;
0135 Bool_t HasToolBar() const override;
0136 Bool_t HasToolTips() const override;
0137
0138 void Activated(Int_t id);
0139
0140 TGMenuBar *GetMenuBar() const { return fMenuBar; }
0141 TGLayoutHints *GetMenuBarItemLayout() const { return fMenuBarItemLayout; }
0142 TGStatusBar *GetStatusBar() const { return fStatusBar; }
0143 TGDockableFrame *GetToolDock() const { return fToolDock; }
0144
0145
0146 void CloseWindow() override;
0147 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0148 void ReallyDelete() override;
0149
0150 ClassDefOverride(TRootCanvas,0)
0151 };
0152
0153 #endif