ArrayCtrl.patch
ArrayCtrl.cpp (working copy) | ||
---|---|---|
1423 | 1423 |
sel = true; |
1424 | 1424 |
} |
1425 | 1425 |
if(dosel && multiselect) { |
1426 |
ClearSelection(); |
|
1426 |
ClearSelection(false);
|
|
1427 | 1427 |
anchor = cursor; |
1428 |
Select(cursor); |
|
1428 |
Select(cursor, true, false);
|
|
1429 | 1429 |
sel = true; |
1430 | 1430 |
} |
1431 | 1431 |
if(sel) |
... | ... | |
1489 | 1489 |
return selectcount; |
1490 | 1490 |
} |
1491 | 1491 | |
1492 |
void ArrayCtrl::Select(int i, bool sel) |
|
1492 |
void ArrayCtrl::Select(int i, bool sel, bool raise)
|
|
1493 | 1493 |
{ |
1494 | 1494 |
array.At(i).select = sel; |
1495 | 1495 |
selectiondirty = true; |
1496 | 1496 |
RefreshRow(i); |
1497 |
WhenSelection(); |
|
1498 |
WhenSel(); |
|
1497 |
if(raise) { |
|
1498 |
WhenSelection(); |
|
1499 |
WhenSel(); |
|
1500 |
} |
|
1499 | 1501 |
SyncInfo(); |
1500 | 1502 |
} |
1501 | 1503 | |
... | ... | |
1541 | 1543 |
SyncInfo(); |
1542 | 1544 |
} |
1543 | 1545 | |
1544 |
void ArrayCtrl::ClearSelection() |
|
1546 |
void ArrayCtrl::ClearSelection(bool raise)
|
|
1545 | 1547 |
{ |
1546 | 1548 |
if(IsSelection()) { |
1547 | 1549 |
for(int i = 0; i < array.GetCount(); i++) |
... | ... | |
1551 | 1553 |
} |
1552 | 1554 |
selectiondirty = false; |
1553 | 1555 |
selectcount = 0; |
1554 |
WhenSelection(); |
|
1555 |
WhenSel(); |
|
1556 |
if(raise) { |
|
1557 |
WhenSelection(); |
|
1558 |
WhenSel(); |
|
1559 |
} |
|
1556 | 1560 |
SyncInfo(); |
1557 | 1561 |
} |
1558 | 1562 |
} |
... | ... | |
1650 | 1654 |
{ |
1651 | 1655 |
if(cursor >= 0 && multiselect) { |
1652 | 1656 |
if(flags & K_CTRL) { |
1653 |
Select(cursor, !IsSelected(cursor)); |
|
1657 |
Select(cursor, !IsSelected(cursor), false);
|
|
1654 | 1658 |
anchor = cursor; |
1655 | 1659 |
} |
1656 | 1660 |
else { |
1657 |
ClearSelection(); |
|
1661 |
ClearSelection(false);
|
|
1658 | 1662 |
if((flags & K_SHIFT) && anchor >= 0) |
1659 | 1663 |
Select(min(anchor, cursor), abs(anchor - cursor) + 1, true); |
1660 | 1664 |
else { |
1661 | 1665 |
anchor = cursor; |
1662 |
Select(cursor, true); |
|
1666 |
Select(cursor, true, false);
|
|
1663 | 1667 |
} |
1664 | 1668 |
} |
1665 | 1669 |
Action(); |
ArrayCtrl.h (working copy) | ||
---|---|---|
452 | 452 | |
453 | 453 |
int GetSelectCount() const; |
454 | 454 |
bool IsSelection() const { return GetSelectCount(); } |
455 |
void Select(int i, bool sel = true); |
|
455 |
void Select(int i, bool sel = true, bool raise = true);
|
|
456 | 456 |
void Select(int i, int count, bool sel = true); |
457 | 457 |
bool IsSelected(int i) const { return i < array.GetCount() && array[i].select; } |
458 |
void ClearSelection(); |
|
458 |
void ClearSelection(bool raise = true);
|
|
459 | 459 |
bool IsSel(int i) const; |
460 | 460 |
Vector<int> GetSelKeys() const; |
461 | 461 |