only allow selecting existing files in wxLoadFileSelector; use this function instead of wxFileSelector in the samples (closes #10693)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -687,7 +687,7 @@ wxString MyFrame::LoadUserImage(wxImage& image)
|
||||
wxString filename;
|
||||
|
||||
#if wxUSE_FILEDLG
|
||||
filename = wxFileSelector(_T("Select image file"));
|
||||
filename = wxLoadFileSelector(_T("image"), wxEmptyString);
|
||||
if ( !filename.empty() )
|
||||
{
|
||||
if ( !image.LoadFile(filename) )
|
||||
@@ -796,7 +796,7 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
|
||||
{
|
||||
#if wxUSE_FILEDLG
|
||||
wxString filename = wxFileSelector(_T("Select image file"));
|
||||
wxString filename = wxLoadFileSelector(_T("image"), wxEmptyString, wxEmptyString, this);
|
||||
if ( filename.empty() )
|
||||
return;
|
||||
|
||||
|
@@ -958,7 +958,7 @@ void MyFrame::OnToolbarBgCol(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnToolbarCustomBitmap(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_pathBmp = wxFileSelector(_T("Custom bitmap path"));
|
||||
m_pathBmp = wxLoadFileSelector(_T("custom bitmap"));
|
||||
|
||||
RecreateToolbar();
|
||||
}
|
||||
|
@@ -882,12 +882,9 @@ wxBitmap BitmapComboBoxWidgetsPage::LoadBitmap(const wxString& WXUNUSED(filepath
|
||||
|
||||
wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr)
|
||||
{
|
||||
wxString filepath = wxFileSelector(wxT("Choose image file"),
|
||||
wxString filepath = wxLoadFileSelector(wxT("image"),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT("*.*"),
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
||||
this);
|
||||
|
||||
wxBitmap bitmap;
|
||||
|
Reference in New Issue
Block a user