Don't allow using GetPath/GetFilename() with wxFD_MULTIPLE
GetPaths/GetFilenames() must be used instead when more than one file could be selected: document this and assert if the wrong functions are called. Closes https://github.com/wxWidgets/wxWidgets/pull/1883
This commit is contained in:
committed by
Vadim Zeitlin
parent
284cf9a872
commit
4ac648901d
@@ -73,13 +73,19 @@ public:
|
||||
{ m_filectrl->SetWildcard(wildCard); }
|
||||
|
||||
virtual wxString GetPath() const wxOVERRIDE
|
||||
{ return m_filectrl->GetPath(); }
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxFD_MULTIPLE), wxString(), "When using wxFD_MULTIPLE, must call GetPaths() instead" );
|
||||
return m_filectrl->GetPath();
|
||||
}
|
||||
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE
|
||||
{ m_filectrl->GetPaths(paths); }
|
||||
virtual wxString GetDirectory() const wxOVERRIDE
|
||||
{ return m_filectrl->GetDirectory(); }
|
||||
virtual wxString GetFilename() const wxOVERRIDE
|
||||
{ return m_filectrl->GetFilename(); }
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxFD_MULTIPLE), wxString(), "When using wxFD_MULTIPLE, must call GetFilenames() instead" );
|
||||
return m_filectrl->GetFilename();
|
||||
}
|
||||
virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE
|
||||
{ m_filectrl->GetFilenames(files); }
|
||||
virtual wxString GetWildcard() const wxOVERRIDE
|
||||
|
Reference in New Issue
Block a user