00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- 00002 #ifndef __oblabelwidget_hh 00003 #define __oblabelwidget_hh 00004 00005 #include "widgetbase.hh" 00006 #include "otk/widget.hh" 00007 #include "otk/font.hh" 00008 #include "otk/renderstyle.hh" 00009 #include "otk/ustring.hh" 00010 00011 namespace ob { 00012 00013 class LabelWidget : public otk::Widget, public WidgetBase 00014 { 00015 private: 00016 void setTextures(); 00017 const otk::Font *_font; 00018 otk::RenderColor *_text_color; 00019 int _sidemargin; 00020 otk::RenderStyle::TextJustify _justify; 00021 otk::ustring _text; 00022 00023 public: 00024 LabelWidget(otk::Widget *parent, WidgetBase::WidgetType type); 00025 virtual ~LabelWidget(); 00026 00027 virtual void setStyle(otk::RenderStyle *style); 00028 00029 virtual void adjust(); 00030 00031 virtual void focus(); 00032 virtual void unfocus(); 00033 00034 virtual void renderForeground(); 00035 00036 inline const otk::ustring &text() const { return _text; } 00037 void setText(const otk::ustring &text); 00038 }; 00039 00040 } 00041 00042 #endif // __oblabelwidget_hh