SetMarginWidth(0);
}
-wxOwnerDrawn *wxListBox::CreateItem(size_t n)
+wxOwnerDrawn *wxListBox::CreateItem(size_t WXUNUSED(n))
{
return new wxListBoxItem();
}
DWORD wstyle = WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
LBS_NOTIFY | LBS_HASSTRINGS /* | WS_CLIPSIBLINGS */;
+
+ wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
+ _T("only one of listbox selection modes can be specified") );
+ if ( m_windowStyle & wxCLIP_SIBLINGS )
+ wstyle |= WS_CLIPSIBLINGS;
+
if (m_windowStyle & wxLB_MULTIPLE)
wstyle |= LBS_MULTIPLESEL;
else if (m_windowStyle & wxLB_EXTENDED)
wListbox += 3*cx;
- int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)*(wxMax(m_noItems, 7));
+ // don't make the listbox too tall (limit height to 10 items) but don't
+ // make it too small neither
+ int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)*
+ wxMin(wxMax(m_noItems, 3), 10);
return wxSize(wListbox, hListbox);
}
wxListBoxItem *pItem = (wxListBoxItem *)data;
- wxDC dc;
- dc.SetHDC((WXHDC)pStruct->hDC, FALSE);
+ wxDCTemp dc((WXHDC)pStruct->hDC);
wxRect rect(wxPoint(pStruct->rcItem.left, pStruct->rcItem.top),
wxPoint(pStruct->rcItem.right, pStruct->rcItem.bottom));
return pItem->OnDrawItem(dc, rect,
- (wxOwnerDrawn::wxODAction)pStruct->itemAction,
- (wxOwnerDrawn::wxODStatus)pStruct->itemState);
+ (wxOwnerDrawn::wxODAction)pStruct->itemAction,
+ (wxOwnerDrawn::wxODStatus)pStruct->itemState);
}
#endif