Add wxFileDialog::AddShortcut()

This allows to add application-specific directories to the file dialog.

This commit only contains the implementation for wxMSW and a change
showing the new function in the sample.
This commit is contained in:
Vadim Zeitlin
2022-07-17 22:24:56 +01:00
parent 172ebc6dbc
commit 5d3ebf9457
7 changed files with 105 additions and 0 deletions
+8
View File
@@ -1824,6 +1824,14 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
)
);
// For demonstration purposes, add wxWidgets directories to the sidebar.
wxString wxdir;
if ( wxGetEnv("WXWIN", &wxdir) )
{
dialog.AddShortcut(wxdir + "/src", wxFD_SHORTCUT_BOTTOM);
dialog.AddShortcut(wxdir + "/include", wxFD_SHORTCUT_TOP);
}
// Note: this object must remain alive until ShowModal() returns.
MyCustomizeHook myCustomizer(dialog);