diff --git a/include/wx/dirdlg.h b/include/wx/dirdlg.h index a53efee977..8a732eef20 100644 --- a/include/wx/dirdlg.h +++ b/include/wx/dirdlg.h @@ -40,6 +40,7 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[]; #define wxDD_CHANGE_DIR 0x0100 #define wxDD_DIR_MUST_EXIST 0x0200 #define wxDD_MULTIPLE 0x0400 +#define wxDD_SHOW_HIDDEN 0x0001 // deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it #define wxDD_NEW_DIR_BUTTON 0 diff --git a/interface/wx/dirdlg.h b/interface/wx/dirdlg.h index b5b638666c..d4f6c6eaa6 100644 --- a/interface/wx/dirdlg.h +++ b/interface/wx/dirdlg.h @@ -5,9 +5,11 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + #define wxDD_CHANGE_DIR 0x0100 #define wxDD_DIR_MUST_EXIST 0x0200 #define wxDD_MULTIPLE 0x0400 +#define wxDD_SHOW_HIDDEN 0x0001 #define wxDD_NEW_DIR_BUTTON 0 // deprecated, on by default now, @@ -45,11 +47,13 @@ const char wxDirDialogNameStr[] = "wxDirCtrl"; @style{wxDD_CHANGE_DIR} Change the current working directory to the directory chosen by the user. - @note This flag cannot be used with the @c wxDD_MULTIPLE style. + @note This flag cannot be used with the @c wxDD_MULTIPLE style. @style{wxDD_MULTIPLE} Allow the user to select multiple directories. This flag is only available since wxWidgets 3.1.4 - + @style{wxDD_SHOW_HIDDEN} + Show hidden and system folders. + This flag is only available since wxWidgets 3.1.4 @endStyleTable Notice that @c wxRESIZE_BORDER has special side effect under Windows diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 8298c7f172..9a69411e62 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -489,7 +489,7 @@ bool MyApp::OnInit() dir_menu->Append(DIALOGS_DIR_CHOOSE, "&Choose a directory\tCtrl-D"); dir_menu->Append(DIALOGS_DIRNEW_CHOOSE, "Choose a directory (with \"Ne&w\" button)\tShift-Ctrl-D"); - dir_menu->Append(DIALOGS_DIRMULTIPLE_CHOOSE, "Choose multiple directories\tAlt-Ctrl-D"); + dir_menu->Append(DIALOGS_DIRMULTIPLE_CHOOSE, "Choose multiple and hidden directories\tAlt-Ctrl-D"); menuDlg->Append(wxID_ANY,"&Directory operations",dir_menu); #if USE_DIRDLG_GENERIC @@ -1809,7 +1809,7 @@ void MyFrame::DirChooseNew(wxCommandEvent& WXUNUSED(event) ) void MyFrame::DirChooseMultiple(wxCommandEvent& WXUNUSED(event)) { // pass some initial dir and the style to wxDirDialog - int style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST | wxDD_MULTIPLE; + int style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST | wxDD_MULTIPLE | wxDD_SHOW_HIDDEN; wxString dirHome; wxGetHomeDir(&dirHome); diff --git a/src/gtk/dirdlg.cpp b/src/gtk/dirdlg.cpp index 88e352df3b..65fa6a6bf5 100644 --- a/src/gtk/dirdlg.cpp +++ b/src/gtk/dirdlg.cpp @@ -121,6 +121,9 @@ bool wxDirDialog::Create(wxWindow* parent, gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER(m_widget), HasFlag(wxDD_MULTIPLE) ); + // Enable show hidden folders if desired + gtk_file_chooser_set_show_hidden( + GTK_FILE_CHOOSER(m_widget), HasFlag(wxDD_SHOW_HIDDEN) ); // local-only property could be set to false to allow non-local files to be loaded. // In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere