Added constructor versions of the Group and Grid layout builders that take a
BWindow* parameter. They set the newly created layout on the window, which saves the API user to do that. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31118 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#include <GroupView.h>
|
#include <GroupView.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
#include <SplitView.h>
|
#include <SplitView.h>
|
||||||
|
#include <Window.h>
|
||||||
|
|
||||||
|
|
||||||
namespace BLayoutBuilder {
|
namespace BLayoutBuilder {
|
||||||
@@ -49,6 +50,9 @@ public:
|
|||||||
inline Group(enum orientation orientation
|
inline Group(enum orientation orientation
|
||||||
= B_HORIZONTAL,
|
= B_HORIZONTAL,
|
||||||
float spacing = 0.0f);
|
float spacing = 0.0f);
|
||||||
|
inline Group(BWindow* window,
|
||||||
|
enum orientation orientation = B_HORIZONTAL,
|
||||||
|
float spacing = 0.0f);
|
||||||
inline Group(BGroupLayout* layout);
|
inline Group(BGroupLayout* layout);
|
||||||
inline Group(BGroupView* view);
|
inline Group(BGroupView* view);
|
||||||
|
|
||||||
@@ -95,6 +99,9 @@ public:
|
|||||||
public:
|
public:
|
||||||
inline Grid(float horizontalSpacing = 0.0f,
|
inline Grid(float horizontalSpacing = 0.0f,
|
||||||
float verticalSpacing = 0.0f);
|
float verticalSpacing = 0.0f);
|
||||||
|
inline Grid(BWindow* window,
|
||||||
|
float horizontalSpacing = 0.0f,
|
||||||
|
float verticalSpacing = 0.0f);
|
||||||
inline Grid(BGridLayout* layout);
|
inline Grid(BGridLayout* layout);
|
||||||
inline Grid(BGridView* view);
|
inline Grid(BGridView* view);
|
||||||
|
|
||||||
@@ -213,6 +220,16 @@ Group<ParentBuilder>::Group(enum orientation orientation, float spacing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename ParentBuilder>
|
||||||
|
Group<ParentBuilder>::Group(BWindow* window, enum orientation orientation,
|
||||||
|
float spacing)
|
||||||
|
:
|
||||||
|
fLayout((new BGroupView(orientation, spacing))->GroupLayout())
|
||||||
|
{
|
||||||
|
window->SetLayout(fLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename ParentBuilder>
|
template<typename ParentBuilder>
|
||||||
Group<ParentBuilder>::Group(BGroupLayout* layout)
|
Group<ParentBuilder>::Group(BGroupLayout* layout)
|
||||||
:
|
:
|
||||||
@@ -392,6 +409,16 @@ Grid<ParentBuilder>::Grid(float horizontalSpacing, float verticalSpacing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename ParentBuilder>
|
||||||
|
Grid<ParentBuilder>::Grid(BWindow* window, float horizontalSpacing,
|
||||||
|
float verticalSpacing)
|
||||||
|
:
|
||||||
|
fLayout((new BGridView(horizontalSpacing, verticalSpacing))->GridLayout())
|
||||||
|
{
|
||||||
|
window->SetLayout(fLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename ParentBuilder>
|
template<typename ParentBuilder>
|
||||||
Grid<ParentBuilder>::Grid(BGridLayout* layout)
|
Grid<ParentBuilder>::Grid(BGridLayout* layout)
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -149,10 +149,7 @@ TeamWindow::ThreadStackTraceChanged(const Team::ThreadEvent& event)
|
|||||||
void
|
void
|
||||||
TeamWindow::_Init()
|
TeamWindow::_Init()
|
||||||
{
|
{
|
||||||
BGroupLayout* rootLayout = new BGroupLayout(B_VERTICAL);
|
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||||
SetLayout(rootLayout);
|
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(rootLayout)
|
|
||||||
.AddSplit(B_VERTICAL, 3.0f)
|
.AddSplit(B_VERTICAL, 3.0f)
|
||||||
.Add(fTabView = new BTabView("tab view"), 0.4f)
|
.Add(fTabView = new BTabView("tab view"), 0.4f)
|
||||||
.AddGroup(B_VERTICAL, 4.0f)
|
.AddGroup(B_VERTICAL, 4.0f)
|
||||||
|
|||||||
Reference in New Issue
Block a user