mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlLib: ArrayCtrl new Sort variant
git-svn-id: svn://ultimatepp.org/upp/trunk@1968 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e7fe6eec1b
commit
ff9af34cd7
2 changed files with 9 additions and 2 deletions
|
|
@ -2261,10 +2261,15 @@ struct ArrayCtrl::RowOrder : public ArrayCtrl::Order {
|
|||
}
|
||||
};
|
||||
|
||||
void ArrayCtrl::Sort(int (*compare)(const Vector<Value>& v1, const Vector<Value>& v2)) {
|
||||
void ArrayCtrl::Sort(int from, int count, int (*compare)(const Vector<Value>& v1, const Vector<Value>& v2))
|
||||
{
|
||||
RowOrder io;
|
||||
io.compare = compare;
|
||||
Sort(io);
|
||||
Sort(from, count, io);
|
||||
}
|
||||
|
||||
void ArrayCtrl::Sort(int (*compare)(const Vector<Value>& v1, const Vector<Value>& v2)) {
|
||||
Sort(0, GetCount(), compare);
|
||||
}
|
||||
|
||||
struct ArrayCtrl::ItemOrder : public ArrayCtrl::Order {
|
||||
|
|
|
|||
|
|
@ -471,6 +471,8 @@ public:
|
|||
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));
|
||||
void Sort(int from, int count,
|
||||
int (*compare)(const Vector<Value>& v1, const Vector<Value>& v2));
|
||||
void Sort(int ii, int (*compare)(const Value& v1, const Value& v2)
|
||||
= StdValueCompare);
|
||||
void Sort(Id id, int (*compare)(const Value& v1, const Value& v2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue