Fix for assertions when updating UI and focus is on read-only combobox

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-02-04 21:35:54 +00:00
parent f062c0e2ee
commit 9b433fceec

View File

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