The Battle for Wesnoth  1.15.1+dev
advanced_graphics_options.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 - 2018 by Chris Beck <render787@gmail.com>
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 #pragma once
16 
18 #include "gui/widgets/group.hpp"
19 #include "preferences/general.hpp"
20 
21 namespace gui2
22 {
23 namespace dialogs
24 {
25 
27 {
28 public:
29  /** Constructor. */
31 
32  /**
33  * The display function.
34  *
35  * See @ref modal_dialog for more information.
36  */
38 
39  // These names must match the infixes of the widget ids in advanced_graphics_options.cfg
40  static const std::vector<std::string> scale_cases;
41 
42 private:
43  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
44  virtual const std::string& window_id() const override;
45 
46  /** Inherited from modal_dialog. */
47  virtual void pre_show(window& window) override;
48 
49  /** Inherited from modal_dialog. */
50  virtual void post_show(window& window) override;
51 
52  void setup_scale_case(const std::string&, window&);
53  void update_scale_case(const std::string&);
54 
56 
57  SCALING_ALGORITHM get_scale_pref(const std::string& pref_id);
58 
59  std::map<std::string, group<SCALING_ALGORITHM>> groups_;
60 };
61 
62 } // namespace dialogs
63 } // end namespace gui2
STL namespace.
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Generic file dialog.
Definition: field-fwd.hpp:22
Modify, read and display user preferences.
Various uncategorised dialogs.
static const std::vector< std::string > scale_cases
The display function.
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
void setup_scale_case(const std::string &, window &)
Abstract base class for all modal dialogs.
std::map< std::string, group< SCALING_ALGORITHM > > groups_
SCALING_ALGORITHM get_scale_pref(const std::string &pref_id)
virtual void post_show(window &window) override
Inherited from modal_dialog.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:63