textbox cursor fix, h265 param files, bluray updates, new-proj theme fixes
[goodguy/history.git] / cinelerra-5.1 / guicast / bctextbox.C
index f8777993c500f35a95096f8156b62392b06ff638..5a9cac03f0c1dc783036e6326caa01b1f7c9e711 100644 (file)
@@ -766,6 +766,8 @@ void BC_TextBox::draw(int flush)
                                draw_wtext(text_x, k + text_ascent, wtext_row, len,
                                        0, &positions[wtext_row - wtext]);
                        }
+                       else
+                               positions[wtext_row - wtext] = 0;
 
 // Get ibeam location
                        if(ibeam_letter >= row_begin && ibeam_letter <= row_end) {
@@ -778,14 +780,8 @@ void BC_TextBox::draw(int flush)
 
 //printf("BC_TextBox::draw 3 %d\n", ibeam_y);
        if(need_ibeam) {
-               if( wtext_len == 0 ) {
-                       ibeam_x = 0;
-                       ibeam_y = 0;
-               }
-               else {
-                       ibeam_x = -1;
-                       ibeam_y = -1;
-               }
+//             ibeam_x = ibeam_y = !wtext_len ? 0 : -1;
+               ibeam_x = 0;  ibeam_y = k - text_y;
        }
 
 //printf("BC_TextBox::draw 4 %d\n", ibeam_y);
@@ -1231,21 +1227,23 @@ int BC_TextBox::keypress_event()
                int wlen =  -1;
                switch( last_keypress ) {
 //unicode active acitons
-               case ESC: {
-                       unicode_active = -1;
-                       result = 1;
-                       wlen = 0;
-                       break; }
                case RETURN: {
                        for( int i=highlight_letter1+1; i<highlight_letter2; ++i ) {
                                int ch = nib(wtext[i]);
                                if( ch < 0 ) return 1;
                                wch = (wch<<4) + ch;
                        }
+                       if( wch ) {
+                               dispatch_event = 1;
+                               unicode_active = -1;
+                               result = 1;
+                               wlen = 1;
+                               break;
+                       } } // fall through
+               case ESC: {
                        unicode_active = -1;
-                       dispatch_event = 1;
                        result = 1;
-                       wlen = 1;
+                       wlen = 0;
                        break; }
                case BACKSPACE: {
                        if(ibeam_letter > 0) {
@@ -1851,9 +1849,8 @@ void BC_TextBox::get_ibeam_position(int &x, int &y)
 {
        int i, row_begin, row_end;
        int wtext_len = wtext_update();
+       x = y = 0;
 
-       y = 0;
-       x = 0;
        for( i=0; i<wtext_len; ) {
                row_begin = i;
                for(; i<wtext_len && wtext[i]!='\n'; i++);
@@ -2282,7 +2279,7 @@ void BC_ScrollTextBox::create_objects()
        parent_window->add_subwindow(yscroll = new BC_ScrollTextBoxYScroll(this));
        text->yscroll = yscroll;
        yscroll->bound_to = text;
-
+       set_text_row(0);
 }
 
 int BC_ScrollTextBox::handle_event()