The Battle for Wesnoth  1.15.2+dev
scrollbar_panel.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2018 by Mark de Wever <koraq@xs4all.nl>
3  Part of the Battle for Wesnoth Project https://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 #pragma once
16 
18 
21 
22 namespace gui2
23 {
24 
25 // ------------ WIDGET -----------{
26 
27 namespace implementation
28 {
29 struct builder_scrollbar_panel;
30 }
31 
32 /**
33  * Visible container to hold multiple widgets.
34  *
35  * This widget can draw items beyond the widgets it holds and in front of
36  * them. A panel is always active so these functions return dummy values.
37  */
39 {
41 
42 public:
43  /**
44  * Constructor.
45  */
47 
48  /** See @ref styled_widget::get_active. */
49  virtual bool get_active() const override;
50 
51  /** See @ref styled_widget::get_state. */
52  virtual unsigned get_state() const override;
53 
54  /** Static type getter that does not rely on the widget being constructed. */
55  static const std::string& type();
56 
57 private:
58  /** Inherited from styled_widget, implemented by REGISTER_WIDGET. */
59  virtual const std::string& get_control_type() const override;
60 
61  /** See @ref container_base::set_self_active. */
62  virtual void set_self_active(const bool active) override;
63 };
64 
65 // }---------- DEFINITION ---------{
66 
68 {
69 
70  explicit scrollbar_panel_definition(const config& cfg);
71 
73  {
74  explicit resolution(const config& cfg);
75 
77  };
78 };
79 
80 // }---------- BUILDER -----------{
81 
82 namespace implementation
83 {
84 
86 {
87  explicit builder_scrollbar_panel(const config& cfg);
88 
90 
91  widget* build() const;
92 
95 
97 };
98 
99 } // namespace implementation
100 
101 // }------------ END --------------
102 
103 } // namespace gui2
Base class of a resolution, contains the common keys for a resolution.
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode
virtual widget * build() const =0
Base class for all widgets.
Definition: widget.hpp:47
Generic file dialog.
Definition: field-fwd.hpp:22
Visible container to hold multiple widgets.
Base class for creating containers with one or two scrollbar(s).
window * build(const builder_window::window_resolution *definition)
Builds a window.
scrollbar_mode
The way to handle the showing or hiding of the scrollbar.
point resolution()
Definition: general.cpp:373
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:68
std::shared_ptr< builder_grid > builder_grid_ptr
Contains the implementation details for lexical_cast and shouldn&#39;t be used directly.
scrollbar_container::scrollbar_mode vertical_scrollbar_mode