]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/textctrl.cpp
added missing selstore.cpp
[wxWidgets.git] / src / mac / textctrl.cpp
index 5f71de9973b194c461a2d6b70e41bc646372401a..17740e7ccea3a5fc56c37463ad5a1685b5535a5d 100644 (file)
@@ -859,7 +859,7 @@ void wxTextCtrl::SetValue(const wxString& st)
     }
     else
     {
-        bool formerEditable = IsEditable() ;
+        bool formerEditable = m_editable ;
         if ( !formerEditable )
             SetEditable(true) ;
 #if wxUSE_UNICODE
@@ -887,7 +887,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
 {
     if ( m_macUsesTXN )
     {
-        bool formerEditable = IsEditable() ;
+        bool formerEditable = m_editable ;
         if ( !formerEditable )
             SetEditable(true) ;
         TXNTypeAttributes typeAttr[4] ;
@@ -1150,7 +1150,7 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value)
     }
     else
     {
-        bool formerEditable = IsEditable() ;
+        bool formerEditable = m_editable ;
         if ( !formerEditable )
             SetEditable(true) ;
         TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
@@ -1181,7 +1181,7 @@ void wxTextCtrl::Remove(long from, long to)
     }
     else
     {
-        bool formerEditable = IsEditable() ;
+        bool formerEditable = m_editable ;
         if ( !formerEditable )
             SetEditable(true) ;
         TXNSetSelection( ((TXNObject) m_macTXN) , from , to ) ;
@@ -1242,7 +1242,7 @@ void wxTextCtrl::WriteText(const wxString& st)
     }
     else
     {
-        bool formerEditable = IsEditable() ;
+        bool formerEditable = m_editable ;
         if ( !formerEditable )
             SetEditable(true) ;
         long start , end , dummy ;
@@ -1344,6 +1344,10 @@ void wxTextCtrl::Undo()
 {
     if (CanUndo())
     {
+        if ( m_macUsesTXN ) 
+        {
+            TXNUndo((TXNObject)m_macTXN); 
+        }
     }
 }
 
@@ -1351,16 +1355,36 @@ void wxTextCtrl::Redo()
 {
     if (CanRedo())
     {
+        if ( m_macUsesTXN ) 
+        {
+            TXNRedo((TXNObject)m_macTXN); 
+        }
     }
 }
 
 bool wxTextCtrl::CanUndo() const
 {
+    if ( !IsEditable() ) 
+    {
+        return false ; 
+    }
+    if ( m_macUsesTXN ) 
+    {
+        return TXNCanUndo((TXNObject)m_macTXN,NULL); 
+    }
     return FALSE ;
 }
 
 bool wxTextCtrl::CanRedo() const
 {
+    if ( !IsEditable() ) 
+    {
+        return false ; 
+    }
+    if ( m_macUsesTXN ) 
+    {
+        return TXNCanRedo((TXNObject)m_macTXN,NULL); 
+    }
     return FALSE ;
 }