| 84 | |
| 85 | |
| 86 | void MainFrame::OnClose(wxCloseEvent &event) { |
| 87 | |
| 88 | // If the window is minimized. Do not save as last position |
| 89 | |
| 90 | if (!IsIconized()) { |
| 91 | bool maximized = IsMaximized(); |
| 92 | wxPoint end_pos = GetPosition(); |
| 93 | wxSize end_size = GetSize(); |
| 94 | auto* app_config = wxConfig::Get(); |
| 95 | |
| 96 | if (maximized) { |
| 97 | app_config->Write("/MainWin/Max",maximized); |
| 98 | } else { |
| 99 | app_config->Write("/MainWin/X", end_pos.x); |
| 100 | app_config->Write("/MainWin/Y", end_pos.y); |
| 101 | app_config->Write("/MainWin/XWidth", end_size.x); |
| 102 | app_config->Write("/MainWin/YWidth", end_size.y); |
| 103 | app_config->Write("/MainWin/Max", maximized); |
| 104 | } |
| 105 | } |
| 106 | event.Skip(true); |
| 107 | } |
| 108 | |
| 109 | void MainFrame::OnAbout(wxCommandEvent&) { |
| 110 | wxAboutDialogInfo info; |