X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbctextbox.C;h=128d514b92a0d5edbf2c1e8467946964753bb124;hb=b78b166faf60a1c7357f990b1e2fb0e70be29fee;hp=3dfb6cd5f29c42435261b4bb9766d18ff1fb32bb;hpb=7718f72da6995e7b2b2a59dcc61cc80a2f4bf38f;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index 3dfb6cd5..128d514b 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -2487,6 +2487,7 @@ BC_PopupTextBoxText::~BC_PopupTextBoxText() int BC_PopupTextBoxText::handle_event() { + popup->list_item = -1; popup->handle_event(); return 1; } @@ -2500,10 +2501,10 @@ BC_PopupTextBoxList::BC_PopupTextBoxList(BC_PopupTextBox *popup, int x, int y) } int BC_PopupTextBoxList::handle_event() { - BC_ListBoxItem *item = get_selection(0, 0); - if(item) - { - popup->textbox->update(item->get_text()); + int k = get_selection_number(0, 0); + popup->list_item = k; + if( k >= 0 && k < popup->list_items->size() ) { + popup->textbox->update(popup->list_items->get(k)->get_text()); popup->textbox->set_text_row(0); popup->handle_event(); } @@ -2558,6 +2559,7 @@ void BC_PopupTextBox::update(const char *text) void BC_PopupTextBox::update_list(ArrayList *data) { + list_items = data; listbox->update(data, 0, 0, 1); } @@ -2568,7 +2570,8 @@ int BC_PopupTextBox::handle_event() const char *BC_PopupTextBox::get_text() { return textbox->get_text(); } const wchar_t *BC_PopupTextBox::get_wtext() { return textbox->get_wtext(); } -int BC_PopupTextBox::get_number() { return listbox->get_selection_number(0, 0); } +int BC_PopupTextBox::get_number() { return list_item; } +void BC_PopupTextBox::set_number(int v) { list_item = v; } int BC_PopupTextBox::get_x() { return x; } int BC_PopupTextBox::get_y() { return y; } int BC_PopupTextBox::get_w() { return textbox->get_w() + listbox->get_w(); } @@ -2858,12 +2861,8 @@ void BC_TumbleTextBox::reposition_window(int x, int y) this->x = x; this->y = y; - textbox->reposition_window(x, - y, - text_w, - 1); - tumbler->reposition_window(x + textbox->get_w(), - y); + textbox->reposition_window(x, y, text_w, 1); + tumbler->reposition_window(x + textbox->get_w(), y); // if(flush) parent_window->flush(); }