| library: libGui #include "TGXYLayout.h" |

| TGXYLayout(TGCompositeFrame* main) | |
| ~TGXYLayout() | |
| void | TObject::AbstractMethod(const char* method) const |
| virtual void | TObject::AppendPad(Option_t* option = "") |
| virtual void | TObject::Browse(TBrowser* b) |
| static TClass* | Class() |
| virtual const char* | TObject::ClassName() const |
| virtual void | TObject::Clear(Option_t* = "") |
| virtual TObject* | TObject::Clone(const char* newname = "") const |
| virtual Int_t | TObject::Compare(const TObject* obj) const |
| virtual void | TObject::Copy(TObject& object) const |
| virtual void | TObject::Delete(Option_t* option = "") |
| virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
| virtual void | TObject::Draw(Option_t* option = "") |
| virtual void | TObject::DrawClass() const |
| virtual TObject* | TObject::DrawClone(Option_t* option = "") const |
| virtual void | TObject::Dump() const |
| virtual void | TObject::Error(const char* method, const char* msgfmt) const |
| virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
| virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
| virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
| virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
| virtual TObject* | TObject::FindObject(const char* name) const |
| virtual TObject* | TObject::FindObject(const TObject* obj) const |
| virtual TGDimension | GetDefaultSize() const |
| virtual Option_t* | TObject::GetDrawOption() const |
| static Long_t | TObject::GetDtorOnly() |
| virtual const char* | TObject::GetIconName() const |
| virtual const char* | TObject::GetName() const |
| virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
| static Bool_t | TObject::GetObjectStat() |
| virtual Option_t* | TObject::GetOption() const |
| virtual const char* | TObject::GetTitle() const |
| virtual UInt_t | TObject::GetUniqueID() const |
| virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
| virtual ULong_t | TObject::Hash() const |
| virtual void | TObject::Info(const char* method, const char* msgfmt) const |
| virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
| virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
| virtual void | TObject::Inspect() const |
| void | TObject::InvertBit(UInt_t f) |
| virtual TClass* | IsA() const |
| virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
| virtual Bool_t | TObject::IsFolder() const |
| Bool_t | TObject::IsOnHeap() const |
| virtual Bool_t | TObject::IsSortable() const |
| Bool_t | TObject::IsZombie() const |
| virtual void | Layout() |
| virtual void | TObject::ls(Option_t* option = "") const |
| void | TObject::MayNotUse(const char* method) const |
| void | NewSize() |
| virtual Bool_t | TObject::Notify() |
| static void | TObject::operator delete(void* ptr) |
| static void | TObject::operator delete(void* ptr, void* vp) |
| static void | TObject::operator delete[](void* ptr) |
| static void | TObject::operator delete[](void* ptr, void* vp) |
| void* | TObject::operator new(size_t sz) |
| void* | TObject::operator new(size_t sz, void* vp) |
| void* | TObject::operator new[](size_t sz) |
| void* | TObject::operator new[](size_t sz, void* vp) |
| virtual void | TObject::Paint(Option_t* option = "") |
| virtual void | TObject::Pop() |
| virtual void | TObject::Print(Option_t* option = "") const |
| virtual Int_t | TObject::Read(const char* name) |
| virtual void | TObject::RecursiveRemove(TObject* obj) |
| void | TObject::ResetBit(UInt_t f) |
| virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") const |
| virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
| void | TObject::SetBit(UInt_t f) |
| void | TObject::SetBit(UInt_t f, Bool_t set) |
| virtual void | TGLayoutManager::SetDefaultHeight(UInt_t) |
| virtual void | TGLayoutManager::SetDefaultWidth(UInt_t) |
| virtual void | TObject::SetDrawOption(Option_t* option = "") |
| static void | TObject::SetDtorOnly(void* obj) |
| static void | TObject::SetObjectStat(Bool_t stat) |
| virtual void | TObject::SetUniqueID(UInt_t uid) |
| virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
| virtual void | Streamer(TBuffer& b) |
| void | StreamerNVirtual(TBuffer& b) |
| virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
| Bool_t | TObject::TestBit(UInt_t f) const |
| Int_t | TObject::TestBits(UInt_t f) const |
| virtual void | TObject::UseCurrentStyle() |
| virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
| virtual Int_t | TObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) |
| virtual Int_t | TObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const |
| TGXYLayout(const TGXYLayout&) | |
| virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
| void | TObject::MakeZombie() |
| TGXYLayout& | operator=(const TGXYLayout&) |
| enum TObject::EStatusBits { | kCanDelete | |
| kMustCleanup | ||
| kObjInCanvas | ||
| kIsReferenced | ||
| kHasUUID | ||
| kCannotPick | ||
| kNoContextMenu | ||
| kInvalidObject | ||
| }; | ||
| enum TObject::[unnamed] { | kIsOnHeap | |
| kNotDeleted | ||
| kZombie | ||
| kBitMask | ||
| kSingleKey | ||
| kOverwrite | ||
| kWriteDelete | ||
| }; |
| TList* | fList | list of frames to arrange |
| TGCompositeFrame* | fMain | container frame |
| Bool_t | fFirst | flag to determine the first call of Layout() |
| UInt_t | fFirstWidth | original width of the frame fMain |
| UInt_t | fFirstHeight | original height of the fram fMain |
| Int_t | fTWidth | text width of a default character "1234567890" / 10 |
| Int_t | fTHeight | text height |
TGXYLayout
Is a layout manager where the position and the size of each widget
in the frame are defined by X / Y - coordinates. The coordinates
for each widget are defined by the TGXYLayoutHints. Therefore it
is not possible to share a layout hint for several widgets.
The coordinates (X, Y) and the size (W, H) are defined in units
of the size of a typical character. Also the size of the
TGCompositeFrame for which a TGXYLayout manager is used has to be
defined in its constructor in units of the size of a character!
It is not possible to use any other layout hint than the
TGXYLayoutHints for this layout manager!
The rubberFlag in the constructor of the TGLXYLayoutHins defines
how the position and the size of a widget is recalculated if the
size of the frame is increased:
- kLRubberX: The X - position (left edge) is increased by the same
factor as the width of the frame increases.
- kLRubberY: The Y - position (upper edge) is increased by the same
factor as the height of the frame increases.
- kLRubberW: The width of the widget is increased by the same
factor as the width of the frame increases.
- kLRubberY: The height of the widget is increased by the same
factor as the height of the frame increases.
But the size never becomes smaller than defined by the
TGXYLayoutHints and the X and Y coordinates becomes never smaller
than defined by the layout hints.
TGXYLayoutHints
This layout hint must be used for the TGXYLouyout manager!
Example how to use this layout manager:
TGMyFrame::TGMyFrame()
: TGMainFrame(gClient->GetRoot(), 30, 12)
// frame is 30 character long and 12 character heigh
{
SetLayoutManager(new TGXYLayout(this));
// create a button of size 8 X 1.8 at position 20 / 1
TGTextButton * button;
button = new TGTextButton(this, "&Apply", 1);
AddFrame(button, new TGXYLayoutHints(20, 1, 8, 1.8));
// create a listbox of size 18 X 10 at position 1 / 1.
// The height will increase if the frame height increases
TGListBox * listBox;
listBox = new TGListBox(this, 2);
AddFrame(listBox, new TGXYLayoutHints(1, 1, 18, 10,
TGXYLayoutHints::kLRubberX |
TGXYLayoutHints::kLRubberY |
TGXYLayoutHints::kLRubberH ));
.
.
.
}
Normaly there is one layout hint per widget. Therefore these
can be deleted like in the following example in the desctuctor
of the frame:
TGMyFrame::~TGMyFrame()
{
// Destructor, deletes all frames and their layout hints.
TGFrameElement *ptr;
// delete all frames and layout hints
if (fList) {
TIter next(fList);
while ((ptr = (TGFrameElement *) next())) {
if (ptr->fLayout)
delete ptr->fLayout;
if (ptr->fFrame)
delete ptr->fFrame;
}
}
}
Constructor. The main is the frame for which this layout manager works.