Logo ROOT   6.18/05
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-2000, 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//////////////////////////////////////////////////////////////////////////
17// //
18// TGSplitter, TGVSplitter and TGHSplitter //
19// //
20// A splitter allows the frames left and right or above and below of //
21// it to be resized. The frame to be resized must have the kFixedWidth //
22// or kFixedHeight property set. //
23// //
24//////////////////////////////////////////////////////////////////////////
25
26#include "TGFrame.h"
27
28
29class TGSplitter : public TGFrame {
30
31protected:
32 Cursor_t fSplitCursor; // split cursor
33 Bool_t fDragging; // true if in dragging mode
34 Bool_t fExternalHandler; // true when splitter movement is handled externally
35 const TGPicture *fSplitterPic; // picture to draw splitter
36
37private:
38 TGSplitter(const TGSplitter&); // not implemented
39 TGSplitter& operator=(const TGSplitter&); // not implemented
40
41public:
42 TGSplitter(const TGWindow *p = 0, UInt_t w = 2, UInt_t h = 4,
43 UInt_t options = kChildFrame,
45 virtual ~TGSplitter() { }
46
47 virtual void SetFrame(TGFrame *frame, Bool_t prev) = 0;
48
49 virtual Bool_t HandleButton(Event_t *event) = 0;
50 virtual Bool_t HandleMotion(Event_t *event) = 0;
51 virtual Bool_t HandleCrossing(Event_t *event) = 0;
52
53 void DragStarted(); // *SIGNAL*
54 void Moved(Int_t delta); // *SIGNAL*
55
58
59 ClassDef(TGSplitter,0) //A frame splitter abstract base class
60};
61
62
63class TGVSplitter : public TGSplitter {
64
65private:
66 TGVSplitter(const TGVSplitter&); // not implemented
67 TGVSplitter& operator=(const TGVSplitter&); // not implemented
68
69protected:
70 Int_t fStartX; // x position when dragging starts
71 UInt_t fFrameWidth; // width of frame to be resized
72 UInt_t fFrameHeight; // height of frame to be resized
73 Int_t fMin; // min x position frame can be resized to
74 Int_t fMax; // max x position frame can be resized to
75 TGFrame *fFrame; // frame that should be resized
76 Bool_t fLeft; // true if frame is on the left of splitter
77
78public:
79 TGVSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
80 UInt_t options = kChildFrame,
82 TGVSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
83 virtual ~TGVSplitter();
84
85 virtual void DrawBorder();
86 virtual void SetFrame(TGFrame *frame, Bool_t left);
87 const TGFrame *GetFrame() const { return fFrame; }
88 Bool_t GetLeft() const { return fLeft; }
89 Bool_t IsLeft() const { return fLeft; }
90 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
91
92 virtual Bool_t HandleButton(Event_t *event);
93 virtual Bool_t HandleMotion(Event_t *event);
94 virtual Bool_t HandleCrossing(Event_t *event);
95
96 ClassDef(TGVSplitter,0) //A vertical frame splitter
97};
98
99
100class TGHSplitter : public TGSplitter {
101
102private:
103 TGHSplitter(const TGHSplitter&); // not implemented
104 TGHSplitter& operator=(const TGHSplitter&); // not implemented
105
106protected:
107 Int_t fStartY; // y position when dragging starts
108 UInt_t fFrameWidth; // width of frame to be resized
109 UInt_t fFrameHeight; // height of frame to be resized
110 Int_t fMin; // min y position frame can be resized to
111 Int_t fMax; // max y position frame can be resized to
112 TGFrame *fFrame; // frame that should be resized
113 Bool_t fAbove; // true if frame is above the splitter
114
115public:
116 TGHSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
117 UInt_t options = kChildFrame,
119 TGHSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
120 virtual ~TGHSplitter();
121
122 virtual void DrawBorder();
123 virtual void SetFrame(TGFrame *frame, Bool_t above);
124 const TGFrame *GetFrame() const { return fFrame; }
125 Bool_t GetAbove() const { return fAbove; }
126 Bool_t IsAbove() const { return fAbove; }
127 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
128
129 virtual Bool_t HandleButton(Event_t *event);
130 virtual Bool_t HandleMotion(Event_t *event);
131 virtual Bool_t HandleCrossing(Event_t *event);
132
133 ClassDef(TGHSplitter,0) //A horizontal frame splitter
134};
135
137
138public:
139 TGVFileSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
140 UInt_t options = kChildFrame,
142 virtual ~TGVFileSplitter();
143
145 virtual Bool_t HandleButton(Event_t *event);
146 virtual Bool_t HandleMotion(Event_t *event);
147 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
148
149 void LayoutHeader(TGFrame *f); //*SIGNAL*
150 void LayoutListView(); //*SIGNAL*
151 void ButtonPressed(); //*SIGNAL*
152 void ButtonReleased(); //*SIGNAL*
153 void DoubleClicked(TGVFileSplitter* frame); //*SIGNAL*
154
155 ClassDef(TGVFileSplitter,0) //A vertical file frame splitter
156};
157
158
159#endif
Handle_t Cursor_t
Definition: GuiTypes.h:33
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
@ kChildFrame
Definition: TGFrame.h:57
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
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:613
const TGFrame * GetFrame() const
Definition: TGSplitter.h:124
UInt_t fFrameHeight
Definition: TGSplitter.h:109
virtual void SetFrame(TGFrame *frame, Bool_t above)
Set frame to be resized.
Definition: TGSplitter.cxx:339
virtual void DrawBorder()
Draw horizontal splitter.
Definition: TGSplitter.cxx:447
TGHSplitter(const TGHSplitter &)
TGFrame * fFrame
Definition: TGSplitter.h:112
Bool_t GetAbove() const
Definition: TGSplitter.h:125
Bool_t fAbove
Definition: TGSplitter.h:113
Int_t fStartY
Definition: TGSplitter.h:107
Int_t fMin
Definition: TGSplitter.h:110
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse motion event in horizontal splitter.
Definition: TGSplitter.cxx:434
virtual ~TGHSplitter()
Delete horizontal splitter widget.
Definition: TGSplitter.cxx:330
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal splitter.
Definition: TGSplitter.cxx:351
UInt_t fFrameWidth
Definition: TGSplitter.h:108
TGHSplitter & operator=(const TGHSplitter &)
Int_t fMax
Definition: TGSplitter.h:111
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal splitter.
Definition: TGSplitter.cxx:398
Bool_t IsAbove() const
Definition: TGSplitter.h:126
TGSplitter(const TGSplitter &)
Cursor_t fSplitCursor
Definition: TGSplitter.h:32
void DragStarted()
Emit DragStarted signal.
Definition: TGSplitter.cxx:50
virtual Bool_t HandleCrossing(Event_t *event)=0
void Moved(Int_t delta)
Emit Moved signal.
Definition: TGSplitter.cxx:58
void SetExternalHandler(Bool_t x)
Definition: TGSplitter.h:57
const TGPicture * fSplitterPic
Definition: TGSplitter.h:35
virtual void SetFrame(TGFrame *frame, Bool_t prev)=0
virtual Bool_t HandleMotion(Event_t *event)=0
Bool_t fDragging
Definition: TGSplitter.h:33
Bool_t GetExternalHandler() const
Definition: TGSplitter.h:56
virtual ~TGSplitter()
Definition: TGSplitter.h:45
virtual Bool_t HandleButton(Event_t *event)=0
Bool_t fExternalHandler
Definition: TGSplitter.h:34
TGSplitter & operator=(const TGSplitter &)
void ButtonPressed()
Emit ButtonPressed() signal.
Definition: TGSplitter.cxx:547
virtual ~TGVFileSplitter()
if (fSplitterPic) fClient->FreePicture(fSplitterPic);
Definition: TGSplitter.cxx:470
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical splitter.
Definition: TGSplitter.cxx:514
void DoubleClicked(TGVFileSplitter *frame)
Emit DoubleClicked() signal.
Definition: TGSplitter.cxx:563
void LayoutListView()
Emit LayoutListView() signal.
Definition: TGSplitter.cxx:539
void ButtonReleased()
Emit ButtonReleased() signal.
Definition: TGSplitter.cxx:555
virtual Bool_t HandleDoubleClick(Event_t *)
Handle double click mouse event in splitter.
Definition: TGSplitter.cxx:571
TGVFileSplitter(const TGWindow *p=0, UInt_t w=4, UInt_t h=4, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
fSplitterPic = fClient->GetPicture("filesplitterv.xpm");
Definition: TGSplitter.cxx:459
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical splitter.
Definition: TGSplitter.cxx:477
void LayoutHeader(TGFrame *f)
Emit LayoutFeader() signal.
Definition: TGSplitter.cxx:531
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:646
Int_t fMin
Definition: TGSplitter.h:73
TGVSplitter & operator=(const TGVSplitter &)
UInt_t fFrameHeight
Definition: TGSplitter.h:72
TGVSplitter(const TGVSplitter &)
virtual ~TGVSplitter()
Delete vertical splitter widget.
Definition: TGSplitter.cxx:131
const TGFrame * GetFrame() const
Definition: TGSplitter.h:87
Bool_t IsLeft() const
Definition: TGSplitter.h:89
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
Definition: TGSplitter.cxx:140
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical splitter.
Definition: TGSplitter.cxx:152
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse motion event in vertical splitter.
Definition: TGSplitter.cxx:235
Bool_t GetLeft() const
Definition: TGSplitter.h:88
TGFrame * fFrame
Definition: TGSplitter.h:75
Int_t fMax
Definition: TGSplitter.h:74
UInt_t fFrameWidth
Definition: TGSplitter.h:71
Int_t fStartX
Definition: TGSplitter.h:70
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:580
Bool_t fLeft
Definition: TGSplitter.h:76
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical splitter.
Definition: TGSplitter.cxx:199
virtual void DrawBorder()
Draw vertical splitter.
Definition: TGSplitter.cxx:248
Double_t x[n]
Definition: legend1.C:17