diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-03-25 21:40:45 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-13 22:40:52 +0100 |
commit | 231a5c0d8dfc6d5b0fd2cbbdbd10cea582562f85 (patch) | |
tree | 10c217ed3e7137dc8bedf15cc00a45413656983c /src/menu/text.hpp | |
parent | 443d35771754821fbcf205005c7f5a632bdfbbd2 (diff) | |
download | usdx-231a5c0d8dfc6d5b0fd2cbbdbd10cea582562f85.tar.gz usdx-231a5c0d8dfc6d5b0fd2cbbdbd10cea582562f85.tar.xz usdx-231a5c0d8dfc6d5b0fd2cbbdbd10cea582562f85.zip |
menu/text: added variable vertical alignment in the box of the control
Diffstat (limited to '')
-rw-r--r-- | src/menu/text.hpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/menu/text.hpp b/src/menu/text.hpp index ad5fcb9a..7ec0dade 100644 --- a/src/menu/text.hpp +++ b/src/menu/text.hpp @@ -35,6 +35,7 @@ #include "drawable_control.hpp" #include "container.hpp" #include "utils/point.hpp" +#include "vertical_text_alignment.hpp" namespace usdx { @@ -62,15 +63,33 @@ namespace usdx */ bool stretch; + /** + * Offset of the baseline of the text to the top left corner of the + * control. + */ + Point<int> offset; + FTFont *font; + const VerticalTextAlignment *valign; + boost::mutex font_mutex; + /** + * This function is used to recalculate the offset of the drawn + * text. It should be called every time the text or the font size is + * changed. + * + * @see: offset + */ + void realign(void); protected: virtual void draw(void); public: - Text(Container* parent, const std::string text = "", const unsigned int size = 60); + Text(Container*, const std::string = "", const unsigned int = 60, + const VerticalTextAlignment* = new VerticalTextAlignmentTop()); + virtual ~Text(); void set_font_size(const unsigned int value); |