The Battle for Wesnoth  1.19.2+dev
mp_change_control.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2024
3  by Lukasz Dobrogowski <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::dialogs
28 {
29 
31 {
32 public:
34 
36 
37 private:
38  virtual const std::string& window_id() const override;
39 
40  virtual void pre_show(window& window) override;
41 
42  virtual void post_show(window& window) override;
43 
46 
47  void highlight_side_nick();
48 
50 
51  unsigned int selected_side_;
52  unsigned int selected_nick_;
53 
54  // Contains the mapping from listbox labels to actual sides
55  std::vector<int> sides_;
56 
57  // Contains the mapping from listbox labels to actual nicks
58  std::vector<std::string> nicks_;
59 };
60 
61 } // namespace dialogs
Abstract base class for all modal dialogs.
std::vector< std::string > nicks_
virtual const std::string & window_id() const override
The ID of the window to build.
events::menu_handler & menu_handler_
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
mp_change_control(events::menu_handler &mh)
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
base class of top level items, the only item which needs to store the final canvases to draw on.
Definition: window.hpp:61
#define DEFINE_SIMPLE_DISPLAY_WRAPPER(dialog)
Adds a bare-bones static display function to a dialog class that immediately invokes the dialogs's mo...
Handling of system events.