+void wxTopLevelWindow::OnSystemMenu(wxCommandEvent& event)
+{
+ bool ret = TRUE;
+
+ switch (event.GetId())
+ {
+ case wxID_CLOSE_FRAME:
+ ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK,
+ wxTOPLEVEL_BUTTON_CLOSE);
+ break;
+ case wxID_MOVE_FRAME:
+ InteractiveMove(wxINTERACTIVE_MOVE | wxINTERACTIVE_WAIT_FOR_INPUT);
+ break;
+ case wxID_RESIZE_FRAME:
+ InteractiveMove(wxINTERACTIVE_RESIZE | wxINTERACTIVE_WAIT_FOR_INPUT);
+ break;
+ case wxID_MAXIMIZE_FRAME:
+ ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK,
+ wxTOPLEVEL_BUTTON_MAXIMIZE);
+ break;
+ case wxID_ICONIZE_FRAME:
+ ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK,
+ wxTOPLEVEL_BUTTON_ICONIZE);
+ break;
+ case wxID_RESTORE_FRAME:
+ ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK,
+ wxTOPLEVEL_BUTTON_RESTORE);
+ break;
+
+ default:
+ ret = FALSE;
+ }
+
+ if ( !ret )
+ event.Skip();
+}
+