]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/mobile/wxedit/wxedit.cpp
removed datacmn, not a base file any more
[wxWidgets.git] / samples / mobile / wxedit / wxedit.cpp
index d9e0c53c4e9a142304d8b471d1f907024334d502..c3e155bacebd0a4f8a69ecf6aeadffcd459894a6 100644 (file)
@@ -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;