X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbctextbox.C;h=cbd74e0623c45760221fe5dec44075d23d81ce04;hb=25bafacda1fe9d8a9520cad451547a75d934c1bb;hp=cac049a27807845676cf276a30267424b3b5477a;hpb=dafc18d66d48cd981a012d2e73a3b3db5351c538;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index cac049a2..cbd74e06 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 && !get_buttonpress() && + !(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,47 +2166,6 @@ 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::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(); -} - void BC_ScrollTextBox::set_text(char *text, int isz) { this->text->set_text(text, isz); @@ -2256,27 +2221,36 @@ void BC_ScrollTextBox::reposition_window(int x, int y, int w, int rows) 0); } -void BC_ScrollTextBox::set_selection(int char1, int char2, int ibeam) +int BC_ScrollTextBox::button_press_event() +{ + return text->BC_TextBox::button_press_event(); +} +int BC_ScrollTextBox::button_release_event() { - this->text->set_selection(char1, char2, ibeam); + return text->BC_TextBox::button_release_event(); } +int BC_ScrollTextBox::get_h() { return text->get_h(); } +const char *BC_ScrollTextBox::get_text() { return text->get_text(); } +const wchar_t *BC_ScrollTextBox::get_wtext() { return text->get_wtext(); } + +int BC_ScrollTextBox::get_buttonpress() +{ + return text->BC_TextBox::get_buttonpress(); +} void BC_ScrollTextBox::wset_selection(int char1, int char2, int ibeam) { - this->text->wset_selection(char1, char2, ibeam); + text->wset_selection(char1, char2, ibeam); +} +void BC_ScrollTextBox::set_selection(int char1, int char2, int ibeam) +{ + text->set_selection(char1, char2, ibeam); } - int BC_ScrollTextBox::get_ibeam_letter() { - return this->text->get_ibeam_letter(); + return text->get_ibeam_letter(); } - - - - - - BC_ScrollTextBoxText::BC_ScrollTextBoxText(BC_ScrollTextBox *gui, const char *text) : BC_TextBox(gui->x, gui->y, gui->w - get_resources()->vscroll_data[SCROLL_HANDLE_UP]->get_w(), @@ -2320,7 +2294,6 @@ int BC_ScrollTextBoxText::motion_event() return 1; } - BC_ScrollTextBoxYScroll::BC_ScrollTextBoxYScroll(BC_ScrollTextBox *gui) : BC_ScrollBar(gui->x + gui->w - @@ -2348,13 +2321,6 @@ int BC_ScrollTextBoxYScroll::handle_event() - - - - - - - BC_PopupTextBoxText::BC_PopupTextBoxText(BC_PopupTextBox *popup, int x, int y, const char *text) : BC_TextBox(x, y, popup->text_w, 1, text, BCTEXTLEN) { @@ -2523,22 +2489,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 +2652,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();