X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11fdee427ee7c2aae0fda8655b30791f084a45ab..428f841bd05025c94626d3ddf357a02901e87bc4:/samples/mobile/wxedit/wxedit.cpp?ds=sidebyside diff --git a/samples/mobile/wxedit/wxedit.cpp b/samples/mobile/wxedit/wxedit.cpp index 49b826f480..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,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; } -