Logo ROOT  
Reference Guide
TGXYLayout.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Reiner Rohlfs 24/03/2002
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, Rene Brun, Fons Rademakers and Reiner Rohlfs *
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 
13 #ifndef ROOT_TGXYLayout
14 #define ROOT_TGXYLayout
15 
16 #include "TGLayout.h"
17 
18 
20 
21 protected:
22  Double_t fX; ///< x - position of widget
23  Double_t fY; ///< y - position of widget
24  Double_t fW; ///< width of widget
25  Double_t fH; ///< height of widget
26  UInt_t fFlag; ///< rubber flag
27 
28 public:
29 
30  enum ERubberFlag {
31  kLRubberX = BIT(0),
32  kLRubberY = BIT(1),
33  kLRubberW = BIT(2),
34  kLRubberH = BIT(3)
35  };
36 
38  UInt_t rubberFlag = kLRubberX | kLRubberY);
39 
40  Double_t GetX() const { return fX; };
41  Double_t GetY() const { return fY; };
42  Double_t GetW() const { return fW; };
43  Double_t GetH() const { return fH; };
44  UInt_t GetFlag() const { return fFlag; };
45 
46  void SetX(Double_t x) { fX = x; }
47  void SetY(Double_t y) { fY = y; }
48  void SetW(Double_t w) { fW = w; }
49  void SetH(Double_t h) { fH = h; }
50  void SetFlag(UInt_t flag) { fFlag = flag; }
51 
52  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
53 
54  ClassDef(TGXYLayoutHints,0) // Hits for the X / Y - layout manager
55 };
56 
57 
58 class TGXYLayout : public TGLayoutManager {
59 
60 protected:
61  TList *fList; ///< list of frames to arrange
62  TGCompositeFrame *fMain; ///< container frame
63 
64  Bool_t fFirst; ///< flag to determine the first call of Layout()
65  UInt_t fFirstWidth; ///< original width of the frame fMain
66  UInt_t fFirstHeight; ///< original height of the fram fMain
67 
68  Int_t fTWidth; ///< text width of a default character "1234567890" / 10
69  Int_t fTHeight; ///< text height
70 
71  TGXYLayout(const TGXYLayout&);
73 
74 public:
76 
77  virtual void Layout();
78  virtual TGDimension GetDefaultSize() const;
79  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
80 
81  void NewSize() { fFirst = kTRUE; }
82 
83  ClassDef(TGXYLayout,0) // X / Y - layout manager
84 };
85 
86 #endif
TGXYLayout::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save XY layout manager as a C++ statement(s) on output stream.
Definition: TGXYLayout.cxx:306
TGXYLayout::fTHeight
Int_t fTHeight
text height
Definition: TGXYLayout.h:69
TGXYLayoutHints::GetH
Double_t GetH() const
Definition: TGXYLayout.h:43
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGXYLayoutHints::fX
Double_t fX
x - position of widget
Definition: TGXYLayout.h:22
TGXYLayout::fFirstWidth
UInt_t fFirstWidth
original width of the frame fMain
Definition: TGXYLayout.h:65
TGXYLayout::Layout
virtual void Layout()
Recalculates the postion and the size of all widgets.
Definition: TGXYLayout.cxx:233
TGXYLayoutHints::kLRubberH
@ kLRubberH
Definition: TGXYLayout.h:34
TGDimension
Definition: TGDimension.h:18
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGXYLayoutHints::SetH
void SetH(Double_t h)
Definition: TGXYLayout.h:49
TGXYLayoutHints::kLRubberW
@ kLRubberW
Definition: TGXYLayout.h:33
TGXYLayout::operator=
TGXYLayout & operator=(const TGXYLayout &)
assignment operator
Definition: TGXYLayout.cxx:215
TGLayout.h
TGXYLayoutHints::fFlag
UInt_t fFlag
rubber flag
Definition: TGXYLayout.h:26
TGXYLayoutHints
This layout hint must be used for the TGXYLayout manager!
Definition: TGXYLayout.h:19
TGXYLayoutHints::SetY
void SetY(Double_t y)
Definition: TGXYLayout.h:47
x
Double_t x[n]
Definition: legend1.C:17
TGXYLayoutHints::kLRubberX
@ kLRubberX
Definition: TGXYLayout.h:31
TGXYLayoutHints::GetW
Double_t GetW() const
Definition: TGXYLayout.h:42
TGXYLayout
Is a layout manager where the position and the size of each widget in the frame are defined by X / Y ...
Definition: TGXYLayout.h:58
bool
TGLayoutManager
Frame layout manager.
Definition: TGLayout.h:135
TGXYLayoutHints::SetX
void SetX(Double_t x)
Definition: TGXYLayout.h:46
TGXYLayoutHints::fW
Double_t fW
width of widget
Definition: TGXYLayout.h:24
TGXYLayout::GetDefaultSize
virtual TGDimension GetDefaultSize() const
Returns the original size of the frame.
Definition: TGXYLayout.cxx:296
TGXYLayout::fFirstHeight
UInt_t fFirstHeight
original height of the fram fMain
Definition: TGXYLayout.h:66
TGXYLayoutHints::TGXYLayoutHints
TGXYLayoutHints(Double_t x, Double_t y, Double_t w, Double_t h, UInt_t rubberFlag=kLRubberX|kLRubberY)
Constructor.
Definition: TGXYLayout.cxx:125
h
#define h(i)
Definition: RSha256.hxx:106
TGXYLayout::fTWidth
Int_t fTWidth
text width of a default character "1234567890" / 10
Definition: TGXYLayout.h:68
TGXYLayout::fFirst
Bool_t fFirst
flag to determine the first call of Layout()
Definition: TGXYLayout.h:64
TGXYLayoutHints::GetY
Double_t GetY() const
Definition: TGXYLayout.h:41
TGXYLayoutHints::SetW
void SetW(Double_t w)
Definition: TGXYLayout.h:48
TGXYLayoutHints::ERubberFlag
ERubberFlag
Definition: TGXYLayout.h:30
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGXYLayout::fList
TList * fList
list of frames to arrange
Definition: TGXYLayout.h:61
BIT
#define BIT(n)
Definition: Rtypes.h:85
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TGXYLayoutHints::GetFlag
UInt_t GetFlag() const
Definition: TGXYLayout.h:44
y
Double_t y[n]
Definition: legend1.C:17
TGXYLayoutHints::fH
Double_t fH
height of widget
Definition: TGXYLayout.h:25
unsigned int
TGXYLayoutHints::kLRubberY
@ kLRubberY
Definition: TGXYLayout.h:32
TGXYLayout::fMain
TGCompositeFrame * fMain
container frame
Definition: TGXYLayout.h:62
Double_t
double Double_t
Definition: RtypesCore.h:59
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGXYLayoutHints::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save XY layout hints as a C++ statement(s) on output stream.
Definition: TGXYLayout.cxx:139
TGXYLayout::TGXYLayout
TGXYLayout(const TGXYLayout &)
copy constructor
Definition: TGXYLayout.cxx:200
TGXYLayoutHints::SetFlag
void SetFlag(UInt_t flag)
Definition: TGXYLayout.h:50
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGXYLayoutHints::fY
Double_t fY
y - position of widget
Definition: TGXYLayout.h:23
TList
A doubly linked list.
Definition: TList.h:44
TGXYLayoutHints::GetX
Double_t GetX() const
Definition: TGXYLayout.h:40
main
int main(int argc, char *argv[])
Definition: cef_main.cxx:54
int
TGXYLayout::NewSize
void NewSize()
Definition: TGXYLayout.h:81