Add IndexOf methods.
This commit is contained in:
parent
15ef732f0d
commit
d7568eabd2
@ -50,6 +50,8 @@ public:
|
||||
int32 CountYTabs() const;
|
||||
XTab* XTabAt(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);
|
||||
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
|
||||
CompareXTabFunc(const XTab* tab1, const XTab* tab2)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user