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