added wxFileDialog::SetfilterIndex() test

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-09-23 14:54:50 +00:00
parent 27579129e9
commit 07b3c46cb6

View File

@@ -534,16 +534,16 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
wxFileDialog dialog(this, wxFileDialog dialog(this,
_T("Testing save file dialog"), _T("Testing save file dialog"),
_T(""), _T(""),
_T("myletter.txt"), _T("myletter.doc"),
_T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"), _T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
wxSAVE|wxOVERWRITE_PROMPT); wxSAVE|wxOVERWRITE_PROMPT);
dialog.SetFilterIndex(1);
if (dialog.ShowModal() == wxID_OK) if (dialog.ShowModal() == wxID_OK)
{ {
wxChar buf[400]; wxLogMessage(_T("%s, filter %d"),
wxSprintf(buf, _T("%s, filter %d"), (const wxChar*)dialog.GetPath(), dialog.GetFilterIndex()); dialog.GetPath().c_str(), dialog.GetFilterIndex());
wxMessageDialog dialog2(this, wxString(buf), _T("Selected path"));
dialog2.ShowModal();
} }
} }
@@ -557,8 +557,7 @@ void MyFrame::DirChoose(wxCommandEvent& WXUNUSED(event) )
if (dialog.ShowModal() == wxID_OK) if (dialog.ShowModal() == wxID_OK)
{ {
wxMessageDialog dialog2(this, dialog.GetPath(), _T("Selected path")); wxLogMessage(_T("Selected path: %s"), dialog.GetPath().c_str());
dialog2.ShowModal();
} }
} }