X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95a16b12044cb40a8287ca67b74de133392804ea..428f841bd05025c94626d3ddf357a02901e87bc4:/samples/mobile/wxedit/wxedit.cpp diff --git a/samples/mobile/wxedit/wxedit.cpp b/samples/mobile/wxedit/wxedit.cpp index c2e2afaddd..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,22 +209,22 @@ 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(); - #ifdef __WXX11__ // requires wxUSE_UNIV_TEXTCTRL to be set to 0 #if 0 @@ -266,6 +262,7 @@ void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) ) SetStatusText( m_filename ); #endif // wxUSE_STATUSBAR } +#endif // wxUSE_FILEDLG } void MyFrame::OnSave( wxCommandEvent& WXUNUSED(event) ) @@ -275,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(); @@ -287,6 +285,7 @@ void MyFrame::OnSaveAs( wxCommandEvent& WXUNUSED(event) ) SetStatusText( m_filename ); #endif // wxUSE_STATUSBAR } +#endif // wxUSE_FILEDLG } void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) @@ -405,6 +404,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + SetVendorName(_T("Free world")); SetAppName(_T("wxEdit")); @@ -418,4 +420,3 @@ int MyApp::OnExit() { return 0; } -