1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00
This commit is contained in:
lomekragow 2025-12-28 05:32:51 +02:00 committed by GitHub
commit 44bbb9fc3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -2987,6 +2987,16 @@ bool ImGuiTextFilter::Draw(const char* label, float width)
return value_changed; return value_changed;
} }
bool ImGuiTextFilter::DrawWithHint(const char* label, const char* hint, float width)
{
if (width != 0.0f)
ImGui::SetNextItemWidth(width);
bool value_changed = ImGui::InputTextWithHint(label, hint, InputBuf, IM_ARRAYSIZE(InputBuf));
if (value_changed)
Build();
return value_changed;
}
void ImGuiTextFilter::ImGuiTextRange::split(char separator, ImVector<ImGuiTextRange>* out) const void ImGuiTextFilter::ImGuiTextRange::split(char separator, ImVector<ImGuiTextRange>* out) const
{ {
out->resize(0); out->resize(0);

View file

@ -2712,6 +2712,7 @@ struct ImGuiTextFilter
{ {
IMGUI_API ImGuiTextFilter(const char* default_filter = ""); IMGUI_API ImGuiTextFilter(const char* default_filter = "");
IMGUI_API bool Draw(const char* label = "Filter (inc,-exc)", float width = 0.0f); // Helper calling InputText+Build IMGUI_API bool Draw(const char* label = "Filter (inc,-exc)", float width = 0.0f); // Helper calling InputText+Build
IMGUI_API bool DrawWithHint(const char* label, const char* hint = "Filter (inc,-exc)", float width = 0.0f);
IMGUI_API bool PassFilter(const char* text, const char* text_end = NULL) const; IMGUI_API bool PassFilter(const char* text, const char* text_end = NULL) const;
IMGUI_API void Build(); IMGUI_API void Build();
void Clear() { InputBuf[0] = 0; Build(); } void Clear() { InputBuf[0] = 0; Build(); }