The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
core_selection.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_DIALOGS_CORE_SELECTION_HPP_INCLUDED
16 #define GUI_DIALOGS_CORE_SELECTION_HPP_INCLUDED
17 
18 #include "gui/dialogs/dialog.hpp"
19 
20 class config;
21 
22 namespace gui2
23 {
24 
25 class tcore_selection : public tdialog
26 {
27 public:
28  explicit tcore_selection(const std::vector<config>& cores, int choice)
29  : cores_(cores), choice_(choice)
30 
31  {
32  }
33 
34  /***** ***** ***** setters / getters for members ***** ****** *****/
35 
36  int get_choice() const
37  {
38  return choice_;
39  }
40 
41 private:
42  /** Called when another core is selected. */
43  void core_selected(twindow& window);
44 
45  /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
46  virtual const std::string& window_id() const;
47 
48  /** Inherited from tdialog. */
49  void pre_show(twindow& window);
50 
51  /** Inherited from tdialog. */
52  void post_show(twindow& window);
53 
54  /** Contains the config objects for all cores. */
55  const std::vector<config>& cores_;
56 
57  /** The chosen core. */
58  int choice_;
59 };
60 
61 } // namespace gui2
62 
63 #endif
const std::vector< config > & cores_
Contains the config objects for all cores.
void core_selected(twindow &window)
Called when another core is selected.
void pre_show(twindow &window)
Inherited from tdialog.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
tcore_selection(const std::vector< config > &cores, int choice)
Abstract base class for all dialogs.
Definition: dialog.hpp:121
virtual const std::string & window_id() const
Inherited from tdialog, implemented by REGISTER_DIALOG.
int choice_
The chosen core.
void post_show(twindow &window)
Inherited from tdialog.
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
GLsizei const GLcharARB ** string
Definition: glew.h:4503