Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
24protected:
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
35protected:
36 virtual void Init();
37
38public:
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
72
73 ClassDef(TVirtualDragManager,0) // drag and drop manager
74};
75
77
78#endif
#define R__EXTERN
Definition DllImport.h:26
#define f(i)
Definition RSha256.hxx:104
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassDef(name, id)
Definition Rtypes.h:342
@ kDragLink
@ kDragNone
@ kDragLasso
@ kDragResize
@ kDragMove
@ kDragCopy
R__EXTERN TVirtualDragManager * gDragManager
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
EDragType fDragType
dragging type
virtual Bool_t HandleTimerEvent(Event_t *, TTimer *)
virtual void SetTarget(TGFrame *f)
TGFrame * fSource
frame being dragged
virtual void SetPasteFrame(TGFrame *f)
virtual Bool_t IgnoreEvent(Event_t *)
static TVirtualDragManager * Instance()
Load plugin and create drag manager object.
Bool_t fMoveWaiting
kTRUE if source is clicked but not moved
Bool_t fDragging
in dragging mode?
Bool_t fDropping
drop is in progress
TGFrame * fTarget
drop target
TVirtualDragManager()
Constructor.
virtual Bool_t EndDrag()
Bool_t fPasting
paste action is in progress
TGFrame * GetTarget() const
virtual Int_t GetEndDragY() const
Bool_t IsMoveWaiting() const
virtual void Init()
Initialization.
virtual Bool_t HandleEvent(Event_t *)
EDragType GetEDragType() const
TGFrame * fFrameUnder
frame under drag
virtual void SetEditable(Bool_t)
TGFrame * GetPasteFrame() const
TGFrame * GetSource() const
virtual Int_t GetStrartDragX() const
virtual Bool_t StartDrag(TGFrame *=nullptr, Int_t=0, Int_t=0)
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
Event structure.
Definition GuiTypes.h:174