+ return CreateAndInit(parent, id, pos, size, n, choices, style,
+ validator, name);
+}
+
+bool wxChoice::CreateAndInit(wxWindow *parent,
+ wxWindowID id,
+ const wxPoint& pos,
+ const wxSize& sizeOrig,
+ int n, const wxString choices[],
+ long style,
+ const wxValidator& validator,
+ const wxString& name)
+{
+ // this is a bit hackish but we want to prevent MSWCreateControl() from
+ // calling SetBestSize() (which it would do if any of the size components
+ // is not given) because it wouldn't calculate it correctly if we have any
+ // strings as they're not yet added to the control when it is called
+ //
+ // so: if we have any strings, we fudge the size parameter so that
+ // SetBestSize() is not called by MSWCreateControl() but then we do call it
+ // manually below
+ bool autoSize = false;
+ wxSize size = sizeOrig;
+ if ( n )
+ {
+ if ( size.x < 0 )
+ {
+ size.x = 1;
+ autoSize = true;
+ }
+ if ( size.y < 0 )
+ {
+ size.y = 1;
+ autoSize = true;
+ }
+ }
+
+ // initialize wxControl
+ if ( !CreateControl(parent, id, pos, size, style, validator, name) )
+ return FALSE;
+
+ // now create the real HWND
+ if ( !MSWCreateControl(wxT("COMBOBOX"), _T(""), pos, size) )