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
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)