Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef LABEL_HPP_INCLUDED
00017 #define LABEL_HPP_INCLUDED
00018
00019 #include "../font.hpp"
00020 #include "widget.hpp"
00021 #include <string>
00022
00023 namespace gui {
00024
00025 class label : public widget
00026 {
00027 public:
00028 label(CVideo& video, const std::string& text, int size=font::SIZE_NORMAL,
00029 const SDL_Color& color=font::NORMAL_COLOR, const bool auto_join=true);
00030 const std::string& set_text(const std::string& text);
00031 const std::string& get_text() const;
00032
00033 const SDL_Color& set_color(const SDL_Color& color);
00034 const SDL_Color& get_color() const;
00035
00036 virtual void draw_contents();
00037 private:
00038 void update_label_size();
00039
00040 std::string text_;
00041 int size_;
00042 SDL_Color color_;
00043 };
00044
00045 }
00046
00047 #endif
00048