00001 #include "bcbar.h"
00002 #include "bcpixmap.h"
00003 #include "bcresources.h"
00004 #include "vframe.h"
00005
00006
00007
00008
00009 BC_Bar::BC_Bar(int x, int y, int w, VFrame *data)
00010 : BC_SubWindow(x, y, w, 0, -1)
00011 {
00012 this->data = data;
00013 image = 0;
00014 }
00015
00016 BC_Bar::~BC_Bar()
00017 {
00018 delete image;
00019 }
00020
00021 int BC_Bar::initialize()
00022 {
00023 if(data)
00024 set_image(data);
00025 else
00026 set_image(get_resources()->bar_data);
00027
00028
00029 BC_SubWindow::initialize();
00030
00031 draw();
00032 return 0;
00033 }
00034
00035 void BC_Bar::set_image(VFrame *data)
00036 {
00037 delete image;
00038 image = new BC_Pixmap(parent_window, data, PIXMAP_ALPHA);
00039 h = image->get_h();
00040 }
00041
00042 int BC_Bar::reposition_window(int x, int y, int w)
00043 {
00044 BC_WindowBase::reposition_window(x, y, w, -1);
00045 draw();
00046 return 0;
00047 }
00048
00049 int BC_Bar::resize_event(int w, int h)
00050 {
00051 reposition_window(x, y, get_w());
00052 return 1;
00053 }
00054
00055
00056 void BC_Bar::draw()
00057 {
00058 draw_top_background(parent_window, 0, 0,w, h);
00059 draw_3segmenth(0, 0, w, 0, w, image);
00060 flash();
00061 }