}
+int BC_ListBox::get_icon_x(BC_ListBoxItem *item)
+{
+ return get_item_x(item) + ICON_MARGIN;
+}
+
+int BC_ListBox::get_icon_y(BC_ListBoxItem *item)
+{
+ return get_item_y(item) + ICON_MARGIN;
+}
+
int BC_ListBox::get_icon_w(BC_ListBoxItem *item)
{
- return item->get_icon_w();
+ return item->get_icon_w() + 2*ICON_MARGIN;
}
int BC_ListBox::get_icon_h(BC_ListBoxItem *item)
{
- return item->get_icon_h();
+ return item->get_icon_h() + 2*ICON_MARGIN;
}
int BC_ListBox::get_text_w(BC_ListBoxItem *item)
return 0;
}
+int BC_ListBox::is_highlighted()
+{
+ return list_highlighted;
+}
+
void BC_ListBox::expand_item(BC_ListBoxItem *item, int expand)
{
if( item ) {
case LISTBOX_ICONS:
case LISTBOX_ICONS_PACKED:
case LISTBOX_ICON_LIST: {
- x = get_item_x(item) + ICON_MARGIN;
- y = get_item_y(item) + ICON_MARGIN;
- w = get_icon_w(item) + ICON_MARGIN;
- h = get_icon_h(item) + ICON_MARGIN;
+ x = get_icon_x(item);
+ y = get_icon_y(item);
+ w = get_icon_w(item);
+ h = get_icon_h(item);
break; }
case LISTBOX_TEXT:
default: {
case LISTBOX_ICONS:
case LISTBOX_ICONS_PACKED: {
if( icon_position == ICON_LEFT ) {
- x += get_icon_w(item) + ICON_MARGIN * 2;
+ x += get_icon_w(item);
y += get_icon_h(item) - get_text_h(item);
}
else {
- y += get_icon_h(item) + ICON_MARGIN;
+ y += get_icon_h(item);
}
w = packed_icons ?
- get_icon_w(item) + ICON_MARGIN * 4 :
+ get_icon_w(item) + ICON_MARGIN * 2 :
get_text_w(item) + ICON_MARGIN * 2 ;
h = get_text_h(item) + ICON_MARGIN * 2;
break; }
}
// Draw icons
gui->set_color(get_item_color(data, 0, i));
- if( item->icon )
- gui->pixmap->draw_pixmap(item->icon,
- icon_x + ICON_MARGIN, icon_y + ICON_MARGIN);
+ VFrame *vicon = item->get_vicon_frame();
+ if( vicon )
+ gui->pixmap->draw_vframe(vicon, icon_x, icon_y);
+ else if( item->icon )
+ gui->pixmap->draw_pixmap(item->icon, icon_x, icon_y);
char item_text[BCTEXTLEN];
if( display_format == LISTBOX_ICONS_PACKED )
gui->truncate_text(item_text, item->text, text_w);
else
strcpy(item_text, item->text);
- gui->draw_text(text_x + ICON_MARGIN,
- text_y + ICON_MARGIN + get_baseline(item), item_text);
+ gui->draw_text(text_x, text_y + get_baseline(item), item_text);
}
else
item->set_in_view(0);
if( column == 0 && display_format == LISTBOX_ICON_LIST ) {
- if( item->icon ) {
- gui->pixmap->draw_pixmap(item->icon, x, y);
+ int ix = get_icon_x(item), iy = get_icon_y(item);
+ VFrame *vicon = item->get_vicon_frame();
+ if( vicon ) {
+ gui->pixmap->draw_vframe(vicon, ix, iy);
+ x += vicon->get_w() + ICON_MARGIN;
+ }
+ else if( item->icon ) {
+ gui->pixmap->draw_pixmap(item->icon, ix, iy);
x += item->icon->get_w() + ICON_MARGIN;
}
}