55 myBackGroundColor(backGroundColor) {
63 icon = (FXIcon*) - 1L;
175 FXFont* font = list->
getFont();
178 w =
icon->getWidth();
180 if (!
label.empty()) {
184 w += font->getTextWidth(
label.text(),
label.length());
193 FXFont* font = list->
getFont();
194 FXint th = 0, ih = 0;
196 ih =
icon->getHeight();
198 if (!
label.empty()) {
199 th = font->getFontHeight();
217 FXFont* font = list->
getFont();
220 if (!
label.empty()) {
221 th = font->getFontHeight();
228 dc.fillRectangle(xx, yy, ww, hh);
230 dc.drawFocusRectangle(xx + 1, yy + 1, ww - 2, hh - 2);
234 dc.drawIcon(
icon, xx, yy + (hh - ih) / 2);
239 if (!
label.empty()) {
242 dc.setForeground(makeShadowColor(list->getBackColor()));
248 dc.drawText(xx, yy + (hh - th) / 2 + font->getFontAscent(),
label);
255 FXint iw = 0, ih = 0, tw = 0, th = 0, ix, iy, tx, ty, h;
256 FXFont* font = list->
getFont();
258 iw =
icon->getWidth();
259 ih =
icon->getHeight();
261 if (!
label.empty()) {
262 tw = 4 + font->getTextWidth(
label.text(),
label.length());
263 th = 4 + font->getFontHeight();
275 if (ix <= xx && iy <= yy && xx < ix + iw && yy < iy + ih) {
280 if (tx <= xx && ty <= yy && xx < tx + tw && yy < ty + th) {
A list item which allows for custom coloring.
FXFont * getFont() const
Return text font.
FXColor getTextColor() const
Return normal text color.
FXColor getSelBackColor() const
Return selected text background.
FXColor getSelTextColor() const
Return selected text color.
FXbool isEnabled() const
Return true if this item is enabled.
void detach()
Detach server-side resources.
void setDraggable(FXbool draggable)
Make item draggable.
MFXListIconItem()
FOX need this.
FXint getHeight(const MFXListIcon *list) const
Return height of item as drawn in list.
void setText(const FXString &txt)
Change item's text label.
void create()
Create server-side resources.
void setSelected(FXbool selected)
Select item.
const FXString & getText() const
Return item's text label.
FXint getWidth(const MFXListIcon *list) const
Return width of item as drawn in list.
void setEnabled(FXbool enabled)
Enable or disable item.
FXIcon * getIcon() const
Return item's icon.
void destroy()
Destroy server-side resources.
const FXColor & getBackGroundColor() const
get background color
FXbool hasFocus() const
Return true if item has focus.
FXColor myBackGroundColor
backGround color
~MFXListIconItem()
Destroy item and free icons if owned.
FXint hitItem(const MFXListIcon *list, FXint x, FXint y) const
hit item
FXbool isSelected() const
Return true if this item is selected.
FXbool isDraggable() const
Return true if this item is draggable.
void setFocus(FXbool focus)
Make item draw as focused.
void draw(const MFXListIcon *list, FXDC &dc, FXint x, FXint y, FXint w, FXint h)
daraw