X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbctextbox.C;h=3dfb6cd5f29c42435261b4bb9766d18ff1fb32bb;hb=f41ee8a0f00338fffb7fd6760a5ecd04c0101a41;hp=a7c8f5f7570ff1ce45d55bb65aaf1fded2da3007;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index a7c8f5f7..3dfb6cd5 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -2561,55 +2561,26 @@ void BC_PopupTextBox::update_list(ArrayList *data) listbox->update(data, 0, 0, 1); } - -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_x() -{ - return x; -} - -int BC_PopupTextBox::get_y() -{ - return y; -} - -int BC_PopupTextBox::get_w() -{ - return textbox->get_w() + listbox->get_w(); -} - -int BC_PopupTextBox::get_h() -{ - return textbox->get_h(); -} - -int BC_PopupTextBox::get_show_query() +int BC_PopupTextBox::handle_event() { - return listbox->get_show_query(); + return 1; } -void BC_PopupTextBox::set_show_query(int v) -{ - listbox->set_show_query(v); -} +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_x() { return x; } +int BC_PopupTextBox::get_y() { return y; } +int BC_PopupTextBox::get_w() { return textbox->get_w() + listbox->get_w(); } +int BC_PopupTextBox::get_h() { return textbox->get_h(); } +int BC_PopupTextBox::get_show_query() { return listbox->get_show_query(); } +void BC_PopupTextBox::set_show_query(int v) { listbox->set_show_query(v); } +int BC_PopupTextBox::get_back_color() { return textbox->get_back_color(); } +void BC_PopupTextBox::set_back_color(int v) { textbox->set_back_color(v); } -int BC_PopupTextBox::handle_event() +void BC_PopupTextBox::set_tooltip(const char *text) { - return 1; + listbox->set_tooltip(text); } void BC_PopupTextBox::reposition_window(int x, int y) @@ -2627,18 +2598,6 @@ void BC_PopupTextBox::reposition_window(int x, int y) } - - - - - - - - - - - - BC_TumbleTextBoxText::BC_TumbleTextBoxText(BC_TumbleTextBox *popup, int64_t default_value, int x, int y) : BC_TextBox(x, y, popup->text_w, 1, default_value) @@ -2684,14 +2643,9 @@ int BC_TumbleTextBoxText::button_press_event() - BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window, - int64_t default_value, - int64_t min, - int64_t max, - int x, - int y, - int text_w) + int64_t default_value, int64_t min, int64_t max, + int x, int y, int text_w) { reset(); this->x = x; @@ -2707,12 +2661,8 @@ BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window, } BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window, - int default_value, - int min, - int max, - int x, - int y, - int text_w) + int default_value, int min, int max, + int x, int y, int text_w) { reset(); this->x = x; @@ -2728,12 +2678,8 @@ BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window, } BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window, - float default_value_f, - float min_f, - float max_f, - int x, - int y, - int text_w) + float default_value_f, float min_f, float max_f, + int x, int y, int text_w, int precision) { reset(); this->x = x; @@ -2742,9 +2688,9 @@ BC_TumbleTextBox::BC_TumbleTextBox(BC_WindowBase *parent_window, this->max_f = max_f; this->default_value_f = default_value_f; this->text_w = text_w; + this->precision = precision; this->parent_window = parent_window; use_float = 1; - precision = 4; increment = 1; } @@ -2799,13 +2745,27 @@ int BC_TumbleTextBox::create_objects() x += textbox->get_w(); tumbler = use_float ? - (BC_Tumbler *)new BC_FTumbler(textbox, min_f, max_f, x, y) : - (BC_Tumbler *)new BC_ITumbler(textbox, min, max, x, y); + (BC_Tumbler *)new BC_FTextTumbler(this, min_f, max_f, x, y) : + (BC_Tumbler *)new BC_ITextTumbler(this, min, max, x, y); parent_window->add_subwindow(tumbler); tumbler->set_increment(increment); return 0; } +int BC_TumbleTextBox::handle_up_event() +{ + return use_float ? + ((BC_FTumbler *)tumbler)->BC_FTumbler::handle_up_event() : + ((BC_ITumbler *)tumbler)->BC_ITumbler::handle_up_event() ; +} + +int BC_TumbleTextBox::handle_down_event() +{ + return use_float ? + ((BC_FTumbler *)tumbler)->BC_FTumbler::handle_down_event() : + ((BC_ITumbler *)tumbler)->BC_ITumbler::handle_down_event() ; +} + const char* BC_TumbleTextBox::get_text() { return textbox->get_text();