#include "gui/auxiliary/event/dispatcher.hpp"#include "gui/widgets/event_executor.hpp"#include "gui/widgets/helper.hpp"#include "utils/const_clone.tpp"#include "wml_exception.hpp"#include <boost/noncopyable.hpp>#include <string>#include <cassert>

Go to the source code of this file.
Classes | |
| class | gui2::twidget |
| Base class for all widgets. More... | |
Namespaces | |
| namespace | gui2 |
A class inherited from ttext_box that displays its input as stars. | |
| namespace | gui2::iterator |
Defines | |
| #define | REGISTER_WIDGET3(type, id, key) |
| Registers a widget. | |
| #define | REGISTER_WIDGET(id) REGISTER_WIDGET3(t##id##_definition, id, _4) |
| Wrapper for REGISTER_WIDGET3. | |
Typedefs | |
| typedef std::map< std::string, t_string > | gui2::string_map |
Functions | |
| template<class T > | |
| T * | gui2::get_parent (twidget *widget) |
| Returns the first parent of a widget with a certain type. | |
| template<class T > | |
| T * | gui2::find_widget (typename utils::tconst_clone< twidget, T >::pointer widget, const std::string &id, const bool must_be_active, const bool must_exist) |
| Gets a widget with the wanted id. | |
| template<class T > | |
| T & | gui2::find_widget (typename utils::tconst_clone< twidget, T >::pointer widget, const std::string &id, const bool must_be_active) |
| Gets a widget with the wanted id. | |
| #define REGISTER_WIDGET | ( | id | ) | REGISTER_WIDGET3(t##id##_definition, id, _4) |
Wrapper for REGISTER_WIDGET3.
"Calls" REGISTER_WIDGET3(tid_definition, id, _4)
Definition at line 867 of file widget.hpp.
| #define REGISTER_WIDGET3 | ( | type, | ||
| id, | ||||
| key | ||||
| ) |
namespace { \ \ namespace ns_##type { \ \ struct tregister_helper { \ tregister_helper() \ { \ register_widget(#id, boost::bind( \ load_widget_definitions<type> \ , _1 \ , _2 \ , _3 \ , key)); \ \ register_builder_widget(#id, boost::bind( \ build_widget<implementation::tbuilder_##id> \ , _1)); \ } \ }; \ \ static tregister_helper register_helper; \ } \ }
Registers a widget.
Call this function to register a widget. Use this macro in the implementation, inside the gui2 namespace.
| type | Class type of the window to register. | |
| id | Id of the widget | |
| key | The id to load if differs from id. |
Definition at line 837 of file widget.hpp.
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:05:21 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |