X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbctextbox.C;h=e8cb09ced1fc35afb853cea90382e99766229cd8;hp=cac049a27807845676cf276a30267424b3b5477a;hb=77815ec03df6a03ed75433e8cf8ae1e83fb76d6e;hpb=dafc18d66d48cd981a012d2e73a3b3db5351c538 diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index cac049a2..e8cb09ce 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -750,7 +750,8 @@ int BC_TextBox::focus_out_event() int BC_TextBox::cursor_enter_event() { - if(top_level->event_win == win && enabled) + if( top_level->event_win == win && enabled && + !(top_level->get_resources()->textbox_focus_policy & CLICK_ACTIVATE) ) { tooltip_done = 0; if( !active ) { @@ -772,10 +773,12 @@ int BC_TextBox::cursor_leave_event() if(highlighted) { highlighted = 0; - draw_border(); hide_tooltip(); + draw_border(); + flash(1); } - if( !suggestions_popup ) + if( !suggestions_popup && + !(top_level->get_resources()->textbox_focus_policy & CLICK_DEACTIVATE) ) deactivate(); return 0; } @@ -894,10 +897,13 @@ int BC_TextBox::button_press_event() return 1; } else - if(active && suggestions_popup && (!yscroll || !yscroll->is_event_win())) - { - if( suggestions_popup->button_press_event() ) - return suggestions_popup->handle_event(); + if( active ) { + if( suggestions_popup && (!yscroll || !yscroll->is_event_win())) { + if( suggestions_popup->button_press_event() ) + return suggestions_popup->handle_event(); + } + else if( (top_level->get_resources()->textbox_focus_policy & CLICK_DEACTIVATE) ) + deactivate(); } return 0; @@ -2160,46 +2166,18 @@ void BC_ScrollTextBox::create_objects() set_text_row(0); } -int BC_ScrollTextBox::handle_event() -{ - return 1; -} - -int BC_ScrollTextBox::get_x() -{ - return x; -} - -int BC_ScrollTextBox::get_y() -{ - return y; -} +int BC_ScrollTextBox::handle_event() { return 1; } +int BC_ScrollTextBox::button_press_event() { return text->BC_TextBox::button_press_event(); } +int BC_ScrollTextBox::button_release_event() { return text->BC_TextBox::button_release_event(); } +int BC_ScrollTextBox::get_buttonpress() { return text->BC_TextBox::get_buttonpress(); }; +int BC_ScrollTextBox::get_x() { return x; } +int BC_ScrollTextBox::get_y() { return y; } +int BC_ScrollTextBox::get_w() { return w; } +int BC_ScrollTextBox::get_h() { return text->get_h(); } +int BC_ScrollTextBox::get_rows() { return rows; } -int BC_ScrollTextBox::get_w() -{ - return w; -} - -int BC_ScrollTextBox::get_h() -{ - return this->text->get_h(); -} - -int BC_ScrollTextBox::get_rows() -{ - return rows; -} - - -const char* BC_ScrollTextBox::get_text() -{ - return text->get_text(); -} - -const wchar_t* BC_ScrollTextBox::get_wtext() -{ - return text->get_wtext(); -} +const char* BC_ScrollTextBox::get_text() { return text->get_text(); } +const wchar_t* BC_ScrollTextBox::get_wtext() { return text->get_wtext(); } void BC_ScrollTextBox::set_text(char *text, int isz) { @@ -2320,7 +2298,6 @@ int BC_ScrollTextBoxText::motion_event() return 1; } - BC_ScrollTextBoxYScroll::BC_ScrollTextBoxYScroll(BC_ScrollTextBox *gui) : BC_ScrollBar(gui->x + gui->w - @@ -2523,22 +2500,14 @@ void BC_PopupTextBox::reposition_window(int x, int y) BC_TumbleTextBoxText::BC_TumbleTextBoxText(BC_TumbleTextBox *popup, - int64_t default_value, - int64_t min, - int64_t max, - int x, - int y) + int64_t default_value, int x, int y) : BC_TextBox(x, y, popup->text_w, 1, default_value) { this->popup = popup; } BC_TumbleTextBoxText::BC_TumbleTextBoxText(BC_TumbleTextBox *popup, - float default_value, - float min, - float max, - int x, - int y) + float default_value, int x, int y) : BC_TextBox(x, y, popup->text_w, 1, default_value) { this->popup = popup; @@ -2694,20 +2663,12 @@ int BC_TumbleTextBox::create_objects() if(use_float) { parent_window->add_subwindow(textbox = new BC_TumbleTextBoxText(this, - default_value_f, - min_f, - max_f, - x, - y)); + default_value_f, x, y)); textbox->set_precision(precision); } else parent_window->add_subwindow(textbox = new BC_TumbleTextBoxText(this, - default_value, - min, - max, - x, - y)); + default_value, x, y)); x += textbox->get_w();