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 ) {
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;
}
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;
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)
{
return 1;
}
-
BC_ScrollTextBoxYScroll::BC_ScrollTextBoxYScroll(BC_ScrollTextBox *gui)
: BC_ScrollBar(gui->x +
gui->w -
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;
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();