int width, int height,
int sizeFlags = wxSIZE_AUTO);
+ // Show or hide the popup part of the control.
+ void MSWDoPopupOrDismiss(bool show);
+
// update the height of the drop down list to fit the number of items we
// have (without changing the visible height)
void MSWUpdateDropDownHeight();
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip(wxToolTip *tip);
#endif
- void MSWDoPopupOrDismiss(bool show);
// this is the implementation of GetEditHWND() which can also be used when
// we don't have the edit control, it simply returns NULL then
return EDIT_HEIGHT_FROM_CHAR_HEIGHT( cy ) * wxMin( wxMax( nItems, 3 ), 6 ) + hItem - 1;
}
+// ----------------------------------------------------------------------------
+// Popup operations
+// ----------------------------------------------------------------------------
+
+void wxChoice::MSWDoPopupOrDismiss(bool show)
+{
+ wxASSERT_MSG( !HasFlag(wxCB_SIMPLE),
+ wxT("can't popup/dismiss the list for simple combo box") );
+
+ // we *must* set focus to the combobox before showing or hiding the drop
+ // down as without this we get WM_LBUTTONDOWN messages with invalid HWND
+ // when hiding it (whether programmatically or manually) resulting in a
+ // crash when we pass them to IsDialogMessage()
+ //
+ // this can be seen in the combo page of the widgets sample under Windows 7
+ SetFocus();
+
+ ::SendMessage(GetHwnd(), CB_SHOWDROPDOWN, show, 0);
+}
+
// ----------------------------------------------------------------------------
// MSW message handlers
// ----------------------------------------------------------------------------
event.Enable(IsEditable() && !wxTextEntry::IsEmpty());
}
-void wxComboBox::MSWDoPopupOrDismiss(bool show)
-{
- wxASSERT_MSG( !HasFlag(wxCB_SIMPLE),
- wxT("can't popup/dismiss the list for simple combo box") );
-
- // we *must* set focus to the combobox before showing or hiding the drop
- // down as without this we get WM_LBUTTONDOWN messages with invalid HWND
- // when hiding it (whether programmatically or manually) resulting in a
- // crash when we pass them to IsDialogMessage()
- //
- // this can be seen in the combo page of the widgets sample under Windows 7
- SetFocus();
-
- ::SendMessage(GetHwnd(), CB_SHOWDROPDOWN, show, 0);
-}
-
#if wxUSE_TOOLTIPS
void wxComboBox::DoSetToolTip(wxToolTip *tip)