Skip to content

Commit

Permalink
[ADD] : add samples for insensitive case
Browse files Browse the repository at this point in the history
[FIX] : fix doe for last ImGui
[UPD] : update of ImGuiFileDialog and glfw
  • Loading branch information
aiekick committed Sep 27, 2023
1 parent 47627c8 commit fb8171f
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/glfw
Submodule glfw updated 2 files
+1 −0 README.md
+51 −59 src/wl_window.c
2 changes: 1 addition & 1 deletion 3rdparty/imgui
Submodule imgui updated 85 files
+1 −1 .github/issue_template.md
+2 −2 .github/workflows/build.yml
+1 −2 .gitignore
+14 −5 backends/imgui_impl_allegro5.cpp
+10 −3 backends/imgui_impl_allegro5.h
+11 −2 backends/imgui_impl_android.cpp
+10 −2 backends/imgui_impl_android.h
+9 −2 backends/imgui_impl_dx10.cpp
+8 −2 backends/imgui_impl_dx10.h
+10 −2 backends/imgui_impl_dx11.cpp
+8 −2 backends/imgui_impl_dx11.h
+10 −2 backends/imgui_impl_dx12.cpp
+8 −2 backends/imgui_impl_dx12.h
+10 −2 backends/imgui_impl_dx9.cpp
+8 −2 backends/imgui_impl_dx9.h
+19 −12 backends/imgui_impl_glfw.cpp
+8 −2 backends/imgui_impl_glfw.h
+11 −3 backends/imgui_impl_glut.cpp
+10 −4 backends/imgui_impl_glut.h
+10 −2 backends/imgui_impl_metal.h
+10 −2 backends/imgui_impl_metal.mm
+11 −6 backends/imgui_impl_opengl2.cpp
+9 −3 backends/imgui_impl_opengl2.h
+24 −15 backends/imgui_impl_opengl3.cpp
+8 −2 backends/imgui_impl_opengl3.h
+8 −2 backends/imgui_impl_osx.h
+10 −2 backends/imgui_impl_osx.mm
+15 −2 backends/imgui_impl_sdl2.cpp
+9 −2 backends/imgui_impl_sdl2.h
+17 −4 backends/imgui_impl_sdl3.cpp
+9 −2 backends/imgui_impl_sdl3.h
+11 −6 backends/imgui_impl_sdlrenderer2.cpp
+11 −0 backends/imgui_impl_sdlrenderer2.h
+11 −6 backends/imgui_impl_sdlrenderer3.cpp
+11 −0 backends/imgui_impl_sdlrenderer3.h
+121 −8 backends/imgui_impl_vulkan.cpp
+17 −5 backends/imgui_impl_vulkan.h
+15 −4 backends/imgui_impl_wgpu.cpp
+11 −2 backends/imgui_impl_wgpu.h
+62 −13 backends/imgui_impl_win32.cpp
+8 −2 backends/imgui_impl_win32.h
+1 −1 docs/BACKENDS.md
+341 −68 docs/CHANGELOG.txt
+13 −12 docs/CONTRIBUTING.md
+2 −2 docs/EXAMPLES.md
+11 −38 docs/FAQ.md
+161 −111 docs/FONTS.md
+12 −8 docs/README.md
+12 −36 docs/TODO.txt
+6 −2 examples/example_allegro5/main.cpp
+6 −1 examples/example_android_opengl3/main.cpp
+6 −2 examples/example_apple_metal/main.mm
+6 −2 examples/example_apple_opengl2/main.mm
+19 −12 examples/example_emscripten_wgpu/main.cpp
+6 −2 examples/example_glfw_metal/main.mm
+6 −2 examples/example_glfw_opengl2/main.cpp
+6 −2 examples/example_glfw_opengl3/main.cpp
+10 −14 examples/example_glfw_vulkan/main.cpp
+6 −2 examples/example_glut_opengl2/main.cpp
+6 −2 examples/example_sdl2_directx11/main.cpp
+6 −2 examples/example_sdl2_metal/main.mm
+6 −2 examples/example_sdl2_opengl2/main.cpp
+6 −2 examples/example_sdl2_opengl3/main.cpp
+6 −2 examples/example_sdl2_sdlrenderer2/main.cpp
+10 −14 examples/example_sdl2_vulkan/main.cpp
+6 −2 examples/example_sdl3_opengl3/main.cpp
+6 −2 examples/example_sdl3_sdlrenderer3/main.cpp
+6 −2 examples/example_win32_directx10/main.cpp
+6 −2 examples/example_win32_directx11/main.cpp
+6 −2 examples/example_win32_directx12/main.cpp
+6 −2 examples/example_win32_directx9/main.cpp
+8 −4 examples/example_win32_opengl3/main.cpp
+16 −9 imconfig.h
+986 −678 imgui.cpp
+189 −108 imgui.h
+449 −222 imgui_demo.cpp
+185 −66 imgui_draw.cpp
+246 −94 imgui_internal.h
+102 −54 imgui_tables.cpp
+441 −186 imgui_widgets.cpp
+4 −1 imstb_textedit.h
+10 −0 misc/cpp/imgui_stdlib.cpp
+9 −2 misc/freetype/README.md
+147 −2 misc/freetype/imgui_freetype.cpp
+3 −1 misc/freetype/imgui_freetype.h
2 changes: 1 addition & 1 deletion ImGuiFileDialog
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ int main(int, char**) {
if (ImGui::TableSetColumnIndex(0)) // first column
{
ImGuiSelectableFlags selectableFlags = ImGuiSelectableFlags_AllowDoubleClick;
selectableFlags |= ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap;
selectableFlags |= ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap;
if (ImGui::Selectable(sel.first.c_str(), i == selected, selectableFlags)) selected = i;
}
if (ImGui::TableSetColumnIndex(1)) // second column
Expand Down
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ SetTest(Test_IGFD_FileManager_Filtering_divers_0)
SetTest(Test_IGFD_FileManager_Filtering_divers_1)
SetTest(Test_IGFD_FileManager_Filtering_divers_2)

## Test_IGFD_FileManager -- Filtering Sensitive/Insenstive case
SetTest(Test_IGFD_FileManager_Filtering_sensitive_case_0)
SetTest(Test_IGFD_FileManager_Filtering_sensitive_case_1)
SetTest(Test_IGFD_FileManager_Filtering_insensitive_case_0)
SetTest(Test_IGFD_FileManager_Filtering_insensitive_case_1)

## Test_IGFD_FileStyle
##SetTest(Test_IGFD_FileStyle_ByExtention_0)
##SetTest(Test_IGFD_FileStyle_ByExtention_1)
Expand Down
62 changes: 62 additions & 0 deletions tests/ImGuiFileDialog/Test_FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class FileManagerTestHelper {
return (arr.find(vFile) != arr.end());
}

void useFlags(ImGuiFileDialogFlags vFlags) {
fd.puDLGflags = vFlags;
}

IGFD::FilterInfos getSelectedFilter() const {
return fd.puFilterManager.GetSelectedFilter();
}
Expand Down Expand Up @@ -150,6 +154,60 @@ bool Test_IGFD_FileManager_Filtering_divers_2() {

#pragma endregion

#pragma region Filtering Sensitive/Insensitive case

// issue #140
bool Test_IGFD_FileManager_Filtering_sensitive_case_0() {
FileManagerTestHelper mgr;
mgr.addFilter(".cpp");
mgr.addFiles({"toto.cpp", "titi.CPP"});

if (!mgr.isFileExist("toto.cpp")) return false;
if (mgr.isFileExist("titi.CPP")) return false;

return true;
}

// issue #140
bool Test_IGFD_FileManager_Filtering_sensitive_case_1() {
FileManagerTestHelper mgr;
mgr.addFilter(".CPP");
mgr.addFiles({"toto.cpp", "titi.CPP"});

if (mgr.isFileExist("toto.cpp")) return false;
if (!mgr.isFileExist("titi.CPP")) return false;

return true;
}

// issue #140
bool Test_IGFD_FileManager_Filtering_insensitive_case_0() {
FileManagerTestHelper mgr;
mgr.useFlags(ImGuiFileDialogFlags_CaseInsensitiveExtention);
mgr.addFilter(".cpp");
mgr.addFiles({"toto.cpp", "titi.CPP"});

if (!mgr.isFileExist("toto.cpp")) return false;
if (!mgr.isFileExist("titi.CPP")) return false;

return true;
}

// issue #140
bool Test_IGFD_FileManager_Filtering_insensitive_case_1() {
FileManagerTestHelper mgr;
mgr.useFlags(ImGuiFileDialogFlags_CaseInsensitiveExtention);
mgr.addFilter(".CPP");
mgr.addFiles({"toto.cpp", "titi.CPP"});

if (!mgr.isFileExist("toto.cpp")) return false;
if (!mgr.isFileExist("titi.CPP")) return false;

return true;
}

#pragma endregion

#pragma region Entry Point

#define IfTestExist(v) \
Expand All @@ -163,6 +221,10 @@ bool Test_FileManager(const std::string& vTest) {
IfTestExist(Test_IGFD_FileManager_Filtering_divers_0);
IfTestExist(Test_IGFD_FileManager_Filtering_divers_1);
IfTestExist(Test_IGFD_FileManager_Filtering_divers_2);
IfTestExist(Test_IGFD_FileManager_Filtering_sensitive_case_0);
IfTestExist(Test_IGFD_FileManager_Filtering_sensitive_case_1);
IfTestExist(Test_IGFD_FileManager_Filtering_insensitive_case_0);
IfTestExist(Test_IGFD_FileManager_Filtering_insensitive_case_1);

assert(0);

Expand Down

0 comments on commit fb8171f

Please sign in to comment.