openbox/src/labelwidget.hh

45 lines
945 B
C++
Raw Normal View History

2002-12-18 11:35:26 +00:00
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __oblabelwidget_hh
#define __oblabelwidget_hh
#include "widgetbase.hh"
#include "otk/widget.hh"
#include "otk/font.hh"
#include "otk/style.hh"
2003-01-13 05:54:40 +00:00
#include "otk/ustring.hh"
2002-12-18 11:35:26 +00:00
namespace ob {
2003-01-11 19:42:43 +00:00
class LabelWidget : public otk::Widget, public WidgetBase
2002-12-18 11:35:26 +00:00
{
private:
void setTextures();
2003-01-11 19:42:43 +00:00
const otk::Font *_font;
otk::Color *_text_color;
int _sidemargin;
otk::Style::TextJustify _justify;
2003-01-13 05:54:40 +00:00
otk::ustring _text;
//! Object used by Xft to render to the drawable
XftDraw *_xftdraw;
2002-12-18 11:35:26 +00:00
public:
2003-01-11 19:42:43 +00:00
LabelWidget(otk::Widget *parent, WidgetBase::WidgetType type);
virtual ~LabelWidget();
2002-12-18 11:35:26 +00:00
virtual void setStyle(otk::Style *style);
virtual void adjust();
virtual void focus();
virtual void unfocus();
virtual void update();
2003-01-13 05:54:40 +00:00
inline const otk::ustring &text() const { return _text; }
void setText(const otk::ustring &text);
2002-12-18 11:35:26 +00:00
};
}
#endif // __oblabelwidget_hh