Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
message.hxx
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_MESSAGE_HXX__
22#define __ANTARES_APPLICATION_MESSAGE_HXX__
23
24namespace Antares
25{
26namespace Window
27{
28inline void Message::add(DefaultButtonType btn, bool defaultButton, int space)
29{
30 switch (btn)
31 {
32 case btnCancel:
33 add(wxT("Cancel"), btn, defaultButton, space);
34 break;
35 case btnOk:
36 add(wxT(" Ok "), btn, defaultButton, space);
37 break;
38 case btnYes:
39 add(wxT(" Yes "), btn, defaultButton, space);
40 break;
41 case btnNo:
42 add(wxT(" No "), btn, defaultButton, space);
43 break;
44 case btnRetry:
45 add(wxT(" Retry "), btn, defaultButton, space);
46 break;
47 case btnSaveChanges:
48 add(wxT("Save changes"), btn, defaultButton, space);
49 break;
51 add(wxT("Quit without saving"), btn, defaultButton, space);
52 break;
53 case btnDiscard:
54 add(wxT("Discard"), btn, defaultButton, space);
55 break;
56 case btnSaveAs:
57 add(wxT("Save as..."), btn, defaultButton, space);
58 break;
59 case btnUpgrade:
60 add(wxT("Upgrade"), btn, defaultButton, space);
61 break;
62 case btnContinue:
63 add(wxT("Continue"), btn, defaultButton, space);
64 break;
65 case btnViewResults:
66 add(wxT("View results"), btn, defaultButton, space);
67 break;
68 case btnQuit:
69 add(wxT("Quit the program"), btn, defaultButton, space);
70 break;
71 case btnStartID:
72 break;
73 }
74}
75
77{
78 pItemList.push_back(item);
79}
80
82{
83 pItemList.push_back(item);
84 return *this;
85}
86
87inline void Message::recommendedWidth(uint w)
88{
89 pRecommendedWidth = w;
90}
91
92} // namespace Window
93} // namespace Antares
94
95#endif // __ANTARES_APPLICATION_MESSAGE_HXX__
std::shared_ptr< IItem > Ptr
Ptr.
Definition spotlight.h:31
Standard message Box for Antares.
Definition message.h:60
void add(const wxString &caption, DefaultButtonType value, bool defaultButton=false, int space=3)
Add a new custom button.
Definition message.cpp:188
void recommendedWidth(uint w)
Set the recommended width of the dialog box.
Definition message.hxx:87
Message & operator+=(Component::Spotlight::IItem::Ptr item)
Definition message.hxx:81
DefaultButtonType
Definition message.h:63
@ btnSaveChanges
Standard button: Save changes.
Definition message.h:79
@ btnQuit
Standard button: quit.
Definition message.h:91
@ btnNo
Standard button: No.
Definition message.h:71
@ btnYes
Standard button: Yes.
Definition message.h:69
@ btnSaveAs
Standard button: Save as...
Definition message.h:83
@ btnRetry
Standard button: retry.
Definition message.h:73
@ btnViewResults
Standard button: view simulation results.
Definition message.h:89
@ btnOk
Standard button: Ok.
Definition message.h:67
@ btnCancel
Standard button: Cancel.
Definition message.h:81
@ btnDiscard
Standard button: Discard.
Definition message.h:75
@ btnUpgrade
Standard button: Upgrade.
Definition message.h:85
@ btnQuitWithoutSaving
Quit without saving.
Definition message.h:77
@ btnContinue
Standard button: continue.
Definition message.h:87
@ btnStartID
constant
Definition message.h:65