* Removed the title creator method. Just set the title in the constructor
instead. * Used the new layout builders. Now that's how layout code should look. :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31095 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1a726098ec
commit
2903bc659c
@ -5,7 +5,7 @@
|
||||
|
||||
#include "TeamWindow.h"
|
||||
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Message.h>
|
||||
#include <TabView.h>
|
||||
#include <SplitView.h>
|
||||
@ -21,14 +21,18 @@
|
||||
|
||||
TeamWindow::TeamWindow(::Team* team, Listener* listener)
|
||||
:
|
||||
BWindow(BRect(100, 100, 699, 499), _GetWindowTitle(team).String(),
|
||||
B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS),
|
||||
BWindow(BRect(100, 100, 699, 499), "Team", B_DOCUMENT_WINDOW,
|
||||
B_ASYNCHRONOUS_CONTROLS),
|
||||
fTeam(team),
|
||||
fListener(listener),
|
||||
fTabView(NULL),
|
||||
fThreadListView(NULL),
|
||||
fImageListView(NULL)
|
||||
{
|
||||
BString name = team->Name();
|
||||
if (team->ID() >= 0)
|
||||
name << " (" << team->ID() << ")";
|
||||
SetTitle(name.String());
|
||||
}
|
||||
|
||||
|
||||
@ -71,40 +75,25 @@ TeamWindow::QuitRequested()
|
||||
}
|
||||
|
||||
|
||||
/*static*/ BString
|
||||
TeamWindow::_GetWindowTitle(::Team* team)
|
||||
{
|
||||
BString name = team->Name();
|
||||
if (team->ID() >= 0)
|
||||
name << " (" << team->ID() << ")";
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TeamWindow::_Init()
|
||||
{
|
||||
BGroupLayout* rootLayout = new BGroupLayout(B_VERTICAL);
|
||||
SetLayout(rootLayout);
|
||||
|
||||
BSplitView* mainSplitView = new BSplitView(B_VERTICAL, 3.0f);
|
||||
BGroupLayoutBuilder(rootLayout)
|
||||
.Add(mainSplitView);
|
||||
BLayoutBuilder::Group<>(rootLayout)
|
||||
.AddSplit(B_VERTICAL, 3.0f)
|
||||
.Add(fTabView = new BTabView("tab view"), 0.4f)
|
||||
.AddSplit(B_HORIZONTAL, 3.0f)
|
||||
.Add(fImageListView = ImageListView::Create())
|
||||
.Add(new BTextView("source view"), 2.0f)
|
||||
.End()
|
||||
.End();
|
||||
|
||||
fTabView = new BTabView("tab view");
|
||||
mainSplitView->AddChild(fTabView, 0.4f);
|
||||
|
||||
fTabView->AddTab(fThreadListView = ThreadListView::Create());
|
||||
// fTabView->AddTab(fTeamsPage = new TeamsPage(this));
|
||||
// fTabView->AddTab(fThreadsPage = new ThreadsPage(this));
|
||||
|
||||
BSplitView* imageAndSourceSplitView = new BSplitView(B_HORIZONTAL, 3.0f);
|
||||
mainSplitView->AddChild(imageAndSourceSplitView);
|
||||
|
||||
fImageListView = ImageListView::Create();
|
||||
imageAndSourceSplitView->AddChild(fImageListView);
|
||||
imageAndSourceSplitView->AddChild(new BTextView("source view"), 2.0f);
|
||||
|
||||
fThreadListView->SetTeam(fTeam);
|
||||
fImageListView->SetTeam(fTeam);
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ public:
|
||||
virtual bool QuitRequested();
|
||||
|
||||
private:
|
||||
static BString _GetWindowTitle(::Team* team);
|
||||
void _Init();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user