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 //printf("StatusBar::create_objects 1\n");
41 add_subwindow(main_progress =
42 new BC_ProgressBar(mwindow->theme->mstatus_progress_x,
43 mwindow->theme->mstatus_progress_y,
44 mwindow->theme->mstatus_progress_w,
45 mwindow->theme->mstatus_progress_w));
46 x += main_progress->get_w() + 5;
47 //printf("StatusBar::create_objects 1\n");
48 add_subwindow(main_progress_cancel =
49 new StatusBarCancel(mwindow,
50 mwindow->theme->mstatus_cancel_x,
51 mwindow->theme->mstatus_cancel_y));
52 //printf("StatusBar::create_objects 1\n");
55 //printf("StatusBar::create_objects 2\n");
59 void StatusBar::resize_event()
64 reposition_window(mwindow->theme->mstatus_x,
65 mwindow->theme->mstatus_y,
66 mwindow->theme->mstatus_w,
67 mwindow->theme->mstatus_h);
68 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
70 status_text->reposition_window(mwindow->theme->mstatus_message_x,
71 mwindow->theme->mstatus_message_y);
73 main_progress->reposition_window(mwindow->theme->mstatus_progress_x,
74 mwindow->theme->mstatus_progress_y);
75 x += main_progress->get_w() + 5;
76 main_progress_cancel->reposition_window(mwindow->theme->mstatus_cancel_x,
77 mwindow->theme->mstatus_cancel_y);
81 void StatusBar::set_message(char *text)
83 status_text->update(text);
86 void StatusBar::default_message()
88 status_text->set_color(BLACK);
89 status_text->update(_("Welcome to Cinelerra."));
93 StatusBarCancel::StatusBarCancel(MWindow *mwindow, int x, int y)
94 : BC_Button(x, y, mwindow->theme->statusbar_cancel_data)
96 this->mwindow = mwindow;
97 set_tooltip(_("Cancel operation"));
99 int StatusBarCancel::handle_event()
101 mwindow->mainprogress->cancelled = 1;