Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
saveas.h
1/*
2** Copyright 2007-2024, 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_SAVEAS_H__
22#define __ANTARES_APPLICATION_WINDOWS_SAVEAS_H__
23
24#include <antares/study/study.h>
25#include "../application/study.h"
26
27#include <wx/sizer.h>
28#include <wx/textctrl.h>
29#include <wx/checkbox.h>
30#include <wx/collpane.h>
31#include <wx/dialog.h>
32#include <wx/textctrl.h>
33#include <wx/collpane.h>
34#include <wx/valtext.h>
35
36namespace Antares
37{
38namespace Window
39{
43class SaveAs final : public wxDialog
44{
45public:
53 static SaveResult Execute(wxFrame* parent, Data::Study::Ptr study);
54
55public:
56 enum
57 {
58 mnIDCollapsePanel = wxID_HIGHEST + 1,
59 mnIDEditStudyName,
60 mnIDEditStudyFolderName,
61 mnIDBrowse,
62 };
63
64public:
65 // \name Constructors & Destructor
67
70 explicit SaveAs(wxFrame* parent);
74 SaveAs(wxFrame* parent, Data::Study::Ptr study);
76 virtual ~SaveAs();
78
80
81
82 Data::Study::Ptr study();
84 const Data::Study::Ptr study() const;
86
90 SaveResult result() const;
91
92private:
94 void internalCreateComponents();
95
96 void onCollapsePanel(wxCollapsiblePaneEvent& evt);
97 void onStudyNameChanged(wxCommandEvent& evt);
98 void onStudyFolderNameChanged(wxCommandEvent& evt);
99 void onBrowse(wxCommandEvent& evt);
100
102 void onCancel(void*);
104 void onSave(void*);
105
106 void propCaption(const wxString& text, bool bold = false);
107 wxTextCtrl* propEdit(const wxString& defaultValue = wxString(), int id = wxID_ANY);
108 wxWindow* propEdit(wxWindow* control);
109 wxTextCtrl* propEdit(const wxString& defaultValue,
110 const wxTextValidator& validator,
111 int id = wxID_ANY);
112
113private:
115 Data::Study::Ptr pStudy;
117 wxFlexGridSizer* pGridSizer;
119 wxWindow* pParentProperties;
121 wxTextCtrl* pStudyName;
123 wxTextCtrl* pStudyFolderName;
125 wxTextCtrl* pFolder;
127 bool pCustomFolderName;
128
130 wxCheckBox* pCopyOutput;
132 wxCheckBox* pCopyUserData;
134 wxCheckBox* pCopyLogs;
136 SaveResult pResult;
137 // Event Table
138 DECLARE_EVENT_TABLE()
139
140}; // class SaveAs
141
142} // namespace Window
143} // namespace Antares
144
145#include "saveas.hxx"
146
147#endif // __ANTARES_APPLICATION_WINDOWS_SAVEAS_H__
Save As Dialog
Definition saveas.h:44
Data::Study::Ptr study()
Get the attached study.
Definition saveas.hxx:28
SaveResult result() const
Get if the study has been saved.
Definition saveas.hxx:38
SaveAs(wxFrame *parent)
Constructor with a parent window and a study.
Definition saveas.cpp:103
virtual ~SaveAs()
Destructor.
Definition saveas.cpp:147
static SaveResult Execute(wxFrame *parent, Data::Study::Ptr study)
Execute the SaveAs dialog and save the given study accordingly.
Definition saveas.cpp:95