Logo ROOT  
Reference Guide
TVirtualDragManager.h
Go to the documentation of this file.
1 // $Id: TVirtualDragManager.h,v 1.1 2004/09/08 16:03:57 brun Exp $
2 // Author: Valeriy Onuchin 12/08/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, 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 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TVirtualDragManager //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 #include "TGFrame.h"
23 
26 
27 
29 
30 protected:
31  Bool_t fMoveWaiting; // kTRUE if source is clicked but not moved
32  Bool_t fDragging; // in dragging mode?
33  Bool_t fDropping; // drop is in progress
34  Bool_t fPasting; // paste action is in progress
35  EDragType fDragType; // dragging type
36  TGFrame *fSource; // frame being dragged
37  TGFrame *fFrameUnder; // frame under drag
38  TGFrame *fTarget; // drop target
40 
41 protected:
42  virtual void Init();
43 
44 public:
46  virtual ~TVirtualDragManager() {}
47 
48  EDragType GetEDragType() const { return fDragType; }
49  Bool_t IsMoveWaiting() const { return fMoveWaiting; }
50  Bool_t IsDragging() const { return fDragging; }
51  Bool_t IsDropping() const { return fDropping; }
52  Bool_t IsPasting() const { return fPasting; }
53  TGFrame *GetTarget() const { return fTarget; }
54  TGFrame *GetSource() const { return fSource; }
55  TGFrame *GetFrameUnder() const { return fFrameUnder; }
56  TGFrame *GetPasteFrame() const { return fPasteFrame; }
57 
58  virtual void SetTarget(TGFrame *f) { fTarget = f; }
59  virtual void SetSource(TGFrame *f) { fSource = f; }
60  virtual void SetPasteFrame(TGFrame *f) { fPasteFrame = f; }
61 
62  virtual Bool_t StartDrag(TGFrame * = 0, Int_t = 0, Int_t = 0) { return kFALSE; }
63  virtual Bool_t EndDrag() { return kFALSE; }
64  virtual Bool_t Drop() { return kFALSE; }
65  virtual Bool_t Cancel(Bool_t = kTRUE) { return kFALSE; }
66 
67  virtual Bool_t HandleEvent(Event_t *) { return kFALSE; }
68  virtual Bool_t HandleTimerEvent(Event_t *, TTimer *) { return kFALSE; }
69  virtual Bool_t IgnoreEvent(Event_t *) { return kTRUE; }
70  virtual void SetEditable(Bool_t) {}
71 
72  virtual Int_t GetStrartDragX() const { return 0; }
73  virtual Int_t GetStrartDragY() const { return 0; }
74  virtual Int_t GetEndDragX() const { return 0; }
75  virtual Int_t GetEndDragY() const { return 0; }
76 
77  static TVirtualDragManager *Instance();
78 
79  ClassDef(TVirtualDragManager,0) // drag and drop manager
80 };
81 
82 R__EXTERN TVirtualDragManager *gDragManager; // global drag manager
83 
84 #endif
TVirtualDragManager::SetTarget
virtual void SetTarget(TGFrame *f)
Definition: TVirtualDragManager.h:58
TVirtualDragManager::HandleEvent
virtual Bool_t HandleEvent(Event_t *)
Definition: TVirtualDragManager.h:67
TVirtualDragManager::~TVirtualDragManager
virtual ~TVirtualDragManager()
Definition: TVirtualDragManager.h:46
TVirtualDragManager::EndDrag
virtual Bool_t EndDrag()
Definition: TVirtualDragManager.h:63
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TVirtualDragManager::Cancel
virtual Bool_t Cancel(Bool_t=kTRUE)
Definition: TVirtualDragManager.h:65
TVirtualDragManager::IsPasting
Bool_t IsPasting() const
Definition: TVirtualDragManager.h:52
f
#define f(i)
Definition: RSha256.hxx:122
TVirtualDragManager::Init
virtual void Init()
Initialization.
Definition: TVirtualDragManager.cxx:67
TVirtualDragManager::fMoveWaiting
Bool_t fMoveWaiting
Definition: TVirtualDragManager.h:31
TVirtualDragManager::HandleTimerEvent
virtual Bool_t HandleTimerEvent(Event_t *, TTimer *)
Definition: TVirtualDragManager.h:68
TVirtualDragManager::SetPasteFrame
virtual void SetPasteFrame(TGFrame *f)
Definition: TVirtualDragManager.h:60
kDragLink
@ kDragLink
Definition: TVirtualDragManager.h:31
TVirtualDragManager::GetEndDragX
virtual Int_t GetEndDragX() const
Definition: TVirtualDragManager.h:74
gDragManager
R__EXTERN TVirtualDragManager * gDragManager
Definition: TVirtualDragManager.h:82
TVirtualDragManager::GetEDragType
EDragType GetEDragType() const
Definition: TVirtualDragManager.h:48
TVirtualDragManager::IgnoreEvent
virtual Bool_t IgnoreEvent(Event_t *)
Definition: TVirtualDragManager.h:69
TVirtualDragManager::fSource
TGFrame * fSource
Definition: TVirtualDragManager.h:36
TVirtualDragManager::GetEndDragY
virtual Int_t GetEndDragY() const
Definition: TVirtualDragManager.h:75
TVirtualDragManager::Drop
virtual Bool_t Drop()
Definition: TVirtualDragManager.h:64
TGFrame
Definition: TGFrame.h:105
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TVirtualDragManager::GetStrartDragX
virtual Int_t GetStrartDragX() const
Definition: TVirtualDragManager.h:72
TVirtualDragManager::TVirtualDragManager
TVirtualDragManager()
Constructor.
Definition: TVirtualDragManager.cxx:36
bool
EDragType
EDragType
Definition: TVirtualDragManager.h:24
TVirtualDragManager::fPasting
Bool_t fPasting
Definition: TVirtualDragManager.h:34
TVirtualDragManager::GetPasteFrame
TGFrame * GetPasteFrame() const
Definition: TVirtualDragManager.h:56
kDragNone
@ kDragNone
Definition: TVirtualDragManager.h:30
kDragCopy
@ kDragCopy
Definition: TVirtualDragManager.h:30
TVirtualDragManager::fFrameUnder
TGFrame * fFrameUnder
Definition: TVirtualDragManager.h:37
TVirtualDragManager::GetSource
TGFrame * GetSource() const
Definition: TVirtualDragManager.h:54
TTimer
Definition: TTimer.h:51
TVirtualDragManager::fPasteFrame
TGFrame * fPasteFrame
Definition: TVirtualDragManager.h:39
TVirtualDragManager::fTarget
TGFrame * fTarget
Definition: TVirtualDragManager.h:38
TVirtualDragManager::StartDrag
virtual Bool_t StartDrag(TGFrame *=0, Int_t=0, Int_t=0)
Definition: TVirtualDragManager.h:62
TVirtualDragManager::IsDropping
Bool_t IsDropping() const
Definition: TVirtualDragManager.h:51
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TVirtualDragManager::GetTarget
TGFrame * GetTarget() const
Definition: TVirtualDragManager.h:53
TGFrame.h
TVirtualDragManager
Definition: TVirtualDragManager.h:28
TVirtualDragManager::GetFrameUnder
TGFrame * GetFrameUnder() const
Definition: TVirtualDragManager.h:55
TVirtualDragManager::fDragging
Bool_t fDragging
Definition: TVirtualDragManager.h:32
TVirtualDragManager::fDragType
EDragType fDragType
Definition: TVirtualDragManager.h:35
TVirtualDragManager::Instance
static TVirtualDragManager * Instance()
Load plugin and create drag manager object.
Definition: TVirtualDragManager.cxx:44
kDragResize
@ kDragResize
Definition: TVirtualDragManager.h:31
TVirtualDragManager::GetStrartDragY
virtual Int_t GetStrartDragY() const
Definition: TVirtualDragManager.h:73
TVirtualDragManager::fDropping
Bool_t fDropping
Definition: TVirtualDragManager.h:33
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TVirtualDragManager::SetEditable
virtual void SetEditable(Bool_t)
Definition: TVirtualDragManager.h:70
Event_t
Definition: GuiTypes.h:173
TVirtualDragManager::SetSource
virtual void SetSource(TGFrame *f)
Definition: TVirtualDragManager.h:59
TVirtualDragManager::IsMoveWaiting
Bool_t IsMoveWaiting() const
Definition: TVirtualDragManager.h:49
TVirtualDragManager::IsDragging
Bool_t IsDragging() const
Definition: TVirtualDragManager.h:50
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
kDragLasso
@ kDragLasso
Definition: TVirtualDragManager.h:31
kDragMove
@ kDragMove
Definition: TVirtualDragManager.h:30
int