- m_noItems = n;
- m_hWnd = 0;
- m_selected = 0;
- m_selections = NULL;
-
- SetName(name);
- SetValidator(validator);
-
- if (parent) parent->AddChild(this);
-
- wxSystemSettings settings;
- SetBackgroundColour(settings.GetSystemColour(wxSYS_COLOUR_WINDOW));
- SetForegroundColour(parent->GetDefaultForegroundColour());
-
- m_windowId = ( id == -1 ) ? (int)NewControlId() : id;
-
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
- m_windowStyle = style;
-
- DWORD wstyle = WS_VSCROLL | WS_TABSTOP | LBS_NOTIFY | LBS_HASSTRINGS;
- if (m_windowStyle & wxLB_MULTIPLE)
- wstyle |= LBS_MULTIPLESEL;
- else if (m_windowStyle & wxLB_EXTENDED)
- wstyle |= LBS_EXTENDEDSEL;
-
- if (m_windowStyle & wxLB_ALWAYS_SB)
- wstyle |= LBS_DISABLENOSCROLL ;
- if (m_windowStyle & wxLB_HSCROLL)
- wstyle |= WS_HSCROLL;
- if (m_windowStyle & wxLB_SORT)
- wstyle |= LBS_SORT;
-
-#if USE_OWNER_DRAWN
- if ( m_windowStyle & wxLB_OWNERDRAW ) {
- // we don't support LBS_OWNERDRAWVARIABLE yet
- wstyle |= LBS_OWNERDRAWFIXED;
- }
-#endif
- // Without this style, you get unexpected heights, so e.g. constraint layout
- // doesn't work properly
- wstyle |= LBS_NOINTEGRALHEIGHT;
-
- bool want3D;
- WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
-
- // Even with extended styles, need to combine with WS_BORDER
- // for them to look right.
- if ( want3D || (m_windowStyle & wxSIMPLE_BORDER)
- || (m_windowStyle & wxRAISED_BORDER)
- || (m_windowStyle & wxSUNKEN_BORDER)
- || (m_windowStyle & wxDOUBLE_BORDER) ) {
- wstyle |= WS_BORDER;
- }
-
- HWND wx_list = CreateWindowEx(exStyle, "LISTBOX", NULL,
- wstyle | WS_CHILD,
- 0, 0, 0, 0,
- (HWND)parent->GetHWND(), (HMENU)m_windowId,
- wxGetInstance(), NULL);
-#if CTL3D
- if (want3D)
- {
- Ctl3dSubclassCtl(wx_list);
- m_useCtl3D = TRUE;
- }
-#endif
+ wxCArrayString chs(choices);
+ return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
+ style, validator, name);
+}