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