00001 /* $Id: walker_grid.hpp 52869 2012-02-03 20:18:33Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2011 - 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 #ifndef GUI_WIDGETS_AUXILIARY_WALKER_VISITOR_GRID_HPP_INCLUDED 00017 #define GUI_WIDGETS_AUXILIARY_WALKER_VISITOR_GRID_HPP_INCLUDED 00018 00019 #include "gui/auxiliary/iterator/walker.hpp" 00020 00021 #include "gui/widgets/grid.hpp" 00022 00023 namespace gui2 { 00024 00025 namespace iterator { 00026 00027 /** A walker for a @ref gui2::tgrid. */ 00028 class tgrid 00029 : public twalker_ 00030 { 00031 public: 00032 00033 /** 00034 * Constructor. 00035 * 00036 * @param grid The grid which the walker is attached to. 00037 */ 00038 explicit tgrid(gui2::tgrid& grid); 00039 00040 /** Inherited from @ref gui2::iterator::twalker_. */ 00041 virtual tstate next(const tlevel level); 00042 00043 /** Inherited from @ref gui2::iterator::twalker_. */ 00044 virtual bool at_end(const tlevel level) const; 00045 00046 /** Inherited from @ref gui2::iterator::twalker_. */ 00047 virtual gui2::twidget* get(const tlevel level); 00048 00049 private: 00050 00051 /** The grid which the walker is attached to. */ 00052 gui2::tgrid& grid_; 00053 00054 /** 00055 * The grid which the walker is attached to. 00056 * 00057 * This variable is used to track whether the @ref 00058 * gui2::iterator::twalker_::widget level has been visited. 00059 */ 00060 gui2::twidget* widget_; 00061 00062 /** 00063 * The iterator to the children of @ref grid_. 00064 * 00065 * This variable is used to track where the @ref 00066 * gui2::iterator::twalker_::child level visiting is. 00067 */ 00068 gui2::tgrid::iterator itor_; 00069 }; 00070 00071 } // namespace iterator 00072 00073 } // namespace gui2 00074 00075 #endif 00076 00077 00078
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:54 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |