The Battle for Wesnoth  1.15.2+dev
unit_advance.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2018 by the Battle for Wesnoth Project https://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12 */
13 
14 #pragma once
15 
17 #include "units/ptr.hpp"
18 
19 namespace gui2
20 {
21 namespace dialogs
22 {
23 
24 class unit_advance : public modal_dialog
25 {
26  typedef std::vector<unit_const_ptr> unit_ptr_vector;
27 public:
28  unit_advance(const unit_ptr_vector& samples, std::size_t real);
29 
30  int get_selected_index() const
31  {
32  return selected_index_;
33  }
34 
35 private:
36  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
37  virtual const std::string& window_id() const override;
38 
39  /** Inherited from modal_dialog. */
40  virtual void pre_show(window& window) override;
41  virtual void post_show(window& window) override;
42 
43  void list_item_clicked(window& window);
44 
45  void show_help();
46 
47  const unit_ptr_vector& previews_;
48 
50 };
51 
52 } // namespace dialogs
53 } // namespace gui2
std::vector< unit_const_ptr > unit_ptr_vector
unit_advance(const unit_ptr_vector &samples, std::size_t real)
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Generic file dialog.
Definition: field-fwd.hpp:22
const unit_ptr_vector & previews_
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
Various uncategorised dialogs.
void list_item_clicked(window &window)
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
virtual void pre_show(window &window) override
Inherited from modal_dialog.