Logo ROOT  
Reference Guide
TGSplitter.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 6/09/2000
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_TGSplitter
13#define ROOT_TGSplitter
14
15
16#include "TGFrame.h"
17
18
19class TGSplitter : public TGFrame {
20
21protected:
22 Cursor_t fSplitCursor; ///< split cursor
23 Bool_t fDragging; ///< true if in dragging mode
24 Bool_t fExternalHandler; ///< true when splitter movement is handled externally
25 const TGPicture *fSplitterPic; ///< picture to draw splitter
26
27private:
28 TGSplitter(const TGSplitter&) = delete;
29 TGSplitter& operator=(const TGSplitter&) = delete;
30
31public:
32 TGSplitter(const TGWindow *p = nullptr, UInt_t w = 2, UInt_t h = 4,
33 UInt_t options = kChildFrame,
35 virtual ~TGSplitter() { }
36
37 virtual void SetFrame(TGFrame *frame, Bool_t prev) = 0;
38
42
43 void DragStarted(); // *SIGNAL*
44 void Moved(Int_t delta); // *SIGNAL*
45
48
49 ClassDef(TGSplitter,0) //A frame splitter abstract base class
50};
51
52
53class TGVSplitter : public TGSplitter {
54
55private:
56 TGVSplitter(const TGVSplitter&) = delete;
58
59protected:
60 Int_t fStartX; ///< x position when dragging starts
61 UInt_t fFrameWidth; ///< width of frame to be resized
62 UInt_t fFrameHeight; ///< height of frame to be resized
63 Int_t fMin; ///< min x position frame can be resized to
64 Int_t fMax; ///< max x position frame can be resized to
65 TGFrame *fFrame; ///< frame that should be resized
66 Bool_t fLeft; ///< true if frame is on the left of splitter
67
68public:
69 TGVSplitter(const TGWindow *p = nullptr, UInt_t w = 4, UInt_t h = 4,
70 UInt_t options = kChildFrame,
72 TGVSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
73 virtual ~TGVSplitter();
74
75 virtual void DrawBorder();
76 virtual void SetFrame(TGFrame *frame, Bool_t left);
77 const TGFrame *GetFrame() const { return fFrame; }
78 Bool_t GetLeft() const { return fLeft; }
79 Bool_t IsLeft() const { return fLeft; }
80 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
81
85
86 ClassDef(TGVSplitter,0) //A vertical frame splitter
87};
88
89
90class TGHSplitter : public TGSplitter {
91
92private:
93 TGHSplitter(const TGHSplitter&) = delete;
95
96protected:
97 Int_t fStartY; ///< y position when dragging starts
98 UInt_t fFrameWidth; ///< width of frame to be resized
99 UInt_t fFrameHeight; ///< height of frame to be resized
100 Int_t fMin; ///< min y position frame can be resized to
101 Int_t fMax; ///< max y position frame can be resized to
102 TGFrame *fFrame; ///< frame that should be resized
103 Bool_t fAbove; ///< true if frame is above the splitter
104
105public:
106 TGHSplitter(const TGWindow *p = nullptr, UInt_t w = 4, UInt_t h = 4,
107 UInt_t options = kChildFrame,
109 TGHSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
110 virtual ~TGHSplitter();
111
112 virtual void DrawBorder();
113 virtual void SetFrame(TGFrame *frame, Bool_t above);
114 const TGFrame *GetFrame() const { return fFrame; }
115 Bool_t GetAbove() const { return fAbove; }
116 Bool_t IsAbove() const { return fAbove; }
117 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
118
122
123 ClassDef(TGHSplitter,0) //A horizontal frame splitter
124};
125
127
128private:
131
132public:
133 TGVFileSplitter(const TGWindow *p = nullptr, UInt_t w = 4, UInt_t h = 4,
134 UInt_t options = kChildFrame,
136 virtual ~TGVFileSplitter();
137
141 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
142
143 void LayoutHeader(TGFrame *f); //*SIGNAL*
144 void LayoutListView(); //*SIGNAL*
145 void ButtonPressed(); //*SIGNAL*
146 void ButtonReleased(); //*SIGNAL*
147 void DoubleClicked(TGVFileSplitter* frame); //*SIGNAL*
148
149 ClassDef(TGVFileSplitter,0) //A vertical file frame splitter
150};
151
152
153#endif
Handle_t Cursor_t
Cursor handle.
Definition: GuiTypes.h:34
@ kChildFrame
Definition: GuiTypes.h:379
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
bool Bool_t
Definition: RtypesCore.h:63
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a splitter widget as a C++ statement(s) on output stream out.
Definition: TGSplitter.cxx:616
TGHSplitter(const TGHSplitter &)=delete
const TGFrame * GetFrame() const
Definition: TGSplitter.h:114
UInt_t fFrameHeight
height of frame to be resized
Definition: TGSplitter.h:99
TGHSplitter & operator=(const TGHSplitter &)=delete
virtual void SetFrame(TGFrame *frame, Bool_t above)
Set frame to be resized.
Definition: TGSplitter.cxx:342
virtual void DrawBorder()
Draw horizontal splitter.
Definition: TGSplitter.cxx:450
TGFrame * fFrame
frame that should be resized
Definition: TGSplitter.h:102
Bool_t GetAbove() const
Definition: TGSplitter.h:115
Bool_t fAbove
true if frame is above the splitter
Definition: TGSplitter.h:103
Int_t fStartY
y position when dragging starts
Definition: TGSplitter.h:97
Int_t fMin
min y position frame can be resized to
Definition: TGSplitter.h:100
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse motion event in horizontal splitter.
Definition: TGSplitter.cxx:437
virtual ~TGHSplitter()
Delete horizontal splitter widget.
Definition: TGSplitter.cxx:333
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal splitter.
Definition: TGSplitter.cxx:354
UInt_t fFrameWidth
width of frame to be resized
Definition: TGSplitter.h:98
Int_t fMax
max y position frame can be resized to
Definition: TGSplitter.h:101
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal splitter.
Definition: TGSplitter.cxx:401
Bool_t IsAbove() const
Definition: TGSplitter.h:116
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
A splitter allows the frames left and right or above and below of it to be resized.
Definition: TGSplitter.h:19
TGSplitter(const TGSplitter &)=delete
Cursor_t fSplitCursor
split cursor
Definition: TGSplitter.h:22
void DragStarted()
Emit DragStarted signal.
Definition: TGSplitter.cxx:53
virtual Bool_t HandleCrossing(Event_t *event)=0
void Moved(Int_t delta)
Emit Moved signal.
Definition: TGSplitter.cxx:61
void SetExternalHandler(Bool_t x)
Definition: TGSplitter.h:47
const TGPicture * fSplitterPic
picture to draw splitter
Definition: TGSplitter.h:25
virtual void SetFrame(TGFrame *frame, Bool_t prev)=0
virtual Bool_t HandleMotion(Event_t *event)=0
Bool_t fDragging
true if in dragging mode
Definition: TGSplitter.h:23
TGSplitter & operator=(const TGSplitter &)=delete
Bool_t GetExternalHandler() const
Definition: TGSplitter.h:46
virtual ~TGSplitter()
Definition: TGSplitter.h:35
virtual Bool_t HandleButton(Event_t *event)=0
Bool_t fExternalHandler
true when splitter movement is handled externally
Definition: TGSplitter.h:24
void ButtonPressed()
Emit ButtonPressed() signal.
Definition: TGSplitter.cxx:550
virtual ~TGVFileSplitter()
if (fSplitterPic) fClient->FreePicture(fSplitterPic);
Definition: TGSplitter.cxx:473
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical splitter.
Definition: TGSplitter.cxx:517
void DoubleClicked(TGVFileSplitter *frame)
Emit DoubleClicked() signal.
Definition: TGSplitter.cxx:566
void LayoutListView()
Emit LayoutListView() signal.
Definition: TGSplitter.cxx:542
TGVFileSplitter(const TGVFileSplitter &)=delete
void ButtonReleased()
Emit ButtonReleased() signal.
Definition: TGSplitter.cxx:558
virtual Bool_t HandleDoubleClick(Event_t *)
Handle double click mouse event in splitter.
Definition: TGSplitter.cxx:574
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical splitter.
Definition: TGSplitter.cxx:480
TGVFileSplitter & operator=(const TGVFileSplitter &)=delete
void LayoutHeader(TGFrame *f)
Emit LayoutFeader() signal.
Definition: TGSplitter.cxx:534
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a splitter widget as a C++ statement(s) on output stream out.
Definition: TGSplitter.cxx:649
Int_t fMin
min x position frame can be resized to
Definition: TGSplitter.h:63
UInt_t fFrameHeight
height of frame to be resized
Definition: TGSplitter.h:62
TGVSplitter(const TGVSplitter &)=delete
virtual ~TGVSplitter()
Delete vertical splitter widget.
Definition: TGSplitter.cxx:134
const TGFrame * GetFrame() const
Definition: TGSplitter.h:77
Bool_t IsLeft() const
Definition: TGSplitter.h:79
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
Definition: TGSplitter.cxx:143
TGVSplitter & operator=(const TGVSplitter &)=delete
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical splitter.
Definition: TGSplitter.cxx:155
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse motion event in vertical splitter.
Definition: TGSplitter.cxx:238
Bool_t GetLeft() const
Definition: TGSplitter.h:78
TGFrame * fFrame
frame that should be resized
Definition: TGSplitter.h:65
Int_t fMax
max x position frame can be resized to
Definition: TGSplitter.h:64
UInt_t fFrameWidth
width of frame to be resized
Definition: TGSplitter.h:61
Int_t fStartX
x position when dragging starts
Definition: TGSplitter.h:60
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a splitter widget as a C++ statement(s) on output stream out.
Definition: TGSplitter.cxx:583
Bool_t fLeft
true if frame is on the left of splitter
Definition: TGSplitter.h:66
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical splitter.
Definition: TGSplitter.cxx:202
virtual void DrawBorder()
Draw vertical splitter.
Definition: TGSplitter.cxx:251
ROOT GUI Window base class.
Definition: TGWindow.h:23
Double_t x[n]
Definition: legend1.C:17
Event structure.
Definition: GuiTypes.h:174