fix for assert when setting tooltip for a readonly combo

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8530 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-10-12 00:31:18 +00:00
parent 80a24267cb
commit 1be06faf73

View File

@@ -382,12 +382,13 @@ void wxToolTip::SetWindow(wxWindow *win)
wxComboBox *combo = wxDynamicCast(control, wxComboBox); wxComboBox *combo = wxDynamicCast(control, wxComboBox);
if ( combo ) if ( combo )
{ {
WXHWND hwndComboEdit = combo->GetEditHWND(); WXHWND hwndComboEdit = combo->GetWindowStyle() & wxCB_READONLY
? combo->GetHWND()
: combo->GetEditHWND();
if ( hwndComboEdit ) if ( hwndComboEdit )
{ {
Add(hwndComboEdit); Add(hwndComboEdit);
} }
//else: it's ok for a combo to be read only, of course
} }
} }