Added Grid::AddGlue(), and SetExplicit*Size() methods.

This commit is contained in:
Axel Dörfler 2012-11-04 10:53:34 +01:00 committed by Alexander von Gluck IV
parent bcc420b556
commit f9c3ebc53e

View File

@ -1,5 +1,5 @@
/*
* Copyright 2009-2010, Haiku, Inc. All rights reserved.
* Copyright 2009-2012, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _LAYOUT_BUILDER_H
@ -108,6 +108,10 @@ public:
inline ThisBuilder& SetInsets(float horizontal, float vertical);
inline ThisBuilder& SetInsets(float insets);
inline ThisBuilder& SetExplicitMinSize(BSize size);
inline ThisBuilder& SetExplicitMaxSize(BSize size);
inline ThisBuilder& SetExplicitPreferredSize(BSize size);
inline operator BGroupLayout*();
private:
@ -188,6 +192,9 @@ public:
int32 row, int32 columnCount = 1,
int32 rowCount = 1);
inline ThisBuilder& AddGlue(int32 column, int32 row,
int32 columnCount = 1, int32 rowCount = 1);
inline ThisBuilder& SetColumnWeight(int32 column, float weight);
inline ThisBuilder& SetRowWeight(int32 row, float weight);
@ -196,6 +203,10 @@ public:
inline ThisBuilder& SetInsets(float horizontal, float vertical);
inline ThisBuilder& SetInsets(float insets);
inline ThisBuilder& SetExplicitMinSize(BSize size);
inline ThisBuilder& SetExplicitMaxSize(BSize size);
inline ThisBuilder& SetExplicitPreferredSize(BSize size);
inline operator BGridLayout*();
private:
@ -604,6 +615,33 @@ Group<ParentBuilder>::SetInsets(float insets)
}
template<typename ParentBuilder>
typename Group<ParentBuilder>::ThisBuilder&
Group<ParentBuilder>::SetExplicitMinSize(BSize size)
{
fLayout->SetExplicitMinSize(size);
return *this;
}
template<typename ParentBuilder>
typename Group<ParentBuilder>::ThisBuilder&
Group<ParentBuilder>::SetExplicitMaxSize(BSize size)
{
fLayout->SetExplicitMaxSize(size);
return *this;
}
template<typename ParentBuilder>
typename Group<ParentBuilder>::ThisBuilder&
Group<ParentBuilder>::SetExplicitPreferredSize(BSize size)
{
fLayout->SetExplicitPreferredSize(size);
return *this;
}
template<typename ParentBuilder>
Group<ParentBuilder>::operator BGroupLayout*()
{
@ -833,6 +871,17 @@ Grid<ParentBuilder>::AddSplit(BSplitView* splitView, int32 column, int32 row,
}
template<typename ParentBuilder>
typename Grid<ParentBuilder>::ThisBuilder&
Grid<ParentBuilder>::AddGlue(int32 column, int32 row, int32 columnCount,
int32 rowCount)
{
fLayout->AddItem(BSpaceLayoutItem::CreateGlue(), column, row, columnCount,
rowCount);
return *this;
}
template<typename ParentBuilder>
typename Grid<ParentBuilder>::ThisBuilder&
Grid<ParentBuilder>::SetColumnWeight(int32 column, float weight)
@ -879,6 +928,33 @@ Grid<ParentBuilder>::SetInsets(float insets)
}
template<typename ParentBuilder>
typename Grid<ParentBuilder>::ThisBuilder&
Grid<ParentBuilder>::SetExplicitMinSize(BSize size)
{
fLayout->SetExplicitMinSize(size);
return *this;
}
template<typename ParentBuilder>
typename Grid<ParentBuilder>::ThisBuilder&
Grid<ParentBuilder>::SetExplicitMaxSize(BSize size)
{
fLayout->SetExplicitMaxSize(size);
return *this;
}
template<typename ParentBuilder>
typename Grid<ParentBuilder>::ThisBuilder&
Grid<ParentBuilder>::SetExplicitPreferredSize(BSize size)
{
fLayout->SetExplicitPreferredSize(size);
return *this;
}
template<typename ParentBuilder>
Grid<ParentBuilder>::operator BGridLayout*()
{