MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / DemoWindowWidgetsTextFilter

Function DemoWindowWidgetsTextFilter

external/imgui/imgui_demo.cpp:3789–3810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3787//-----------------------------------------------------------------------------
3788
3789static void DemoWindowWidgetsTextFilter()
3790{
3791 if (ImGui::TreeNode("Text Filter"))
3792 {
3793 IMGUI_DEMO_MARKER("Widgets/Text Filter");
3794 // Helper class to easy setup a text filter.
3795 // You may want to implement a more feature-full filtering scheme in your own application.
3796 HelpMarker("Not a widget per-se, but ImGuiTextFilter is a helper to perform simple filtering on text strings.");
3797 static ImGuiTextFilter filter;
3798 ImGui::Text("Filter usage:\n"
3799 " \"\" display all lines\n"
3800 " \"xxx\" display lines containing \"xxx\"\n"
3801 " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
3802 " \"-xxx\" hide lines containing \"xxx\"");
3803 filter.Draw();
3804 const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
3805 for (int i = 0; i < IM_COUNTOF(lines); i++)
3806 if (filter.PassFilter(lines[i]))
3807 ImGui::BulletText("%s", lines[i]);
3808 ImGui::TreePop();
3809 }
3810}
3811
3812//-----------------------------------------------------------------------------
3813// [SECTION] DemoWindowWidgetsTextInput()

Callers 1

DemoWindowWidgetsFunction · 0.85

Calls 3

HelpMarkerFunction · 0.85
PassFilterMethod · 0.80
DrawMethod · 0.45

Tested by

no test coverage detected