Make tabs BReferenceable. Maintain a list of tabs.
This commit is contained in:
@@ -35,12 +35,16 @@ public:
|
|||||||
BALMLayout* friendLayout = NULL);
|
BALMLayout* friendLayout = NULL);
|
||||||
virtual ~BALMLayout();
|
virtual ~BALMLayout();
|
||||||
|
|
||||||
XTab* AddXTab();
|
BReference<XTab> AddXTab();
|
||||||
YTab* AddYTab();
|
BReference<YTab> AddYTab();
|
||||||
|
|
||||||
int32 CountXTabs() const;
|
int32 CountXTabs() const;
|
||||||
int32 CountYTabs() const;
|
int32 CountYTabs() const;
|
||||||
XTab* XTabAt(int32 index) const;
|
XTab* XTabAt(int32 index) const;
|
||||||
YTab* YTabAt(int32 index) const;
|
YTab* YTabAt(int32 index) const;
|
||||||
|
/*! Order the tab list and return a reference to the list. */
|
||||||
|
const XTabList& OrderedXTabs();
|
||||||
|
const YTabList& OrderedYTabs();
|
||||||
|
|
||||||
Row* AddRow(YTab* top, YTab* bottom);
|
Row* AddRow(YTab* top, YTab* bottom);
|
||||||
Column* AddColumn(XTab* left, XTab* right);
|
Column* AddColumn(XTab* left, XTab* right);
|
||||||
@@ -104,6 +108,7 @@ public:
|
|||||||
YTab* bottom = NULL);
|
YTab* bottom = NULL);
|
||||||
virtual Area* AddItem(BLayoutItem* item, Row* row,
|
virtual Area* AddItem(BLayoutItem* item, Row* row,
|
||||||
Column* column);
|
Column* column);
|
||||||
|
|
||||||
virtual Area* AddItemToRight(BLayoutItem* item,
|
virtual Area* AddItemToRight(BLayoutItem* item,
|
||||||
XTab* right = NULL, YTab* top = NULL,
|
XTab* right = NULL, YTab* top = NULL,
|
||||||
YTab* bottom = NULL);
|
YTab* bottom = NULL);
|
||||||
@@ -129,6 +134,9 @@ public:
|
|||||||
virtual void DerivedLayoutItems();
|
virtual void DerivedLayoutItems();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class XTab;
|
||||||
|
friend class YTab;
|
||||||
|
|
||||||
/*! Add a view without initialize the Area. */
|
/*! Add a view without initialize the Area. */
|
||||||
BLayoutItem* _CreateLayoutItem(BView* view);
|
BLayoutItem* _CreateLayoutItem(BView* view);
|
||||||
|
|
||||||
@@ -138,16 +146,18 @@ private:
|
|||||||
BSize _CalculateMaxSize();
|
BSize _CalculateMaxSize();
|
||||||
BSize _CalculatePreferredSize();
|
BSize _CalculatePreferredSize();
|
||||||
|
|
||||||
void _ParseGroupItem(GroupItem& item, XTab* left,
|
void _ParseGroupItem(GroupItem& item,
|
||||||
YTab* top, XTab* right, YTab* bottom);
|
BReference<XTab> left, BReference<YTab> top,
|
||||||
|
BReference<XTab> right,
|
||||||
|
BReference<YTab> bottom);
|
||||||
|
|
||||||
LinearSpec* fSolver;
|
LinearSpec* fSolver;
|
||||||
LinearSpec fOwnSolver;
|
LinearSpec fOwnSolver;
|
||||||
|
|
||||||
XTab* fLeft;
|
BReference<XTab> fLeft;
|
||||||
XTab* fRight;
|
BReference<XTab> fRight;
|
||||||
YTab* fTop;
|
BReference<YTab> fTop;
|
||||||
YTab* fBottom;
|
BReference<YTab> fBottom;
|
||||||
BSize fMinSize;
|
BSize fMinSize;
|
||||||
BSize fMaxSize;
|
BSize fMaxSize;
|
||||||
BSize fPreferredSize;
|
BSize fPreferredSize;
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ public:
|
|||||||
|
|
||||||
void InvalidateSizeConstraints();
|
void InvalidateSizeConstraints();
|
||||||
|
|
||||||
BRect Frame();
|
BRect Frame() const;
|
||||||
BRect ItemFrame();
|
BRect ItemFrame() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Area(BLayoutItem* item);
|
Area(BLayoutItem* item);
|
||||||
@@ -124,10 +124,10 @@ private:
|
|||||||
|
|
||||||
LinearSpec* fLS;
|
LinearSpec* fLS;
|
||||||
|
|
||||||
XTab* fLeft;
|
BReference<XTab> fLeft;
|
||||||
XTab* fRight;
|
BReference<XTab> fRight;
|
||||||
YTab* fTop;
|
BReference<YTab> fTop;
|
||||||
YTab* fBottom;
|
BReference<YTab> fBottom;
|
||||||
|
|
||||||
Row* fRow;
|
Row* fRow;
|
||||||
Column* fColumn;
|
Column* fColumn;
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ private:
|
|||||||
Column(LinearSpec* ls, XTab* left, XTab* right);
|
Column(LinearSpec* ls, XTab* left, XTab* right);
|
||||||
|
|
||||||
LinearSpec* fLS;
|
LinearSpec* fLS;
|
||||||
XTab* fLeft;
|
BReference<XTab> fLeft;
|
||||||
XTab* fRight;
|
BReference<XTab> fRight;
|
||||||
|
|
||||||
//! managed by RowColumnManager
|
//! managed by RowColumnManager
|
||||||
Constraint* fPrefSizeConstraint;
|
Constraint* fPrefSizeConstraint;
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ private:
|
|||||||
Row(LinearSpec* ls, YTab* top, YTab* bottom);
|
Row(LinearSpec* ls, YTab* top, YTab* bottom);
|
||||||
|
|
||||||
LinearSpec* fLS;
|
LinearSpec* fLS;
|
||||||
YTab* fTop;
|
BReference<YTab> fTop;
|
||||||
YTab* fBottom;
|
BReference<YTab> fBottom;
|
||||||
|
|
||||||
//! managed by RowColumnManager
|
//! managed by RowColumnManager
|
||||||
Constraint* fPrefSizeConstraint;
|
Constraint* fPrefSizeConstraint;
|
||||||
|
|||||||
+22
-18
@@ -6,6 +6,7 @@
|
|||||||
#define X_TAB_H
|
#define X_TAB_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <Referenceable.h>
|
||||||
#include "LinearSpec.h"
|
#include "LinearSpec.h"
|
||||||
#include "Variable.h"
|
#include "Variable.h"
|
||||||
|
|
||||||
@@ -13,34 +14,37 @@
|
|||||||
namespace BALM {
|
namespace BALM {
|
||||||
|
|
||||||
|
|
||||||
|
class BALMLayout;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vertical grid line (x-tab).
|
* Vertical grid line (x-tab).
|
||||||
*/
|
*/
|
||||||
class XTab : public Variable {
|
class XTab : public Variable, public BReferenceable {
|
||||||
protected:
|
|
||||||
XTab(LinearSpec* ls)
|
|
||||||
:
|
|
||||||
Variable(ls)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual ~XTab();
|
||||||
|
|
||||||
friend class BALMLayout;
|
friend class BALMLayout;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
XTab(BALMLayout* layout);
|
||||||
|
|
||||||
|
private:
|
||||||
|
BALMLayout* fALMLayout;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class YTab : public Variable {
|
class YTab : public Variable, public BReferenceable {
|
||||||
protected:
|
|
||||||
YTab(LinearSpec* ls)
|
|
||||||
:
|
|
||||||
Variable(ls)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual ~YTab();
|
||||||
|
|
||||||
friend class BALMLayout;
|
friend class BALMLayout;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
YTab(BALMLayout* layout);
|
||||||
|
|
||||||
|
private:
|
||||||
|
BALMLayout* fALMLayout;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+83
-38
@@ -68,16 +68,14 @@ BALMLayout::~BALMLayout()
|
|||||||
*
|
*
|
||||||
* @return the new x-tab
|
* @return the new x-tab
|
||||||
*/
|
*/
|
||||||
XTab*
|
BReference<XTab>
|
||||||
BALMLayout::AddXTab()
|
BALMLayout::AddXTab()
|
||||||
{
|
{
|
||||||
XTab* tab = new(std::nothrow) XTab(fSolver);
|
BReference<XTab> tab(new(std::nothrow) XTab(this), true);
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!fSolver->AddVariable(tab)) {
|
if (!fSolver->AddVariable(tab))
|
||||||
delete tab;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
fXTabList.AddItem(tab);
|
fXTabList.AddItem(tab);
|
||||||
return tab;
|
return tab;
|
||||||
@@ -89,16 +87,14 @@ BALMLayout::AddXTab()
|
|||||||
*
|
*
|
||||||
* @return the new y-tab
|
* @return the new y-tab
|
||||||
*/
|
*/
|
||||||
YTab*
|
BReference<YTab>
|
||||||
BALMLayout::AddYTab()
|
BALMLayout::AddYTab()
|
||||||
{
|
{
|
||||||
YTab* tab = new(std::nothrow) YTab(fSolver);
|
BReference<YTab> tab(new(std::nothrow) YTab(this), true);
|
||||||
if (!tab)
|
if (tab.Get() == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!fSolver->AddVariable(tab)) {
|
if (!fSolver->AddVariable(tab))
|
||||||
delete tab;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
fYTabList.AddItem(tab);
|
fYTabList.AddItem(tab);
|
||||||
return tab;
|
return tab;
|
||||||
@@ -133,6 +129,45 @@ BALMLayout::YTabAt(int32 index) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
CompareXTabFunc(const XTab* tab1, const XTab* tab2)
|
||||||
|
{
|
||||||
|
if (tab1->Value() < tab2->Value())
|
||||||
|
return -1;
|
||||||
|
else if (tab1->Value() == tab2->Value())
|
||||||
|
return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
CompareYTabFunc(const YTab* tab1, const YTab* tab2)
|
||||||
|
{
|
||||||
|
if (tab1->Value() < tab2->Value())
|
||||||
|
return -1;
|
||||||
|
else if (tab1->Value() == tab2->Value())
|
||||||
|
return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const XTabList&
|
||||||
|
BALMLayout::OrderedXTabs()
|
||||||
|
{
|
||||||
|
fXTabList.SortItems(CompareXTabFunc);
|
||||||
|
return fXTabList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const YTabList&
|
||||||
|
BALMLayout::OrderedYTabs()
|
||||||
|
{
|
||||||
|
fYTabList.SortItems(CompareYTabFunc);
|
||||||
|
return fYTabList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new row to the specification that is glued to the given y-tabs.
|
* Adds a new row to the specification that is glued to the given y-tabs.
|
||||||
*
|
*
|
||||||
@@ -141,11 +176,13 @@ BALMLayout::YTabAt(int32 index) const
|
|||||||
* @return the new row
|
* @return the new row
|
||||||
*/
|
*/
|
||||||
Row*
|
Row*
|
||||||
BALMLayout::AddRow(YTab* top, YTab* bottom)
|
BALMLayout::AddRow(YTab* _top, YTab* _bottom)
|
||||||
{
|
{
|
||||||
if (top == NULL)
|
BReference<YTab> top = _top;
|
||||||
|
BReference<YTab> bottom = _bottom;
|
||||||
|
if (_top == NULL)
|
||||||
top = AddYTab();
|
top = AddYTab();
|
||||||
if (bottom == NULL)
|
if (_bottom == NULL)
|
||||||
bottom = AddYTab();
|
bottom = AddYTab();
|
||||||
return new(std::nothrow) Row(fSolver, top, bottom);
|
return new(std::nothrow) Row(fSolver, top, bottom);
|
||||||
}
|
}
|
||||||
@@ -159,11 +196,13 @@ BALMLayout::AddRow(YTab* top, YTab* bottom)
|
|||||||
* @return the new column
|
* @return the new column
|
||||||
*/
|
*/
|
||||||
Column*
|
Column*
|
||||||
BALMLayout::AddColumn(XTab* left, XTab* right)
|
BALMLayout::AddColumn(XTab* _left, XTab* _right)
|
||||||
{
|
{
|
||||||
if (left == NULL)
|
BReference<XTab> left = _left;
|
||||||
|
BReference<XTab> right = _right;
|
||||||
|
if (_left == NULL)
|
||||||
left = AddXTab();
|
left = AddXTab();
|
||||||
if (right == NULL)
|
if (_right == NULL)
|
||||||
right = AddXTab();
|
right = AddXTab();
|
||||||
return new(std::nothrow) Column(fSolver, left, right);
|
return new(std::nothrow) Column(fSolver, left, right);
|
||||||
}
|
}
|
||||||
@@ -319,13 +358,13 @@ void
|
|||||||
BALMLayout::BuildLayout(GroupItem& item, XTab* left, YTab* top, XTab* right,
|
BALMLayout::BuildLayout(GroupItem& item, XTab* left, YTab* top, XTab* right,
|
||||||
YTab* bottom)
|
YTab* bottom)
|
||||||
{
|
{
|
||||||
if (!left)
|
if (left == NULL)
|
||||||
left = Left();
|
left = Left();
|
||||||
if (!top)
|
if (top == NULL)
|
||||||
top = Top();
|
top = Top();
|
||||||
if (!right)
|
if (right == NULL)
|
||||||
right = Right();
|
right = Right();
|
||||||
if (!bottom)
|
if (bottom == NULL)
|
||||||
bottom = Bottom();
|
bottom = Bottom();
|
||||||
|
|
||||||
_ParseGroupItem(item, left, top, right, bottom);
|
_ParseGroupItem(item, left, top, right, bottom);
|
||||||
@@ -333,8 +372,8 @@ BALMLayout::BuildLayout(GroupItem& item, XTab* left, YTab* top, XTab* right,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BALMLayout::_ParseGroupItem(GroupItem& item, XTab* left, YTab* top, XTab* right,
|
BALMLayout::_ParseGroupItem(GroupItem& item, BReference<XTab> left,
|
||||||
YTab* bottom)
|
BReference<YTab> top, BReference<XTab> right, BReference<YTab> bottom)
|
||||||
{
|
{
|
||||||
if (item.LayoutItem())
|
if (item.LayoutItem())
|
||||||
AddItem(item.LayoutItem(), left, top, right, bottom);
|
AddItem(item.LayoutItem(), left, top, right, bottom);
|
||||||
@@ -346,14 +385,14 @@ BALMLayout::_ParseGroupItem(GroupItem& item, XTab* left, YTab* top, XTab* right,
|
|||||||
GroupItem& current = const_cast<GroupItem&>(
|
GroupItem& current = const_cast<GroupItem&>(
|
||||||
item.GroupItems()[i]);
|
item.GroupItems()[i]);
|
||||||
if (item.Orientation() == B_HORIZONTAL) {
|
if (item.Orientation() == B_HORIZONTAL) {
|
||||||
XTab* r = (i == item.GroupItems().size() - 1) ? right
|
BReference<XTab> r = (i == item.GroupItems().size() - 1) ? right
|
||||||
: AddXTab();
|
: AddXTab();
|
||||||
_ParseGroupItem(current, left, top, r, bottom);
|
_ParseGroupItem(current, left, top, r, bottom);
|
||||||
left = r;
|
left = r;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
YTab* b = (i == item.GroupItems().size() - 1) ? bottom
|
BReference<YTab> b = (i == item.GroupItems().size() - 1)
|
||||||
: AddYTab();
|
? bottom : AddYTab();
|
||||||
_ParseGroupItem(current, left, top, right, b);
|
_ParseGroupItem(current, left, top, right, b);
|
||||||
top = b;
|
top = b;
|
||||||
}
|
}
|
||||||
@@ -510,12 +549,14 @@ BALMLayout::AddItem(int32 index, BLayoutItem* item)
|
|||||||
|
|
||||||
|
|
||||||
Area*
|
Area*
|
||||||
BALMLayout::AddItem(BLayoutItem* item, XTab* left, YTab* top, XTab* right,
|
BALMLayout::AddItem(BLayoutItem* item, XTab* left, YTab* top, XTab* _right,
|
||||||
YTab* bottom)
|
YTab* _bottom)
|
||||||
{
|
{
|
||||||
if (!right)
|
BReference<XTab> right = _right;
|
||||||
|
if (right.Get() == NULL)
|
||||||
right = AddXTab();
|
right = AddXTab();
|
||||||
if (!bottom)
|
BReference<YTab> bottom = _bottom;
|
||||||
|
if (bottom.Get() == NULL)
|
||||||
bottom = AddYTab();
|
bottom = AddYTab();
|
||||||
|
|
||||||
// Area is added int ItemAdded
|
// Area is added int ItemAdded
|
||||||
@@ -551,14 +592,15 @@ BALMLayout::AddItem(BLayoutItem* item, Row* row, Column* column)
|
|||||||
|
|
||||||
|
|
||||||
Area*
|
Area*
|
||||||
BALMLayout::AddItemToRight(BLayoutItem* item, XTab* right, YTab* top,
|
BALMLayout::AddItemToRight(BLayoutItem* item, XTab* _right, YTab* top,
|
||||||
YTab* bottom)
|
YTab* bottom)
|
||||||
{
|
{
|
||||||
if (fCurrentArea == NULL)
|
if (fCurrentArea == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
XTab* left = fCurrentArea->Right();
|
XTab* left = fCurrentArea->Right();
|
||||||
if (!right)
|
BReference<XTab> right = _right;
|
||||||
|
if (_right == NULL)
|
||||||
right = AddXTab();
|
right = AddXTab();
|
||||||
if (!top)
|
if (!top)
|
||||||
top = fCurrentArea->Top();
|
top = fCurrentArea->Top();
|
||||||
@@ -570,13 +612,14 @@ BALMLayout::AddItemToRight(BLayoutItem* item, XTab* right, YTab* top,
|
|||||||
|
|
||||||
|
|
||||||
Area*
|
Area*
|
||||||
BALMLayout::AddItemToLeft(BLayoutItem* item, XTab* left, YTab* top,
|
BALMLayout::AddItemToLeft(BLayoutItem* item, XTab* _left, YTab* top,
|
||||||
YTab* bottom)
|
YTab* bottom)
|
||||||
{
|
{
|
||||||
if (fCurrentArea == NULL)
|
if (fCurrentArea == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!left)
|
BReference<XTab> left = _left;
|
||||||
|
if (_left == NULL)
|
||||||
left = AddXTab();
|
left = AddXTab();
|
||||||
XTab* right = fCurrentArea->Left();
|
XTab* right = fCurrentArea->Left();
|
||||||
if (!top)
|
if (!top)
|
||||||
@@ -589,7 +632,7 @@ BALMLayout::AddItemToLeft(BLayoutItem* item, XTab* left, YTab* top,
|
|||||||
|
|
||||||
|
|
||||||
Area*
|
Area*
|
||||||
BALMLayout::AddItemToTop(BLayoutItem* item, YTab* top, XTab* left, XTab* right)
|
BALMLayout::AddItemToTop(BLayoutItem* item, YTab* _top, XTab* left, XTab* right)
|
||||||
{
|
{
|
||||||
if (fCurrentArea == NULL)
|
if (fCurrentArea == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -598,7 +641,8 @@ BALMLayout::AddItemToTop(BLayoutItem* item, YTab* top, XTab* left, XTab* right)
|
|||||||
left = fCurrentArea->Left();
|
left = fCurrentArea->Left();
|
||||||
if (!right)
|
if (!right)
|
||||||
right = fCurrentArea->Right();
|
right = fCurrentArea->Right();
|
||||||
if (!top)
|
BReference<YTab> top = _top;
|
||||||
|
if (_top == NULL)
|
||||||
top = AddYTab();
|
top = AddYTab();
|
||||||
YTab* bottom = fCurrentArea->Top();
|
YTab* bottom = fCurrentArea->Top();
|
||||||
|
|
||||||
@@ -607,7 +651,7 @@ BALMLayout::AddItemToTop(BLayoutItem* item, YTab* top, XTab* left, XTab* right)
|
|||||||
|
|
||||||
|
|
||||||
Area*
|
Area*
|
||||||
BALMLayout::AddItemToBottom(BLayoutItem* item, YTab* bottom, XTab* left,
|
BALMLayout::AddItemToBottom(BLayoutItem* item, YTab* _bottom, XTab* left,
|
||||||
XTab* right)
|
XTab* right)
|
||||||
{
|
{
|
||||||
if (fCurrentArea == NULL)
|
if (fCurrentArea == NULL)
|
||||||
@@ -618,7 +662,8 @@ BALMLayout::AddItemToBottom(BLayoutItem* item, YTab* bottom, XTab* left,
|
|||||||
if (!right)
|
if (!right)
|
||||||
right = fCurrentArea->Right();
|
right = fCurrentArea->Right();
|
||||||
YTab* top = fCurrentArea->Bottom();
|
YTab* top = fCurrentArea->Bottom();
|
||||||
if (!bottom)
|
BReference<YTab> bottom = _bottom;
|
||||||
|
if (_bottom == NULL)
|
||||||
bottom = AddYTab();
|
bottom = AddYTab();
|
||||||
|
|
||||||
return AddItem(item, left, top, right, bottom);
|
return AddItem(item, left, top, right, bottom);
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ Area::LeftInset() const
|
|||||||
return fTopLeftInset.Width();
|
return fTopLeftInset.Width();
|
||||||
|
|
||||||
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
||||||
if (fLeft == layout->Left())
|
if (fLeft.Get() == layout->Left())
|
||||||
return layout->Inset();
|
return layout->Inset();
|
||||||
return layout->Spacing() / 2;
|
return layout->Spacing() / 2;
|
||||||
}
|
}
|
||||||
@@ -353,7 +353,7 @@ Area::TopInset() const
|
|||||||
return fTopLeftInset.Height();
|
return fTopLeftInset.Height();
|
||||||
|
|
||||||
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
||||||
if (fTop == layout->Top())
|
if (fTop.Get() == layout->Top())
|
||||||
return layout->Inset();
|
return layout->Inset();
|
||||||
return layout->Spacing() / 2;
|
return layout->Spacing() / 2;
|
||||||
}
|
}
|
||||||
@@ -369,7 +369,7 @@ Area::RightInset() const
|
|||||||
return fRightBottomInset.Width();
|
return fRightBottomInset.Width();
|
||||||
|
|
||||||
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
||||||
if (fRight == layout->Right())
|
if (fRight.Get() == layout->Right())
|
||||||
return layout->Inset();
|
return layout->Inset();
|
||||||
return layout->Spacing() / 2;
|
return layout->Spacing() / 2;
|
||||||
}
|
}
|
||||||
@@ -385,7 +385,7 @@ Area::BottomInset() const
|
|||||||
return fRightBottomInset.Height();
|
return fRightBottomInset.Height();
|
||||||
|
|
||||||
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
BALMLayout* layout = static_cast<BALMLayout*>(fLayoutItem->Layout());
|
||||||
if (fBottom == layout->Bottom())
|
if (fBottom.Get() == layout->Bottom())
|
||||||
return layout->Inset();
|
return layout->Inset();
|
||||||
return layout->Spacing() / 2;
|
return layout->Spacing() / 2;
|
||||||
}
|
}
|
||||||
@@ -497,7 +497,7 @@ Area::InvalidateSizeConstraints()
|
|||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
Area::Frame()
|
Area::Frame() const
|
||||||
{
|
{
|
||||||
return BRect(fLeft->Value(), fTop->Value(), fRight->Value(),
|
return BRect(fLeft->Value(), fTop->Value(), fRight->Value(),
|
||||||
fBottom->Value());
|
fBottom->Value());
|
||||||
@@ -505,7 +505,7 @@ Area::Frame()
|
|||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
Area::ItemFrame()
|
Area::ItemFrame() const
|
||||||
{
|
{
|
||||||
return fLayoutItem->Frame();
|
return fLayoutItem->Frame();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ SharedLibrary libalm.so :
|
|||||||
Column.cpp
|
Column.cpp
|
||||||
Row.cpp
|
Row.cpp
|
||||||
RowColumnManager.cpp
|
RowColumnManager.cpp
|
||||||
|
Tab.cpp
|
||||||
:
|
:
|
||||||
liblpsolve55.so liblinprog.a
|
liblpsolve55.so liblinprog.a
|
||||||
be $(TARGET_LIBSTDC++)
|
be $(TARGET_LIBSTDC++)
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ RowColumnManager::_FindRowFor(Area* area)
|
|||||||
{
|
{
|
||||||
for (int32 i = 0; i < fRows.CountItems(); i++) {
|
for (int32 i = 0; i < fRows.CountItems(); i++) {
|
||||||
Row* row = fRows.ItemAt(i);
|
Row* row = fRows.ItemAt(i);
|
||||||
if (row->fTop == area->Top() && row->fBottom == area->Bottom())
|
if (row->fTop.Get() == area->Top()
|
||||||
|
&& row->fBottom.Get() == area->Bottom())
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -120,7 +121,8 @@ RowColumnManager::_FindColumnFor(Area* area)
|
|||||||
{
|
{
|
||||||
for (int32 i = 0; i < fColumns.CountItems(); i++) {
|
for (int32 i = 0; i < fColumns.CountItems(); i++) {
|
||||||
Column* column = fColumns.ItemAt(i);
|
Column* column = fColumns.ItemAt(i);
|
||||||
if (column->fLeft == area->Left() && column->fRight == area->Right())
|
if (column->fLeft.Get() == area->Left()
|
||||||
|
&& column->fRight.Get() == area->Right())
|
||||||
return column;
|
return column;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <Tab.h>
|
||||||
|
|
||||||
|
#include <ALMLayout.h>
|
||||||
|
|
||||||
|
|
||||||
|
XTab::XTab(BALMLayout* layout)
|
||||||
|
:
|
||||||
|
Variable(layout->Solver()),
|
||||||
|
fALMLayout(layout)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
XTab::~XTab()
|
||||||
|
{
|
||||||
|
fALMLayout->fXTabList.RemoveItem(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
YTab::YTab(BALMLayout* layout)
|
||||||
|
:
|
||||||
|
Variable(layout->Solver()),
|
||||||
|
fALMLayout(layout)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
YTab::~YTab()
|
||||||
|
{
|
||||||
|
fALMLayout->fYTabList.RemoveItem(this);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user