Logo ROOT   6.16/01
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
30protected:
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
41protected:
42 virtual void Init();
43
44public:
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
78
79 ClassDef(TVirtualDragManager,0) // drag and drop manager
80};
81
83
84#endif
#define R__EXTERN
Definition: DllImport.h:27
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:324
@ kDragLink
@ kDragNone
@ kDragLasso
@ kDragResize
@ kDragMove
@ kDragCopy
R__EXTERN TVirtualDragManager * gDragManager
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
Bool_t IsDropping() const
virtual Bool_t HandleTimerEvent(Event_t *, TTimer *)
virtual Bool_t Drop()
virtual void SetTarget(TGFrame *f)
virtual void SetPasteFrame(TGFrame *f)
virtual Bool_t IgnoreEvent(Event_t *)
static TVirtualDragManager * Instance()
Load plugin and create drag manager object.
TVirtualDragManager()
Constructor.
virtual Bool_t EndDrag()
TGFrame * GetTarget() const
virtual Int_t GetEndDragY() const
Bool_t IsMoveWaiting() const
virtual Bool_t StartDrag(TGFrame *=0, Int_t=0, Int_t=0)
virtual void Init()
Initialization.
virtual Bool_t HandleEvent(Event_t *)
EDragType GetEDragType() const
virtual void SetEditable(Bool_t)
TGFrame * GetPasteFrame() const
TGFrame * GetSource() const
virtual Int_t GetStrartDragX() const
Bool_t IsPasting() const
Bool_t IsDragging() const
virtual Int_t GetEndDragX() const
virtual void SetSource(TGFrame *f)
TGFrame * GetFrameUnder() const
virtual Bool_t Cancel(Bool_t=kTRUE)
virtual Int_t GetStrartDragY() const