Skip to content

Commit 1829b4c

Browse files
committed
ImStrv: Combo(), ListBox(): seems better to not introduce 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.
1 parent 6ea4275 commit 1829b4c

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

imgui.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ namespace ImGui
680680
IMGUI_API bool BeginCombo(ImStrv label, ImStrv preview_value, ImGuiComboFlags flags = 0);
681681
IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true!
682682
IMGUI_API bool Combo(ImStrv label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1);
683-
IMGUI_API bool Combo(ImStrv label, int* current_item, ImStrv const items[], int items_count, int popup_max_height_in_items = -1);
684683
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);
685684
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"
686685

@@ -808,7 +807,6 @@ namespace ImGui
808807
IMGUI_API bool BeginListBox(ImStrv label, const ImVec2& size = ImVec2(0, 0)); // open a framed scrolling region
809808
IMGUI_API void EndListBox(); // only call EndListBox() if BeginListBox() returned true!
810809
IMGUI_API bool ListBox(ImStrv label, int* current_item, const char* const items[], int items_count, int height_in_items = -1);
811-
IMGUI_API bool ListBox(ImStrv label, int* current_item, ImStrv const items[], int items_count, int height_in_items = -1);
812810
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);
813811

814812
// Widgets: Data Plotting

imgui_widgets.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,12 +2106,6 @@ static ImStrv Items_CharArrayGetter(void* data, int idx)
21062106
return items[idx];
21072107
}
21082108

2109-
static ImStrv Items_StrvArrayGetter(void* data, int idx)
2110-
{
2111-
ImStrv const* items = (ImStrv const*)data;
2112-
return items[idx];
2113-
}
2114-
21152109
// Getter for the old Combo() API: "item1\0item2\0item3\0"
21162110
static ImStrv Items_SingleStringGetter(void* data, int idx)
21172111
{
@@ -2177,11 +2171,6 @@ bool ImGui::Combo(ImStrv label, int* current_item, ImStrv (*getter)(void* user_d
21772171
}
21782172

21792173
// Combo box helper allowing to pass an array of strings.
2180-
bool ImGui::Combo(ImStrv label, int* current_item, ImStrv const items[], int items_count, int height_in_items)
2181-
{
2182-
return Combo(label, current_item, Items_StrvArrayGetter, (void*)items, items_count, height_in_items);
2183-
}
2184-
21852174
// We cannot easily obsolete the 'const char* []' version as this would be stored on user side..
21862175
bool ImGui::Combo(ImStrv label, int* current_item, const char* const items[], int items_count, int height_in_items)
21872176
{
@@ -8661,11 +8650,7 @@ void ImGui::EndListBox()
86618650
EndGroup(); // This is only required to be able to do IsItemXXX query on the whole ListBox including label
86628651
}
86638652

8664-
bool ImGui::ListBox(ImStrv label, int* current_item, ImStrv const items[], int items_count, int height_items)
8665-
{
8666-
return ListBox(label, current_item, Items_StrvArrayGetter, (void*)items, items_count, height_items);
8667-
}
8668-
8653+
// List box helper allowing to pass an array of strings.
86698654
// We cannot easily obsolete the 'const char* []' version as this would be stored on user side..
86708655
bool ImGui::ListBox(ImStrv label, int* current_item, const char* const items[], int items_count, int height_items)
86718656
{

0 commit comments

Comments
 (0)