const wxString& wildCard,
long style,
const wxPoint& WXUNUSED(pos))
+ : m_message(message),
+ m_dir(defaultDir),
+ m_fileName(defaultFile),
+ m_wildCard(wildCard)
{
m_parent = parent;
- m_message = message;
- m_dir = defaultDir;
- m_fileName = defaultFile;
- m_wildCard = wildCard;
m_dialogStyle = style;
- m_path = wxT("");
m_filterIndex = 0;
- if (m_wildCard.IsEmpty())
- m_wildCard = wxFileSelectorDefaultWildcardStr;
-
- // convert m_wildCard from "*.bar" to "Files (*.bar)|*.bar"
- if ( m_wildCard.Find(wxT('|')) == wxNOT_FOUND )
+ if ( wildCard.empty() || wildCard == wxFileSelectorDefaultWildcardStr )
+ {
+ m_wildCard = wxString::Format(_("All files (%s)|%s"),
+ wxFileSelectorDefaultWildcardStr,
+ wxFileSelectorDefaultWildcardStr);
+ }
+ else // have wild card
{
- m_wildCard.Printf(_("Files (%s)|%s"),
- m_wildCard.c_str(), m_wildCard.c_str());
+ // convert m_wildCard from "*.bar" to "bar files (*.bar)|*.bar"
+ if ( m_wildCard.Find(wxT('|')) == wxNOT_FOUND )
+ {
+ wxString::size_type nDot = m_wildCard.find(_T("*."));
+ if ( nDot != wxString::npos )
+ nDot++;
+ else
+ nDot = 0;
+
+ m_wildCard = wxString::Format
+ (
+ _("%s files (%s)|%s"),
+ wildCard.c_str() + nDot,
+ wildCard.c_str(),
+ wildCard.c_str()
+ );
+ }
}
}