0, 0, 0, 0,
(HWND)parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
+
+ m_hWnd = (WXHWND)wx_list;
+
#if CTL3D
if (want3D)
{
}
#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 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
ListBox_SetItemData(wx_list, ui, pNewItem);
}
}
- #endif
+#endif
if ((m_windowStyle & wxLB_MULTIPLE) == 0)
SendMessage(wx_list, LB_SETCURSEL, 0, 0);
- ShowWindow(wx_list, SW_SHOW);
-
- m_hWnd = (WXHWND)wx_list;
-
- // Subclass again for purposes of dialog editing mode
- SubclassWin((WXHWND)wx_list);
-
SetFont(* parent->GetFont());
SetSize(x, y, width, height);
+ ShowWindow(wx_list, SW_SHOW);
+
return TRUE;
}
wxListBox::~wxListBox(void)
{
- #if USE_OWNER_DRAWN
+#if USE_OWNER_DRAWN
uint uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
}
- #endif
+#endif
}
void wxListBox::SetupColours(void)
int index = ListBox_AddString(hwnd, item);
m_noItems ++;
- #if USE_OWNER_DRAWN
+#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
wxOwnerDrawn *pNewItem = CreateItem(-1); // dummy argument
pNewItem->SetName(item);
m_aItems.Add(pNewItem);
ListBox_SetItemData(hwnd, index, pNewItem);
}
- #endif
+#endif
SetHorizontalExtent(item);
}
int index = ListBox_AddString(hwnd, item);
m_noItems ++;
- #if USE_OWNER_DRAWN
+#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// client data must be pointer to wxOwnerDrawn, otherwise we would crash
// in OnMeasure/OnDraw.
wxFAIL_MSG("Can't use client data with owner-drawn listboxes");
}
else
- #endif
+#endif
ListBox_SetItemData(hwnd, index, Client_data);
SetHorizontalExtent(item);
}
m_noItems = n;
- #if USE_OWNER_DRAWN
+#if USE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// first delete old items
uint ui = m_aItems.Count();
"Can't use client data with owner-drawn listboxes");
}
}
- #endif
+#endif
SetHorizontalExtent("");
ShowWindow(hwnd, SW_SHOW);
long wxListBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
-/*
+#if 0
switch (nMsg)
{
case WM_INITDIALOG:
case WM_MBUTTONDBLCLK:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
-// case WM_LBUTTONDBLCLK:
+ case WM_LBUTTONDBLCLK:
case WM_MOUSEMOVE:
case WM_DESTROY:
case WM_COMMAND:
case WM_NCHITTEST:
return MSWDefWindowProc(nMsg, wParam, lParam );
}
-*/
+#endif
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
}