src/label.h

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: label.h 7 2007-05-24 11:03:53Z eg1981 $
00005 
00006 #ifndef __LABEL_H
00007 #define __LABEL_H
00008 
00009 extern "C" {
00010 #include <X11/Xlib.h>
00011 }
00012 
00013 #include <string>
00014 #include "ncwm.h"
00015 
00016 #include "rectangle.h"
00017 
00018 class Monitor;
00019 class WFont;
00020 
00028 class Label : public Rectangle
00029 {
00030 
00031 public:
00032 
00033     enum Alignment {LEFT, CENTER, RIGHT};
00034 
00035     Label(Monitor *monitor, Window window, Alignment align, GC gc);
00036 
00037     ~Label();
00038 
00039     void setText(string text);
00040 
00041     string text() const;
00042 
00050     void update(unsigned long background, unsigned long text,
00051                 unsigned long shine, unsigned long shadow,
00052                 bool shineBorder = false, bool shadowBorder = false);
00053 
00054     void setAlignment(const Alignment align);
00055 
00060     unsigned int adjustWidth();
00061 
00065     unsigned int textWidth();
00066 
00067 private:
00068 
00069     Alignment align_;
00070     GC gc_;
00071     Monitor *monitor_;
00072     string text_;
00073     Window window_;
00074     WFont *font_;
00075 };
00076 
00077 #endif // __LABEL_H

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