X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbclistbox.C;h=960226f8bfffc43116fb4134706efaef1555186b;hb=680d2000be2db33da1e2733461854158067f5862;hp=3b1332923fcc9953e21374d060afe169960a0254;hpb=331564c0ebb30688da917fc1c89058e12771e348;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index 3b133292..960226f8 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -432,6 +432,7 @@ BC_ListBox::BC_ListBox(int x, // reset the search engine //printf("BC_ListBox::BC_ListBox 4\n"); + show_query = 0; reset_query(); //printf("BC_ListBox::BC_ListBox 5\n"); } @@ -1361,6 +1362,8 @@ int BC_ListBox::get_text_mask(BC_ListBoxItem *item, { w = get_text_width(MEDIUMFONT, item->text) + LISTBOX_MARGIN * 2; h = row_height; + int ih = get_icon_h(item); + if( h < ih ) h = ih; } return 0; } @@ -2479,12 +2482,11 @@ int BC_ListBox::repeat_event(int64_t duration) case NO_OPERATION: // Show tooltip - if(button_highlighted && is_popup && !tooltip_done && + if(button_highlighted && is_popup && tooltip_text && tooltip_text[0] != 0 && duration == get_resources()->tooltip_delay) { show_tooltip(); - tooltip_done = 1; return 1; } break; @@ -3942,6 +3944,7 @@ int BC_ListBox::reposition_window(int x, int y, int w, int h, int flush) int BC_ListBox::deactivate() { + hide_tooltip(); // printf("BC_ListBox::deactivate %d this=%p gui=%p active=%d\n", // __LINE__, // this, @@ -3978,6 +3981,7 @@ int BC_ListBox::deactivate() int BC_ListBox::activate(int take_focus) { if( active ) return 0; + active = 1; if( take_focus ) set_active_subwindow(this); button_releases = 0; @@ -3996,11 +4000,11 @@ int BC_ListBox::activate(int take_focus) int BC_ListBox::activate(int x, int y, int w, int h) { - if( active || !is_popup || gui ) return 0; + if( !is_popup || gui ) return 0; + active = 1; if(w != -1) popup_w = w; if(h != -1) popup_h = h; reset_query(); - active = 1; if( y + popup_h > top_level->get_root_h(0) ) y -= get_h() + popup_h; add_subwindow(gui = new BC_Popup(this, @@ -4030,7 +4034,6 @@ int BC_ListBox::keypress_event() { case ESC: case RETURN: - case BACKSPACE: top_level->deactivate(); // If user is manipulating popup with keyboard, don't pass on event. @@ -4131,7 +4134,12 @@ int BC_ListBox::keypress_event() if(query_len > 0) query[--query_len] = 0; new_selection = query_list(); } - + if( show_query ) { + if( query_len > 0 ) + show_tooltip(query); + else + hide_tooltip(); + } redraw = 1; result = 1; } @@ -4398,9 +4406,14 @@ void BC_ListBox::draw_text_recursive(ArrayList *data, gui->set_color(row_color); gui->draw_box(x, y, column_width, h); gui->set_color(BLACK); - int yy = y, xx = x + column_width-1; - gui->draw_line(x, yy, xx, yy); - yy = y + row_height; + int xx = x + column_width-1; + gui->draw_line(x, y, xx, y); + int hh = row_height; + if( display_format == LISTBOX_ICON_LIST ) { + int ih = get_icon_h(item); + if( ih > hh ) hh = ih; + } + int yy = y + hh-1; gui->draw_line(x, yy, xx, yy); }