2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
6 #include <GridLayoutBuilder.h>
10 #include <SpaceLayoutItem.h>
17 BGridLayoutBuilder::BGridLayoutBuilder(float horizontalSpacing
,
18 float verticalSpacing
)
19 : fLayout((new BGridView(horizontalSpacing
, verticalSpacing
))
25 BGridLayoutBuilder::BGridLayoutBuilder(BGridLayout
* layout
)
32 BGridLayoutBuilder::BGridLayoutBuilder(BGridView
* view
)
33 : fLayout(view
->GridLayout())
39 BGridLayoutBuilder::GridLayout() const
46 BGridLayoutBuilder::View() const
48 return fLayout
->Owner();
53 BGridLayoutBuilder::GetGridLayout(BGridLayout
** _layout
)
61 BGridLayoutBuilder::GetView(BView
** _view
)
63 *_view
= fLayout
->Owner();
69 BGridLayoutBuilder::Add(BView
* view
, int32 column
, int32 row
,
70 int32 columnCount
, int32 rowCount
)
72 fLayout
->AddView(view
, column
, row
, columnCount
, rowCount
);
78 BGridLayoutBuilder::Add(BLayoutItem
* item
, int32 column
, int32 row
,
79 int32 columnCount
, int32 rowCount
)
81 fLayout
->AddItem(item
, column
, row
, columnCount
, rowCount
);
87 BGridLayoutBuilder::SetColumnWeight(int32 column
, float weight
)
89 fLayout
->SetColumnWeight(column
, weight
);
95 BGridLayoutBuilder::SetRowWeight(int32 row
, float weight
)
97 fLayout
->SetRowWeight(row
, weight
);
103 BGridLayoutBuilder::SetInsets(float left
, float top
, float right
, float bottom
)
105 fLayout
->SetInsets(left
, top
, right
, bottom
);
109 // cast operator BGridLayout*
110 BGridLayoutBuilder::operator BGridLayout
*()