]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix for assertions when updating UI and focus is on read-only combobox
authorJulian Smart <julian@anthemion.co.uk>
Fri, 4 Feb 2005 21:35:54 +0000 (21:35 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 4 Feb 2005 21:35:54 +0000 (21:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/combobox.cpp

index 642e48329ae4dfacf27b63af69ab8f3b14be2660..0bd353a41a2f97b46c25dda003092f66e326b33b 100644 (file)
@@ -558,6 +558,9 @@ void wxComboBox::SelectAll()
 
 bool wxComboBox::CanUndo() const
 {
+    if (!IsEditable())
+        return false;
+    
     HWND hEditWnd = (HWND) GetEditHWND() ;
     if ( hEditWnd )
         return ::SendMessage(hEditWnd, EM_CANUNDO, 0, 0) != 0;
@@ -567,6 +570,9 @@ bool wxComboBox::CanUndo() const
 
 bool wxComboBox::CanRedo() const
 {
+    if (!IsEditable())
+        return false;
+    
     HWND hEditWnd = (HWND) GetEditHWND() ;
     if ( hEditWnd )
         return ::SendMessage(hEditWnd, EM_CANUNDO, 0, 0) != 0;
@@ -589,7 +595,7 @@ bool wxComboBox::CanCopy() const
 
 bool wxComboBox::CanCut() const
 {
-    return CanCopy() && IsEditable();
+    return IsEditable() && CanCopy() ;
 }
 
 bool wxComboBox::CanPaste() const