X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fswindow.C;h=fd173764f8eab5d61e4d4218c986e0a3af099422;hb=6338f0b010dfd93ae6a823970d853cfdd5279500;hp=423dd55d0ada2e3e1ec1cd2fa51346ac65ac3b65;hpb=af2d680fc71d16363f7f7fb7e602cb0c30015ee5;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/swindow.C b/cinelerra-5.1/cinelerra/swindow.C index 423dd55d..fd173764 100644 --- a/cinelerra-5.1/cinelerra/swindow.C +++ b/cinelerra-5.1/cinelerra/swindow.C @@ -184,14 +184,14 @@ void SWindowGUI::create_objects() add_subwindow(script_title = new BC_Title(x1, y, _("Script Text:"))); y += script_title->get_h() + pad; int rows = (ok_y - y - BC_Title::calculate_h(this,_("Line Text:")) - - 4*pad) / text_rowsz - 3; + 4*pad) / text_rowsz - 4; int w1 = get_w() - x1 - pad; script_entry = new ScriptEntry(this, x1, y, w1, rows, blank_line); script_entry->create_objects(); y += script_entry->get_h() + pad; add_subwindow(line_title = new BC_Title(x1, y, _("Line Text:"))); y += line_title->get_h() + pad; - line_entry = new ScriptEntry(this, x1, y, w1, 3); + line_entry = new ScriptEntry(this, x1, y, w1, 4); line_entry->create_objects(); ok = new SWindowOK(this, ok_x, ok_y); add_subwindow(ok); @@ -321,12 +321,12 @@ int SWindowGUI::resize_event(int w, int h) script_title->reposition_window(x, y); y += script_title->get_h() + pad; w1 = w - x - pad; - int rows = (ok_y - y - line_title->get_h() - 4*pad) / text_rowsz - 3; + int rows = (ok_y - y - line_title->get_h() - 4*pad) / text_rowsz - 4; script_entry->reposition_window(x, y, w1, rows); y += script_entry->get_h() + 2*pad; line_title->reposition_window(x, y); y += line_title->get_h() + pad; - line_entry->reposition_window(x, y, w1, 3); + line_entry->reposition_window(x, y, w1, 4); return 0; } @@ -356,6 +356,7 @@ void SWindowGUI::set_script_pos(int64_t entry_no, int text_no) int SWindowGUI::load_selection(int pos, int row) { + if( pos < 0 || pos >= script.size() ) return 1; ScriptLines *texts = script[pos]; char *rp = texts->get_text_row(row); if( !rp || *rp == '=' || *rp == '*' || *rp=='\n' ) return 1; @@ -677,7 +678,7 @@ char *ScriptLines::get_text_row(int n) } ScriptScroll::ScriptScroll(SWindowGUI *gui, int x, int y, int w) - : BC_ScrollBar(x, y, SCROLL_HORIZ, w, 0, 0, 0) + : BC_ScrollBar(x, y, SCROLL_HORIZ + SCROLL_STRETCH, w, 0, 0, 0) { this->sw_gui = gui; } @@ -811,7 +812,7 @@ void SWindowGUI::load_script(FILE *fp) script_entries->update(value); sprintf(value,"%jd",script_text_lines); script_texts->update(value); - int hw = 2*script_scroll->get_h(); + int hw = script_scroll->get_h(); script_scroll->update_length(script.size(), script_entry_no, hw, 0); script_position->update(script_entry_no); script_position->set_boundaries((int64_t)0, (int64_t)script.size()-1);