X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/447d184e0fac4d02fc056946638c5b8e70dcc546..6cd674726b8ae173a567410b03bfa94423c69926:/samples/mobile/wxedit/wxedit.cpp diff --git a/samples/mobile/wxedit/wxedit.cpp b/samples/mobile/wxedit/wxedit.cpp index 491b8c333d..b6043f9e66 100644 --- a/samples/mobile/wxedit/wxedit.cpp +++ b/samples/mobile/wxedit/wxedit.cpp @@ -5,10 +5,6 @@ // Copyright: ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "wxedit.h" -#endif - // For compilers that support precompilation #include "wx/wxprec.h" @@ -66,7 +62,7 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title, // Create edit control. Since it is the only // control in the frame, it will be resized // to file it out. - m_text = new wxTextCtrl( this, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); + m_text = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); // Read .ini file for file history etc. wxConfig *conf = (wxConfig*) wxConfig::Get(); @@ -213,17 +209,18 @@ void MyFrame::OnNew( wxCommandEvent& WXUNUSED(event) ) m_filename = wxEmptyString; #if wxUSE_STATUSBAR - SetStatusText( _T("") ); + SetStatusText( wxEmptyString ); #endif // wxUSE_STATUSBAR } void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) ) { +#if wxUSE_FILEDLG if (!Discard()) return; - wxFileDialog dialog( this, _T("Open text"), _T(""), _T(""), + wxFileDialog dialog( this, _T("Open text"), wxEmptyString, wxEmptyString, _T("Text file (*.txt)|*.txt|Any file (*)|*"), - wxOPEN|wxFILE_MUST_EXIST ); + wxFD_OPEN|wxFD_FILE_MUST_EXIST ); if (dialog.ShowModal() == wxID_OK) { m_text->Clear(); @@ -265,6 +262,7 @@ void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) ) SetStatusText( m_filename ); #endif // wxUSE_STATUSBAR } +#endif // wxUSE_FILEDLG } void MyFrame::OnSave( wxCommandEvent& WXUNUSED(event) ) @@ -274,9 +272,10 @@ void MyFrame::OnSave( wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnSaveAs( wxCommandEvent& WXUNUSED(event) ) { - wxFileDialog dialog( this, _T("Open text"), _T(""), _T(""), +#if wxUSE_FILEDLG + wxFileDialog dialog( this, _T("Open text"), wxEmptyString, wxEmptyString, _T("Text file (*.txt)|*.txt|Any file (*)|*"), - wxSAVE|wxOVERWRITE_PROMPT ); + wxFD_SAVE|wxFD_OVERWRITE_PROMPT ); if (dialog.ShowModal() == wxID_OK) { m_filename = dialog.GetPath(); @@ -286,6 +285,7 @@ void MyFrame::OnSaveAs( wxCommandEvent& WXUNUSED(event) ) SetStatusText( m_filename ); #endif // wxUSE_STATUSBAR } +#endif // wxUSE_FILEDLG } void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) @@ -404,6 +404,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + SetVendorName(_T("Free world")); SetAppName(_T("wxEdit")); @@ -417,4 +420,3 @@ int MyApp::OnExit() { return 0; } -