Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 ~TGSplitter() override { }
36
37 virtual void SetFrame(TGFrame *frame, Bool_t prev) = 0;
38
39 Bool_t HandleButton(Event_t *event) override = 0;
40 Bool_t HandleMotion(Event_t *event) override = 0;
41 Bool_t HandleCrossing(Event_t *event) override = 0;
42
43 void DragStarted(); // *SIGNAL*
44 void Moved(Int_t delta); // *SIGNAL*
45
48
49 ClassDefOverride(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 ~TGVSplitter() override;
74
75 void DrawBorder() override;
76 void SetFrame(TGFrame *frame, Bool_t left) override;
77 const TGFrame *GetFrame() const { return fFrame; }
78 Bool_t GetLeft() const { return fLeft; }
79 Bool_t IsLeft() const { return fLeft; }
80 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
81
82 Bool_t HandleButton(Event_t *event) override;
83 Bool_t HandleMotion(Event_t *event) override;
84 Bool_t HandleCrossing(Event_t *event) override;
85
86 ClassDefOverride(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 ~TGHSplitter() override;
111
112 void DrawBorder() override;
113 void SetFrame(TGFrame *frame, Bool_t above) override;
114 const TGFrame *GetFrame() const { return fFrame; }
115 Bool_t GetAbove() const { return fAbove; }
116 Bool_t IsAbove() const { return fAbove; }
117 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
118
119 Bool_t HandleButton(Event_t *event) override;
120 Bool_t HandleMotion(Event_t *event) override;
121 Bool_t HandleCrossing(Event_t *event) override;
122
123 ClassDefOverride(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 ~TGVFileSplitter() override;
137
138 Bool_t HandleDoubleClick(Event_t *) override;
139 Bool_t HandleButton(Event_t *event) override;
140 Bool_t HandleMotion(Event_t *event) override;
141 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
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 ClassDefOverride(TGVFileSplitter,0) //A vertical file frame splitter
150};
151
152
153#endif
@ kChildFrame
Definition GuiTypes.h:379
Handle_t Cursor_t
Cursor handle.
Definition GuiTypes.h:34
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
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
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in horizontal splitter.
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
void DrawBorder() override
Draw horizontal splitter.
Bool_t HandleCrossing(Event_t *event) override
Handle mouse motion event in horizontal splitter.
TGFrame * fFrame
frame that should be resized
Definition TGSplitter.h:102
Bool_t GetAbove() const
Definition TGSplitter.h:115
void SetFrame(TGFrame *frame, Bool_t above) override
Set frame to be resized.
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
~TGHSplitter() override
Delete horizontal splitter widget.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a splitter widget as a C++ statement(s) on output stream out.
Int_t fMin
min y position frame can be resized to
Definition TGSplitter.h:100
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in horizontal splitter.
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
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.
void Moved(Int_t delta)
Emit Moved signal.
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
Bool_t HandleMotion(Event_t *event) override=0
~TGSplitter() override
Definition TGSplitter.h:35
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
Bool_t HandleButton(Event_t *event) override=0
Bool_t HandleCrossing(Event_t *event) override=0
Bool_t fExternalHandler
true when splitter movement is handled externally
Definition TGSplitter.h:24
void ButtonPressed()
Emit ButtonPressed() signal.
void DoubleClicked(TGVFileSplitter *frame)
Emit DoubleClicked() signal.
void LayoutListView()
Emit LayoutListView() signal.
TGVFileSplitter(const TGVFileSplitter &)=delete
void ButtonReleased()
Emit ButtonReleased() signal.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in vertical splitter.
~TGVFileSplitter() override
if (fSplitterPic) fClient->FreePicture(fSplitterPic);
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in vertical splitter.
TGVFileSplitter & operator=(const TGVFileSplitter &)=delete
void LayoutHeader(TGFrame *f)
Emit LayoutFeader() signal.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a splitter widget as a C++ statement(s) on output stream out.
Bool_t HandleDoubleClick(Event_t *) override
Handle double click mouse event in splitter.
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
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a splitter widget as a C++ statement(s) on output stream out.
const TGFrame * GetFrame() const
Definition TGSplitter.h:77
Bool_t IsLeft() const
Definition TGSplitter.h:79
~TGVSplitter() override
Delete vertical splitter widget.
TGVSplitter & operator=(const TGVSplitter &)=delete
void DrawBorder() override
Draw vertical splitter.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in vertical splitter.
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
Bool_t fLeft
true if frame is on the left of splitter
Definition TGSplitter.h:66
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in vertical splitter.
Bool_t HandleCrossing(Event_t *event) override
Handle mouse motion event in vertical splitter.
void SetFrame(TGFrame *frame, Bool_t left) override
Set frame to be resized.
ROOT GUI Window base class.
Definition TGWindow.h:23
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174