mask xy scale, mask boundary only overlay, fix 8 char mask nm bug, rework maskgui...
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bctextbox.C
index c404877cced5fbcf885be1096435d7df3a5a21b9..78e6fa42a0eea4c282c6dc19d30cea26050d91b4 100644 (file)
@@ -2487,6 +2487,7 @@ BC_PopupTextBoxText::~BC_PopupTextBoxText()
 
 int BC_PopupTextBoxText::handle_event()
 {
+       popup->list_item = -1;
        popup->handle_event();
        return 1;
 }
@@ -2500,10 +2501,10 @@ BC_PopupTextBoxList::BC_PopupTextBoxList(BC_PopupTextBox *popup, int x, int y)
 }
 int BC_PopupTextBoxList::handle_event()
 {
-       BC_ListBoxItem *item = get_selection(0, 0);
-       if(item)
-       {
-               popup->textbox->update(item->get_text());
+       int k = get_selection_number(0, 0);
+       popup->list_item = k;
+       if( k >= 0 && k < popup->list_items->size() ) {
+               popup->textbox->update(popup->list_items->get(k)->get_text());
                popup->textbox->set_text_row(0);
                popup->handle_event();
        }
@@ -2558,58 +2559,30 @@ void BC_PopupTextBox::update(const char *text)
 
 void BC_PopupTextBox::update_list(ArrayList<BC_ListBoxItem*> *data)
 {
+       list_items = 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 list_item; }
+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 +2600,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,7 +2645,6 @@ 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)
@@ -2787,13 +2747,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();