Add option for generic file dialogs
This commit is contained in:
parent
7dbad8e85c
commit
db5c890e0d
|
@ -15,6 +15,7 @@ if(WIN32 OR APPLE)
|
|||
endif()
|
||||
|
||||
option(ENABLE_SDL3 "Use SDL3" ON)
|
||||
option(ENABLE_GENERIC_FILE_DIALOGS "Use generic file dialogs" OFF)
|
||||
option(DISABLE_OPENGL "Disable OpenGL" OFF)
|
||||
option(ENABLE_SDL "Build the SDL port" ${ENABLE_SDL_DEFAULT})
|
||||
option(ENABLE_WX "Build the wxWidgets port" ${BUILD_DEFAULT})
|
||||
|
|
|
@ -261,6 +261,11 @@ function(configure_wx_target target)
|
|||
_add_compile_definitions(${wxWidgets_DEFINITIONS_DEBUG})
|
||||
endif()
|
||||
|
||||
# Generic file dialogs
|
||||
if (ENABLE_GENERIC_FILE_DIALOGS)
|
||||
_add_compile_definitions(USE_GENERIC_FILE_DIALOGS)
|
||||
endif()
|
||||
|
||||
# No Metal
|
||||
if(NOT CMAKE_Metal_COMPILER)
|
||||
_add_compile_definitions(NO_METAL)
|
||||
|
|
|
@ -141,9 +141,11 @@ EVT_HANDLER(wxID_OPEN, "Open ROM...")
|
|||
"*.dmg.z;*.gb.z;*.gbc.z;*.cgb.z;*.sgb.z;"
|
||||
"*.zip;*.7z;*.rar|");
|
||||
pats.append(wxALL_FILES);
|
||||
|
||||
wxFileDialog dlg(this, _("Open ROM file"), gba_rom_dir, "",
|
||||
pats,
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
|
||||
dlg.SetFilterIndex(open_ft);
|
||||
|
||||
if (ShowModal(&dlg) == wxID_OK)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#ifdef USE_GENERIC_FILE_DIALOGS
|
||||
#include "wx/generic/filedlgg.h"
|
||||
|
||||
#undef wxFileDialog
|
||||
#define wxFileDialog wxGenericFileDialog
|
||||
#endif
|
|
@ -36,6 +36,7 @@
|
|||
#endif
|
||||
|
||||
#include "wx/wxlogdebug.h"
|
||||
#include "wx/compat_generic_file_dialog.h"
|
||||
|
||||
template <typename T>
|
||||
void CheckPointer(T pointer)
|
||||
|
|
Loading…
Reference in New Issue