mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-12 00:14:20 +00:00
ImGuiTextFilter() can take a default filter string
This commit is contained in:
parent
d58ded3acb
commit
c1f20f03c5
2 changed files with 12 additions and 4 deletions
14
imgui.cpp
14
imgui.cpp
|
|
@ -1260,10 +1260,18 @@ void ImGuiStorage::SetAllInt(int v)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
|
||||
ImGuiTextFilter::ImGuiTextFilter()
|
||||
ImGuiTextFilter::ImGuiTextFilter(const char* default_filter)
|
||||
{
|
||||
InputBuf[0] = 0;
|
||||
CountGrep = 0;
|
||||
if (default_filter)
|
||||
{
|
||||
ImFormatString(InputBuf, IM_ARRAYSIZE(InputBuf), "%s", default_filter);
|
||||
Build();
|
||||
}
|
||||
else
|
||||
{
|
||||
InputBuf[0] = 0;
|
||||
CountGrep = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ImGuiTextFilter::Draw(const char* label, float width)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue