-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
tree_view.hpp
70 lines (51 loc) · 1.73 KB
/
tree_view.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
Copyright (C) 2010 - 2016 by Mark de Wever <koraq@xs4all.nl>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#ifndef GUI_AUXILIARY_WINDOW_BUILDER_TREE_VIEW_HPP_INCLUDED
#define GUI_AUXILIARY_WINDOW_BUILDER_TREE_VIEW_HPP_INCLUDED
#include "gui/auxiliary/window_builder/control.hpp"
#include "gui/widgets/scrollbar_container.hpp"
namespace gui2
{
namespace implementation
{
struct tbuilder_tree_view : public tbuilder_control
{
explicit tbuilder_tree_view(const config& cfg);
using tbuilder_control::build;
twidget* build() const;
tscrollbar_container::tscrollbar_mode vertical_scrollbar_mode;
tscrollbar_container::tscrollbar_mode horizontal_scrollbar_mode;
unsigned indention_step_size;
struct tnode
{
explicit tnode(const config& cfg);
std::string id;
bool unfolded;
tbuilder_grid_ptr builder;
};
/**
* The types of nodes in the tree view.
*
* Since we expect the amount of nodes to remain low it's stored in a
* vector and not in a map.
*/
std::vector<tnode> nodes;
/*
* NOTE this class doesn't have a data section, so it can only be filled
* with data by the engine. I think this poses no limit on the usage since
* I don't foresee that somebody wants to pre-fill a tree view. If the need
* arises the data part can be added.
*/
};
} // namespace implementation
} // namespace gui2
#endif