Index: headers/os/interface/TabView.h
===================================================================
--- headers/os/interface/TabView.h	(revision 28696)
+++ headers/os/interface/TabView.h	(working copy)
@@ -106,12 +106,17 @@
 class BTabView : public BView
 {
 public:
+						BTabView(const char *name,
+							button_width width = B_WIDTH_AS_USUAL,
+							uint32 flags = B_FULL_UPDATE_ON_RESIZE |
+								 B_WILL_DRAW | B_NAVIGABLE_JUMP |
+								 B_FRAME_EVENTS | B_NAVIGABLE);
 						BTabView(BRect frame, const char *name,
 							button_width width = B_WIDTH_AS_USUAL, 
 							uint32 resizingMode = B_FOLLOW_ALL,
 							uint32 flags = B_FULL_UPDATE_ON_RESIZE |
-								B_WILL_DRAW | B_NAVIGABLE_JUMP |
-								B_FRAME_EVENTS | B_NAVIGABLE);
+								 B_WILL_DRAW | B_NAVIGABLE_JUMP |
+								 B_FRAME_EVENTS | B_NAVIGABLE);
 						~BTabView();
 
 						BTabView(BMessage *archive);
@@ -150,9 +155,13 @@
 virtual	void			SetFlags(uint32 flags);
 virtual	void			SetResizingMode(uint32 mode);
 
-virtual void 			GetPreferredSize(float *width, float *height);
-virtual void 			ResizeToPreferred();
+virtual	void			ResizeToPreferred();
+virtual	void			GetPreferredSize(float* _width, float* _height);
 
+virtual BSize			MinSize();
+virtual BSize			MaxSize();
+virtual BSize			PreferredSize();
+
 virtual BHandler		*ResolveSpecifier(BMessage *message, int32 index,
 							BMessage *specifier, int32 what, const char *property);
 virtual	status_t		GetSupportedSuites(BMessage *message);
@@ -174,7 +183,7 @@
 		BView			*ViewForTab(int32 tabIndex) const;
 
 private:
-		void			_InitObject();
+		void			_InitObject(bool layouted = false);
 
 virtual	void			_ReservedTabView1();
 virtual	void			_ReservedTabView2();
Index: src/kits/interface/TabView.cpp
===================================================================
--- src/kits/interface/TabView.cpp	(revision 28700)
+++ src/kits/interface/TabView.cpp	(working copy)
@@ -10,6 +10,8 @@
 
 #include <string.h>
 
+#include <CardLayout.h>
+#include <LayoutUtils.h>
 #include <List.h>
 #include <Message.h>
 #include <PropertyInfo.h>
@@ -131,7 +133,8 @@
 	if (!owner || !View() || !owner->Window())
 		return;
 
-	owner->AddChild(fView);
+	if (!owner->GetLayout())
+		owner->AddChild(fView);
 	//fView->Show();
 
 	fSelected = true;
@@ -141,9 +144,16 @@
 void
 BTab::Deselect()
 {
-	if (View())
-		View()->RemoveSelf();
-
+	if (View()) {
+		bool removeView = false;
+		BView* container = View()->Parent();
+		if (container)
+			removeView =
+				dynamic_cast<BCardLayout*>(container->GetLayout()) == NULL;
+		if (removeView)
+			View()->RemoveSelf();
+	}
+	
 	fSelected = false;
 }
 
@@ -329,7 +339,17 @@
 
 //	#pragma mark -
 
+BTabView::BTabView(const char *name, button_width width, uint32 flags)
+	: BView(name, flags)
+{
+	SetFont(be_bold_font);
+	
+	_InitObject(true);
+	
+	fTabWidthSetting = width;
+}
 
+
 BTabView::BTabView(BRect frame, const char *name, button_width width, 
 	uint32 resizingMode, uint32 flags)
 	: BView(frame, name, resizingMode, flags)
@@ -669,6 +689,9 @@
 		index = Selection();
 
 	BTab *tab = TabAt(Selection());
+	
+	bool layouted = fContainerView->GetLayout() ? true : false;
+	
 	if (tab)
 		tab->Deselect();
 
@@ -678,6 +701,13 @@
 			fTabOffset = 0.0f;
 		tab->Select(ContainerView());
 		fSelection = index;
+		
+		if (layouted) {
+			BCardLayout* layout =
+				dynamic_cast<BCardLayout*>(fContainerView->GetLayout());
+			if (layout)
+				layout->SetVisibleItem(index);
+		}
 	}
 
 	Invalidate();
@@ -917,6 +947,36 @@
 }
 
 
+BSize
+BTabView::MinSize()
+{
+	BSize size = fContainerView->MinSize();
+	size.height += TabHeight() + 6.0f;
+	size.width += 6.0f;
+	return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
+}
+
+
+BSize
+BTabView::MaxSize()
+{
+	BSize size = fContainerView->MaxSize();
+	size.height += TabHeight() + 6.0f;
+	size.width += 6.0f;
+	return BLayoutUtils::ComposeSize(ExplicitMaxSize(), size);
+}
+
+
+BSize
+BTabView::PreferredSize()
+{
+	BSize size = fContainerView->PreferredSize();
+	size.height += TabHeight() + 6.0f;
+	size.width += 6.0f;
+	return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), size);
+}
+
+
 void
 BTabView::ResizeToPreferred()
 {
@@ -957,6 +1017,9 @@
 		tab = new BTab(target);
 	else
 		tab->SetView(target);
+	
+	if (fContainerView->GetLayout())
+		fContainerView->GetLayout()->AddView(CountTabs(), target);
 
 	fTabList->AddItem(tab);
 }
@@ -972,6 +1035,8 @@
 	if (tab == NULL)
 		return NULL;
 
+	bool layouted = fContainerView->GetLayout() ? true : false;
+	
 	tab->Deselect();
 
 	if (index <= fSelection && fSelection != 0)
@@ -987,6 +1052,9 @@
 	else
 		SetFocusTab(fFocus, true);
 
+	if (layouted)
+		fContainerView->GetLayout()->RemoveItem(index);
+	
 	return tab;
 }
 
@@ -1062,7 +1130,7 @@
 
 
 void
-BTabView::_InitObject()
+BTabView::_InitObject(bool layouted)
 {
 	fTabList = new BList;
 
@@ -1088,6 +1156,12 @@
 	fContainerView = new BView(bounds, "view container", B_FOLLOW_ALL,
 		B_WILL_DRAW);
 
+	if (layouted) {
+		BCardLayout* layout = new BCardLayout();
+		if (layout)
+			fContainerView->SetLayout(layout);
+	}
+	
 	fContainerView->SetViewColor(color);
 	fContainerView->SetLowColor(color);
 
