From: Good Guy Date: Sun, 19 Aug 2018 16:26:11 +0000 (-0600) Subject: bin folder tweaks X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=2f7295c1067fb2935ddc215831431c2959782ee3;p=goodguy%2Fhistory.git bin folder tweaks --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index fceeb04c..9be5b66b 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1455,13 +1455,17 @@ void AWindowGUI::update_folder_list() } // Delete unused non-persistent folders + int do_autoplace = 0; for( int i=folders.total; --i>=0; ) { AssetPicon *picon = (AssetPicon*)folders.values[i]; if( !picon->in_use && !picon->persistent ) { delete picon; folders.remove_number(i); + do_autoplace = 1; } } + if( do_autoplace ) + folder_list->set_autoplacement(&folders, 0, 1); } void AWindowGUI::create_persistent_folder(ArrayList *output, diff --git a/cinelerra-5.1/cinelerra/binfolder.C b/cinelerra-5.1/cinelerra/binfolder.C index 868f1c20..68f8cb0b 100644 --- a/cinelerra-5.1/cinelerra/binfolder.C +++ b/cinelerra-5.1/cinelerra/binfolder.C @@ -57,12 +57,12 @@ const char *BinFolderTarget::types[] = { const char *BinFolderOp::types[] = { N_("Around"), - N_("Eq"), - N_("Ge"), - N_("Gt"), - N_("Ne"), - N_("Le"), - N_("Lt"), + N_("Eq =="), + N_("Ge >="), + N_("Gt > "), + N_("Ne !="), + N_("Le <="), + N_("Lt < "), N_("Matches"), }; @@ -1890,10 +1890,10 @@ void ModifyTargetThread::handle_close_event(int result) target = 0; } -ModifyTargetGUI::ModifyTargetGUI(ModifyTargetThread *thread) +ModifyTargetGUI::ModifyTargetGUI(ModifyTargetThread *thread, int allow_resize) : BC_Window(_(PROGRAM_NAME ": Modify target"), thread->wx, thread->wy, thread->ww, thread->wh, - -1, -1, 0, 0, 1) + -1, -1, allow_resize, 0, 1) { this->thread = thread; } @@ -1914,11 +1914,17 @@ void ModifyTargetGUI::create_objects(BC_TextBox *&text_box) unlock_window(); } +int ModifyTargetGUI::resize_event(int w, int h) +{ + return BC_WindowBase::resize_event(w, h); +} + ModifyTargetPatternsGUI::ModifyTargetPatternsGUI(ModifyTargetThread *thread) - : ModifyTargetGUI(thread) + : ModifyTargetGUI(thread, 1) { this->thread = thread; scroll_text_box = 0; + text_rowsz = 0; } ModifyTargetPatternsGUI::~ModifyTargetPatternsGUI() @@ -1932,17 +1938,33 @@ void ModifyTargetPatternsGUI::create_objects() BinFolderTargetPatterns *target = (BinFolderTargetPatterns *)thread->target; int x = 10, y = 10; int text_font = MEDIUMFONT; - int text_rowsz = get_text_ascent(text_font)+1 + get_text_descent(text_font)+1; - int th = get_h() - BC_OKButton::calculate_h() - y - 10; + text_rowsz = get_text_ascent(text_font)+1 + get_text_descent(text_font)+1; + int th = get_h() - y - BC_OKButton::calculate_h() - 20; int rows = th / text_rowsz; - scroll_text_box = new BC_ScrollTextBox(this, x, y, get_w()-20, rows, target->text); + int text_len = strlen(target->text); + if( text_len < BCTEXTLEN ) text_len = BCTEXTLEN; + scroll_text_box = new BC_ScrollTextBox(this, x, y, get_w()-20, rows, + target->text, 2*text_len); scroll_text_box->create_objects(); - add_subwindow(new BC_OKButton(this)); - add_subwindow(new BC_CancelButton(this)); + add_subwindow(ok_button = new BC_OKButton(this)); + add_subwindow(cancel_button = new BC_CancelButton(this)); show_window(); unlock_window(); } +int ModifyTargetPatternsGUI::resize_event(int w, int h) +{ + int tx = scroll_text_box->get_x(); + int ty = scroll_text_box->get_y(); + int th = h - ty - BC_OKButton::calculate_h() - 20; + int tw = w - 20; + int rows = th / text_rowsz; + scroll_text_box->reposition_window(tx, ty, tw, rows); + ok_button->resize_event(w, h); + cancel_button->resize_event(w, h); + return 1; +} + void ModifyTargetPatternsGUI::update() { BinFolderTargetPatterns *target = (BinFolderTargetPatterns *)thread->target; diff --git a/cinelerra-5.1/cinelerra/binfolder.h b/cinelerra-5.1/cinelerra/binfolder.h index f35017a9..38b014d4 100644 --- a/cinelerra-5.1/cinelerra/binfolder.h +++ b/cinelerra-5.1/cinelerra/binfolder.h @@ -601,10 +601,11 @@ public: class ModifyTargetGUI : public BC_Window { public: - ModifyTargetGUI(ModifyTargetThread *thread); + ModifyTargetGUI(ModifyTargetThread *thread, int allow_resize=0); ~ModifyTargetGUI(); virtual void create_objects() {} virtual void update() {} + virtual int resize_event(int w, int h); void create_objects(BC_TextBox *&text_box); ModifyTargetThread *thread; @@ -632,9 +633,13 @@ public: ModifyTargetPatternsGUI(ModifyTargetThread *thread); ~ModifyTargetPatternsGUI(); void create_objects(); + int resize_event(int w, int h); void update(); BC_ScrollTextBox *scroll_text_box; + BC_OKButton *ok_button; + BC_CancelButton *cancel_button; + int text_rowsz; }; class ModifyTargetFileSizeGUI : public ModifyTargetGUI