]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
don't keep dangling m_prevRadio pointer (2nd part of patch 1836644)
[wxWidgets.git] / src / msw / combobox.cpp
index bd3650dc3b47b0e18db87cb87f536dc554532a34..bb651346225a7cbe8d9aa2ff066f8db3700fbdda 100644 (file)
@@ -396,12 +396,9 @@ bool wxComboBox::MSWShouldPreProcessMessage(WXMSG *pMsg)
 
 WXHWND wxComboBox::GetEditHWNDIfAvailable() const
 {
-    POINT pt = { 4, 4 };
-    WXHWND hWndEdit = (WXHWND)::ChildWindowFromPoint(GetHwnd(), pt);
-    if ( hWndEdit == GetHWND() )
-        hWndEdit = NULL;
-
-    return hWndEdit;
+    // we assume that the only child of the combobox is the edit window so it's
+    // unnecessary to pass "EDIT" as class name parameter
+    return (WXHWND)::FindWindowEx(GetHwnd(), NULL, NULL, NULL);
 }
 
 WXHWND wxComboBox::GetEditHWND() const
@@ -610,12 +607,12 @@ void wxComboBox::OnUpdatePaste(wxUpdateUIEvent& event)
 
 void wxComboBox::OnUpdateUndo(wxUpdateUIEvent& event)
 {
-    event.Enable( CanUndo() );
+    event.Enable( IsEditable() && CanUndo() );
 }
 
 void wxComboBox::OnUpdateRedo(wxUpdateUIEvent& event)
 {
-    event.Enable( CanRedo() );
+    event.Enable( IsEditable() && CanRedo() );
 }
 
 void wxComboBox::OnUpdateDelete(wxUpdateUIEvent& event)