35 if (Size == 0)
return -1;
38 const int focused_idx =
39 (int)ms_io->NavIdItem;
40 if (ms_io->NavIdSelected ==
44 ms_io->RangeSrcReset =
54 for (
int idx = focused_idx + 1; idx < items_count; idx++)
55 if (!Contains(GetStorageIdFromIndex(idx)))
return idx;
59 for (
int idx =
IM_MIN(focused_idx, items_count) - 1; idx >= 0; idx--)
60 if (!Contains(GetStorageIdFromIndex(idx)))
return idx;
71 ImVector<ITEM_TYPE>& items,
72 int item_curr_idx_to_select) {
76 ImVector<ITEM_TYPE> new_items;
77 new_items.reserve(items.Size - Size);
78 int item_next_idx_to_select = -1;
79 for (
int idx = 0; idx < items.Size; idx++) {
80 if (!Contains(GetStorageIdFromIndex(idx)))
81 new_items.push_back(items[idx]);
82 if (item_curr_idx_to_select == idx)
83 item_next_idx_to_select = new_items.Size - 1;
85 items.swap(new_items);
89 if (item_next_idx_to_select != -1 && ms_io->NavIdSelected)
90 SetItemSelected(GetStorageIdFromIndex(item_next_idx_to_select),
true);