replaced generic automatic filter string by 2 different ones for all files and all files with the given extension
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
960b193e59
commit
186545a42f
@ -43,24 +43,39 @@ wxFileDialogBase::wxFileDialogBase(wxWindow *parent,
|
||||
const wxString& wildCard,
|
||||
long style,
|
||||
const wxPoint& WXUNUSED(pos))
|
||||
: m_message(message),
|
||||
m_dir(defaultDir),
|
||||
m_fileName(defaultFile)
|
||||
{
|
||||
m_parent = parent;
|
||||
m_message = message;
|
||||
m_dir = defaultDir;
|
||||
m_fileName = defaultFile;
|
||||
if (wildCard.IsEmpty())
|
||||
m_wildCard = wxFileSelectorDefaultWildcardStr;
|
||||
else
|
||||
m_wildCard = wildCard ;
|
||||
m_dialogStyle = style;
|
||||
m_path = wxT("");
|
||||
m_filterIndex = 0;
|
||||
|
||||
// convert m_wildCard from "*.bar" to "Files (*.bar)|*.bar"
|
||||
if ( wildCard.empty() )
|
||||
{
|
||||
m_wildCard = wxString::Format(_("All files (%s)|%s"),
|
||||
wxFileSelectorDefaultWildcardStr,
|
||||
wxFileSelectorDefaultWildcardStr);
|
||||
}
|
||||
else // have wild card
|
||||
{
|
||||
// convert m_wildCard from "*.bar" to "bar files (*.bar)|*.bar"
|
||||
if ( m_wildCard.Find(wxT('|')) == wxNOT_FOUND )
|
||||
{
|
||||
m_wildCard = wxString::Format(_("Files (%s)|%s"),
|
||||
m_wildCard.c_str(), m_wildCard.c_str());
|
||||
wxString::size_type nDot = m_wildCard.find(_T("*."));
|
||||
if ( nDot != wxString::npos )
|
||||
nDot++;
|
||||
else
|
||||
nDot = 0;
|
||||
|
||||
m_wildCard = wxString::Format
|
||||
(
|
||||
_("%s files (%s)|%s"),
|
||||
m_wildCard.c_str() + nDot,
|
||||
m_wildCard.c_str(),
|
||||
m_wildCard.c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user