mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Merge 20fb286e4f into 922a11f084
This commit is contained in:
commit
44bbb9fc3a
2 changed files with 11 additions and 0 deletions
10
imgui.cpp
10
imgui.cpp
|
|
@ -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);
|
||||||
|
|
|
||||||
1
imgui.h
1
imgui.h
|
|
@ -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(); }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue