-#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);
-
- m_hWnd = (WXHWND)wx_list;
-
-#if CTL3D
- if (want3D)
- {
- Ctl3dSubclassCtl(wx_list);
- m_useCtl3D = TRUE;
- }
-#endif
-
- // Subclass again to catch messages
- SubclassWin((WXHWND)wx_list);
-
- uint ui;
- for (ui = 0; ui < (uint)n; ui++) {
- SendMessage(wx_list, LB_ADDSTRING, 0, (LPARAM)(const char *)choices[ui]);
- }
-
-#if USE_OWNER_DRAWN
- if ( m_windowStyle & wxLB_OWNERDRAW ) {
- for (ui = 0; ui < (uint)n; ui++) {
- // create new item which will process WM_{DRAW|MEASURE}ITEM messages
- wxOwnerDrawn *pNewItem = CreateItem(ui);
- pNewItem->SetName(choices[ui]);
- m_aItems.Add(pNewItem);
- ListBox_SetItemData(wx_list, ui, pNewItem);
- }