ImStrv: Combo(), ListBox(): maybe seems better to not introducte the ImStrv [] versions?
As 1) user is unlikely to store that on their end. 2) nowadays with lambdas isn't an easy user-side conversion.
Then we limit explosion of an already messy API.
diff --git a/imgui.h b/imgui.h
index 8c12955..42c34f3 100644
--- a/imgui.h
+++ b/imgui.h
@@ -574,7 +574,6 @@
IMGUI_API bool BeginCombo(ImStrv label, ImStrv preview_value, ImGuiComboFlags flags = 0);
IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true!
IMGUI_API bool Combo(ImStrv label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1);
- IMGUI_API bool Combo(ImStrv label, int* current_item, ImStrv const items[], int items_count, int popup_max_height_in_items = -1);
IMGUI_API bool Combo(ImStrv label, int* current_item, ImStrv (*getter)(void* user_data, int idx), void* user_data, int items_count, int popup_max_height_in_items = -1);
IMGUI_API bool Combo(ImStrv label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0"
@@ -688,7 +687,6 @@
IMGUI_API bool BeginListBox(ImStrv label, const ImVec2& size = ImVec2(0, 0)); // open a framed scrolling region
IMGUI_API void EndListBox(); // only call EndListBox() if BeginListBox() returned true!
IMGUI_API bool ListBox(ImStrv label, int* current_item, const char* const items[], int items_count, int height_in_items = -1);
- IMGUI_API bool ListBox(ImStrv label, int* current_item, ImStrv const items[], int items_count, int height_in_items = -1);
IMGUI_API bool ListBox(ImStrv label, int* current_item, ImStrv (*getter)(void* user_data, int idx), void* user_data, int items_count, int height_in_items = -1);
// Widgets: Data Plotting
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index 2314742..54553c5 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -1878,12 +1878,6 @@
return items[idx];
}
-static ImStrv Items_StrvArrayGetter(void* data, int idx)
-{
- ImStrv const* items = (ImStrv const*)data;
- return items[idx];
-}
-
// Getter for the old Combo() API: "item1\0item2\0item3\0"
static ImStrv Items_SingleStringGetter(void* data, int idx)
{
@@ -1947,11 +1941,6 @@
}
// Combo box helper allowing to pass an array of strings.
-bool ImGui::Combo(ImStrv label, int* current_item, ImStrv const items[], int items_count, int height_in_items)
-{
- return Combo(label, current_item, Items_StrvArrayGetter, (void*)items, items_count, height_in_items);
-}
-
// We cannot easily obsolete the 'const char* []' version as this would be stored on user side..
bool ImGui::Combo(ImStrv label, int* current_item, const char* const items[], int items_count, int height_in_items)
{
@@ -6966,11 +6955,7 @@
EndGroup(); // This is only required to be able to do IsItemXXX query on the whole ListBox including label
}
-bool ImGui::ListBox(ImStrv label, int* current_item, ImStrv const items[], int items_count, int height_items)
-{
- return ListBox(label, current_item, Items_StrvArrayGetter, (void*)items, items_count, height_items);
-}
-
+// List box helper allowing to pass an array of strings.
// We cannot easily obsolete the 'const char* []' version as this would be stored on user side..
bool ImGui::ListBox(ImStrv label, int* current_item, const char* const items[], int items_count, int height_items)
{