mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-24 07:24:31 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user