00001 /* $Id: label.hpp 23842 2008-02-16 08:47:16Z mordante $ */ 00002 /* 00003 Copyright (C) 2004 - 2008 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 version 2 00008 or at your option any later version. 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY. 00011 00012 See the COPYING file for more details. 00013 */ 00014 00015 #ifndef LABEL_HPP_INCLUDED 00016 #define LABEL_HPP_INCLUDED 00017 00018 #include "../font.hpp" 00019 #include "widget.hpp" 00020 #include <string> 00021 00022 namespace gui { 00023 00024 class label : public widget 00025 { 00026 public: 00027 label(CVideo& video, const std::string& text, int size=font::SIZE_NORMAL, 00028 const SDL_Color& colour=font::NORMAL_COLOUR, const bool auto_join=true); 00029 const std::string& set_text(const std::string& text); 00030 const std::string& get_text() const; 00031 00032 int set_size(int size); 00033 int get_size() const; 00034 00035 const SDL_Color& set_colour(const SDL_Color& colour); 00036 const SDL_Color& get_colour() const; 00037 00038 virtual void draw_contents(); 00039 private: 00040 void update_label_size(); 00041 00042 std::string text_; 00043 int size_; 00044 SDL_Color colour_; 00045 }; 00046 00047 } 00048 00049 #endif 00050
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |