+bool wxComboBox::Create(
+ wxWindow* pParent
+, wxWindowID vId
+, const wxString& rsValue
+, const wxPoint& rPos
+, const wxSize& rSize
+, int n
+, const wxString asChoices[]
+, long lStyle
+, const wxValidator& rValidator
+, const wxString& rsName
+)
+{
+ m_isShown = false;
+
+ if (!CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
+ ,rValidator
+ ,rsName
+ ))
+ return false;
+
+ //
+ // Get the right style
+ //
+ long lSstyle = 0L;
+
+ lSstyle = WS_TABSTOP |
+ WS_VISIBLE;
+
+ // clipping siblings does not yet work
+ // if (lStyle & wxCLIP_SIBLINGS )
+ // lSstyle |= WS_CLIPSIBLINGS;
+ if (lStyle & wxCB_READONLY)
+ lSstyle |= CBS_DROPDOWNLIST;
+ else if (lStyle & wxCB_SIMPLE)
+ lSstyle |= CBS_SIMPLE; // A list (shown always) and edit control
+ else
+ lSstyle |= CBS_DROPDOWN;
+
+
+ if (!OS2CreateControl( _T("COMBOBOX")
+ ,lSstyle
+ ))
+ return false;
+
+ //
+ // A choice/combobox normally has a white background (or other, depending
+ // on global settings) rather than inheriting the parent's background colour.
+ //
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
+
+ for (int i = 0; i < n; i++)
+ {
+ Append(asChoices[i]);
+ }
+
+ SetSize( rPos.x
+ ,rPos.y
+ ,rSize.x
+ ,rSize.y
+ );
+
+ // Set height to use with sizers i.e. without the dropdown listbox
+ wxFont vFont = GetFont();
+ int nEditHeight;
+ wxGetCharSize( GetHWND(), NULL, &nEditHeight, &vFont );
+ nEditHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nEditHeight);
+ SetInitialSize(wxSize(-1,nEditHeight+4)); // +2x2 for the border
+
+ if (!rsValue.empty())
+ {
+ SetValue(rsValue);
+ }
+ gfnWndprocEdit = (WXFARPROC)::WinSubclassWindow( (HWND)GetHwnd()
+ ,(PFNWP)wxComboEditWndProc
+ );
+ ::WinSetWindowULong(GetHwnd(), QWL_USER, (ULONG)this);
+ Show(true);
+ return true;
+} // end of wxComboBox::Create
+