Add wxFileDialog::GetCurrentlySelectedFilename().

Also send wxEVT_UPDATE_UI events for the extra controls in wxFileDialog.

The combination of these changes allows extra controls to update their state
depending on the current selection in the dialog. Show a simple example of
doing it in the dialogs sample.

Closes #15235.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-05-31 23:21:27 +00:00
parent 438959cca8
commit 926df8a162
8 changed files with 123 additions and 9 deletions

View File

@@ -122,6 +122,9 @@ public:
virtual wxString GetWildcard() const { return m_wildCard; }
virtual int GetFilterIndex() const { return m_filterIndex; }
virtual wxString GetCurrentlySelectedFilename() const
{ return m_currentlySelectedFilename; }
// this function is called with wxFileDialog as parameter and should
// create the window containing the extra controls we want to show in it
typedef wxWindow *(*ExtraControlCreatorFunction)(wxWindow*);
@@ -155,6 +158,13 @@ protected:
wxString m_fileName;
wxString m_wildCard;
int m_filterIndex;
// Currently selected, but not yet necessarily accepted by the user, file.
// This should be updated whenever the selection in the control changes by
// the platform-specific code to provide a useful implementation of
// GetCurrentlySelectedFilename().
wxString m_currentlySelectedFilename;
wxWindow* m_extraControl;
// returns true if control is created (if it already exists returns false)