* 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:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "TeamWindow.h"
|
#include "TeamWindow.h"
|
||||||
|
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <LayoutBuilder.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <TabView.h>
|
#include <TabView.h>
|
||||||
#include <SplitView.h>
|
#include <SplitView.h>
|
||||||
@@ -21,14 +21,18 @@
|
|||||||
|
|
||||||
TeamWindow::TeamWindow(::Team* team, Listener* listener)
|
TeamWindow::TeamWindow(::Team* team, Listener* listener)
|
||||||
:
|
:
|
||||||
BWindow(BRect(100, 100, 699, 499), _GetWindowTitle(team).String(),
|
BWindow(BRect(100, 100, 699, 499), "Team", B_DOCUMENT_WINDOW,
|
||||||
B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS),
|
B_ASYNCHRONOUS_CONTROLS),
|
||||||
fTeam(team),
|
fTeam(team),
|
||||||
fListener(listener),
|
fListener(listener),
|
||||||
fTabView(NULL),
|
fTabView(NULL),
|
||||||
fThreadListView(NULL),
|
fThreadListView(NULL),
|
||||||
fImageListView(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
|
void
|
||||||
TeamWindow::_Init()
|
TeamWindow::_Init()
|
||||||
{
|
{
|
||||||
BGroupLayout* rootLayout = new BGroupLayout(B_VERTICAL);
|
BGroupLayout* rootLayout = new BGroupLayout(B_VERTICAL);
|
||||||
SetLayout(rootLayout);
|
SetLayout(rootLayout);
|
||||||
|
|
||||||
BSplitView* mainSplitView = new BSplitView(B_VERTICAL, 3.0f);
|
BLayoutBuilder::Group<>(rootLayout)
|
||||||
BGroupLayoutBuilder(rootLayout)
|
.AddSplit(B_VERTICAL, 3.0f)
|
||||||
.Add(mainSplitView);
|
.Add(fTabView = new BTabView("tab view"), 0.4f)
|
||||||
|
.AddSplit(B_HORIZONTAL, 3.0f)
|
||||||
fTabView = new BTabView("tab view");
|
.Add(fImageListView = ImageListView::Create())
|
||||||
mainSplitView->AddChild(fTabView, 0.4f);
|
.Add(new BTextView("source view"), 2.0f)
|
||||||
|
.End()
|
||||||
|
.End();
|
||||||
|
|
||||||
fTabView->AddTab(fThreadListView = ThreadListView::Create());
|
fTabView->AddTab(fThreadListView = ThreadListView::Create());
|
||||||
// fTabView->AddTab(fTeamsPage = new TeamsPage(this));
|
// fTabView->AddTab(fTeamsPage = new TeamsPage(this));
|
||||||
// fTabView->AddTab(fThreadsPage = new ThreadsPage(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);
|
fThreadListView->SetTeam(fTeam);
|
||||||
fImageListView->SetTeam(fTeam);
|
fImageListView->SetTeam(fTeam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public:
|
|||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static BString _GetWindowTitle(::Team* team);
|
|
||||||
void _Init();
|
void _Init();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user