ROOT  6.06/09
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 #ifndef ROOT_TGFrame
23 #include "TGFrame.h"
24 #endif
25 
28 
29 
31 
32 protected:
33  Bool_t fMoveWaiting; // kTRUE if source is clicked but not moved
34  Bool_t fDragging; // in dragging mode?
35  Bool_t fDropping; // drop is in progress
36  Bool_t fPasting; // paste action is in progress
37  EDragType fDragType; // dragging type
38  TGFrame *fSource; // frame being dragged
39  TGFrame *fFrameUnder; // frame under drag
40  TGFrame *fTarget; // drop target
42 
43 protected:
44  virtual void Init();
45 
46 public:
48  virtual ~TVirtualDragManager() {}
49 
50  EDragType GetEDragType() const { return fDragType; }
51  Bool_t IsMoveWaiting() const { return fMoveWaiting; }
52  Bool_t IsDragging() const { return fDragging; }
53  Bool_t IsDropping() const { return fDropping; }
54  Bool_t IsPasting() const { return fPasting; }
55  TGFrame *GetTarget() const { return fTarget; }
56  TGFrame *GetSource() const { return fSource; }
57  TGFrame *GetFrameUnder() const { return fFrameUnder; }
58  TGFrame *GetPasteFrame() const { return fPasteFrame; }
59 
60  virtual void SetTarget(TGFrame *f) { fTarget = f; }
61  virtual void SetSource(TGFrame *f) { fSource = f; }
62  virtual void SetPasteFrame(TGFrame *f) { fPasteFrame = f; }
63 
64  virtual Bool_t StartDrag(TGFrame * = 0, Int_t = 0, Int_t = 0) { return kFALSE; }
65  virtual Bool_t EndDrag() { return kFALSE; }
66  virtual Bool_t Drop() { return kFALSE; }
67  virtual Bool_t Cancel(Bool_t = kTRUE) { return kFALSE; }
68 
69  virtual Bool_t HandleEvent(Event_t *) { return kFALSE; }
70  virtual Bool_t HandleTimerEvent(Event_t *, TTimer *) { return kFALSE; }
71  virtual Bool_t IgnoreEvent(Event_t *) { return kTRUE; }
72  virtual void SetEditable(Bool_t) {}
73 
74  virtual Int_t GetStrartDragX() const { return 0; }
75  virtual Int_t GetStrartDragY() const { return 0; }
76  virtual Int_t GetEndDragX() const { return 0; }
77  virtual Int_t GetEndDragY() const { return 0; }
78 
79  static TVirtualDragManager *Instance();
80 
81  ClassDef(TVirtualDragManager,0) // drag and drop manager
82 };
83 
84 R__EXTERN TVirtualDragManager *gDragManager; // global drag manager
85 
86 #endif
virtual void Init()
Initialization.
Bool_t IsMoveWaiting() const
virtual void SetSource(TGFrame *f)
virtual Bool_t IgnoreEvent(Event_t *)
TGFrame * GetSource() const
virtual Bool_t Drop()
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Int_t GetStrartDragX() const
R__EXTERN TVirtualDragManager * gDragManager
virtual void SetEditable(Bool_t)
TGFrame * GetTarget() const
#define ClassDef(name, id)
Definition: Rtypes.h:254
EDragType GetEDragType() const
virtual Int_t GetEndDragX() const
virtual Bool_t EndDrag()
static TVirtualDragManager * Instance()
Load plugin and create drag manager object.
virtual Bool_t Cancel(Bool_t=kTRUE)
Bool_t IsDropping() const
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:57
TGFrame * GetPasteFrame() const
virtual Int_t GetEndDragY() const
double f(double x)
virtual void SetTarget(TGFrame *f)
Bool_t IsPasting() const
Bool_t IsDragging() const
virtual Int_t GetStrartDragY() 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.
const Bool_t kTRUE
Definition: Rtypes.h:91
TGFrame * GetFrameUnder() const
virtual Bool_t HandleEvent(Event_t *)