X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f4a9a1025aace6f5f82aa4c05c5ceb651b86dd4..6feaaaedd69b30001afcfe54620f08f635094819:/samples/mobile/wxedit/wxedit.cpp?ds=sidebyside diff --git a/samples/mobile/wxedit/wxedit.cpp b/samples/mobile/wxedit/wxedit.cpp index d9e0c53c4e..c3e155bace 100644 --- a/samples/mobile/wxedit/wxedit.cpp +++ b/samples/mobile/wxedit/wxedit.cpp @@ -249,10 +249,7 @@ void MyFrame::OnOpen( wxCommandEvent &event ) void MyFrame::OnSave( wxCommandEvent &event ) { - if (m_filename.empty()) - OnSaveAs( event ); - else - m_text->SaveFile( m_filename ); + Save(); } void MyFrame::OnSaveAs( wxCommandEvent &event ) @@ -284,7 +281,12 @@ void MyFrame::OnQuit( wxCommandEvent &event ) bool MyFrame::Save() { - m_text->SaveFile(); + wxCommandEvent event; + + if (m_filename.empty()) + OnSaveAs( event ); + else + m_text->SaveFile( m_filename ); return TRUE; } @@ -325,7 +327,15 @@ void MyFrame::OnUpdateUI( wxUpdateUIEvent &event ) event.Enable( FALSE ); break; case ID_DELETE: +#ifdef __WXUNIVERSAL__ event.Enable( m_text->HasSelection() ); +#else + { + long selFrom, selTo; + m_text->GetSelection(& selFrom, & selTo); + event.Enable( selFrom != selTo ); + } +#endif break; default: break;