Warn on incompatible wxDirDialog styles
This commit is contained in:
committed by
Vadim Zeitlin
parent
7230acd110
commit
ade5030c56
@@ -88,7 +88,12 @@ public:
|
||||
virtual void SetPath(const wxString& path) { m_path = path; }
|
||||
|
||||
virtual wxString GetMessage() const { return m_message; }
|
||||
virtual wxString GetPath() const { return m_path; }
|
||||
virtual wxString GetPath() const
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxDD_MULTIPLE), wxString(), "When using wxDD_MULTIPLE, must call GetPaths() instead" );
|
||||
return m_path;
|
||||
}
|
||||
|
||||
virtual void GetPaths(wxArrayString& paths) const { paths.Empty(); paths.Add(m_path); }
|
||||
|
||||
protected:
|
||||
|
@@ -122,6 +122,9 @@ public:
|
||||
|
||||
/**
|
||||
Returns the default or user-selected path.
|
||||
|
||||
@note This function can't be used with dialogs which have the @c wxDD_MULTIPLE style,
|
||||
use GetPaths() instead.
|
||||
*/
|
||||
virtual wxString GetPath() const;
|
||||
|
||||
|
@@ -190,6 +190,7 @@ void wxDirDialog::SetPath(const wxString& dir)
|
||||
|
||||
wxString wxDirDialog::GetPath() const
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxDD_MULTIPLE), wxString(), "When using wxDD_MULTIPLE, must call GetPaths() instead" );
|
||||
return m_paths.Last();
|
||||
}
|
||||
|
||||
|
@@ -173,6 +173,7 @@ void wxDirDialog::SetTitle(const wxString &title)
|
||||
|
||||
wxString wxDirDialog::GetPath() const
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxDD_MULTIPLE), wxString(), "When using wxDD_MULTIPLE, must call GetPaths() instead" );
|
||||
return m_paths.Last();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user