[Haiku-commits] r31095 - haiku/trunk/src/apps/debugger/gui/team_window
bonefish at BerliOS
bonefish at mail.berlios.de
Wed Jun 17 21:42:11 CEST 2009
Author: bonefish
Date: 2009-06-17 21:42:11 +0200 (Wed, 17 Jun 2009)
New Revision: 31095
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31095&view=rev
Modified:
haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp
haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h
Log:
* 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. :-)
Modified: haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp 2009-06-17 19:38:51 UTC (rev 31094)
+++ haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp 2009-06-17 19:42:11 UTC (rev 31095)
@@ -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 @@
}
-/*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);
}
Modified: haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h
===================================================================
--- haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h 2009-06-17 19:38:51 UTC (rev 31094)
+++ haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.h 2009-06-17 19:42:11 UTC (rev 31095)
@@ -30,7 +30,6 @@
virtual bool QuitRequested();
private:
- static BString _GetWindowTitle(::Team* team);
void _Init();
private:
More information about the Haiku-commits
mailing list