1 #include "mainprogress.h"
9 #define _(String) gettext(String)
10 #define gettext_noop(String) String
11 #define N_(String) gettext_noop (String)
14 StatusBar::StatusBar(MWindow *mwindow, MWindowGUI *gui)
15 : BC_SubWindow(mwindow->theme->mstatus_x,
16 mwindow->theme->mstatus_y,
17 mwindow->theme->mstatus_w,
18 mwindow->theme->mstatus_h)
20 this->mwindow = mwindow;
24 StatusBar::~StatusBar()
30 int StatusBar::create_objects()
32 //printf("StatusBar::create_objects 1\n");
34 //printf("StatusBar::create_objects 1\n");
35 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
36 add_subwindow(status_text = new BC_Title(mwindow->theme->mstatus_message_x,
37 mwindow->theme->mstatus_message_y,
40 mwindow->theme->message_normal));
42 //printf("StatusBar::create_objects 1\n");
43 add_subwindow(main_progress =
44 new BC_ProgressBar(mwindow->theme->mstatus_progress_x,
45 mwindow->theme->mstatus_progress_y,
46 mwindow->theme->mstatus_progress_w,
47 mwindow->theme->mstatus_progress_w));
48 x += main_progress->get_w() + 5;
49 //printf("StatusBar::create_objects 1\n");
50 add_subwindow(main_progress_cancel =
51 new StatusBarCancel(mwindow,
52 mwindow->theme->mstatus_cancel_x,
53 mwindow->theme->mstatus_cancel_y));
54 //printf("StatusBar::create_objects 1\n");
57 //printf("StatusBar::create_objects 2\n");
61 void StatusBar::resize_event()
66 reposition_window(mwindow->theme->mstatus_x,
67 mwindow->theme->mstatus_y,
68 mwindow->theme->mstatus_w,
69 mwindow->theme->mstatus_h);
70 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
72 status_text->reposition_window(mwindow->theme->mstatus_message_x,
73 mwindow->theme->mstatus_message_y);
75 main_progress->reposition_window(mwindow->theme->mstatus_progress_x,
76 mwindow->theme->mstatus_progress_y);
77 x += main_progress->get_w() + 5;
78 main_progress_cancel->reposition_window(mwindow->theme->mstatus_cancel_x,
79 mwindow->theme->mstatus_cancel_y);
83 void StatusBar::set_message(char *text)
85 status_text->update(text);
88 void StatusBar::default_message()
90 status_text->set_color(mwindow->theme->message_normal);
91 status_text->update(_("Welcome to Cinelerra."));
95 StatusBarCancel::StatusBarCancel(MWindow *mwindow, int x, int y)
96 : BC_Button(x, y, mwindow->theme->statusbar_cancel_data)
98 this->mwindow = mwindow;
99 set_tooltip(_("Cancel operation"));
101 int StatusBarCancel::handle_event()
103 mwindow->mainprogress->cancelled = 1;