34 if (Size == 0)
return -1;
37 const int focused_idx =
38 (int)ms_io->NavIdItem;
39 if (ms_io->NavIdSelected ==
43 ms_io->RangeSrcReset =
53 for (
int idx = focused_idx + 1; idx < items_count; idx++)
54 if (!Contains(GetStorageIdFromIndex(idx)))
return idx;
58 for (
int idx =
IM_MIN(focused_idx, items_count) - 1; idx >= 0; idx--)
59 if (!Contains(GetStorageIdFromIndex(idx)))
return idx;
70 ImVector<ITEM_TYPE>& items,
71 int item_curr_idx_to_select) {
75 ImVector<ITEM_TYPE> new_items;
76 new_items.reserve(items.Size - Size);
77 int item_next_idx_to_select = -1;
78 for (
int idx = 0; idx < items.Size; idx++) {
79 if (!Contains(GetStorageIdFromIndex(idx)))
80 new_items.push_back(items[idx]);
81 if (item_curr_idx_to_select == idx)
82 item_next_idx_to_select = new_items.Size - 1;
84 items.swap(new_items);
88 if (item_next_idx_to_select != -1 && ms_io->NavIdSelected)
89 SetItemSelected(GetStorageIdFromIndex(item_next_idx_to_select),
true);