mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Implement unique IDs and card linking
This commit is contained in:
@@ -79,7 +79,7 @@ void ItemList::selectItem(const VoidP& item, bool focus, bool event) {
|
||||
focusNone();
|
||||
}
|
||||
selected_item = item;
|
||||
if (event) sendEvent();
|
||||
if (event) sendEvent(); // sending an event will trigger a UI update
|
||||
findSelectedItemPos();
|
||||
if (focus) focusSelectedItem();
|
||||
}
|
||||
@@ -111,6 +111,14 @@ void ItemList::findSelectedItemPos() {
|
||||
}
|
||||
}
|
||||
}
|
||||
long ItemList::findGivenItemPos(const VoidP& item) {
|
||||
long count = GetItemCount();
|
||||
for (long pos = 0; pos < count; ++pos) {
|
||||
if (getItem(pos) == item) {
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
void ItemList::focusSelectedItem(bool force_focus) {
|
||||
if (GetItemCount() > 0) {
|
||||
if (selected_item_pos == -1 || (size_t)selected_item_pos > sorted_list.size()) {
|
||||
|
||||
Reference in New Issue
Block a user