Remove BALMLayout::Add*To* methods, which are availabe in the builder.
This commit is contained in:
@@ -75,10 +75,6 @@ public:
|
|||||||
Area* AreaFor(const BLayoutItem* item) const;
|
Area* AreaFor(const BLayoutItem* item) const;
|
||||||
int32 CountAreas() const;
|
int32 CountAreas() const;
|
||||||
Area* AreaAt(int32 index) const;
|
Area* AreaAt(int32 index) const;
|
||||||
Area* CurrentArea() const;
|
|
||||||
bool SetCurrentArea(const Area* area);
|
|
||||||
bool SetCurrentArea(const BView* view);
|
|
||||||
bool SetCurrentArea(const BLayoutItem* item);
|
|
||||||
|
|
||||||
XTab* LeftOf(const BView* view) const;
|
XTab* LeftOf(const BView* view) const;
|
||||||
XTab* LeftOf(const BLayoutItem* item) const;
|
XTab* LeftOf(const BLayoutItem* item) const;
|
||||||
@@ -98,15 +94,6 @@ public:
|
|||||||
virtual Area* AddView(BView* view, XTab* left, YTab* top,
|
virtual Area* AddView(BView* view, XTab* left, YTab* top,
|
||||||
XTab* right = NULL, YTab* bottom = NULL);
|
XTab* right = NULL, YTab* bottom = NULL);
|
||||||
virtual Area* AddView(BView* view, Row* row, Column* column);
|
virtual Area* AddView(BView* view, Row* row, Column* column);
|
||||||
virtual Area* AddViewToRight(BView* view, XTab* right = NULL,
|
|
||||||
YTab* top = NULL, YTab* bottom = NULL);
|
|
||||||
virtual Area* AddViewToLeft(BView* view, XTab* left = NULL,
|
|
||||||
YTab* top = NULL, YTab* bottom = NULL);
|
|
||||||
virtual Area* AddViewToTop(BView* view, YTab* top = NULL,
|
|
||||||
XTab* left = NULL, XTab* right = NULL);
|
|
||||||
virtual Area* AddViewToBottom(BView* view,
|
|
||||||
YTab* bottom = NULL, XTab* left = NULL,
|
|
||||||
XTab* right = NULL);
|
|
||||||
|
|
||||||
virtual bool AddItem(BLayoutItem* item);
|
virtual bool AddItem(BLayoutItem* item);
|
||||||
virtual bool AddItem(int32 index, BLayoutItem* item);
|
virtual bool AddItem(int32 index, BLayoutItem* item);
|
||||||
@@ -116,19 +103,6 @@ public:
|
|||||||
virtual Area* AddItem(BLayoutItem* item, Row* row,
|
virtual Area* AddItem(BLayoutItem* item, Row* row,
|
||||||
Column* column);
|
Column* column);
|
||||||
|
|
||||||
virtual Area* AddItemToRight(BLayoutItem* item,
|
|
||||||
XTab* right = NULL, YTab* top = NULL,
|
|
||||||
YTab* bottom = NULL);
|
|
||||||
virtual Area* AddItemToLeft(BLayoutItem* item,
|
|
||||||
XTab* left = NULL, YTab* top = NULL,
|
|
||||||
YTab* bottom = NULL);
|
|
||||||
virtual Area* AddItemToTop(BLayoutItem* item,
|
|
||||||
YTab* top = NULL, XTab* left = NULL,
|
|
||||||
XTab* right = NULL);
|
|
||||||
virtual Area* AddItemToBottom(BLayoutItem* item,
|
|
||||||
YTab* bottom = NULL, XTab* left = NULL,
|
|
||||||
XTab* right = NULL);
|
|
||||||
|
|
||||||
bool SaveLayout(BMessage* archive) const;
|
bool SaveLayout(BMessage* archive) const;
|
||||||
bool RestoreLayout(const BMessage* archive);
|
bool RestoreLayout(const BMessage* archive);
|
||||||
|
|
||||||
@@ -184,8 +158,6 @@ private:
|
|||||||
float fHSpacing;
|
float fHSpacing;
|
||||||
float fVSpacing;
|
float fVSpacing;
|
||||||
|
|
||||||
Area* fCurrentArea;
|
|
||||||
|
|
||||||
XTabList fXTabList;
|
XTabList fXTabList;
|
||||||
YTabList fYTabList;
|
YTabList fYTabList;
|
||||||
|
|
||||||
|
|||||||
+1
-176
@@ -36,8 +36,7 @@ BALMLayout::BALMLayout(float hSpacing, float vSpacing, BALMLayout* friendLayout)
|
|||||||
fTopInset(0),
|
fTopInset(0),
|
||||||
fBottomInset(0),
|
fBottomInset(0),
|
||||||
fHSpacing(hSpacing),
|
fHSpacing(hSpacing),
|
||||||
fVSpacing(vSpacing),
|
fVSpacing(vSpacing)
|
||||||
fCurrentArea(NULL)
|
|
||||||
{
|
{
|
||||||
fSolver = friendLayout ? friendLayout->Solver() : &fOwnSolver;
|
fSolver = friendLayout ? friendLayout->Solver() : &fOwnSolver;
|
||||||
fRowColumnManager = new RowColumnManager(fSolver);
|
fRowColumnManager = new RowColumnManager(fSolver);
|
||||||
@@ -275,43 +274,6 @@ BALMLayout::AreaAt(int32 index) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::CurrentArea() const
|
|
||||||
{
|
|
||||||
return fCurrentArea;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
BALMLayout::SetCurrentArea(const Area* area)
|
|
||||||
{
|
|
||||||
fCurrentArea = const_cast<Area*>(area);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
BALMLayout::SetCurrentArea(const BView* view)
|
|
||||||
{
|
|
||||||
Area* area = AreaFor(view);
|
|
||||||
if (!area)
|
|
||||||
return false;
|
|
||||||
fCurrentArea = area;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
BALMLayout::SetCurrentArea(const BLayoutItem* item)
|
|
||||||
{
|
|
||||||
Area* area = AreaFor(item);
|
|
||||||
if (!area)
|
|
||||||
return false;
|
|
||||||
fCurrentArea = area;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
XTab*
|
XTab*
|
||||||
BALMLayout::LeftOf(const BView* view) const
|
BALMLayout::LeftOf(const BView* view) const
|
||||||
{
|
{
|
||||||
@@ -500,62 +462,6 @@ BALMLayout::AddView(BView* view, Row* row, Column* column)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddViewToRight(BView* view, XTab* right, YTab* top, YTab* bottom)
|
|
||||||
{
|
|
||||||
BLayoutItem* item = _LayoutItemToAdd(view);
|
|
||||||
Area* area = AddItemToRight(item, right, top, bottom);
|
|
||||||
if (!area) {
|
|
||||||
if (item != view->GetLayout())
|
|
||||||
delete item;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return area;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddViewToLeft(BView* view, XTab* left, YTab* top, YTab* bottom)
|
|
||||||
{
|
|
||||||
BLayoutItem* item = _LayoutItemToAdd(view);
|
|
||||||
Area* area = AddItemToLeft(item, left, top, bottom);
|
|
||||||
if (!area) {
|
|
||||||
if (item != view->GetLayout())
|
|
||||||
delete item;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return area;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddViewToTop(BView* view, YTab* top, XTab* left, XTab* right)
|
|
||||||
{
|
|
||||||
BLayoutItem* item = _LayoutItemToAdd(view);
|
|
||||||
Area* area = AddItemToTop(item, top, left, right);
|
|
||||||
if (!area) {
|
|
||||||
if (item != view->GetLayout())
|
|
||||||
delete item;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return area;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddViewToBottom(BView* view, YTab* bottom, XTab* left, XTab* right)
|
|
||||||
{
|
|
||||||
BLayoutItem* item = _LayoutItemToAdd(view);
|
|
||||||
Area* area = AddItemToBottom(item, bottom, left, right);
|
|
||||||
if (!area) {
|
|
||||||
if (item != view->GetLayout())
|
|
||||||
delete item;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return area;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BALMLayout::AddItem(BLayoutItem* item)
|
BALMLayout::AddItem(BLayoutItem* item)
|
||||||
{
|
{
|
||||||
@@ -609,7 +515,6 @@ BALMLayout::AddItem(BLayoutItem* item, XTab* left, YTab* top, XTab* _right,
|
|||||||
Area* area = AreaFor(item);
|
Area* area = AreaFor(item);
|
||||||
if (!area)
|
if (!area)
|
||||||
return NULL;
|
return NULL;
|
||||||
fCurrentArea = area;
|
|
||||||
|
|
||||||
area->_Init(fSolver, left, top, right, bottom, fRowColumnManager);
|
area->_Init(fSolver, left, top, right, bottom, fRowColumnManager);
|
||||||
|
|
||||||
@@ -626,7 +531,6 @@ BALMLayout::AddItem(BLayoutItem* item, Row* row, Column* column)
|
|||||||
Area* area = AreaFor(item);
|
Area* area = AreaFor(item);
|
||||||
if (!area)
|
if (!area)
|
||||||
return NULL;
|
return NULL;
|
||||||
fCurrentArea = area;
|
|
||||||
|
|
||||||
area->_Init(fSolver, row, column, fRowColumnManager);
|
area->_Init(fSolver, row, column, fRowColumnManager);
|
||||||
|
|
||||||
@@ -635,85 +539,6 @@ BALMLayout::AddItem(BLayoutItem* item, Row* row, Column* column)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddItemToRight(BLayoutItem* item, XTab* _right, YTab* top,
|
|
||||||
YTab* bottom)
|
|
||||||
{
|
|
||||||
if (fCurrentArea == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
XTab* left = fCurrentArea->Right();
|
|
||||||
BReference<XTab> right = _right;
|
|
||||||
if (_right == NULL)
|
|
||||||
right = AddXTab();
|
|
||||||
if (!top)
|
|
||||||
top = fCurrentArea->Top();
|
|
||||||
if (!bottom)
|
|
||||||
bottom = fCurrentArea->Bottom();
|
|
||||||
|
|
||||||
return AddItem(item, left, top, right, bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddItemToLeft(BLayoutItem* item, XTab* _left, YTab* top,
|
|
||||||
YTab* bottom)
|
|
||||||
{
|
|
||||||
if (fCurrentArea == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
BReference<XTab> left = _left;
|
|
||||||
if (_left == NULL)
|
|
||||||
left = AddXTab();
|
|
||||||
XTab* right = fCurrentArea->Left();
|
|
||||||
if (!top)
|
|
||||||
top = fCurrentArea->Top();
|
|
||||||
if (!bottom)
|
|
||||||
bottom = fCurrentArea->Bottom();
|
|
||||||
|
|
||||||
return AddItem(item, left, top, right, bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddItemToTop(BLayoutItem* item, YTab* _top, XTab* left, XTab* right)
|
|
||||||
{
|
|
||||||
if (fCurrentArea == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (!left)
|
|
||||||
left = fCurrentArea->Left();
|
|
||||||
if (!right)
|
|
||||||
right = fCurrentArea->Right();
|
|
||||||
BReference<YTab> top = _top;
|
|
||||||
if (_top == NULL)
|
|
||||||
top = AddYTab();
|
|
||||||
YTab* bottom = fCurrentArea->Top();
|
|
||||||
|
|
||||||
return AddItem(item, left, top, right, bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Area*
|
|
||||||
BALMLayout::AddItemToBottom(BLayoutItem* item, YTab* _bottom, XTab* left,
|
|
||||||
XTab* right)
|
|
||||||
{
|
|
||||||
if (fCurrentArea == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (!left)
|
|
||||||
left = fCurrentArea->Left();
|
|
||||||
if (!right)
|
|
||||||
right = fCurrentArea->Right();
|
|
||||||
YTab* top = fCurrentArea->Bottom();
|
|
||||||
BReference<YTab> bottom = _bottom;
|
|
||||||
if (_bottom == NULL)
|
|
||||||
bottom = AddYTab();
|
|
||||||
|
|
||||||
return AddItem(item, left, top, right, bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kLeftBorderIndex = -2,
|
kLeftBorderIndex = -2,
|
||||||
kTopBorderIndex = -3,
|
kTopBorderIndex = -3,
|
||||||
|
|||||||
Reference in New Issue
Block a user