X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fstatusbar.C;h=02b92d058c0b9d889e9a2fe4943d960de39e5930;hb=6f8a01f30489bde88280931c3ef9ea4edeb44d0f;hp=06ab4284b69c1d2c3674cc4bc80a4d7d570ca325;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/statusbar.C b/cinelerra-5.1/cinelerra/statusbar.C index 06ab4284..02b92d05 100644 --- a/cinelerra-5.1/cinelerra/statusbar.C +++ b/cinelerra-5.1/cinelerra/statusbar.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ @@ -31,9 +31,9 @@ StatusBar::StatusBar(MWindow *mwindow, MWindowGUI *gui) - : BC_SubWindow(mwindow->theme->mstatus_x, - mwindow->theme->mstatus_y, - mwindow->theme->mstatus_w, + : BC_SubWindow(mwindow->theme->mstatus_x, + mwindow->theme->mstatus_y, + mwindow->theme->mstatus_w, mwindow->theme->mstatus_h) { this->mwindow = mwindow; @@ -52,27 +52,27 @@ void StatusBar::create_objects() int x = 10; //int y = 5; //printf("StatusBar::create_objects 1\n"); draw_top_background(get_parent(), 0, 0, get_w(), get_h()); - add_subwindow(status_text = new BC_Title(mwindow->theme->mstatus_message_x, - mwindow->theme->mstatus_message_y, + add_subwindow(status_text = new BC_Title(mwindow->theme->mstatus_message_x, + mwindow->theme->mstatus_message_y, "", MEDIUMFONT, mwindow->theme->message_normal)); x = get_w() - 290; -// printf("StatusBar::create_objects %d: 0x%08x\n", +// printf("StatusBar::create_objects %d: 0x%08x\n", // __LINE__, mwindow->theme->message_normal); - add_subwindow(main_progress = - new BC_ProgressBar(mwindow->theme->mstatus_progress_x, - mwindow->theme->mstatus_progress_y, - mwindow->theme->mstatus_progress_w, + add_subwindow(main_progress = + new BC_ProgressBar(mwindow->theme->mstatus_progress_x, + mwindow->theme->mstatus_progress_y, + mwindow->theme->mstatus_progress_w, mwindow->theme->mstatus_progress_w)); x += main_progress->get_w() + 5; //printf("StatusBar::create_objects 1\n"); - add_subwindow(main_progress_cancel = - new StatusBarCancel(mwindow, - mwindow->theme->mstatus_cancel_x, + add_subwindow(main_progress_cancel = + new StatusBarCancel(mwindow, + mwindow->theme->mstatus_cancel_x, mwindow->theme->mstatus_cancel_y)); //printf("StatusBar::create_objects 1\n"); - default_message(); + reset_default_message(); flash(); } @@ -89,32 +89,40 @@ void StatusBar::resize_event() draw_top_background(get_parent(), 0, 0, get_w(), get_h()); - status_text->reposition_window(mwindow->theme->mstatus_message_x, + status_text->reposition_window(mwindow->theme->mstatus_message_x, mwindow->theme->mstatus_message_y); x = get_w() - 290; - main_progress->reposition_window(mwindow->theme->mstatus_progress_x, + main_progress->reposition_window(mwindow->theme->mstatus_progress_x, mwindow->theme->mstatus_progress_y); x += main_progress->get_w() + 5; - main_progress_cancel->reposition_window(mwindow->theme->mstatus_cancel_x, + main_progress_cancel->reposition_window(mwindow->theme->mstatus_cancel_x, mwindow->theme->mstatus_cancel_y); flash(0); } -void StatusBar::set_message(char *text) +void StatusBar::set_message(const char *text, int color) { + if( color < 0 ) color = mwindow->theme->message_normal; + status_text->set_color(color); status_text->update(text); } - +void StatusBar::set_default_message(const char *text) +{ + strcpy(default_msg, text); + default_message(); +} +void StatusBar::reset_default_message() +{ + set_default_message(_("Welcome to cinelerra")); +} void StatusBar::default_message() { - status_text->set_color(mwindow->theme->message_normal); - status_text->update(_("Welcome to Cinelerra.")); + set_message(default_msg, mwindow->theme->message_normal); } - StatusBarCancel::StatusBarCancel(MWindow *mwindow, int x, int y) : BC_Button(x, y, mwindow->theme->statusbar_cancel_data) {