The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
scrollbar_panel.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 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_SCROLLBAR_PANEL_HPP_INCLUDED
16 #define GUI_WIDGETS_SCROLLBAR_PANEL_HPP_INCLUDED
17 
19 
22 
23 namespace gui2
24 {
25 
26 // ------------ WIDGET -----------{
27 
28 namespace implementation
29 {
30 struct tbuilder_scrollbar_panel;
31 }
32 
33 /**
34  * Visible container to hold multiple widgets.
35  *
36  * This widget can draw items beyond the widgets it holds and in front of
37  * them. A panel is always active so these functions return dummy values.
38  */
40 {
42 
43 public:
44  /**
45  * Constructor.
46  *
47  * @param canvas_count The canvas count for tcontrol.
48  */
49  explicit tscrollbar_panel(const unsigned canvas_count = 2)
50  : tscrollbar_container(canvas_count)
51  {
52  }
53 
54  /** See @ref tcontrol::get_active. */
55  virtual bool get_active() const override;
56 
57  /** See @ref tcontrol::get_state. */
58  virtual unsigned get_state() const override;
59 
60 private:
61  /** See @ref tcontrol::get_control_type. */
62  virtual const std::string& get_control_type() const override;
63 
64  /** See @ref tcontainer_::set_self_active. */
65  virtual void set_self_active(const bool active) override;
66 };
67 
68 // }---------- DEFINITION ---------{
69 
71 {
72 
73  explicit tscrollbar_panel_definition(const config& cfg);
74 
76  {
77  explicit tresolution(const config& cfg);
78 
80  };
81 };
82 
83 // }---------- BUILDER -----------{
84 
85 namespace implementation
86 {
87 
89 {
90  explicit tbuilder_scrollbar_panel(const config& cfg);
91 
93 
94  twidget* build() const;
95 
98 
100 };
101 
102 } // namespace implementation
103 
104 // }------------ END --------------
105 
106 } // namespace gui2
107 
108 #endif
tscrollbar_container::tscrollbar_mode horizontal_scrollbar_mode
tscrollbar_container::tscrollbar_mode vertical_scrollbar_mode
virtual bool get_active() const override
See tcontrol::get_active.
Base class of a resolution, contains the common keys for a resolution.
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
virtual twidget * build() const =0
virtual const std::string & get_control_type() const override
See tcontrol::get_control_type.
tscrollbar_mode
The way to handle the showing or hiding of the scrollbar.
tscrollbar_panel(const unsigned canvas_count=2)
Constructor.
tscrollbar_panel_definition(const config &cfg)
virtual unsigned get_state() const override
See tcontrol::get_state.
Base class for all widgets.
Definition: widget.hpp:49
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
virtual void set_self_active(const bool active) override
See tcontainer_::set_self_active.
GLsizei const GLcharARB ** string
Definition: glew.h:4503
Visible container to hold multiple widgets.
Contains the implementation details for lexical_cast and shouldn't be used directly.
Base class for creating containers with one or two scrollbar(s).