Antares Simulator
Power System Simulator
startupwizard.h
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 #ifndef __ANTARES_APPLICATION_WINDOWS_STARTUP_WIZARD_H__
22 #define __ANTARES_APPLICATION_WINDOWS_STARTUP_WIZARD_H__
23 
24 #include <wx/dialog.h>
25 #include <map>
26 #include "../toolbox/components/button.h"
27 
28 namespace Antares::Window
29 {
37 class StartupWizard final: public wxDialog
38 {
39 public:
43  static void Show();
44 
48  static void Close();
49 
50 public:
52 
53 
58  explicit StartupWizard(wxFrame* parent);
60  virtual ~StartupWizard();
62 
63 private:
74  void addControls(const wxString& mapping,
75  const char* image,
76  const wxString& title,
77  const wxString& subtitle = wxString(),
78  bool useEvents = true);
79 
80  void addRecentItem(const wxString& mapping, const wxString& title, const wxString& path);
81 
86  void resetAllBackgroundColors(wxWindow* selected);
87 
89  void onClick(wxCommandEvent& evt);
90 
92  void onClose(void*);
93 
94  void onDropDownExamples(Component::Button&, wxMenu&, void*);
95  void showAllExamples();
97  // void onPreparePopupMenu();
99  void onDisplayPopupMenu();
100 
102  void onWindowMotion(wxMouseEvent& evt);
104  void onMotion(wxMouseEvent& evt);
105 
107  void loadRecentFiles();
108 
109 private:
114  std::map<int, wxString> pMapping;
116  wxColour pDefaultBgColor;
118  wxColour pSelectedBgColor;
120  int pPanelButtonsID;
122  wxWindow* pLastSelected;
124  // This variable is nearly only useful under Windows to prevent useless changes
125  // selecting a folder
126  bool pAllowDisplaySelection;
128  wxMenu* pMenuExamples;
130  std::map<int, Yuni::String> pMenuLinks;
131 
133  wxWindow* pBtnExamples;
135  Yuni::String pExFolder;
136 
137 }; // class StartupWizard
138 
139 } // namespace Antares::Window
140 
141 #endif // __ANTARES_APPLICATION_WINDOWS_STARTUP_WIZARD_H__
Definition: button.h:32
Startup Wizard User Interface.
Definition: startupwizard.h:38
StartupWizard(wxFrame *parent)
Default constructor.
Definition: startupwizard.cpp:229
static void Show()
Show an instance of StartupWizard.
Definition: startupwizard.cpp:210
static void Close()
Close any opened startup window.
Definition: startupwizard.cpp:220
virtual ~StartupWizard()
Destructor.
Definition: startupwizard.cpp:406