+
+
+BC_TitleBar::BC_TitleBar(int x, int y, int w, int offset, int margin,
+ const char *text, int font, int color, VFrame *data)
+: BC_Title(x, y, text, font, color, 0, w)
+{
+ this->offset = offset;
+ this->margin = margin;
+ this->data = data;
+ image = 0;
+}
+
+BC_TitleBar::~BC_TitleBar()
+{
+ delete image;
+}
+
+void BC_TitleBar::set_image(VFrame *data)
+{
+ delete image;
+ image = new BC_Pixmap(get_parent_window(), data, PIXMAP_ALPHA);
+}
+
+int BC_TitleBar::initialize()
+{
+ if(data)
+ set_image(data);
+ else
+ set_image(get_resources()->bar_data);
+ BC_Title::initialize();
+ draw(0);
+ return 0;
+}
+
+int BC_TitleBar::draw(int flush)
+{
+ int w = get_w(), h = get_h(), h2 = h/2;
+ draw_top_background(get_parent_window(), 0, 0,w, h);
+ draw_3segmenth(0,h2, offset, 0, offset, image);
+ int tx = offset + margin, tw, th;
+ set_font(font);
+ BC_WindowBase::set_color(color);
+ BC_Title::draw(flush, tx, 0);
+ get_size(get_parent_window(), font, text, 0, tw, th);
+ tx += tw + margin;
+ draw_3segmenth(tx,h2, w-tx, tx,w-tx, image);
+ flash(flush);
+ return 0;
+}
+