The Battle for Wesnoth  1.19.0-dev
tod_new_schedule.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2023 - 2024
3  Part of the Battle for Wesnoth Project https://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 
19 namespace gui2
20 {
21 
22 namespace dialogs
23 {
24 
25 /**
26  * @ingroup GUIWindowDefinitionWML
27  *
28  * Dialog that takes new schedule ID and name from the player.
29  * custom_tod.cpp is the main editor window for time schedules.
30  * This is launched when the user presses OK there.
31  */
33 {
34 public:
35  tod_new_schedule(std::string& schedule_id, std::string& schedule_name);
36 
37  /** The execute function. See @ref modal_dialog for more information. */
39 
40 private:
41  virtual void post_show(window& window) override;
42  virtual void pre_show(window& window) override;
43 
44  virtual const std::string& window_id() const override;
45 
46  std::string& schedule_id_;
47  std::string& schedule_name_;
48 
49  /* Callback for enabling or disabling OK button */
50  void button_state_change();
51 };
52 
53 
54 } // namespace dialogs
55 } // namespace gui2
Abstract base class for all modal dialogs.
Dialog that takes new schedule ID and name from the player.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
DEFINE_SIMPLE_EXECUTE_WRAPPER(tod_new_schedule)
The execute function.
tod_new_schedule(std::string &schedule_id, std::string &schedule_name)
virtual const std::string & window_id() const override
The ID of the window to build.
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:63
Various uncategorised dialogs.
Generic file dialog.