gui/widgets/label.cpp

Go to the documentation of this file.
00001 /* $Id: label.cpp 54038 2012-04-30 19:37:24Z mordante $ */
00002 /*
00003    Copyright (C) 2008 - 2012 by Mark de Wever <koraq@xs4all.nl>
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 #define GETTEXT_DOMAIN "wesnoth-lib"
00017 
00018 #include "gui/widgets/label.hpp"
00019 
00020 #include "gui/auxiliary/widget_definition/label.hpp"
00021 #include "gui/auxiliary/window_builder/label.hpp"
00022 #include "gui/widgets/settings.hpp"
00023 
00024 #include <boost/bind.hpp>
00025 
00026 namespace gui2 {
00027 
00028 REGISTER_WIDGET(label)
00029 
00030 bool tlabel::can_wrap() const
00031 {
00032     return can_wrap_ || characters_per_line_ != 0;
00033 }
00034 
00035 unsigned tlabel::get_characters_per_line() const
00036 {
00037     return characters_per_line_;
00038 }
00039 
00040 void tlabel::set_characters_per_line(const unsigned characters_per_line)
00041 {
00042     characters_per_line_ = characters_per_line;
00043 }
00044 
00045 void tlabel::set_state(const tstate state)
00046 {
00047     if(state != state_) {
00048         state_ = state;
00049         set_dirty(true);
00050     }
00051 }
00052 
00053 const std::string& tlabel::get_control_type() const
00054 {
00055     static const std::string type = "label";
00056     return type;
00057 }
00058 
00059 } // namespace gui2
00060 
 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