25 #define SIDE_SPACING 4 // Spacing between side and item
26 #define ICON_SPACING 4 // Spacing between parent and child in x direction
37 FXIMPLEMENT(
FXTreeListDinamic, FXTreeList, FXTreeListDinamicMap, ARRAYNUMBER(FXTreeListDinamicMap))
46 FXTreeItem(text, oi, ci, ptr) {
58 register FXIcon* icon = (state & OPENED) ? openIcon : closedIcon;
59 register FXFont* font = list->getFont();
60 register FXint th = 0, tw = 0, ih = 0, iw = 0;
63 iw = icon->getWidth();
64 ih = icon->getHeight();
65 dc.drawIcon(icon, xx, yy + (hh - ih) / 2);
69 tw = 4 + font->getTextWidth(label.text(), label.length());
70 th = 4 + font->getFontHeight();
73 dc.setForeground(list->getSelBackColor());
74 dc.fillRectangle(xx, yy, tw, th);
77 dc.drawFocusRectangle(xx + 1, yy + 1, tw - 2, th - 2);
80 dc.setForeground(makeShadowColor(list->getBackColor()));
81 }
else if (isSelected()) {
82 dc.setForeground(list->getSelTextColor());
86 dc.drawText(xx + 2, yy + font->getFontAscent() + 2, label);
93 FXTreeList(p, tgt, sel, opts, 0, 0, 0, 200) {
100 setHeight(getContentHeight() + 20);
116 FXTreeList::update();
123 return FXTreeList::clearItems();
129 return FXTreeList::getNumItems();
142 if (newItem !=
nullptr) {
159 return FXTreeList::getItemAt(x, y);
180 FXTreeList::onLeftBtnPress(obj, sel, ptr);
189 setHeight(getContentHeight() + 20);
195 FXTreeList::FXTreeList() {