src/bar.cpp

Go to the documentation of this file.
00001 // Copyright (c) 2003 - 2004 Anselm R. Garbe <anselmg at t-online.de>
00002 // See ../LICENSE.txt for license details.
00003 //
00004 // $Id: bar.cpp 2 2007-05-16 10:38:27Z eg $
00005 
00006 #include "bar.h"
00007 
00008 #include <map>
00009 
00010 #include "draw.h"
00011 #include "kernel.h"
00012 #include "label.h"
00013 #include "monitor.h"
00014 #include "theme.h"
00015 #include "util.h"
00016 #include "xcore.h"
00017 
00018 Bar::Bar(Monitor *monitor, Rectangle *rect) :
00019     Widget(monitor, rect)
00020 {
00021     theme_ = this->monitor()->theme();
00022     isButtonVisible_ = (Util::get(KERNEL->commonSettings(), ("bar.buttons"))
00023                         == "yes");
00024     borderRect_ = Rectangle(0, 0, width(), height());
00025 
00026     label_ = new Label(this->monitor(), window(), Label::CENTER, gc());
00027     label_->setX(1);
00028     label_->setY(1);
00029     label_->setWidth(width() - 2);
00030     label_->setHeight(height() - 2);
00031 }
00032 
00033 Bar::~Bar() {
00034     delete label_;
00035 }
00036 
00037 
00038 void Bar::drawBorder() {
00039 
00040     Draw::drawRectBorder(window(), gc(), &borderRect_,
00041                         theme_->BAR_SHINE, theme_->BAR_SHADOW);
00042 
00043     XCORE->sync();
00044 }

Generated on Thu May 24 15:19:31 2007 for ncwm by  doxygen 1.5.1