X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbclistbox.C;h=ae341879caf4f22372e98a4c5ea266e51b0658ee;hb=1db0dacec8f9d7f5687e582bd282d9bf83bd58f0;hp=8ef0ab0b376247d7443d960cf9cefbec7cd41ee9;hpb=0df48ad2d876409c5beeae2e21933a728ea76c33;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index 8ef0ab0b..ae341879 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -1780,12 +1780,13 @@ int BC_ListBox::get_scrollbars() int BC_ListBox::get_w() { - return is_popup ? button_images[0]->get_w() + xS(1) : popup_w; + return is_popup ? BCPOPUPLISTBOX_W : popup_w; } int BC_ListBox::get_h() { - return is_popup ? button_images[0]->get_h() + yS(1) : popup_h; + return is_popup ? BCPOPUPLISTBOX_H : popup_h; } + int BC_ListBox::gui_tooltip(const char *text) { return is_popup && gui ? gui->show_tooltip(text, gui->get_w(),0, -1,-1) : -1; @@ -3724,12 +3725,11 @@ int BC_ListBox::draw_items(int flush, int draw_bg) 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); + char *item_text = display_format == LISTBOX_ICONS_PACKED ? + get_truncated_text(MEDIUMFONT, item->text, text_w) : + cstrdup(item->text); gui->draw_text(text_x, text_y + get_baseline(item), item_text); + delete [] item_text; } else item->set_in_view(0);