12 #ifndef ROOT_TGSplitFrame
13 #define ROOT_TGSplitFrame
22 class TGRectMap :
public TObject {
25 TGRectMap(
const TGRectMap&);
26 TGRectMap& operator=(
const TGRectMap&);
35 TGRectMap(Int_t rx, Int_t ry, UInt_t rw, UInt_t rh):
36 fX(rx), fY(ry), fW(rw), fH(rh) { }
37 virtual ~TGRectMap() { }
40 Bool_t Contains(Int_t px, Int_t py)
const
41 {
return ((px >= fX) && (px < fX + (Int_t) fW) &&
42 (py >= fY) && (py < fY + (Int_t) fH)); }
44 ClassDef(TGRectMap, 0)
47 class TGSplitTool :
public TGCompositeFrame {
50 const TGFrame *fWindow;
53 TContextMenu *fContextMenu;
57 TGSplitTool(
const TGSplitTool&);
58 TGSplitTool& operator=(
const TGSplitTool&);
61 TGSplitTool(
const TGWindow *p = 0,
const TGFrame *f = 0);
62 virtual ~TGSplitTool();
64 void AddRectangle(TGFrame *frm, Int_t x, Int_t y, Int_t w, Int_t h);
67 Bool_t HandleButton(Event_t *event);
68 Bool_t HandleMotion(Event_t *event);
69 void Show(Int_t x, Int_t y);
72 void SetPosition(Int_t x, Int_t y);
74 ClassDef(TGSplitTool, 0)
77 class TGSplitFrame :
public TGCompositeFrame {
80 TGSplitFrame(
const TGSplitFrame&);
81 TGSplitFrame& operator=(
const TGSplitFrame&);
85 TGTransientFrame *fUndocked;
86 TGSplitter *fSplitter;
88 TGSplitFrame *fSecond;
89 TGSplitTool *fSplitTool;
94 TGSplitFrame(
const TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1,
96 virtual ~TGSplitFrame();
98 virtual void AddFrame(TGFrame *f, TGLayoutHints *l = 0);
99 virtual void Cleanup();
100 virtual Bool_t HandleConfigureNotify(Event_t *);
101 virtual void HSplit(UInt_t h = 0);
102 virtual void VSplit(UInt_t w = 0);
103 virtual void RemoveFrame(TGFrame *f);
105 TGSplitFrame *GetFirst()
const {
return fFirst; }
106 TGFrame *GetFrame()
const {
return fFrame; }
107 TGSplitFrame *GetSecond()
const {
return fSecond; }
108 TGSplitter *GetSplitter()
const {
return fSplitter; }
109 TGSplitTool *GetSplitTool()
const {
return fSplitTool; }
110 TGSplitFrame *GetTopFrame();
111 TGFrame *GetUndocked()
const {
return fUndocked; }
112 Float_t GetHRatio()
const {
return fHRatio; }
113 Float_t GetWRatio()
const {
return fWRatio; }
114 void MapToSPlitTool(TGSplitFrame *top);
115 void OnSplitterClicked(Event_t *event);
116 void SetHRatio(Float_t r) { fHRatio = r; }
117 void SetWRatio(Float_t r) { fWRatio = r; }
118 void SplitHorizontal(
const char *side =
"top");
119 void SplitVertical(
const char *side =
"left");
120 void UnSplit(
const char *which);
125 void CloseAndCollapse();
132 void Docked(TGFrame* frame);
133 void Undocked(TGFrame* frame);
135 static void SwitchFrames(TGFrame *frame, TGCompositeFrame *dest,
137 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
139 ClassDef(TGSplitFrame, 0)