Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
MainFrameBase.cpp
1
2// This file was auto-generated by codelite's wxCrafter Plugin
3// wxCrafter project file: MainFrame.wxcp
4// Do not modify this file by hand!
6
7#include "MainFrameBase.h"
8
9
10// Declare the bitmap loading function
11extern void wxC9ED9InitBitmapResources();
12
13
14namespace {
15// return the wxBORDER_SIMPLE that matches the current application theme
16wxBorder get_border_simple_theme_aware_bit() {
17#if wxVERSION_NUMBER >= 3300 && defined(__WXMSW__)
18 return wxSystemSettings::GetAppearance().IsDark() ? wxBORDER_SIMPLE : wxBORDER_DEFAULT;
19#else
20 return wxBORDER_DEFAULT;
21#endif
22} // get_border_simple_theme_aware_bit
23bool bBitmapLoaded = false;
24} // namespace
25
26
27MainFrameBase::MainFrameBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
28 : wxFrame(parent, id, title, pos, size, style)
29{
30 if ( !bBitmapLoaded ) {
31 // We need to initialise the default bitmap handler
32 wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
33 wxC9ED9InitBitmapResources();
34 bBitmapLoaded = true;
35 }
36 // Set icon(s) to the application/dialog
37 wxIconBundle app_icons;
38 {
39 wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("logo16"));
40 wxIcon icn;
41 icn.CopyFromBitmap(iconBmp);
42 app_icons.AddIcon( icn );
43 }
44 {
45 wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("logo32"));
46 wxIcon icn;
47 icn.CopyFromBitmap(iconBmp);
48 app_icons.AddIcon( icn );
49 }
50 {
51 wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("logo64"));
52 wxIcon icn;
53 icn.CopyFromBitmap(iconBmp);
54 app_icons.AddIcon( icn );
55 }
56 {
57 wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("logo128"));
58 wxIcon icn;
59 icn.CopyFromBitmap(iconBmp);
60 app_icons.AddIcon( icn );
61 }
62 {
63 wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("logo256"));
64 wxIcon icn;
65 icn.CopyFromBitmap(iconBmp);
66 app_icons.AddIcon( icn );
67 }
68 SetIcons( app_icons );
69
70
71 wxBoxSizer* boxSizer_lvl_1_1 = new wxBoxSizer(wxVERTICAL);
72 this->SetSizer(boxSizer_lvl_1_1);
73
74 wxBoxSizer* boxSizer_lvl_2_1 = new wxBoxSizer(wxVERTICAL);
75
76 boxSizer_lvl_1_1->Add(boxSizer_lvl_2_1, 0, wxEXPAND, WXC_FROM_DIP(5));
77
78 m_ribbonBar = new wxRibbonBar(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxRIBBON_BAR_DEFAULT_STYLE);
79 m_ribbonBar->SetArtProvider(new wxRibbonDefaultArtProvider);
80
81 boxSizer_lvl_2_1->Add(m_ribbonBar, 0, wxEXPAND, WXC_FROM_DIP(5));
82
83 m_ribbonPageFile = new wxRibbonPage(m_ribbonBar, wxID_ANY, _("File"), wxNullBitmap, 0);
84 m_ribbonPageFile->SetToolTip(_("File"));
85 m_ribbonBar->SetActivePage( m_ribbonPageFile );
86
87 m_ribbonPanelProjects = new wxRibbonPanel(m_ribbonPageFile, wxID_ANY, _("Projects"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageFile, wxSize(-1,-1)), wxRIBBON_PANEL_NO_AUTO_MINIMISE|wxRIBBON_PANEL_DEFAULT_STYLE);
88 m_ribbonPanelProjects->SetToolTip(_("Projects"));
89
90 m_ribbonButtonBarProjects = new wxRibbonButtonBar(m_ribbonPanelProjects, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelProjects, wxSize(-1,-1)), 0);
91 m_ribbonButtonBarProjects->SetToolTip(_("Projects"));
92
93 m_ribbonButtonBarProjects->AddButton(ID_RIBBON_NEW, _("New"), wxXmlResource::Get()->LoadBitmap(wxT("new32")), _("Create new project"), wxRIBBON_BUTTON_NORMAL);
94
95 m_ribbonButtonBarProjects->AddButton(ID_RIBBON_OPEN, _("Open"), wxXmlResource::Get()->LoadBitmap(wxT("open32")), _("Open saved project"), wxRIBBON_BUTTON_NORMAL);
96
97 m_ribbonButtonBarProjects->AddButton(ID_RIBBON_IMPORT, _("Import"), wxXmlResource::Get()->LoadBitmap(wxT("imp32")), _("Open saved project"), wxRIBBON_BUTTON_NORMAL);
98
99 m_ribbonButtonBarProjects->AddButton(ID_RIBBON_GENSETTINGS, _("General Settings"), wxXmlResource::Get()->LoadBitmap(wxT("settings32")), _("Opens a dialog to set the main settings of the program"), wxRIBBON_BUTTON_NORMAL);
100
101 m_ribbonButtonBarProjects->AddButton(ID_RIBBON_EXIT, _("Exit"), wxXmlResource::Get()->LoadBitmap(wxT("exit32")), _("Closes the application"), wxRIBBON_BUTTON_NORMAL);
102 m_ribbonButtonBarProjects->Realize();
103
104 m_ribbonPanelCProject = new wxRibbonPanel(m_ribbonPageFile, wxID_ANY, _("Current project"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageFile, wxSize(-1,-1)), wxRIBBON_PANEL_NO_AUTO_MINIMISE|wxRIBBON_PANEL_DEFAULT_STYLE);
105 m_ribbonPanelCProject->SetToolTip(_("Current project"));
106
107 m_ribbonButtonBarCProject = new wxRibbonButtonBar(m_ribbonPanelCProject, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelCProject, wxSize(-1,-1)), 0);
108
109 m_ribbonButtonBarCProject->AddButton(ID_RIBBON_SAVE, _("Save"), wxXmlResource::Get()->LoadBitmap(wxT("save32")), _("Save the current project"), wxRIBBON_BUTTON_NORMAL);
110
111 m_ribbonButtonBarCProject->AddButton(ID_RIBBON_SAVEAS, _("Save As..."), wxXmlResource::Get()->LoadBitmap(wxT("saveAs32")), _("Save as the current project"), wxRIBBON_BUTTON_NORMAL);
112
113 m_ribbonButtonBarCProject->AddButton(ID_RIBBON_CLOSE, _("Close"), wxXmlResource::Get()->LoadBitmap(wxT("close32")), _("Close the current project"), wxRIBBON_BUTTON_NORMAL);
114 m_ribbonButtonBarCProject->Realize();
115
116 m_ribbonPanelHelp = new wxRibbonPanel(m_ribbonPageFile, wxID_ANY, _("Help"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageFile, wxSize(-1,-1)), wxRIBBON_PANEL_NO_AUTO_MINIMISE|wxRIBBON_PANEL_DEFAULT_STYLE);
117 m_ribbonPanelHelp->SetToolTip(_("Help"));
118
119 m_ribbonButtonBarHelp = new wxRibbonButtonBar(m_ribbonPanelHelp, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelHelp, wxSize(-1,-1)), 0);
120 m_ribbonButtonBarHelp->SetToolTip(_("Help"));
121
122 m_ribbonButtonBarHelp->AddButton(ID_RIBBON_GUIDE, _("PSP-UFU Guide"), wxXmlResource::Get()->LoadBitmap(wxT("guide32")), _("Open PSP-UFU Guide"), wxRIBBON_BUTTON_NORMAL);
123
124 m_ribbonButtonBarHelp->AddButton(ID_RIBBON_ABOUT, _("About..."), wxXmlResource::Get()->LoadBitmap(wxT("about32")), _("About PSP-UFU"), wxRIBBON_BUTTON_NORMAL);
125 m_ribbonButtonBarHelp->Realize();
126
127 m_ribbonPageTools = new wxRibbonPage(m_ribbonBar, wxID_ANY, _("Tools"), wxNullBitmap, 0);
128 m_ribbonPageTools->SetToolTip(_("Tools"));
129
130 m_ribbonPanelClipboard = new wxRibbonPanel(m_ribbonPageTools, wxID_ANY, _("Clipboard"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageTools, wxSize(-1,-1)), wxRIBBON_PANEL_NO_AUTO_MINIMISE|wxRIBBON_PANEL_DEFAULT_STYLE);
131 m_ribbonPanelClipboard->SetToolTip(_("Clipboard"));
132
133 m_ribbonButtonBarClipboard = new wxRibbonButtonBar(m_ribbonPanelClipboard, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelClipboard, wxSize(-1,-1)), 0);
134 m_ribbonButtonBarClipboard->SetToolTip(_("Clipboard"));
135
136 m_ribbonButtonBarClipboard->AddButton(ID_RIBBON_COPY, _("Copy"), wxXmlResource::Get()->LoadBitmap(wxT("copy32")), _("Copies the selected elements"), wxRIBBON_BUTTON_NORMAL);
137
138 m_ribbonButtonBarClipboard->AddButton(ID_RIBBON_PASTE, _("Paste"), wxXmlResource::Get()->LoadBitmap(wxT("paste32")), _("Pastes the elements from clipboard"), wxRIBBON_BUTTON_NORMAL);
139
140 m_ribbonButtonBarClipboard->AddButton(ID_RIBBON_UNDO, _("Undo"), wxXmlResource::Get()->LoadBitmap(wxT("undo32")), _("Undoes the last action"), wxRIBBON_BUTTON_NORMAL);
141
142 m_ribbonButtonBarClipboard->AddButton(ID_RIBBON_REDO, _("Redo"), wxXmlResource::Get()->LoadBitmap(wxT("redo32")), _("Redoes the last undo action"), wxRIBBON_BUTTON_NORMAL);
143 m_ribbonButtonBarClipboard->Realize();
144
145 m_ribbonPanelCircuit = new wxRibbonPanel(m_ribbonPageTools, wxID_ANY, _("Circuit"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageTools, wxSize(-1,-1)), wxRIBBON_PANEL_NO_AUTO_MINIMISE|wxRIBBON_PANEL_DEFAULT_STYLE);
146 m_ribbonPanelCircuit->SetToolTip(_("Circuit"));
147
148 m_ribbonButtonBarCircuit = new wxRibbonButtonBar(m_ribbonPanelCircuit, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelCircuit, wxSize(-1,-1)), 0);
149 m_ribbonButtonBarCircuit->SetToolTip(_("Circuit"));
150
151 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_ADDELEMENT, _("Add Element"), wxXmlResource::Get()->LoadBitmap(wxT("add32")), _("Add a new element in the project"), wxRIBBON_BUTTON_DROPDOWN);
152
153 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_DRAG, _("Drag"), wxXmlResource::Get()->LoadBitmap(wxT("drag32")), _("Drag all the elements"), wxRIBBON_BUTTON_NORMAL);
154
155 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_MOVE, _("Move"), wxXmlResource::Get()->LoadBitmap(wxT("move32")), _("Move the selected elements"), wxRIBBON_BUTTON_NORMAL);
156
157 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_DELETE, _("Delete"), wxXmlResource::Get()->LoadBitmap(wxT("delete32")), _("Removes all selected elements"), wxRIBBON_BUTTON_NORMAL);
158
159 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_FIT, _("Fit"), wxXmlResource::Get()->LoadBitmap(wxT("fit32")), _("Applies the drag and zoom tools to show all elements in workspace"), wxRIBBON_BUTTON_NORMAL);
160
161 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_ROTATEC, _("Rotate Clockwise"), wxXmlResource::Get()->LoadBitmap(wxT("rotateClock32")), _("Rotate clockwise"), wxRIBBON_BUTTON_NORMAL);
162
163 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_ROTATECC, _("Rotate Counter-clockwise"), wxXmlResource::Get()->LoadBitmap(wxT("rotateCounterClock32")), _("Rotate the selected elements counter-clockwise"), wxRIBBON_BUTTON_NORMAL);
164
165 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_LABELMNGR, _("Label Manager"), wxXmlResource::Get()->LoadBitmap(wxT("labelMngr32")), _("Automatically insert labels into multiple elements at once"), wxRIBBON_BUTTON_NORMAL);
166
167 m_ribbonButtonBarCircuit->AddButton(ID_RIBBON_PROJSETTINGS, _("Project Settings"), wxXmlResource::Get()->LoadBitmap(wxT("settings32")), _("Opens a dialog to set the main settings of the current project"), wxRIBBON_BUTTON_NORMAL);
168 m_ribbonButtonBarCircuit->Realize();
169
170 m_ribbonPanelReports = new wxRibbonPanel(m_ribbonPageTools, wxID_ANY, _("Data Visualization"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageTools, wxSize(-1,-1)), wxRIBBON_PANEL_NO_AUTO_MINIMISE|wxRIBBON_PANEL_DEFAULT_STYLE);
171 m_ribbonPanelReports->SetToolTip(_("Reports"));
172
173 m_ribbonButtonBarReports = new wxRibbonButtonBar(m_ribbonPanelReports, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelReports, wxSize(-1,-1)), 0);
174
175 m_ribbonButtonBarReports->AddButton(ID_RIBBON_DATAREPORT, _("Data Report"), wxXmlResource::Get()->LoadBitmap(wxT("dataReport32")), _("Opens a data report"), wxRIBBON_BUTTON_NORMAL);
176
177 m_ribbonButtonBarReports->AddButton(ID_RIBBON_CHARTS, _("Charts"), wxXmlResource::Get()->LoadBitmap(wxT("chart32")), _("Open the charts"), wxRIBBON_BUTTON_NORMAL);
178
179 m_ribbonButtonBarReports->AddButton(ID_RIBBON_HEATMAP, _("Voltage Heatmap"), wxXmlResource::Get()->LoadBitmap(wxT("heatmap32")), _("Enable/disable the voltage heatmap visualization"), wxRIBBON_BUTTON_TOGGLE);
180
181 m_ribbonButtonBarReports->AddButton(ID_RIBBON_SNAPSHOT, _("Snapshot"), wxXmlResource::Get()->LoadBitmap(wxT("snap32")), _("Capture a snapshot of the circuit"), wxRIBBON_BUTTON_HYBRID);
182 m_ribbonButtonBarReports->Realize();
183
184 m_ribbonPageSimulation = new wxRibbonPage(m_ribbonBar, wxID_ANY, _("Simulation"), wxNullBitmap, 0);
185 m_ribbonPageSimulation->SetToolTip(_("Simulation"));
186
187 m_ribbonPanelContinuous = new wxRibbonPanel(m_ribbonPageSimulation, wxID_ANY, _("Continuous"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageSimulation, wxSize(-1,-1)), wxRIBBON_PANEL_DEFAULT_STYLE);
188 m_ribbonPanelContinuous->SetToolTip(_("Continuous"));
189
190 m_ribbonButtonBarContinuous = new wxRibbonButtonBar(m_ribbonPanelContinuous, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelContinuous, wxSize(-1,-1)), 0);
191
192 m_ribbonButtonBarContinuous->AddButton(ID_RIBBON_ENABLESOL, _("Enable Solution"), wxXmlResource::Get()->LoadBitmap(wxT("playStopped32")), _("Enables the power flow and fault (if exists) calculations after any circuit change"), wxRIBBON_BUTTON_TOGGLE);
193
194 m_ribbonButtonBarContinuous->AddButton(ID_RIBBON_DISABLESOL, _("Disable Solution"), wxXmlResource::Get()->LoadBitmap(wxT("pauseStopped32")), _("Disables the power flow and fault calculations after any circuit changes"), wxRIBBON_BUTTON_TOGGLE);
195
196 m_ribbonButtonBarContinuous->AddButton(ID_RIBBON_RESETVOLT, _("Reset Voltages"), wxXmlResource::Get()->LoadBitmap(wxT("reset32")), _("Reset all voltages to initial state"), wxRIBBON_BUTTON_NORMAL);
197 m_ribbonButtonBarContinuous->Realize();
198
199 m_ribbonPanelSimulations = new wxRibbonPanel(m_ribbonPageSimulation, wxID_ANY, _("Simulations"), wxNullBitmap, wxDefaultPosition, wxDLG_UNIT(m_ribbonPageSimulation, wxSize(-1,-1)), wxRIBBON_PANEL_NO_AUTO_MINIMISE|wxRIBBON_PANEL_DEFAULT_STYLE);
200 m_ribbonPanelSimulations->SetToolTip(_("Simulations"));
201
202 m_ribbonButtonBarSimulations = new wxRibbonButtonBar(m_ribbonPanelSimulations, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_ribbonPanelSimulations, wxSize(-1,-1)), 0);
203 m_ribbonButtonBarSimulations->SetToolTip(_("Simulations"));
204
205 m_ribbonButtonBarSimulations->AddButton(ID_RIBBON_POWERFLOW, _("Power Flow"), wxXmlResource::Get()->LoadBitmap(wxT("powerFLow32")), _("Calculate the circuit power flow"), wxRIBBON_BUTTON_NORMAL);
206
207 m_ribbonButtonBarSimulations->AddButton(ID_RIBBON_RUNSTAB, _("Run Stability"), wxXmlResource::Get()->LoadBitmap(wxT("playStopped32")), _("Run the stability calculations"), wxRIBBON_BUTTON_HYBRID);
208
209 m_ribbonButtonBarSimulations->AddButton(ID_RIBBON_FAULT, _("Fault"), wxXmlResource::Get()->LoadBitmap(wxT("fault32")), _("Calculate the circuit fault (if exists)"), wxRIBBON_BUTTON_NORMAL);
210
211 m_ribbonButtonBarSimulations->AddButton(ID_RIBBON_SCPOWER, _("Short-Circuit Power"), wxXmlResource::Get()->LoadBitmap(wxT("faultPower32")), _("Calculate the short-circuit power in all buses"), wxRIBBON_BUTTON_NORMAL);
212
213 m_ribbonButtonBarSimulations->AddButton(ID_RIBBON_HARMDIST, _("Harmonic Distortions"), wxXmlResource::Get()->LoadBitmap(wxT("harmDist32")), _("Calculate the voltage distortions on all buses due to harmonic current sources"), wxRIBBON_BUTTON_NORMAL);
214
215 m_ribbonButtonBarSimulations->AddButton(ID_RIBBON_FREQRESP, _("Frequency response"), wxXmlResource::Get()->LoadBitmap(wxT("freqResp32")), _("Calculate the impedance seen in a bus for varies frequencies"), wxRIBBON_BUTTON_NORMAL);
216
217 m_ribbonButtonBarSimulations->AddButton(ID_RIBBON_SIMULSETTINGS, _("Simulation Settings"), wxXmlResource::Get()->LoadBitmap(wxT("settings32")), _("Opens a dialog to set the settings of the simulations"), wxRIBBON_BUTTON_NORMAL);
218 m_ribbonButtonBarSimulations->Realize();
219 m_ribbonBar->Realize();
220 wxBoxSizer* boxSizer_lvl_2_2 = new wxBoxSizer(wxVERTICAL);
221
222 boxSizer_lvl_1_1->Add(boxSizer_lvl_2_2, 1, wxEXPAND, WXC_FROM_DIP(5));
223
224 m_auiNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxAUI_NB_DEFAULT_STYLE|wxBK_DEFAULT);
225 m_auiNotebook->SetName(wxT("m_auiNotebook"));
226
227 boxSizer_lvl_2_2->Add(m_auiNotebook, 1, wxEXPAND, WXC_FROM_DIP(5));
228
229 m_statusBar = new wxStatusBar(this, wxID_ANY, wxSTB_DEFAULT_STYLE);
230 m_statusBar->SetFieldsCount(4);
231 this->SetStatusBar(m_statusBar);
232
233
234 #if wxVERSION_NUMBER >= 2900
235 if(!wxPersistenceManager::Get().Find(m_auiNotebook)){
236 wxPersistenceManager::Get().RegisterAndRestore(m_auiNotebook);
237 } else {
238 wxPersistenceManager::Get().Restore(m_auiNotebook);
239 }
240 #endif
241
242 SetName(wxT("MainFrameBase"));
243 SetSize(wxDLG_UNIT(this, wxSize(800,600)));
244 if (GetSizer()) {
245 GetSizer()->Fit(this);
246 }
247 if(GetParent()) {
248 CentreOnParent(wxBOTH);
249 } else {
250 CentreOnScreen(wxBOTH);
251 }
252 if(!wxPersistenceManager::Get().Find(this)) {
253 wxPersistenceManager::Get().RegisterAndRestore(this);
254 } else {
255 wxPersistenceManager::Get().Restore(this);
256 }
257 // Connect events
258 this->Bind(wxEVT_CLOSE_WINDOW, &MainFrameBase::OnClose, this);
259 m_ribbonButtonBarProjects->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnNewClick, this, ID_RIBBON_NEW);
260 m_ribbonButtonBarProjects->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnOpenClick, this, ID_RIBBON_OPEN);
261 m_ribbonButtonBarProjects->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnImportClick, this, ID_RIBBON_IMPORT);
262 m_ribbonButtonBarProjects->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnGeneralSettingsClick, this, ID_RIBBON_GENSETTINGS);
263 m_ribbonButtonBarProjects->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnExitClick, this, ID_RIBBON_EXIT);
264 m_ribbonButtonBarCProject->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSaveClick, this, ID_RIBBON_SAVE);
265 m_ribbonButtonBarCProject->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSaveAsClick, this, ID_RIBBON_SAVEAS);
266 m_ribbonButtonBarCProject->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnCloseClick, this, ID_RIBBON_CLOSE);
267 m_ribbonButtonBarHelp->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnPSPGuideClick, this, ID_RIBBON_GUIDE);
268 m_ribbonButtonBarHelp->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnAboutClick, this, ID_RIBBON_ABOUT);
269 m_ribbonButtonBarClipboard->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnCopyClick, this, ID_RIBBON_COPY);
270 m_ribbonButtonBarClipboard->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnPasteClick, this, ID_RIBBON_PASTE);
271 m_ribbonButtonBarClipboard->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnUndoClick, this, ID_RIBBON_UNDO);
272 m_ribbonButtonBarClipboard->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRedoClick, this, ID_RIBBON_REDO);
273 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, &MainFrameBase::OnAddElementDropdown, this, ID_RIBBON_ADDELEMENT);
274 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDragClick, this, ID_RIBBON_DRAG);
275 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnMoveClick, this, ID_RIBBON_MOVE);
276 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDeleteClick, this, ID_RIBBON_DELETE);
277 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnFitClick, this, ID_RIBBON_FIT);
278 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRotClockClick, this, ID_RIBBON_ROTATEC);
279 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRotCounterClockClick, this, ID_RIBBON_ROTATECC);
280 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnLabelMngrClick, this, ID_RIBBON_LABELMNGR);
281 m_ribbonButtonBarCircuit->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnProjectSettingsClick, this, ID_RIBBON_PROJSETTINGS);
282 m_ribbonButtonBarReports->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDataReportClick, this, ID_RIBBON_DATAREPORT);
283 m_ribbonButtonBarReports->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnChartsClick, this, ID_RIBBON_CHARTS);
284 m_ribbonButtonBarReports->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnHeatmapClick, this, ID_RIBBON_HEATMAP);
285 m_ribbonButtonBarReports->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSnapshotClick, this, ID_RIBBON_SNAPSHOT);
286 m_ribbonButtonBarReports->Bind(wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, &MainFrameBase::OnSnapshotDropdown, this, ID_RIBBON_SNAPSHOT);
287 m_ribbonButtonBarContinuous->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnEnableSolutionClick, this, ID_RIBBON_ENABLESOL);
288 m_ribbonButtonBarContinuous->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDisableSolutionClick, this, ID_RIBBON_DISABLESOL);
289 m_ribbonButtonBarContinuous->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnResetVoltagesClick, this, ID_RIBBON_RESETVOLT);
290 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnPowerFlowClick, this, ID_RIBBON_POWERFLOW);
291 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRunStabilityClick, this, ID_RIBBON_RUNSTAB);
292 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, &MainFrameBase::OnStabilityDropdown, this, ID_RIBBON_RUNSTAB);
293 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnFaultClick, this, ID_RIBBON_FAULT);
294 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSCPowerClick, this, ID_RIBBON_SCPOWER);
295 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnHarmDistortionsClick, this, ID_RIBBON_HARMDIST);
296 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnFreqResponseClick, this, ID_RIBBON_FREQRESP);
297 m_ribbonButtonBarSimulations->Bind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSimulationSettingsClick, this, ID_RIBBON_SIMULSETTINGS);
298 m_auiNotebook->Bind(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, &MainFrameBase::NotebookPageClosing, this);
299 m_auiNotebook->Bind(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, &MainFrameBase::NotebookPageClosed, this);
300 m_auiNotebook->Bind(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, &MainFrameBase::OnNotebookPageChanged, this);
301
302}
303
304MainFrameBase::~MainFrameBase()
305{
306 this->Unbind(wxEVT_CLOSE_WINDOW, &MainFrameBase::OnClose, this);
307 m_ribbonButtonBarProjects->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnNewClick, this, ID_RIBBON_NEW);
308 m_ribbonButtonBarProjects->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnOpenClick, this, ID_RIBBON_OPEN);
309 m_ribbonButtonBarProjects->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnImportClick, this, ID_RIBBON_IMPORT);
310 m_ribbonButtonBarProjects->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnGeneralSettingsClick, this, ID_RIBBON_GENSETTINGS);
311 m_ribbonButtonBarProjects->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnExitClick, this, ID_RIBBON_EXIT);
312 m_ribbonButtonBarCProject->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSaveClick, this, ID_RIBBON_SAVE);
313 m_ribbonButtonBarCProject->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSaveAsClick, this, ID_RIBBON_SAVEAS);
314 m_ribbonButtonBarCProject->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnCloseClick, this, ID_RIBBON_CLOSE);
315 m_ribbonButtonBarHelp->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnPSPGuideClick, this, ID_RIBBON_GUIDE);
316 m_ribbonButtonBarHelp->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnAboutClick, this, ID_RIBBON_ABOUT);
317 m_ribbonButtonBarClipboard->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnCopyClick, this, ID_RIBBON_COPY);
318 m_ribbonButtonBarClipboard->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnPasteClick, this, ID_RIBBON_PASTE);
319 m_ribbonButtonBarClipboard->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnUndoClick, this, ID_RIBBON_UNDO);
320 m_ribbonButtonBarClipboard->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRedoClick, this, ID_RIBBON_REDO);
321 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, &MainFrameBase::OnAddElementDropdown, this, ID_RIBBON_ADDELEMENT);
322 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDragClick, this, ID_RIBBON_DRAG);
323 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnMoveClick, this, ID_RIBBON_MOVE);
324 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDeleteClick, this, ID_RIBBON_DELETE);
325 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnFitClick, this, ID_RIBBON_FIT);
326 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRotClockClick, this, ID_RIBBON_ROTATEC);
327 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRotCounterClockClick, this, ID_RIBBON_ROTATECC);
328 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnLabelMngrClick, this, ID_RIBBON_LABELMNGR);
329 m_ribbonButtonBarCircuit->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnProjectSettingsClick, this, ID_RIBBON_PROJSETTINGS);
330 m_ribbonButtonBarReports->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDataReportClick, this, ID_RIBBON_DATAREPORT);
331 m_ribbonButtonBarReports->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnChartsClick, this, ID_RIBBON_CHARTS);
332 m_ribbonButtonBarReports->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnHeatmapClick, this, ID_RIBBON_HEATMAP);
333 m_ribbonButtonBarReports->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSnapshotClick, this, ID_RIBBON_SNAPSHOT);
334 m_ribbonButtonBarReports->Unbind(wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, &MainFrameBase::OnSnapshotDropdown, this, ID_RIBBON_SNAPSHOT);
335 m_ribbonButtonBarContinuous->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnEnableSolutionClick, this, ID_RIBBON_ENABLESOL);
336 m_ribbonButtonBarContinuous->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnDisableSolutionClick, this, ID_RIBBON_DISABLESOL);
337 m_ribbonButtonBarContinuous->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnResetVoltagesClick, this, ID_RIBBON_RESETVOLT);
338 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnPowerFlowClick, this, ID_RIBBON_POWERFLOW);
339 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnRunStabilityClick, this, ID_RIBBON_RUNSTAB);
340 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, &MainFrameBase::OnStabilityDropdown, this, ID_RIBBON_RUNSTAB);
341 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnFaultClick, this, ID_RIBBON_FAULT);
342 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSCPowerClick, this, ID_RIBBON_SCPOWER);
343 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnHarmDistortionsClick, this, ID_RIBBON_HARMDIST);
344 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnFreqResponseClick, this, ID_RIBBON_FREQRESP);
345 m_ribbonButtonBarSimulations->Unbind(wxEVT_COMMAND_RIBBONBUTTON_CLICKED, &MainFrameBase::OnSimulationSettingsClick, this, ID_RIBBON_SIMULSETTINGS);
346 m_auiNotebook->Unbind(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, &MainFrameBase::NotebookPageClosing, this);
347 m_auiNotebook->Unbind(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, &MainFrameBase::NotebookPageClosed, this);
348 m_auiNotebook->Unbind(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, &MainFrameBase::OnNotebookPageChanged, this);
349
350}