Added convenience methods to allow a group or grid layout's insets to be set

while it is being built.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20026 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ryan Leavengood 2007-01-31 20:30:20 +00:00
parent d09c0ef980
commit e3e76a3af9
4 changed files with 24 additions and 0 deletions

View File

@ -28,6 +28,9 @@ public:
BGridLayoutBuilder& SetColumnWeight(int32 column, float weight);
BGridLayoutBuilder& SetRowWeight(int32 row, float weight);
BGridLayoutBuilder& SetInsets(float left, float top, float right,
float bottom);
operator BGridLayout*();
operator BView*();

View File

@ -34,6 +34,9 @@ public:
BGroupLayoutBuilder& AddGlue(float weight = 1.0f);
BGroupLayoutBuilder& AddStrut(float size);
BGroupLayoutBuilder& SetInsets(float left, float top, float right,
float bottom);
operator BGroupLayout*();
operator BView*();

View File

@ -98,6 +98,14 @@ BGridLayoutBuilder::SetRowWeight(int32 row, float weight)
return *this;
}
// SetInsets
BGridLayoutBuilder&
BGridLayoutBuilder::SetInsets(float left, float top, float right, float bottom)
{
fLayout->SetInsets(left, top, right, bottom);
return *this;
}
// cast operator BGridLayout*
BGridLayoutBuilder::operator BGridLayout*()
{

View File

@ -158,6 +158,16 @@ BGroupLayoutBuilder::AddStrut(float size)
return *this;
}
// SetInsets
BGroupLayoutBuilder&
BGroupLayoutBuilder::SetInsets(float left, float top, float right, float bottom)
{
if (BGroupLayout* layout = TopLayout())
layout->SetInsets(left, top, right, bottom);
return *this;
}
// cast operator BGroupLayout*
BGroupLayoutBuilder::operator BGroupLayout*()
{