X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/925e9792d32e353233985f53a4845f154e455a58..b64608901aa9e5ae3d3d6a59daccc77b3119b53b:/samples/mobile/wxedit/wxedit.cpp diff --git a/samples/mobile/wxedit/wxedit.cpp b/samples/mobile/wxedit/wxedit.cpp index 87676f4571..b6043f9e66 100644 --- a/samples/mobile/wxedit/wxedit.cpp +++ b/samples/mobile/wxedit/wxedit.cpp @@ -5,10 +5,6 @@ // Copyright: ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "wxedit.cpp" -#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,25 @@ 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 wxFileName fname( dialog.GetPath() ); if ((fname.GetExt() == _T("cpp")) || (fname.GetExt() == _T("c")) || @@ -253,6 +252,7 @@ void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) ) { m_text->SetLanguage( wxSOURCE_LANG_NONE ); } +#endif #endif m_filename = dialog.GetPath(); @@ -262,6 +262,7 @@ void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) ) SetStatusText( m_filename ); #endif // wxUSE_STATUSBAR } +#endif // wxUSE_FILEDLG } void MyFrame::OnSave( wxCommandEvent& WXUNUSED(event) ) @@ -271,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(); @@ -283,6 +285,7 @@ void MyFrame::OnSaveAs( wxCommandEvent& WXUNUSED(event) ) SetStatusText( m_filename ); #endif // wxUSE_STATUSBAR } +#endif // wxUSE_FILEDLG } void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) @@ -401,6 +404,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + SetVendorName(_T("Free world")); SetAppName(_T("wxEdit")); @@ -414,4 +420,3 @@ int MyApp::OnExit() { return 0; } -