+ // we shouldn't call SetValue() for an empty string because this would
+ // (correctly) result in an assert with a read only combobox and is useless
+ // for the other ones anyhow
+ if ( !value.empty() )
+ SetValue(value);
+
+ // a (not read only) combobox is, in fact, 2 controls: the combobox itself
+ // and an edit control inside it and if we want to catch events from this
+ // edit control, we must subclass it as well
+ if ( !(style & wxCB_READONLY) )
+ {
+ gs_wndprocEdit = wxSetWindowProc((HWND)GetEditHWND(), wxComboEditWndProc);
+ }
+
+ // and finally, show the control
+ Show(true);
+
+ return true;
+}
+
+bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
+ const wxString& value,
+ const wxPoint& pos,
+ const wxSize& size,
+ const wxArrayString& choices,
+ long style,
+ const wxValidator& validator,
+ const wxString& name)
+{
+ wxCArrayString chs(choices);
+ return Create(parent, id, value, pos, size, chs.GetCount(),
+ chs.GetStrings(), style, validator, name);
+}
+
+WXDWORD wxComboBox::MSWGetStyle(long style, WXDWORD *exstyle) const
+{
+ // we never have an external border
+ WXDWORD msStyle = wxChoice::MSWGetStyle
+ (
+ (style & ~wxBORDER_MASK) | wxBORDER_NONE, exstyle
+ );
+
+ // usually WS_TABSTOP is added by wxControl::MSWGetStyle() but as we're
+ // created hidden (see Create() above), it is not done for us but we still
+ // want to have this style
+ msStyle |= WS_TABSTOP;
+
+ // remove the style always added by wxChoice
+ msStyle &= ~CBS_DROPDOWNLIST;