These files were in CR/LF newline format for some reason.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26084 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+589
-589
File diff suppressed because it is too large
Load Diff
+249
-249
@@ -1,249 +1,249 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Ingo Weinhold <[email protected]>.
|
* Copyright 2006, Ingo Weinhold <[email protected]>.
|
||||||
* All rights reserved. Distributed under the terms of the MIT License.
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
|
|
||||||
#include <LayoutItem.h>
|
#include <LayoutItem.h>
|
||||||
|
|
||||||
|
|
||||||
// ItemLayoutData
|
// ItemLayoutData
|
||||||
struct BGroupLayout::ItemLayoutData {
|
struct BGroupLayout::ItemLayoutData {
|
||||||
float weight;
|
float weight;
|
||||||
|
|
||||||
ItemLayoutData()
|
ItemLayoutData()
|
||||||
: weight(1)
|
: weight(1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
BGroupLayout::BGroupLayout(enum orientation orientation, float spacing)
|
BGroupLayout::BGroupLayout(enum orientation orientation, float spacing)
|
||||||
: BTwoDimensionalLayout(),
|
: BTwoDimensionalLayout(),
|
||||||
fOrientation(orientation)
|
fOrientation(orientation)
|
||||||
{
|
{
|
||||||
SetSpacing(spacing);
|
SetSpacing(spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
// destructor
|
// destructor
|
||||||
BGroupLayout::~BGroupLayout()
|
BGroupLayout::~BGroupLayout()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
float
|
float
|
||||||
BGroupLayout::Spacing() const
|
BGroupLayout::Spacing() const
|
||||||
{
|
{
|
||||||
return fHSpacing;
|
return fHSpacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetSpacing
|
// SetSpacing
|
||||||
void
|
void
|
||||||
BGroupLayout::SetSpacing(float spacing)
|
BGroupLayout::SetSpacing(float spacing)
|
||||||
{
|
{
|
||||||
if (spacing != fHSpacing) {
|
if (spacing != fHSpacing) {
|
||||||
fHSpacing = spacing;
|
fHSpacing = spacing;
|
||||||
fVSpacing = spacing;
|
fVSpacing = spacing;
|
||||||
InvalidateLayout();
|
InvalidateLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Orientation
|
// Orientation
|
||||||
orientation
|
orientation
|
||||||
BGroupLayout::Orientation() const
|
BGroupLayout::Orientation() const
|
||||||
{
|
{
|
||||||
return fOrientation;
|
return fOrientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetOrientation
|
// SetOrientation
|
||||||
void
|
void
|
||||||
BGroupLayout::SetOrientation(enum orientation orientation)
|
BGroupLayout::SetOrientation(enum orientation orientation)
|
||||||
{
|
{
|
||||||
if (orientation != fOrientation) {
|
if (orientation != fOrientation) {
|
||||||
fOrientation = orientation;
|
fOrientation = orientation;
|
||||||
|
|
||||||
InvalidateLayout();
|
InvalidateLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ItemWeight
|
// ItemWeight
|
||||||
float
|
float
|
||||||
BGroupLayout::ItemWeight(int32 index) const
|
BGroupLayout::ItemWeight(int32 index) const
|
||||||
{
|
{
|
||||||
if (index < 0 || index >= CountItems())
|
if (index < 0 || index >= CountItems())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ItemLayoutData* data = _LayoutDataForItem(ItemAt(index));
|
ItemLayoutData* data = _LayoutDataForItem(ItemAt(index));
|
||||||
return (data ? data->weight : 0);
|
return (data ? data->weight : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetItemWeight
|
// SetItemWeight
|
||||||
void
|
void
|
||||||
BGroupLayout::SetItemWeight(int32 index, float weight)
|
BGroupLayout::SetItemWeight(int32 index, float weight)
|
||||||
{
|
{
|
||||||
if (index < 0 || index >= CountItems())
|
if (index < 0 || index >= CountItems())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ItemLayoutData* data = _LayoutDataForItem(ItemAt(index)))
|
if (ItemLayoutData* data = _LayoutDataForItem(ItemAt(index)))
|
||||||
data->weight = weight;
|
data->weight = weight;
|
||||||
|
|
||||||
InvalidateLayout();
|
InvalidateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddView
|
// AddView
|
||||||
BLayoutItem*
|
BLayoutItem*
|
||||||
BGroupLayout::AddView(BView* child)
|
BGroupLayout::AddView(BView* child)
|
||||||
{
|
{
|
||||||
return BTwoDimensionalLayout::AddView(child);
|
return BTwoDimensionalLayout::AddView(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddView
|
// AddView
|
||||||
BLayoutItem*
|
BLayoutItem*
|
||||||
BGroupLayout::AddView(int32 index, BView* child)
|
BGroupLayout::AddView(int32 index, BView* child)
|
||||||
{
|
{
|
||||||
return BTwoDimensionalLayout::AddView(index, child);
|
return BTwoDimensionalLayout::AddView(index, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddView
|
// AddView
|
||||||
BLayoutItem*
|
BLayoutItem*
|
||||||
BGroupLayout::AddView(BView* child, float weight)
|
BGroupLayout::AddView(BView* child, float weight)
|
||||||
{
|
{
|
||||||
return AddView(-1, child, weight);
|
return AddView(-1, child, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddView
|
// AddView
|
||||||
BLayoutItem*
|
BLayoutItem*
|
||||||
BGroupLayout::AddView(int32 index, BView* child, float weight)
|
BGroupLayout::AddView(int32 index, BView* child, float weight)
|
||||||
{
|
{
|
||||||
BLayoutItem* item = AddView(index, child);
|
BLayoutItem* item = AddView(index, child);
|
||||||
if (ItemLayoutData* data = _LayoutDataForItem(item))
|
if (ItemLayoutData* data = _LayoutDataForItem(item))
|
||||||
data->weight = weight;
|
data->weight = weight;
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddItem
|
// AddItem
|
||||||
bool
|
bool
|
||||||
BGroupLayout::AddItem(BLayoutItem* item)
|
BGroupLayout::AddItem(BLayoutItem* item)
|
||||||
{
|
{
|
||||||
return BTwoDimensionalLayout::AddItem(item);
|
return BTwoDimensionalLayout::AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddItem
|
// AddItem
|
||||||
bool
|
bool
|
||||||
BGroupLayout::AddItem(int32 index, BLayoutItem* item)
|
BGroupLayout::AddItem(int32 index, BLayoutItem* item)
|
||||||
{
|
{
|
||||||
return BTwoDimensionalLayout::AddItem(index, item);
|
return BTwoDimensionalLayout::AddItem(index, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddItem
|
// AddItem
|
||||||
bool
|
bool
|
||||||
BGroupLayout::AddItem(BLayoutItem* item, float weight)
|
BGroupLayout::AddItem(BLayoutItem* item, float weight)
|
||||||
{
|
{
|
||||||
return AddItem(-1, item, weight);
|
return AddItem(-1, item, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddItem
|
// AddItem
|
||||||
bool
|
bool
|
||||||
BGroupLayout::AddItem(int32 index, BLayoutItem* item, float weight)
|
BGroupLayout::AddItem(int32 index, BLayoutItem* item, float weight)
|
||||||
{
|
{
|
||||||
bool success = AddItem(index, item);
|
bool success = AddItem(index, item);
|
||||||
if (success) {
|
if (success) {
|
||||||
if (ItemLayoutData* data = _LayoutDataForItem(item))
|
if (ItemLayoutData* data = _LayoutDataForItem(item))
|
||||||
data->weight = weight;
|
data->weight = weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ItemAdded
|
// ItemAdded
|
||||||
void
|
void
|
||||||
BGroupLayout::ItemAdded(BLayoutItem* item)
|
BGroupLayout::ItemAdded(BLayoutItem* item)
|
||||||
{
|
{
|
||||||
item->SetLayoutData(new ItemLayoutData);
|
item->SetLayoutData(new ItemLayoutData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ItemRemoved
|
// ItemRemoved
|
||||||
void
|
void
|
||||||
BGroupLayout::ItemRemoved(BLayoutItem* item)
|
BGroupLayout::ItemRemoved(BLayoutItem* item)
|
||||||
{
|
{
|
||||||
if (ItemLayoutData* data = _LayoutDataForItem(item)) {
|
if (ItemLayoutData* data = _LayoutDataForItem(item)) {
|
||||||
item->SetLayoutData(NULL);
|
item->SetLayoutData(NULL);
|
||||||
delete data;
|
delete data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrepareItems
|
// PrepareItems
|
||||||
void
|
void
|
||||||
BGroupLayout::PrepareItems(enum orientation orientation)
|
BGroupLayout::PrepareItems(enum orientation orientation)
|
||||||
{
|
{
|
||||||
// filter the visible items
|
// filter the visible items
|
||||||
fVisibleItems.MakeEmpty();
|
fVisibleItems.MakeEmpty();
|
||||||
int32 itemCount = CountItems();
|
int32 itemCount = CountItems();
|
||||||
for (int i = 0; i < itemCount; i++) {
|
for (int i = 0; i < itemCount; i++) {
|
||||||
BLayoutItem* item = ItemAt(i);
|
BLayoutItem* item = ItemAt(i);
|
||||||
if (item->IsVisible())
|
if (item->IsVisible())
|
||||||
fVisibleItems.AddItem(item);
|
fVisibleItems.AddItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// InternalCountColumns
|
// InternalCountColumns
|
||||||
int32
|
int32
|
||||||
BGroupLayout::InternalCountColumns()
|
BGroupLayout::InternalCountColumns()
|
||||||
{
|
{
|
||||||
return (fOrientation == B_HORIZONTAL ? fVisibleItems.CountItems() : 1);
|
return (fOrientation == B_HORIZONTAL ? fVisibleItems.CountItems() : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// InternalCountRows
|
// InternalCountRows
|
||||||
int32
|
int32
|
||||||
BGroupLayout::InternalCountRows()
|
BGroupLayout::InternalCountRows()
|
||||||
{
|
{
|
||||||
return (fOrientation == B_VERTICAL ? fVisibleItems.CountItems() : 1);
|
return (fOrientation == B_VERTICAL ? fVisibleItems.CountItems() : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetColumnRowConstraints
|
// GetColumnRowConstraints
|
||||||
void
|
void
|
||||||
BGroupLayout::GetColumnRowConstraints(enum orientation orientation, int32 index,
|
BGroupLayout::GetColumnRowConstraints(enum orientation orientation, int32 index,
|
||||||
ColumnRowConstraints* constraints)
|
ColumnRowConstraints* constraints)
|
||||||
{
|
{
|
||||||
if (index >= 0 && index < fVisibleItems.CountItems()) {
|
if (index >= 0 && index < fVisibleItems.CountItems()) {
|
||||||
BLayoutItem* item = (BLayoutItem*)fVisibleItems.ItemAt(index);
|
BLayoutItem* item = (BLayoutItem*)fVisibleItems.ItemAt(index);
|
||||||
constraints->min = -1;
|
constraints->min = -1;
|
||||||
constraints->max = B_SIZE_UNLIMITED;
|
constraints->max = B_SIZE_UNLIMITED;
|
||||||
if (ItemLayoutData* data = _LayoutDataForItem(item))
|
if (ItemLayoutData* data = _LayoutDataForItem(item))
|
||||||
constraints->weight = data->weight;
|
constraints->weight = data->weight;
|
||||||
else
|
else
|
||||||
constraints->weight = 1;
|
constraints->weight = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ItemDimensions
|
// ItemDimensions
|
||||||
void
|
void
|
||||||
BGroupLayout::GetItemDimensions(BLayoutItem* item, Dimensions* dimensions)
|
BGroupLayout::GetItemDimensions(BLayoutItem* item, Dimensions* dimensions)
|
||||||
{
|
{
|
||||||
int32 index = fVisibleItems.IndexOf(item);
|
int32 index = fVisibleItems.IndexOf(item);
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (fOrientation == B_HORIZONTAL) {
|
if (fOrientation == B_HORIZONTAL) {
|
||||||
dimensions->x = index;
|
dimensions->x = index;
|
||||||
dimensions->y = 0;
|
dimensions->y = 0;
|
||||||
dimensions->width = 1;
|
dimensions->width = 1;
|
||||||
dimensions->height = 1;
|
dimensions->height = 1;
|
||||||
} else {
|
} else {
|
||||||
dimensions->x = 0;
|
dimensions->x = 0;
|
||||||
dimensions->y = index;
|
dimensions->y = index;
|
||||||
dimensions->width = 1;
|
dimensions->width = 1;
|
||||||
dimensions->height = 1;
|
dimensions->height = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// _LayoutDataForItem
|
// _LayoutDataForItem
|
||||||
BGroupLayout::ItemLayoutData*
|
BGroupLayout::ItemLayoutData*
|
||||||
BGroupLayout::_LayoutDataForItem(BLayoutItem* item) const
|
BGroupLayout::_LayoutDataForItem(BLayoutItem* item) const
|
||||||
{
|
{
|
||||||
if (!item)
|
if (!item)
|
||||||
return NULL;
|
return NULL;
|
||||||
return (ItemLayoutData*)item->LayoutData();
|
return (ItemLayoutData*)item->LayoutData();
|
||||||
}
|
}
|
||||||
|
|||||||
+175
-175
@@ -1,175 +1,175 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Haiku Inc.
|
* Copyright 2006, Haiku Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _SPLIT_LAYOUT_H
|
#ifndef _SPLIT_LAYOUT_H
|
||||||
#define _SPLIT_LAYOUT_H
|
#define _SPLIT_LAYOUT_H
|
||||||
|
|
||||||
|
|
||||||
#include <Layout.h>
|
#include <Layout.h>
|
||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
namespace Layout {
|
namespace Layout {
|
||||||
class Layouter;
|
class Layouter;
|
||||||
class LayoutInfo;
|
class LayoutInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using BPrivate::Layout::Layouter;
|
using BPrivate::Layout::Layouter;
|
||||||
using BPrivate::Layout::LayoutInfo;
|
using BPrivate::Layout::LayoutInfo;
|
||||||
|
|
||||||
|
|
||||||
class BSplitLayout : public BLayout {
|
class BSplitLayout : public BLayout {
|
||||||
public:
|
public:
|
||||||
BSplitLayout(enum orientation orientation,
|
BSplitLayout(enum orientation orientation,
|
||||||
float spacing = 0.0f);
|
float spacing = 0.0f);
|
||||||
virtual ~BSplitLayout();
|
virtual ~BSplitLayout();
|
||||||
|
|
||||||
void SetInsets(float left, float top, float right,
|
void SetInsets(float left, float top, float right,
|
||||||
float bottom);
|
float bottom);
|
||||||
void GetInsets(float* left, float* top, float* right,
|
void GetInsets(float* left, float* top, float* right,
|
||||||
float* bottom);
|
float* bottom);
|
||||||
|
|
||||||
float Spacing() const;
|
float Spacing() const;
|
||||||
void SetSpacing(float spacing);
|
void SetSpacing(float spacing);
|
||||||
|
|
||||||
orientation Orientation() const;
|
orientation Orientation() const;
|
||||||
void SetOrientation(enum orientation orientation);
|
void SetOrientation(enum orientation orientation);
|
||||||
|
|
||||||
float SplitterSize() const;
|
float SplitterSize() const;
|
||||||
void SetSplitterSize(float size);
|
void SetSplitterSize(float size);
|
||||||
|
|
||||||
virtual BLayoutItem* AddView(BView* child);
|
virtual BLayoutItem* AddView(BView* child);
|
||||||
virtual BLayoutItem* AddView(int32 index, BView* child);
|
virtual BLayoutItem* AddView(int32 index, BView* child);
|
||||||
virtual BLayoutItem* AddView(BView* child, float weight);
|
virtual BLayoutItem* AddView(BView* child, float weight);
|
||||||
virtual BLayoutItem* AddView(int32 index, BView* child,
|
virtual BLayoutItem* AddView(int32 index, BView* child,
|
||||||
float weight);
|
float weight);
|
||||||
|
|
||||||
virtual bool AddItem(BLayoutItem* item);
|
virtual bool AddItem(BLayoutItem* item);
|
||||||
virtual bool AddItem(int32 index, BLayoutItem* item);
|
virtual bool AddItem(int32 index, BLayoutItem* item);
|
||||||
virtual bool AddItem(BLayoutItem* item, float weight);
|
virtual bool AddItem(BLayoutItem* item, float weight);
|
||||||
virtual bool AddItem(int32 index, BLayoutItem* item,
|
virtual bool AddItem(int32 index, BLayoutItem* item,
|
||||||
float weight);
|
float weight);
|
||||||
|
|
||||||
|
|
||||||
float ItemWeight(int32 index) const;
|
float ItemWeight(int32 index) const;
|
||||||
float ItemWeight(BLayoutItem* item) const;
|
float ItemWeight(BLayoutItem* item) const;
|
||||||
void SetItemWeight(int32 index, float weight,
|
void SetItemWeight(int32 index, float weight,
|
||||||
bool invalidateLayout);
|
bool invalidateLayout);
|
||||||
void SetItemWeight(BLayoutItem* item, float weight);
|
void SetItemWeight(BLayoutItem* item, float weight);
|
||||||
|
|
||||||
void SetCollapsible(bool collapsible);
|
void SetCollapsible(bool collapsible);
|
||||||
void SetCollapsible(int32 index, bool collapsible);
|
void SetCollapsible(int32 index, bool collapsible);
|
||||||
void SetCollapsible(int32 first, int32 last,
|
void SetCollapsible(int32 first, int32 last,
|
||||||
bool collapsible);
|
bool collapsible);
|
||||||
|
|
||||||
virtual BSize MinSize();
|
virtual BSize MinSize();
|
||||||
virtual BSize MaxSize();
|
virtual BSize MaxSize();
|
||||||
virtual BSize PreferredSize();
|
virtual BSize PreferredSize();
|
||||||
virtual BAlignment Alignment();
|
virtual BAlignment Alignment();
|
||||||
|
|
||||||
virtual bool HasHeightForWidth();
|
virtual bool HasHeightForWidth();
|
||||||
virtual void GetHeightForWidth(float width, float* min,
|
virtual void GetHeightForWidth(float width, float* min,
|
||||||
float* max, float* preferred);
|
float* max, float* preferred);
|
||||||
|
|
||||||
virtual void InvalidateLayout();
|
virtual void InvalidateLayout();
|
||||||
|
|
||||||
virtual void LayoutView();
|
virtual void LayoutView();
|
||||||
|
|
||||||
// interface for BSplitView
|
// interface for BSplitView
|
||||||
BRect SplitterItemFrame(int32 index) const;
|
BRect SplitterItemFrame(int32 index) const;
|
||||||
|
|
||||||
bool StartDraggingSplitter(BPoint point);
|
bool StartDraggingSplitter(BPoint point);
|
||||||
bool DragSplitter(BPoint point);
|
bool DragSplitter(BPoint point);
|
||||||
bool StopDraggingSplitter();
|
bool StopDraggingSplitter();
|
||||||
int32 DraggedSplitter() const;
|
int32 DraggedSplitter() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void ItemAdded(BLayoutItem* item);
|
virtual void ItemAdded(BLayoutItem* item);
|
||||||
virtual void ItemRemoved(BLayoutItem* item);
|
virtual void ItemRemoved(BLayoutItem* item);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class ItemLayoutInfo;
|
class ItemLayoutInfo;
|
||||||
class ValueRange;
|
class ValueRange;
|
||||||
class SplitterItem;
|
class SplitterItem;
|
||||||
|
|
||||||
void _InvalidateLayout(bool invalidateView);
|
void _InvalidateLayout(bool invalidateView);
|
||||||
void _InvalidateCachedHeightForWidth();
|
void _InvalidateCachedHeightForWidth();
|
||||||
|
|
||||||
SplitterItem* _SplitterItemAt(int32 index) const;
|
SplitterItem* _SplitterItemAt(int32 index) const;
|
||||||
|
|
||||||
void _GetSplitterValueRange(int32 index,
|
void _GetSplitterValueRange(int32 index,
|
||||||
ValueRange& range);
|
ValueRange& range);
|
||||||
int32 _SplitterValue(int32 index) const;
|
int32 _SplitterValue(int32 index) const;
|
||||||
|
|
||||||
void _LayoutItem(BLayoutItem* item, BRect frame,
|
void _LayoutItem(BLayoutItem* item, BRect frame,
|
||||||
bool visible);
|
bool visible);
|
||||||
void _LayoutItem(BLayoutItem* item,
|
void _LayoutItem(BLayoutItem* item,
|
||||||
ItemLayoutInfo* info);
|
ItemLayoutInfo* info);
|
||||||
|
|
||||||
bool _SetSplitterValue(int32 index, int32 value);
|
bool _SetSplitterValue(int32 index, int32 value);
|
||||||
|
|
||||||
ItemLayoutInfo* _ItemLayoutInfo(BLayoutItem* item) const;
|
ItemLayoutInfo* _ItemLayoutInfo(BLayoutItem* item) const;
|
||||||
|
|
||||||
|
|
||||||
void _UpdateSplitterWeights();
|
void _UpdateSplitterWeights();
|
||||||
|
|
||||||
void _ValidateMinMax();
|
void _ValidateMinMax();
|
||||||
|
|
||||||
void _InternalGetHeightForWidth(float width,
|
void _InternalGetHeightForWidth(float width,
|
||||||
bool realLayout, float* minHeight,
|
bool realLayout, float* minHeight,
|
||||||
float* maxHeight, float* preferredHeight);
|
float* maxHeight, float* preferredHeight);
|
||||||
|
|
||||||
float _SplitterSpace() const;
|
float _SplitterSpace() const;
|
||||||
|
|
||||||
BSize _AddInsets(BSize size);
|
BSize _AddInsets(BSize size);
|
||||||
void _AddInsets(float* minHeight, float* maxHeight,
|
void _AddInsets(float* minHeight, float* maxHeight,
|
||||||
float* preferredHeight);
|
float* preferredHeight);
|
||||||
BSize _SubtractInsets(BSize size);
|
BSize _SubtractInsets(BSize size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
orientation fOrientation;
|
orientation fOrientation;
|
||||||
float fLeftInset;
|
float fLeftInset;
|
||||||
float fRightInset;
|
float fRightInset;
|
||||||
float fTopInset;
|
float fTopInset;
|
||||||
float fBottomInset;
|
float fBottomInset;
|
||||||
float fSplitterSize;
|
float fSplitterSize;
|
||||||
float fSpacing;
|
float fSpacing;
|
||||||
|
|
||||||
BList fSplitterItems;
|
BList fSplitterItems;
|
||||||
BList fVisibleItems;
|
BList fVisibleItems;
|
||||||
|
|
||||||
BSize fMin;
|
BSize fMin;
|
||||||
BSize fMax;
|
BSize fMax;
|
||||||
BSize fPreferred;
|
BSize fPreferred;
|
||||||
|
|
||||||
Layouter* fHorizontalLayouter;
|
Layouter* fHorizontalLayouter;
|
||||||
Layouter* fVerticalLayouter;
|
Layouter* fVerticalLayouter;
|
||||||
|
|
||||||
LayoutInfo* fHorizontalLayoutInfo;
|
LayoutInfo* fHorizontalLayoutInfo;
|
||||||
LayoutInfo* fVerticalLayoutInfo;
|
LayoutInfo* fVerticalLayoutInfo;
|
||||||
|
|
||||||
BList fHeightForWidthItems;
|
BList fHeightForWidthItems;
|
||||||
// Incorporates the children's height for width constraints for a
|
// Incorporates the children's height for width constraints for a
|
||||||
// concrete width. Cloned lazily from fVerticalLayout when needed.
|
// concrete width. Cloned lazily from fVerticalLayout when needed.
|
||||||
Layouter* fHeightForWidthVerticalLayouter;
|
Layouter* fHeightForWidthVerticalLayouter;
|
||||||
LayoutInfo* fHeightForWidthHorizontalLayoutInfo;
|
LayoutInfo* fHeightForWidthHorizontalLayoutInfo;
|
||||||
// for computing height for width info
|
// for computing height for width info
|
||||||
|
|
||||||
bool fLayoutValid;
|
bool fLayoutValid;
|
||||||
|
|
||||||
float fCachedHeightForWidthWidth;
|
float fCachedHeightForWidthWidth;
|
||||||
float fHeightForWidthVerticalLayouterWidth;
|
float fHeightForWidthVerticalLayouterWidth;
|
||||||
float fCachedMinHeightForWidth;
|
float fCachedMinHeightForWidth;
|
||||||
float fCachedMaxHeightForWidth;
|
float fCachedMaxHeightForWidth;
|
||||||
float fCachedPreferredHeightForWidth;
|
float fCachedPreferredHeightForWidth;
|
||||||
|
|
||||||
BPoint fDraggingStartPoint;
|
BPoint fDraggingStartPoint;
|
||||||
int32 fDraggingStartValue;
|
int32 fDraggingStartValue;
|
||||||
int32 fDraggingCurrentValue;
|
int32 fDraggingCurrentValue;
|
||||||
int32 fDraggingSplitterIndex;
|
int32 fDraggingSplitterIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _SPLIT_LAYOUT_H
|
#endif // _SPLIT_LAYOUT_H
|
||||||
|
|||||||
Reference in New Issue
Block a user