diff --git a/headers/os/interface/LayoutBuilder.h b/headers/os/interface/LayoutBuilder.h index 83e8824b16..7e9bda0c14 100644 --- a/headers/os/interface/LayoutBuilder.h +++ b/headers/os/interface/LayoutBuilder.h @@ -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::SetInsets(float insets) } +template +typename Group::ThisBuilder& +Group::SetExplicitMinSize(BSize size) +{ + fLayout->SetExplicitMinSize(size); + return *this; +} + + +template +typename Group::ThisBuilder& +Group::SetExplicitMaxSize(BSize size) +{ + fLayout->SetExplicitMaxSize(size); + return *this; +} + + +template +typename Group::ThisBuilder& +Group::SetExplicitPreferredSize(BSize size) +{ + fLayout->SetExplicitPreferredSize(size); + return *this; +} + + template Group::operator BGroupLayout*() { @@ -833,6 +871,17 @@ Grid::AddSplit(BSplitView* splitView, int32 column, int32 row, } +template +typename Grid::ThisBuilder& +Grid::AddGlue(int32 column, int32 row, int32 columnCount, + int32 rowCount) +{ + fLayout->AddItem(BSpaceLayoutItem::CreateGlue(), column, row, columnCount, + rowCount); + return *this; +} + + template typename Grid::ThisBuilder& Grid::SetColumnWeight(int32 column, float weight) @@ -879,6 +928,33 @@ Grid::SetInsets(float insets) } +template +typename Grid::ThisBuilder& +Grid::SetExplicitMinSize(BSize size) +{ + fLayout->SetExplicitMinSize(size); + return *this; +} + + +template +typename Grid::ThisBuilder& +Grid::SetExplicitMaxSize(BSize size) +{ + fLayout->SetExplicitMaxSize(size); + return *this; +} + + +template +typename Grid::ThisBuilder& +Grid::SetExplicitPreferredSize(BSize size) +{ + fLayout->SetExplicitPreferredSize(size); + return *this; +} + + template Grid::operator BGridLayout*() {