mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlLib: ArrayCtrl::SortingFrom, GateN issues
git-svn-id: svn://ultimatepp.org/upp/trunk@10653 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
88e74b4bab
commit
42c006416c
4 changed files with 22 additions and 19 deletions
|
|
@ -2416,22 +2416,6 @@ void ArrayCtrl::ReArrange(const Vector<int>& order)
|
|||
SyncInfo();
|
||||
}
|
||||
|
||||
void ArrayCtrl::Sort(const ArrayCtrl::Order& order) {
|
||||
KillCursor();
|
||||
ClearSelection();
|
||||
ClearCache();
|
||||
SortPredicate sp;
|
||||
sp.order = ℴ
|
||||
if(ln.GetCount() || cellinfo.GetCount()) {
|
||||
SortA();
|
||||
SortB(GetStableSortOrder(array, sp));
|
||||
}
|
||||
else
|
||||
StableSort(array, sp);
|
||||
Refresh();
|
||||
SyncInfo();
|
||||
}
|
||||
|
||||
void ArrayCtrl::Sort(int from, int count, Gate2<int, int> order)
|
||||
{
|
||||
KillCursor();
|
||||
|
|
@ -2449,7 +2433,8 @@ void ArrayCtrl::Sort(int from, int count, Gate2<int, int> order)
|
|||
|
||||
void ArrayCtrl::Sort(Gate2<int, int> order)
|
||||
{
|
||||
Sort(0, array.GetCount(), order);
|
||||
if(sorting_from < array.GetCount())
|
||||
Sort(sorting_from, array.GetCount() - sorting_from, order);
|
||||
}
|
||||
|
||||
bool ArrayCtrl::OrderPred(int i1, int i2, const ArrayCtrl::Order *o)
|
||||
|
|
@ -2462,6 +2447,12 @@ void ArrayCtrl::Sort(int from, int count, const ArrayCtrl::Order& order)
|
|||
Sort(from, count, THISBACK1(OrderPred, &order));
|
||||
}
|
||||
|
||||
void ArrayCtrl::Sort(const ArrayCtrl::Order& order)
|
||||
{
|
||||
if(sorting_from < array.GetCount())
|
||||
Sort(sorting_from, array.GetCount() - sorting_from, order);
|
||||
}
|
||||
|
||||
struct sAC_ColumnSort : public ValueOrder {
|
||||
bool descending;
|
||||
const ValueOrder *order;
|
||||
|
|
@ -2687,6 +2678,7 @@ void ArrayCtrl::Reset() {
|
|||
Clear();
|
||||
sb.SetLine(linecy);
|
||||
columnsortsecondary = NULL;
|
||||
sorting_from = 0;
|
||||
min_visible_line = 0;
|
||||
max_visible_line = INT_MAX;
|
||||
ctrl_low = ctrl_high = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue