The Battle for Wesnoth
1.19.7+dev
gui
auxiliary
iterator
walker_scrollbar_container.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2011 - 2024
3
by Mark de Wever <koraq@xs4all.nl>
4
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY.
12
13
See the COPYING file for more details.
14
*/
15
16
#pragma once
17
18
#include "
gui/auxiliary/iterator/walker.hpp
"
19
20
#include "
gui/widgets/scrollbar_container.hpp
"
21
22
namespace
gui2::iteration
23
{
24
25
/** A walker for a @ref gui2::container_base. */
26
class
scrollbar_container
:
public
walker_base
27
{
28
public
:
29
/**
30
* Constructor.
31
*
32
* @param container The grid which the walker is attached to.
33
*/
34
explicit
scrollbar_container
(
gui2::scrollbar_container
&
container
);
35
36
/** Inherited from @ref gui2::iteration::walker_base. */
37
virtual
state_t
next
(
const
level
level
);
38
39
/** Inherited from @ref gui2::iteration::walker_base. */
40
virtual
bool
at_end
(
const
level
level
)
const
;
41
42
/** Inherited from @ref gui2::iteration::walker_base. */
43
virtual
gui2::widget
*
get
(
const
level
level
);
44
45
private
:
46
/** The container which the walker is attached to. */
47
gui2::scrollbar_container
&
container_
;
48
49
/**
50
* The widget which the walker is attached to.
51
*
52
* This variable is used to track whether the
53
* gui2::iteration::walker_base::widget level has been visited.
54
*/
55
gui2::widget
*
widget_
;
56
57
/**
58
* Whether the grid has been yielded
59
*
60
* This variable is used to track whether the
61
* gui2::iteration::walker_base::internal level has been visited.
62
*/
63
bool
entered_grid
=
false
,
in_grid
=
false
,
entered_children
=
false
;
64
65
/**
66
* The iterator to the children of @ref container_.
67
*
68
* This variable is used to track where the
69
* gui2::iteration::walker_base::child level and
70
* gui2::iteration::walker_base::internal level visiting is.
71
*/
72
gui2::grid::iterator
itor_
;
73
};
74
75
}
// namespace gui2::iteration
gui2::grid::iterator
Iterator for the child items.
Definition:
grid.hpp:437
gui2::iteration::container
A walker for a gui2::container_base.
Definition:
walker_container.hpp:27
gui2::iteration::scrollbar_container
A walker for a gui2::container_base.
Definition:
walker_scrollbar_container.hpp:27
gui2::iteration::scrollbar_container::next
virtual state_t next(const level level)
Inherited from gui2::iteration::walker_base.
Definition:
walker_scrollbar_container.cpp:30
gui2::iteration::scrollbar_container::entered_children
bool entered_children
Definition:
walker_scrollbar_container.hpp:63
gui2::iteration::scrollbar_container::itor_
gui2::grid::iterator itor_
The iterator to the children of container_.
Definition:
walker_scrollbar_container.hpp:72
gui2::iteration::scrollbar_container::at_end
virtual bool at_end(const level level) const
Inherited from gui2::iteration::walker_base.
Definition:
walker_scrollbar_container.cpp:73
gui2::iteration::scrollbar_container::get
virtual gui2::widget * get(const level level)
Inherited from gui2::iteration::walker_base.
Definition:
walker_scrollbar_container.cpp:88
gui2::iteration::scrollbar_container::widget_
gui2::widget * widget_
The widget which the walker is attached to.
Definition:
walker_scrollbar_container.hpp:55
gui2::iteration::scrollbar_container::scrollbar_container
scrollbar_container(gui2::scrollbar_container &container)
Constructor.
Definition:
walker_scrollbar_container.cpp:25
gui2::iteration::scrollbar_container::entered_grid
bool entered_grid
Whether the grid has been yielded.
Definition:
walker_scrollbar_container.hpp:63
gui2::iteration::scrollbar_container::container_
gui2::scrollbar_container & container_
The container which the walker is attached to.
Definition:
walker_scrollbar_container.hpp:47
gui2::iteration::scrollbar_container::in_grid
bool in_grid
Definition:
walker_scrollbar_container.hpp:63
gui2::iteration::walker_base
The walker abstract base class.
Definition:
walker.hpp:28
gui2::iteration::walker_base::level
level
The level to walk at.
Definition:
walker.hpp:35
gui2::iteration::walker_base::state_t
state_t
The state of the walker.
Definition:
walker.hpp:49
gui2::scrollbar_container
Base class for creating containers with one or two scrollbar(s).
Definition:
scrollbar_container.hpp:42
gui2::widget
Base class for all widgets.
Definition:
widget.hpp:55
gui2::iteration
Definition:
exception.hpp:29
scrollbar_container.hpp
walker.hpp
Generated by
1.9.1