widgets/label.hpp

Go to the documentation of this file.
00001 /* $Id: label.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2004 - 2012 by Philippe Plantier <ayin@anathas.org>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
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 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:55 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs