2003-01-11 19:17:13 +00:00
|
|
|
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
|
2002-11-16 13:08:10 +00:00
|
|
|
#ifndef __label_hh
|
|
|
|
#define __label_hh
|
|
|
|
|
|
|
|
#include "widget.hh"
|
2002-12-03 08:54:51 +00:00
|
|
|
#include "font.hh"
|
2002-11-16 13:08:10 +00:00
|
|
|
|
|
|
|
namespace otk {
|
|
|
|
|
2003-01-11 19:17:13 +00:00
|
|
|
class Label : public Widget {
|
2002-11-16 13:08:10 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2003-01-11 19:17:13 +00:00
|
|
|
Label(Widget *parent);
|
|
|
|
~Label();
|
2002-11-16 13:08:10 +00:00
|
|
|
|
2003-01-12 23:55:30 +00:00
|
|
|
inline const std::string &getText(void) const { return _text; }
|
|
|
|
void setText(const std::string &text) { _text = text; _dirty = true; }
|
2002-11-16 13:08:10 +00:00
|
|
|
|
|
|
|
void update(void);
|
|
|
|
|
2002-12-03 19:10:03 +00:00
|
|
|
virtual void setStyle(Style *style);
|
2002-12-18 02:28:44 +00:00
|
|
|
|
2002-11-16 13:08:10 +00:00
|
|
|
private:
|
2002-12-03 08:54:51 +00:00
|
|
|
//! Object used by Xft to render to the drawable
|
|
|
|
XftDraw *_xftdraw;
|
|
|
|
//! Text displayed in the label
|
2003-01-12 23:55:30 +00:00
|
|
|
std::string _text;
|
2002-11-16 13:08:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|