- 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;
- }
-#else
- // Change from previous versions of wxWin: JACS Nov. 1995
- // Not sure whether to have integral, or no integral
- // style. With the latter we may get partial items showing.
- // VZ: also it makes life more difficult for owner-drawn controls
- wstyle |= LBS_NOINTEGRALHEIGHT;
-#endif
+ wxCArrayString chs(choices);
+ return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
+ style, validator, name);
+}