MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / OnClose

Method OnClose

lib/mdflib/mdfviewer/src/mainframe.cpp:86–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86void 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
109void MainFrame::OnAbout(wxCommandEvent&) {
110 wxAboutDialogInfo info;

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected