The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
walker_grid.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef GUI_WIDGETS_AUXILIARY_WALKER_VISITOR_GRID_HPP_INCLUDED
16 #define GUI_WIDGETS_AUXILIARY_WALKER_VISITOR_GRID_HPP_INCLUDED
17 
19 
20 #include "gui/widgets/grid.hpp"
21 
22 namespace gui2
23 {
24 
25 namespace iterator
26 {
27 
28 /** A walker for a @ref gui2::tgrid. */
29 class tgrid : public twalker_
30 {
31 public:
32  /**
33  * Constructor.
34  *
35  * @param grid The grid which the walker is attached to.
36  */
37  explicit tgrid(gui2::tgrid& grid);
38 
39  /** Inherited from @ref gui2::iterator::twalker_. */
40  virtual tstate next(const tlevel level);
41 
42  /** Inherited from @ref gui2::iterator::twalker_. */
43  virtual bool at_end(const tlevel level) const;
44 
45  /** Inherited from @ref gui2::iterator::twalker_. */
46  virtual gui2::twidget* get(const tlevel level);
47 
48 private:
49  /** The grid which the walker is attached to. */
51 
52  /**
53  * The grid which the walker is attached to.
54  *
55  * This variable is used to track whether the @ref
56  * gui2::iterator::twalker_::widget level has been visited.
57  */
59 
60  /**
61  * The iterator to the children of @ref grid_.
62  *
63  * This variable is used to track where the @ref
64  * gui2::iterator::twalker_::child level visiting is.
65  */
67 };
68 
69 } // namespace iterator
70 
71 } // namespace gui2
72 
73 #endif
GLint level
Definition: glew.h:1220
virtual tstate next(const tlevel level)
Inherited from gui2::iterator::twalker_.
Definition: walker_grid.cpp:32
tstate
The state of the walker.
Definition: walker.hpp:51
Base container class.
Definition: grid.hpp:29
gui2::tgrid & grid_
The grid which the walker is attached to.
Definition: walker_grid.hpp:50
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
gui2::twidget * widget_
The grid which the walker is attached to.
Definition: walker_grid.hpp:58
virtual bool at_end(const tlevel level) const
Inherited from gui2::iterator::twalker_.
Definition: walker_grid.cpp:62
Iterator for the tchild items.
Definition: grid.hpp:401
gui2::tgrid::iterator itor_
The iterator to the children of grid_.
Definition: walker_grid.hpp:66
tgrid(gui2::tgrid &grid)
Constructor.
Definition: walker_grid.cpp:27
A walker for a gui2::tgrid.
Definition: walker_grid.hpp:29
tlevel
The level to walk at.
Definition: walker.hpp:35
Base class for all widgets.
Definition: widget.hpp:49
The walker abstract base class.
Definition: walker.hpp:27
std::string::const_iterator iterator
Definition: tokenizer.hpp:21
Visit the children of its nested grid.
Definition: walker.hpp:40