Logo ROOT   6.14/05
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
virtual void Init()
Initialization.
TGFrame * GetPasteFrame() const
virtual void SetSource(TGFrame *f)
virtual Bool_t IgnoreEvent(Event_t *)
virtual Bool_t Drop()
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGFrame * GetTarget() const
TGFrame * GetFrameUnder() const
R__EXTERN TVirtualDragManager * gDragManager
virtual void SetEditable(Bool_t)
TGFrame * GetSource() const
Bool_t IsDragging() const
#define ClassDef(name, id)
Definition: Rtypes.h:320
Bool_t IsPasting() const
Bool_t IsMoveWaiting() const
virtual Bool_t EndDrag()
static TVirtualDragManager * Instance()
Load plugin and create drag manager object.
virtual Bool_t Cancel(Bool_t=kTRUE)
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
Bool_t IsDropping() const
virtual Int_t GetStrartDragY() const
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual Int_t GetStrartDragX() const
virtual void SetTarget(TGFrame *f)
virtual Int_t GetEndDragX() const
EDragType GetEDragType() const
virtual Bool_t StartDrag(TGFrame *=0, Int_t=0, Int_t=0)
#define R__EXTERN
Definition: DllImport.h:27
virtual Bool_t HandleTimerEvent(Event_t *, TTimer *)
virtual void SetPasteFrame(TGFrame *f)
TVirtualDragManager()
Constructor.
virtual Bool_t HandleEvent(Event_t *)
const Bool_t kTRUE
Definition: RtypesCore.h:87
virtual Int_t GetEndDragY() const