File indexing completed on 2025-01-18 10:12:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TVirtualDragManager
0013 #define ROOT_TVirtualDragManager
0014
0015
0016 #include "TGFrame.h"
0017
0018 enum EDragType { kDragNone, kDragMove, kDragCopy,
0019 kDragLink, kDragLasso, kDragResize };
0020
0021
0022 class TVirtualDragManager {
0023
0024 protected:
0025 Bool_t fMoveWaiting;
0026 Bool_t fDragging;
0027 Bool_t fDropping;
0028 Bool_t fPasting;
0029 EDragType fDragType;
0030 TGFrame *fSource;
0031 TGFrame *fFrameUnder;
0032 TGFrame *fTarget;
0033 TGFrame *fPasteFrame;
0034
0035 protected:
0036 virtual void Init();
0037
0038 public:
0039 TVirtualDragManager();
0040 virtual ~TVirtualDragManager() {}
0041
0042 EDragType GetEDragType() const { return fDragType; }
0043 Bool_t IsMoveWaiting() const { return fMoveWaiting; }
0044 Bool_t IsDragging() const { return fDragging; }
0045 Bool_t IsDropping() const { return fDropping; }
0046 Bool_t IsPasting() const { return fPasting; }
0047 TGFrame *GetTarget() const { return fTarget; }
0048 TGFrame *GetSource() const { return fSource; }
0049 TGFrame *GetFrameUnder() const { return fFrameUnder; }
0050 TGFrame *GetPasteFrame() const { return fPasteFrame; }
0051
0052 virtual void SetTarget(TGFrame *f) { fTarget = f; }
0053 virtual void SetSource(TGFrame *f) { fSource = f; }
0054 virtual void SetPasteFrame(TGFrame *f) { fPasteFrame = f; }
0055
0056 virtual Bool_t StartDrag(TGFrame * = nullptr, Int_t = 0, Int_t = 0) { return kFALSE; }
0057 virtual Bool_t EndDrag() { return kFALSE; }
0058 virtual Bool_t Drop() { return kFALSE; }
0059 virtual Bool_t Cancel(Bool_t = kTRUE) { return kFALSE; }
0060
0061 virtual Bool_t HandleEvent(Event_t *) { return kFALSE; }
0062 virtual Bool_t HandleTimerEvent(Event_t *, TTimer *) { return kFALSE; }
0063 virtual Bool_t IgnoreEvent(Event_t *) { return kTRUE; }
0064 virtual void SetEditable(Bool_t) {}
0065
0066 virtual Int_t GetStrartDragX() const { return 0; }
0067 virtual Int_t GetStrartDragY() const { return 0; }
0068 virtual Int_t GetEndDragX() const { return 0; }
0069 virtual Int_t GetEndDragY() const { return 0; }
0070
0071 static TVirtualDragManager *Instance();
0072
0073 ClassDef(TVirtualDragManager,0)
0074 };
0075
0076 R__EXTERN TVirtualDragManager *gDragManager;
0077
0078 #endif