1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
7 #include "renderstyle.hh"
14 class Label : public Widget {
17 Label(Widget *parent);
20 inline const ustring& getText(void) const { return _text; }
21 void setText(const ustring &text);
23 RenderStyle::Justify horizontalJustify() const { return _justify_horz; }
24 virtual void setHorizontalJustify(RenderStyle::Justify j);
25 RenderStyle::Justify verticalJustify() const { return _justify_vert; }
26 virtual void setVerticalJustify(RenderStyle::Justify j);
28 const Font *font() const { return _font; }
29 virtual void setFont(const Font *f);
31 virtual void calcDefaultSizes();
33 virtual void styleChanged(const RenderStyle &style);
35 virtual void renderForeground(Surface &surface);
38 //! The color the label will use for rendering its text
39 RenderColor *_forecolor;
42 //! Text to be displayed in the label
44 //! Text to be displayed, parsed into its separate lines
45 std::vector<ustring> _parsedtext;
46 //! The actual text being shown, may be a subset of _text
48 //! The font the text will be rendered with
50 //! The horizontal justification used for drawing text
51 RenderStyle::Justify _justify_horz;
52 //! The vertical justification used for drawing text
53 RenderStyle::Justify _justify_vert;
54 //! The drawing offset for the text