Logo ROOT  
Reference Guide
TVirtualDragManager.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Valeriy Onuchin 12/08/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TVirtualDragManager
13 #define ROOT_TVirtualDragManager
14 
15 
16 #include "TGFrame.h"
17 
20 
21 
23 
24 protected:
25  Bool_t fMoveWaiting; ///< kTRUE if source is clicked but not moved
26  Bool_t fDragging; ///< in dragging mode?
27  Bool_t fDropping; ///< drop is in progress
28  Bool_t fPasting; ///< paste action is in progress
29  EDragType fDragType; ///< dragging type
30  TGFrame *fSource; ///< frame being dragged
31  TGFrame *fFrameUnder; ///< frame under drag
32  TGFrame *fTarget; ///< drop target
34 
35 protected:
36  virtual void Init();
37 
38 public:
40  virtual ~TVirtualDragManager() {}
41 
42  EDragType GetEDragType() const { return fDragType; }
43  Bool_t IsMoveWaiting() const { return fMoveWaiting; }
44  Bool_t IsDragging() const { return fDragging; }
45  Bool_t IsDropping() const { return fDropping; }
46  Bool_t IsPasting() const { return fPasting; }
47  TGFrame *GetTarget() const { return fTarget; }
48  TGFrame *GetSource() const { return fSource; }
49  TGFrame *GetFrameUnder() const { return fFrameUnder; }
50  TGFrame *GetPasteFrame() const { return fPasteFrame; }
51 
52  virtual void SetTarget(TGFrame *f) { fTarget = f; }
53  virtual void SetSource(TGFrame *f) { fSource = f; }
54  virtual void SetPasteFrame(TGFrame *f) { fPasteFrame = f; }
55 
56  virtual Bool_t StartDrag(TGFrame * = nullptr, Int_t = 0, Int_t = 0) { return kFALSE; }
57  virtual Bool_t EndDrag() { return kFALSE; }
58  virtual Bool_t Drop() { return kFALSE; }
59  virtual Bool_t Cancel(Bool_t = kTRUE) { return kFALSE; }
60 
61  virtual Bool_t HandleEvent(Event_t *) { return kFALSE; }
62  virtual Bool_t HandleTimerEvent(Event_t *, TTimer *) { return kFALSE; }
63  virtual Bool_t IgnoreEvent(Event_t *) { return kTRUE; }
64  virtual void SetEditable(Bool_t) {}
65 
66  virtual Int_t GetStrartDragX() const { return 0; }
67  virtual Int_t GetStrartDragY() const { return 0; }
68  virtual Int_t GetEndDragX() const { return 0; }
69  virtual Int_t GetEndDragY() const { return 0; }
70 
71  static TVirtualDragManager *Instance();
72 
73  ClassDef(TVirtualDragManager,0) // drag and drop manager
74 };
75 
76 R__EXTERN TVirtualDragManager *gDragManager; // global drag manager
77 
78 #endif
TVirtualDragManager::SetTarget
virtual void SetTarget(TGFrame *f)
Definition: TVirtualDragManager.h:52
TVirtualDragManager::HandleEvent
virtual Bool_t HandleEvent(Event_t *)
Definition: TVirtualDragManager.h:61
TVirtualDragManager::~TVirtualDragManager
virtual ~TVirtualDragManager()
Definition: TVirtualDragManager.h:40
TVirtualDragManager::EndDrag
virtual Bool_t EndDrag()
Definition: TVirtualDragManager.h:57
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TVirtualDragManager::Cancel
virtual Bool_t Cancel(Bool_t=kTRUE)
Definition: TVirtualDragManager.h:59
TVirtualDragManager::IsPasting
Bool_t IsPasting() const
Definition: TVirtualDragManager.h:46
f
#define f(i)
Definition: RSha256.hxx:104
TVirtualDragManager::Init
virtual void Init()
Initialization.
Definition: TVirtualDragManager.cxx:67
TVirtualDragManager::fMoveWaiting
Bool_t fMoveWaiting
kTRUE if source is clicked but not moved
Definition: TVirtualDragManager.h:25
TVirtualDragManager::HandleTimerEvent
virtual Bool_t HandleTimerEvent(Event_t *, TTimer *)
Definition: TVirtualDragManager.h:62
TVirtualDragManager::SetPasteFrame
virtual void SetPasteFrame(TGFrame *f)
Definition: TVirtualDragManager.h:54
kDragLink
@ kDragLink
Definition: TVirtualDragManager.h:19
TVirtualDragManager::StartDrag
virtual Bool_t StartDrag(TGFrame *=nullptr, Int_t=0, Int_t=0)
Definition: TVirtualDragManager.h:56
TVirtualDragManager::GetEndDragX
virtual Int_t GetEndDragX() const
Definition: TVirtualDragManager.h:68
gDragManager
R__EXTERN TVirtualDragManager * gDragManager
Definition: TVirtualDragManager.h:76
TVirtualDragManager::GetEDragType
EDragType GetEDragType() const
Definition: TVirtualDragManager.h:42
TVirtualDragManager::IgnoreEvent
virtual Bool_t IgnoreEvent(Event_t *)
Definition: TVirtualDragManager.h:63
TVirtualDragManager::fSource
TGFrame * fSource
frame being dragged
Definition: TVirtualDragManager.h:30
TVirtualDragManager::GetEndDragY
virtual Int_t GetEndDragY() const
Definition: TVirtualDragManager.h:69
TVirtualDragManager::Drop
virtual Bool_t Drop()
Definition: TVirtualDragManager.h:58
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TVirtualDragManager::GetStrartDragX
virtual Int_t GetStrartDragX() const
Definition: TVirtualDragManager.h:66
TVirtualDragManager::TVirtualDragManager
TVirtualDragManager()
Constructor.
Definition: TVirtualDragManager.cxx:36
bool
EDragType
EDragType
Definition: TVirtualDragManager.h:18
TVirtualDragManager::fPasting
Bool_t fPasting
paste action is in progress
Definition: TVirtualDragManager.h:28
TVirtualDragManager::GetPasteFrame
TGFrame * GetPasteFrame() const
Definition: TVirtualDragManager.h:50
kDragNone
@ kDragNone
Definition: TVirtualDragManager.h:18
kDragCopy
@ kDragCopy
Definition: TVirtualDragManager.h:18
TVirtualDragManager::fFrameUnder
TGFrame * fFrameUnder
frame under drag
Definition: TVirtualDragManager.h:31
TVirtualDragManager::GetSource
TGFrame * GetSource() const
Definition: TVirtualDragManager.h:48
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TVirtualDragManager::fPasteFrame
TGFrame * fPasteFrame
Definition: TVirtualDragManager.h:33
TVirtualDragManager::fTarget
TGFrame * fTarget
drop target
Definition: TVirtualDragManager.h:32
TVirtualDragManager::IsDropping
Bool_t IsDropping() const
Definition: TVirtualDragManager.h:45
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TVirtualDragManager::GetTarget
TGFrame * GetTarget() const
Definition: TVirtualDragManager.h:47
TGFrame.h
TVirtualDragManager
Definition: TVirtualDragManager.h:22
TVirtualDragManager::GetFrameUnder
TGFrame * GetFrameUnder() const
Definition: TVirtualDragManager.h:49
TVirtualDragManager::fDragging
Bool_t fDragging
in dragging mode?
Definition: TVirtualDragManager.h:26
TVirtualDragManager::fDragType
EDragType fDragType
dragging type
Definition: TVirtualDragManager.h:29
TVirtualDragManager::Instance
static TVirtualDragManager * Instance()
Load plugin and create drag manager object.
Definition: TVirtualDragManager.cxx:44
kDragResize
@ kDragResize
Definition: TVirtualDragManager.h:19
TVirtualDragManager::GetStrartDragY
virtual Int_t GetStrartDragY() const
Definition: TVirtualDragManager.h:67
TVirtualDragManager::fDropping
Bool_t fDropping
drop is in progress
Definition: TVirtualDragManager.h:27
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TVirtualDragManager::SetEditable
virtual void SetEditable(Bool_t)
Definition: TVirtualDragManager.h:64
Event_t
Event structure.
Definition: GuiTypes.h:174
TVirtualDragManager::SetSource
virtual void SetSource(TGFrame *f)
Definition: TVirtualDragManager.h:53
TVirtualDragManager::IsMoveWaiting
Bool_t IsMoveWaiting() const
Definition: TVirtualDragManager.h:43
TVirtualDragManager::IsDragging
Bool_t IsDragging() const
Definition: TVirtualDragManager.h:44
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
kDragLasso
@ kDragLasso
Definition: TVirtualDragManager.h:19
kDragMove
@ kDragMove
Definition: TVirtualDragManager.h:18
int