asset menu size fixups, new picons+prefs, more timecode del, stretch scrollbars,...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / swindow.C
index 97b9144d716c462e5a60cafce00339fc7aa002a9..1d33f4b15224e166b8f3293a2c3e649391e8d55a 100644 (file)
@@ -76,27 +76,15 @@ SWindowLoadPath::SWindowLoadPath(SWindowGUI *gui, int x, int y, char *path)
  : BC_TextBox(x, y, 200, 1, path)
 {
        this->sw_gui = gui;
-
-       file_entries = new ArrayList<BC_ListBoxItem*>;
-       FileSystem fs;  char string[BCTEXTLEN];
-// Load current directory
-       fs.update(getcwd(string, BCTEXTLEN));
-       int total_files = fs.total_files();
-       for(int i = 0; i < total_files; i++) {
-               const char *name = fs.get_entry(i)->get_name();
-               file_entries->append(new BC_ListBoxItem(name));
-       }
 }
 
 SWindowLoadPath::~SWindowLoadPath()
 {
-       file_entries->remove_all_objects();
-       delete file_entries;
 }
 
 int SWindowLoadPath::handle_event()
 {
-       calculate_suggestions(file_entries);
+       calculate_suggestions();
        strcpy(sw_gui->script_path, get_text());
        return 1;
 }
@@ -196,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);
@@ -333,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;
 }
 
@@ -689,7 +677,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;
 }
@@ -817,13 +805,13 @@ void SWindowGUI::load_script(FILE *fp)
        char value[64];
        sprintf(value,"%ld",ftell(fp));
        script_filesz->update(value);
-       sprintf(value,"%ld",script_line_no);
+       sprintf(value,"%jd",script_line_no);
        script_lines->update(value);
        sprintf(value,"%d",script.size());
        script_entries->update(value);
-       sprintf(value,"%ld",script_text_lines);
+       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);
@@ -863,7 +851,7 @@ void SWindowGUI::save_spumux_data()
                                int64_t end = start + sedit->length;
                                char *text = sedit->get_text();
                                if( *text ) {
-                                       fprintf(fp, "{%ld}{%ld}%s\n", start, end-1, text);
+                                       fprintf(fp, "{%jd}{%jd}%s\n", start, end-1, text);
                                }
                                start = end;
                        }