File indexing completed on 2025-01-18 10:12:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_TRootEmbeddedCanvas
0014 #define ROOT_TRootEmbeddedCanvas
0015
0016
0017 #include "TGCanvas.h"
0018
0019
0020 class TCanvas;
0021 class TRootEmbeddedContainer;
0022 class TDNDData;
0023
0024 class TRootEmbeddedCanvas : public TGCanvas {
0025
0026 friend class TRootEmbeddedContainer;
0027
0028 protected:
0029 Int_t fCWinId;
0030 TRootEmbeddedContainer *fCanvasContainer;
0031 TCanvas *fCanvas;
0032 Bool_t fAutoFit;
0033 Int_t fButton;
0034 Atom_t *fDNDTypeList;
0035
0036 virtual Bool_t HandleContainerButton(Event_t *ev);
0037 virtual Bool_t HandleContainerDoubleClick(Event_t *ev);
0038 virtual Bool_t HandleContainerConfigure(Event_t *ev);
0039 virtual Bool_t HandleContainerKey(Event_t *ev);
0040 virtual Bool_t HandleContainerMotion(Event_t *ev);
0041 virtual Bool_t HandleContainerExpose(Event_t *ev);
0042 virtual Bool_t HandleContainerCrossing(Event_t *ev);
0043
0044 private:
0045 TRootEmbeddedCanvas(const TRootEmbeddedCanvas&) = delete;
0046 TRootEmbeddedCanvas& operator=(const TRootEmbeddedCanvas&) = delete;
0047
0048 public:
0049 TRootEmbeddedCanvas(const char *name = nullptr, const TGWindow *p = nullptr, UInt_t w = 10,
0050 UInt_t h = 10, UInt_t options = kSunkenFrame | kDoubleBorder,
0051 Pixel_t back = GetDefaultFrameBackground());
0052 ~TRootEmbeddedCanvas() override;
0053
0054 void AdoptCanvas(TCanvas *c);
0055 TCanvas *GetCanvas() const { return fCanvas; }
0056 Int_t GetCanvasWindowId() const { return fCWinId; }
0057 Bool_t GetAutoFit() const { return fAutoFit; }
0058 void SetAutoFit(Bool_t fit = kTRUE) { fAutoFit = fit; }
0059 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0060
0061 Bool_t HandleDNDDrop(TDNDData *data) override;
0062 Atom_t HandleDNDPosition(Int_t , Int_t , Atom_t action,
0063 Int_t , Int_t ) override;
0064 Atom_t HandleDNDEnter(Atom_t * typelist) override;
0065 Bool_t HandleDNDLeave() override;
0066
0067 ClassDefOverride(TRootEmbeddedCanvas,0)
0068 };
0069
0070 #endif