Skip to content

Commit

Permalink
ImGuiFileDialog 0.5.2
Browse files Browse the repository at this point in the history
fixed for last ImGui 1.79
fixed #33
some refactoring too
obsolete imgui function disabled by default in sample app
  • Loading branch information
aiekick committed Dec 16, 2020
1 parent 8bd3f00 commit 0008ede
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 174 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/imgui
Submodule imgui updated 150 files
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ endif ()

add_definitions(${GLFW_DEFINITIONS})
add_definitions(-DCUSTOM_IMGUIFILEDIALOG_CONFIG="../../../CustomImGuiFileDialogConfig.h")

add_definitions(-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS)

file(GLOB MAIN_SOURCES ${CMAKE_SOURCE_DIR}/main.cpp)
file(GLOB CUSTOM_SOURCES ${CMAKE_SOURCE_DIR}/CustomImGuiFileDialogConfig.h)
file(GLOB RES_SOURCES
Expand All @@ -37,10 +38,10 @@ file(GLOB IMGUIFILEDIALOG_SOURCES
${CMAKE_SOURCE_DIR}/ImGuiFileDialog/*.cpp
${CMAKE_SOURCE_DIR}/ImGuiFileDialog/*.h)
file(GLOB IMGUIIMPL_SOURCES
${CMAKE_SOURCE_DIR}/3rdparty/imgui/examples/imgui_impl_glfw.cpp
${CMAKE_SOURCE_DIR}/3rdparty/imgui/examples/imgui_impl_glfw.h
${CMAKE_SOURCE_DIR}/3rdparty/imgui/examples/imgui_impl_opengl3.cpp
${CMAKE_SOURCE_DIR}/3rdparty/imgui/examples/imgui_impl_opengl3.h)
${CMAKE_SOURCE_DIR}/3rdparty/imgui/backends/imgui_impl_glfw.cpp
${CMAKE_SOURCE_DIR}/3rdparty/imgui/backends/imgui_impl_glfw.h
${CMAKE_SOURCE_DIR}/3rdparty/imgui/backends/imgui_impl_opengl3.cpp
${CMAKE_SOURCE_DIR}/3rdparty/imgui/backends/imgui_impl_opengl3.h)
source_group(main FILES ${MAIN_SOURCES})
source_group(src\\Custom FILES ${CUSTOM_SOURCES})
source_group(src\\Res FILES ${RES_SOURCES})
Expand Down
50 changes: 26 additions & 24 deletions CustomFont.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
#include "CustomFont.h"

static const char FONT_ICON_BUFFER_NAME_IGFD[3105+1] =
"7])#######qgGmo'/###V),##+Sl##Q6>##w#S+Hh=?<a7*&T&d.7m/oJ[^IflZg#BfG<-iNE/1-2JuBw0'B)i,>>#'tEn/<_[FHkp#L#,)m<-:qEn/@d@UCGD7s$_gG<-]rK8/XU#[A"
">7X*M^iEuLQaX1DIMr62DXe(#=eR%#_AFmBFF1J5h@6gLYwG`-77LkOETt?0(MiSAq@ClLS[bfL)YZ##E)1w--Aa+MNq;?#-D^w'0bR5'Cv9N(f$IP/371^#IhOSMoH<mL6kSG2mEexF"
"TP'##NjToIm3.AF4@;=-1`/,M)F5gL':#gLIlJGMIfG<-IT*COI=-##.<;qMTl:$#L7cwL#3#&#W(^w5i*l.q3;02qtKJ5q'>b9qx:`?q*R[SqOim4vII3L,J-eL,o[njJ@Ro?93VtA#"
"n;4L#?C(DNgJG&#D;B;-KEII-O&Ys1,AP##0Mc##4Yu##fRXgLC;E$#@(V$#jDA]%f,);?o[3YckaZfCj>)Mp64YS76`JYYZGUSItO,AtgC_Y#>v&##je+gL)SL*57*vM($i?X-,BG`a"
"*HWf#Ybf;-?G^##$VG13%&>uuYg8e$UNc##D####,03/MbPMG)@f)T/^b%T%S2`^#J:8Y.pV*i(T=)?#h-[guT#9iu&](?#A]wG;[Dm]uB*07QK(]qFV=fV$H[`V$#kUK#$8^fLmw@8%"
"P92^uJ98=/+@u2OFC.o`5BOojOps+/q=110[YEt$bcx5#kN:tLmb]s$wkH>#iE(E#VA@r%Mep$-#b?1,G2J1,mQOhuvne.Mv?75/Huiw'6`?$=VC]&,EH*7M:9s%,:7QVQM]X-?^10ip"
"&ExrQF7$##lnr?#&r&t%NEE/2XB+a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$agNe'Qk[X'ep.'58=B_A"
"+L1_A'fp`Nae&%#aKb&#W>gkLXu[f$V2Cv-_uv20tt?X-BL75/#(KU)N0;hLr75c4br9s-;va.3exLG`^U;4F9D+tqKKGSIULS:d=vRduSxXCuOq$0ufu'L#>Y[OVk1k3G(kZoAO9iQN"
"'h5',b_mL,v?qr&4uG##%J/GV5J?`a'=@@M#w-tL0+xRV6,A48_fa-Zups+;(=rhZ;ktD#c9OA#axJ+*?7%s$DXI5/CKU:%eQ+,2=C587Rg;E4Z3f.*?ulW-tYqw0`EmS/si+C#[<;S&"
"mInS%FAov#Fu[E+*L'O'GWuN'+)U40`a5k'sA;)*RIRF%Tw/Z--1=e?5;1X:;vPk&CdNjL*(KJ1/,TV-G(^S*v14gL#8,,M*YPgLaII@b+s[&#n+d3#7,(%#';P>#,Gc>#0Su>#4`1?#"
"8lC?#<xU?#@.i?#D:%@#HF7@#k'LVCn)fQD[.C(%ea@uBoF/ZGrDFVCjZ/NB0)61Fg&cF$v:7FHJij$5bW<2Be(&ZG17O(I_DbQD6%WiF,P7/GA'kj02%jMFlq>lEki`]&D-(VA,gpKF"
"jb^oDw/UG$)NkVCdL^kEnw8I$1GKoDar#oDRh&##cW_(AXo&##";

4 changes: 3 additions & 1 deletion CustomFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
#pragma once

#define FONT_ICON_BUFFER_NAME_IGFD IGFD_compressed_data_base85
#define FONT_ICON_BUFFER_SIZE_IGFD 0xc21
#define FONT_ICON_BUFFER_SIZE_IGFD 0xd52

#define ICON_MIN_IGFD 0xf002
#define ICON_MAX_IGFD 0xf1c9

#define ICON_IGFD_ADD u8"\uf067"
#define ICON_IGFD_BOOKMARK u8"\uf02e"
#define ICON_IGFD_CANCEL u8"\uf00d"
#define ICON_IGFD_CHEVRON_DOWN u8"\uf078"
#define ICON_IGFD_CHEVRON_UP u8"\uf077"
#define ICON_IGFD_DRIVES u8"\uf0a0"
#define ICON_IGFD_EDIT u8"\uf040"
#define ICON_IGFD_FILE u8"\uf15b"
Expand Down
2 changes: 2 additions & 0 deletions CustomFont.ifs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<glyph orgId="61540" newId="61540" orgName="share_alt" newName="reset"/>
<glyph orgId="61543" newId="61543" orgName="plus" newName="add"/>
<glyph orgId="61544" newId="61544" orgName="minus" newName="remove"/>
<glyph orgId="61559" newId="61559" orgName="chevron_up" newName="chevron_up"/>
<glyph orgId="61560" newId="61560" orgName="chevron_down" newName="chevron_down"/>
<glyph orgId="61563" newId="61563" orgName="folder_close" newName="folder"/>
<glyph orgId="61564" newId="61564" orgName="folder_open" newName="folder_open"/>
<glyph orgId="61600" newId="61600" orgName="hdd" newName="drives"/>
Expand Down
31 changes: 20 additions & 11 deletions CustomImGuiFileDialogConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

// uncomment and modify defines under for customize ImGuiFileDialog

//#define USE_IMGUI_TABLES
//#define MAX_FILE_DIALOG_NAME_BUFFER 1024
//#define MAX_PATH_BUFFER_SIZE 1024

#define USE_IMGUI_TABLES

#include <GLFW/glfw3.h>

Expand All @@ -17,21 +20,14 @@
#define IGFD_KEY_BACKSPACE GLFW_KEY_BACKSPACE

// widget
// filter combobox width
//#define FILTER_COMBO_WIDTH 120.0f
// button widget use for compose path
//#define IMGUI_PATH_BUTTON ImGui::Button
// standar button
//#define IMGUI_BUTTON ImGui::Button

// locales string
//#define createDirButtonString "+"
//#define okButtonString " OK"
//#define cancelButtonString " Cancel"
//#define resetButtonString "R"
//#define drivesButtonString "Drives"
//#define searchString "Search"
//#define dirEntryString "[DIR] "
//#define linkEntryString "[LINK] "
//#define fileEntryString "[FILE] "

//#define fileNameString "File Name : "
//#define buttonResetSearchString "Reset search"
//#define buttonDriveString "Drives"
Expand All @@ -44,6 +40,7 @@ Comment theses line if you not want to have customization, like icon font here

#include <CustomFont.h>

// locales string
#define createDirButtonString ICON_IGFD_ADD
#define okButtonString ICON_IGFD_OK " OK"
#define cancelButtonString ICON_IGFD_CANCEL " Cancel"
Expand All @@ -53,6 +50,18 @@ Comment theses line if you not want to have customization, like icon font here
#define dirEntryString ICON_IGFD_FOLDER
#define linkEntryString ICON_IGFD_LINK
#define fileEntryString ICON_IGFD_FILE
//#define buttonResetSearchString "Reset search"
//#define buttonDriveString "Drives"
//#define buttonResetPathString "Reset to current directory"
//#define buttonCreateDirString "Create Directory"

// theses icons will appear in table headers
#define USE_CUSTOM_SORTING_ICON
#define tableHeaderAscendingIcon ICON_IGFD_CHEVRON_UP
#define tableHeaderDescendingIcon ICON_IGFD_CHEVRON_DOWN
#define tableHeaderFileNameString " File name"
#define tableHeaderFileSizeString " Size"
#define tableHeaderFileDateString " Date"

#define USE_BOOKMARK
//#define bookmarkPaneWith 150.0f
Expand Down
Loading

0 comments on commit 0008ede

Please sign in to comment.