Add IndexOf methods.
This commit is contained in:
@@ -50,6 +50,8 @@ public:
|
|||||||
int32 CountYTabs() const;
|
int32 CountYTabs() const;
|
||||||
XTab* XTabAt(int32 index, bool ordered = false);
|
XTab* XTabAt(int32 index, bool ordered = false);
|
||||||
YTab* YTabAt(int32 index, bool ordered = false);
|
YTab* YTabAt(int32 index, bool ordered = false);
|
||||||
|
int32 IndexOf(XTab* tab, bool ordered = false);
|
||||||
|
int32 IndexOf(YTab* tab, bool ordered = false);
|
||||||
|
|
||||||
Row* AddRow(YTab* top, YTab* bottom);
|
Row* AddRow(YTab* top, YTab* bottom);
|
||||||
Column* AddColumn(XTab* left, XTab* right);
|
Column* AddColumn(XTab* left, XTab* right);
|
||||||
|
|||||||
@@ -279,6 +279,30 @@ BALMLayout::YTabAt(int32 index, bool ordered)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int32
|
||||||
|
BALMLayout::IndexOf(XTab* tab, bool ordered)
|
||||||
|
{
|
||||||
|
if (ordered && !fXTabsSorted) {
|
||||||
|
Layout();
|
||||||
|
fXTabList.SortItems(CompareXTabFunc);
|
||||||
|
fXTabsSorted = true;
|
||||||
|
}
|
||||||
|
return fXTabList.IndexOf(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int32
|
||||||
|
BALMLayout::IndexOf(YTab* tab, bool ordered)
|
||||||
|
{
|
||||||
|
if (ordered && !fYTabsSorted) {
|
||||||
|
Layout();
|
||||||
|
fYTabList.SortItems(CompareYTabFunc);
|
||||||
|
fYTabsSorted = true;
|
||||||
|
}
|
||||||
|
return fYTabList.IndexOf(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
CompareXTabFunc(const XTab* tab1, const XTab* tab2)
|
CompareXTabFunc(const XTab* tab1, const XTab* tab2)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user