The Battle for Wesnoth  1.19.5+dev
scrollbar_panel.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 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 
19 
22 
23 namespace gui2
24 {
25 
26 // ------------ WIDGET -----------{
27 
28 namespace implementation
29 {
30 struct builder_scrollbar_panel;
31 }
32 
34 {
36 
37 public:
38  /**
39  * Constructor.
40  */
42 
43  /** See @ref styled_widget::get_active. */
44  virtual bool get_active() const override;
45 
46  /** See @ref styled_widget::get_state. */
47  virtual unsigned get_state() const override;
48 
49  /** Static type getter that does not rely on the widget being constructed. */
50  static const std::string& type();
51 
52 private:
53  /** Inherited from styled_widget, implemented by REGISTER_WIDGET. */
54  virtual const std::string& get_control_type() const override;
55 
56  /** See @ref container_base::set_self_active. */
57  virtual void set_self_active(const bool active) override;
58 };
59 
60 // }---------- DEFINITION ---------{
61 
63 {
64 
65  explicit scrollbar_panel_definition(const config& cfg);
66 
68  {
69  explicit resolution(const config& cfg);
70 
72  };
73 };
74 
75 // }---------- BUILDER -----------{
76 
77 namespace implementation
78 {
79 
81 {
82  explicit builder_scrollbar_panel(const config& cfg);
83 
85 
86  virtual std::unique_ptr<widget> build() const override;
87 
90 
92 };
93 
94 } // namespace implementation
95 
96 // }------------ END --------------
97 
98 } // namespace gui2
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:172
Base class for creating containers with one or two scrollbar(s).
scrollbar_mode
The way to handle the showing or hiding of the scrollbar.
virtual void set_self_active(const bool active) override
See container_base::set_self_active.
scrollbar_panel(const implementation::builder_scrollbar_panel &builder)
Constructor.
virtual bool get_active() const override
See styled_widget::get_active.
virtual unsigned get_state() const override
See styled_widget::get_state.
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
virtual const std::string & get_control_type() const override
Inherited from styled_widget, implemented by REGISTER_WIDGET.
Generic file dialog.
std::shared_ptr< builder_grid > builder_grid_ptr
Contains the implementation details for lexical_cast and shouldn't be used directly.
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode
virtual std::unique_ptr< widget > build() const override
scrollbar_container::scrollbar_mode vertical_scrollbar_mode
virtual std::unique_ptr< widget > build() const=0
scrollbar_panel_definition(const config &cfg)