32 #define SIDE_SPACING 6 // Left or right spacing between items 33 #define ICON_SPACING 4 // Spacing between icon and label 38 void MFXListItem::draw(const FXList* list, FXDC& dc, FXint xx, FXint yy, FXint ww, FXint hh) {
40 FXFont* font = list->getFont();
43 ih = icon->getHeight();
46 th = font->getFontHeight();
49 dc.setForeground(list->getSelBackColor());
50 }
else if (bgColor != FXRGBA(0, 0, 0, 0)) {
51 dc.setForeground(bgColor);
53 dc.setForeground(list->getBackColor());
55 dc.fillRectangle(xx, yy, ww, hh);
57 dc.drawFocusRectangle(xx + 1, yy + 1, ww - 2, hh - 2);
61 dc.drawIcon(icon, xx, yy + (hh - ih) / 2);
67 dc.setForeground(makeShadowColor(list->getBackColor()));
68 }
else if (isSelected()) {
69 dc.setForeground(list->getSelTextColor());
71 dc.setForeground(list->getTextColor());
73 dc.drawText(xx, yy + (hh - th) / 2 + font->getFontAscent(), label);
79 FXComposite* p, FXint cols, FXObject* tgt,
80 FXSelector sel, FXuint opts,
81 FXint x, FXint y, FXint w, FXint h,
82 FXint pl, FXint pr, FXint pt, FXint pb):
83 FXComboBox(p, cols, tgt, sel, opts, x, y, w, h, pl, pr, pt, pb)
88 FXint index = list->appendItem(
new MFXListItem(text, icon, bgColor, ptr));
89 if (isItemCurrent(getNumItems() - 1)) {
FXint appendIconItem(const FXString &text, FXIcon *icon, FXColor bgColor=FXRGBA(0, 0, 0, 0), void *ptr=NULL)