[Haiku-commits] r31118 - in haiku/trunk: headers/os/interface src/apps/debugger/gui/team_window

bonefish at BerliOS bonefish at mail.berlios.de
Fri Jun 19 17:28:01 CEST 2009


Author: bonefish
Date: 2009-06-19 17:28:00 +0200 (Fri, 19 Jun 2009)
New Revision: 31118
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31118&view=rev

Modified:
   haiku/trunk/headers/os/interface/LayoutBuilder.h
   haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp
Log:
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.


Modified: haiku/trunk/headers/os/interface/LayoutBuilder.h
===================================================================
--- haiku/trunk/headers/os/interface/LayoutBuilder.h	2009-06-19 15:17:58 UTC (rev 31117)
+++ haiku/trunk/headers/os/interface/LayoutBuilder.h	2009-06-19 15:28:00 UTC (rev 31118)
@@ -11,6 +11,7 @@
 #include <GroupView.h>
 #include <SpaceLayoutItem.h>
 #include <SplitView.h>
+#include <Window.h>
 
 
 namespace BLayoutBuilder {
@@ -49,6 +50,9 @@
 	inline						Group(enum orientation orientation
 										= B_HORIZONTAL,
 									float spacing = 0.0f);
+	inline						Group(BWindow* window,
+									enum orientation orientation = B_HORIZONTAL,
+									float spacing = 0.0f);
 	inline						Group(BGroupLayout* layout);
 	inline						Group(BGroupView* view);
 
@@ -95,6 +99,9 @@
 public:
 	inline						Grid(float horizontalSpacing = 0.0f,
 									float verticalSpacing = 0.0f);
+	inline						Grid(BWindow* window,
+									float horizontalSpacing = 0.0f,
+									float verticalSpacing = 0.0f);
 	inline						Grid(BGridLayout* layout);
 	inline						Grid(BGridView* view);
 
@@ -214,6 +221,16 @@
 
 
 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>
 Group<ParentBuilder>::Group(BGroupLayout* layout)
 	:
 	fLayout(layout)
@@ -393,6 +410,16 @@
 
 
 template<typename ParentBuilder>
+Grid<ParentBuilder>::Grid(BWindow* window, float horizontalSpacing,
+	float verticalSpacing)
+	:
+	fLayout((new BGridView(horizontalSpacing, verticalSpacing))->GridLayout())
+{
+	window->SetLayout(fLayout);
+}
+
+
+template<typename ParentBuilder>
 Grid<ParentBuilder>::Grid(BGridLayout* layout)
 	:
 	fLayout(layout)

Modified: haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp	2009-06-19 15:17:58 UTC (rev 31117)
+++ haiku/trunk/src/apps/debugger/gui/team_window/TeamWindow.cpp	2009-06-19 15:28:00 UTC (rev 31118)
@@ -149,10 +149,7 @@
 void
 TeamWindow::_Init()
 {
-	BGroupLayout* rootLayout = new BGroupLayout(B_VERTICAL);
-	SetLayout(rootLayout);
-
-	BLayoutBuilder::Group<>(rootLayout)
+	BLayoutBuilder::Group<>(this, B_VERTICAL)
 		.AddSplit(B_VERTICAL, 3.0f)
 			.Add(fTabView = new BTabView("tab view"), 0.4f)
 			.AddGroup(B_VERTICAL, 4.0f)




More information about the Haiku-commits mailing list