ArrayCtrl: Alternate Sort predicate

git-svn-id: svn://ultimatepp.org/upp/trunk@7277 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-18 11:13:11 +00:00
commit bf27e1b34f
4 changed files with 109 additions and 24 deletions

View file

@ -69,6 +69,7 @@ public:
mutable Any cache;
const ValueOrder *order;
int (*cmp)(const Value& a, const Value& b);
Gate2<int, int> line_order;
void InvalidateCache(int i);
@ -108,6 +109,7 @@ public:
Column& Sorting(const ValueOrder& o);
Column& Sorting(int (*c)(const Value& a, const Value& b));
Column& Sorting(Gate2<int, int> order);
Column& Sorting();
Column& SortDefault();
@ -311,6 +313,9 @@ private:
void DnD(int line, int col);
enum { DND_INSERTLINE = -1, DND_LINE = -2 };
bool ColumnSortPred(int i1, int i2, int column, const ValueOrder *o);
bool OrderPred(int i1, int i2, const ArrayCtrl::Order *o);
bool DescendingPred(int i1, int i2, const Gate2<int, int> *pred);
void SyncInfo();
void SortA();
void SortB(const Vector<int>& o);
@ -509,6 +514,8 @@ public:
bool FindSetCursor(const Value& val, int ii = 0, int from = 0);
bool FindSetCursor(const Value& val, const Id& id, int from = 0);
void Sort(Gate2<int, int> order);
void Sort(int from, int count, Gate2<int, int> order);
void Sort(const ArrayCtrl::Order& order);
void Sort(int from, int count, const ArrayCtrl::Order& order);
void Sort(int (*compare)(const Vector<Value>& v1, const Vector<Value>& v2));
@ -520,6 +527,7 @@ public:
= StdValueCompare);
void Sort() { Sort(0); }
void ColumnSort(int column, Gate2<int, int> order);
void ColumnSort(int column, const ValueOrder& order);
void SetSortColumn(int ii, bool descending = false);