The Battle for Wesnoth  1.15.2+dev
mp_change_control.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2018 by Lukasz Dobrogowski
3  <lukasz.dobrogowski@gmail.com>
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 
20 #include <vector>
21 
22 namespace events
23 {
24  class menu_handler;
25 }
26 
27 namespace gui2
28 {
29 namespace dialogs
30 {
31 
33 {
34 public:
36 
38 
39 private:
40  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
41  virtual const std::string& window_id() const override;
42 
43  /** Inherited from modal_dialog. */
44  virtual void pre_show(window& window) override;
45 
46  /** Inherited from modal_dialog. */
47  virtual void post_show(window& window) override;
48 
49  void handle_sides_list_item_clicked(window& window);
50  void handle_nicks_list_item_clicked(window& window);
51 
52  void highlight_side_nick(window& window);
53 
55 
56  unsigned int selected_side_;
57  unsigned int selected_nick_;
58 
59  // Contains the mapping from listbox labels to actual sides
60  std::vector<int> sides_;
61 
62  // Contains the mapping from listbox labels to actual nicks
63  std::vector<std::string> nicks_;
64 };
65 
66 } // namespace dialogs
67 } // namespace gui2
events::menu_handler & menu_handler_
Generic file dialog.
Definition: field-fwd.hpp:22
std::vector< std::string > nicks_
Various uncategorised dialogs.
Handling of system events.
Definition: manager.hpp:42
Abstract base class for all modal dialogs.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62