From d1b6305cd976f6b81fbb6e660299ebbaccc79583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 1 Jan 2011 12:08:49 +0000 Subject: [PATCH] Forward important properties and setters of the private BSplitLayout in the BSplitView class, related to getting and setting item weights programatically. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40048 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/SplitView.h | 5 +++++ src/kits/interface/SplitView.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/headers/os/interface/SplitView.h b/headers/os/interface/SplitView.h index 8d3aadf3e9..1391b85fa1 100644 --- a/headers/os/interface/SplitView.h +++ b/headers/os/interface/SplitView.h @@ -33,6 +33,11 @@ public: float SplitterSize() const; void SetSplitterSize(float size); + float ItemWeight(int32 index) const; + float ItemWeight(BLayoutItem* item) const; + void SetItemWeight(int32 index, float weight, + bool invalidateLayout); + void SetItemWeight(BLayoutItem* item, float weight); void SetCollapsible(bool collapsible); void SetCollapsible(int32 index, bool collapsible); diff --git a/src/kits/interface/SplitView.cpp b/src/kits/interface/SplitView.cpp index 77eb6f0edb..4c84409147 100644 --- a/src/kits/interface/SplitView.cpp +++ b/src/kits/interface/SplitView.cpp @@ -95,6 +95,34 @@ BSplitView::SetSplitterSize(float size) } +float +BSplitView::ItemWeight(int32 index) const +{ + return fSplitLayout->ItemWeight(index); +} + + +float +BSplitView::ItemWeight(BLayoutItem* item) const +{ + return fSplitLayout->ItemWeight(item); +} + + +void +BSplitView::SetItemWeight(int32 index, float weight, bool invalidateLayout) +{ + fSplitLayout->SetItemWeight(index, weight, invalidateLayout); +} + + +void +BSplitView::SetItemWeight(BLayoutItem* item, float weight) +{ + fSplitLayout->SetItemWeight(item, weight); +} + + void BSplitView::SetCollapsible(bool collapsible) {