titler fixes, auto paste bug, resize popup hang, focus policy fix, chk lang
[goodguy/history.git] / cinelerra-5.1 / guicast / bctextbox.C
index 4eef5347d7a300369861f6e41e199911ec6bad21..6916f2e1777d0943ec09c910a954bf1a06237b8b 100644 (file)
@@ -753,7 +753,6 @@ int BC_TextBox::cursor_enter_event()
        if( top_level->event_win == win && enabled &&
            !(top_level->get_resources()->textbox_focus_policy & CLICK_ACTIVATE) )
        {
-               tooltip_done = 0;
                if( !active ) {
                        top_level->deactivate();
                        activate();
@@ -777,7 +776,7 @@ int BC_TextBox::cursor_leave_event()
                draw_border();
                flash(1);
        }
-       if( !suggestions_popup &&
+       if( !suggestions_popup && !get_button_down() &&
            !(top_level->get_resources()->textbox_focus_policy & CLICK_DEACTIVATE) )
                deactivate();
        return 0;
@@ -1014,7 +1013,6 @@ int BC_TextBox::repeat_event(int64_t duration)
                tooltip_text && tooltip_text[0] != 0 && highlighted)
        {
                show_tooltip();
-               tooltip_done = 1;
                result = 1;
        }
 
@@ -2166,47 +2164,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);
@@ -2262,27 +2219,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(),
@@ -2326,7 +2292,6 @@ int BC_ScrollTextBoxText::motion_event()
        return 1;
 }
 
-
 BC_ScrollTextBoxYScroll::BC_ScrollTextBoxYScroll(BC_ScrollTextBox *gui)
  : BC_ScrollBar(gui->x +
                        gui->w -
@@ -2354,13 +2319,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)
 {
@@ -2402,6 +2360,7 @@ int BC_PopupTextBoxList::handle_event()
        if(item)
        {
                popup->textbox->update(item->get_text());
+               popup->textbox->set_text_row(0);
                popup->handle_event();
        }
        return 1;
@@ -2450,14 +2409,12 @@ int BC_PopupTextBox::create_objects()
 void BC_PopupTextBox::update(const char *text)
 {
        textbox->update(text);
+       textbox->set_text_row(0);
 }
 
 void BC_PopupTextBox::update_list(ArrayList<BC_ListBoxItem*> *data)
 {
-       listbox->update(data,
-               0,
-               0,
-               1);
+       listbox->update(data, 0, 0, 1);
 }
 
 
@@ -2496,6 +2453,16 @@ 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::handle_event()
 {
        return 1;
@@ -2736,18 +2703,21 @@ BC_TextBox* BC_TumbleTextBox::get_textbox()
 int BC_TumbleTextBox::update(const char *value)
 {
        textbox->update(value);
+       textbox->set_text_row(0);
        return 0;
 }
 
 int BC_TumbleTextBox::update(int64_t value)
 {
        textbox->update(value);
+       textbox->set_text_row(0);
        return 0;
 }
 
 int BC_TumbleTextBox::update(float value)
 {
        textbox->update(value);
+       textbox->set_text_row(0);
        return 0;
 }
 
@@ -2826,3 +2796,9 @@ void BC_TumbleTextBox::set_boundaries(float min, float max)
 {
        tumbler->set_boundaries(min, max);
 }
+
+void BC_TumbleTextBox::set_tooltip(const char *text)
+{
+       textbox->set_tooltip(text);
+}
+