Add Select All functionality, closes #19

This commit is contained in:
Twan van Laarhoven
2020-05-08 01:54:51 +02:00
parent 8b25815f72
commit 2d171732a0
21 changed files with 291 additions and 209 deletions
+9
View File
@@ -40,6 +40,9 @@ bool ItemList::canSelectPrevious() const {
bool ItemList::canSelectNext() const {
return selected_item_pos >= 0 && static_cast<size_t>(selected_item_pos + 1) < sorted_list.size();
}
bool ItemList::canSelectAll() const {
return sorted_list.size() > 0 && !(GetWindowStyle() & wxLC_SINGLE_SEL);
}
void ItemList::selectPrevious() {
assert(selected_item_pos >= 1);
focusNone();
@@ -54,6 +57,12 @@ void ItemList::selectFirst() {
if (sorted_list.empty()) return;
selectItemPos(0, true);
}
void ItemList::doSelectAll() {
long count = GetItemCount();
for (long pos = 0; pos < count; ++pos) {
Select(pos,true);
}
}
bool ItemList::doCut() {
// cut = copy + delete