void wxAuiFloatingFrame::OnClose(wxCloseEvent& evt) { m_owner_mgr->OnFloatingPaneClosed(m_pane_window, evt); if (!evt.GetVeto()) { m_mgr.DetachPane(m_pane_window); Destroy(); } }
void CslApp::OnEndSession(wxCloseEvent& event) { LOG_DEBUG("\n"); m_shutdown=CSL_SHUTDOWN_FORCE; event.Skip(); }
void CDExtraClientFrame::onClose(wxCloseEvent& event) { if (!event.CanVeto()) { Destroy(); return; } int reply = ::wxMessageBox(_("Do you want to exit DExtra Client"), _("Exit DExtra Client"), wxOK | wxCANCEL | wxICON_QUESTION); switch (reply) { case wxOK: Destroy(); break; case wxCANCEL: event.Veto(); break; } }
void AppIQFeedMarketSymbols::OnClose( wxCloseEvent& event ) { // Exit Steps: #2 -> FrameMain::OnClose DelinkFromPanelProviderControl(); // if ( 0 != OnPanelClosing ) OnPanelClosing(); // event.Veto(); // possible call, if needed // event.CanVeto(); // if not a event.Skip(); // auto followed by Destroy(); }
void wxGenericAboutDialog::OnCloseWindow(wxCloseEvent& event) { // safeguards in case the window is still shown using ShowModal if ( !IsModal() ) Destroy(); event.Skip(); }
void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) { m_canvas->SetAbortRequest( true ); if( GetScreen()->IsModify() ) { wxString msg = wxString::Format( _( "Save the changes in\n" "'%s'\n" "before closing?" ), GetChars( GetBoard()->GetFileName() ) ); int ii = DisplayExitDialog( this, msg ); switch( ii ) { case wxID_CANCEL: Event.Veto(); return; case wxID_NO: break; case wxID_YES: SavePcbFile( GetBoard()->GetFileName() ); break; } } GetGalCanvas()->StopDrawing(); // Delete the auto save file if it exists. wxFileName fn = GetBoard()->GetFileName(); // Auto save file name is the normal file name prefixed with a '$'. fn.SetName( wxT( "$" ) + fn.GetName() ); // Remove the auto save file on a normal close of Pcbnew. if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) ) { wxString msg = wxString::Format( _( "The auto save file '%s' could not be removed!" ), GetChars( fn.GetFullPath() ) ); wxMessageBox( msg, Pgm().App().GetAppName(), wxOK | wxICON_ERROR, this ); } // Delete board structs and undo/redo lists, to avoid crash on exit // when deleting some structs (mainly in undo/redo lists) too late Clear_Pcb( false ); // do not show the window because ScreenPcb will be deleted and we do not // want any paint event Show( false ); Destroy(); }
void LIB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) { if( GetScreen()->IsModify() ) { int ii = DisplayExitDialog( this, _( "Save the changes in the library before closing?" ) ); switch( ii ) { case wxID_NO: break; case wxID_YES: if ( this->SaveActiveLibrary( false ) ) break; // fall through: cancel the close because of an error case wxID_CANCEL: Event.Veto(); return; } GetScreen()->ClrModify(); } PART_LIBS* libs = Prj().SchLibs(); BOOST_FOREACH( const PART_LIB& lib, *libs ) { if( lib.IsModified() ) { wxString msg = wxString::Format( _( "Library '%s' was modified!\nDiscard changes?" ), GetChars( lib.GetName() ) ); if( !IsOK( this, msg ) ) { Event.Veto(); return; } } } Destroy(); }
void MyFrame::OnClose(wxCloseEvent& event) { unsigned numChildren = MyChild::GetChildrenCount(); if ( event.CanVeto() && (numChildren > 0) ) { wxString msg; msg.Printf("%d windows still open, close anyhow?", numChildren); if ( wxMessageBox(msg, "Please confirm", wxICON_QUESTION | wxYES_NO) != wxYES ) { event.Veto(); return; } } event.Skip(); }
// // Intercept close command // void vtFrame::OnClose(wxCloseEvent &event) { if (m_canvas) { m_canvas->m_bRunning = false; m_bCloseOnIdle = true; } event.Skip(); }
void wxHtmlHelpController::OnCloseFrame(wxCloseEvent& evt) { evt.Skip(); OnQuit(); m_helpFrame->SetController((wxHelpControllerBase*) NULL); m_helpFrame = NULL; }
void AppFrame::OnClose(wxCloseEvent& event) { wxGetApp().getConfig()->setWindow(this->GetPosition(), this->GetClientSize()); wxGetApp().getConfig()->setWindowMaximized(this->IsMaximized()); wxGetApp().getConfig()->setTheme(ThemeMgr::mgr.getTheme()); wxGetApp().getConfig()->setSnap(wxGetApp().getFrequencySnap()); wxGetApp().getConfig()->setCenterFreq(wxGetApp().getFrequency()); wxGetApp().getConfig()->save(); event.Skip(); }
///////////////////////////////////////// // stock and standard OnCloseWindow callback ///////////////////////////////////////// void WXGL_IO_Frame::OnCloseWindow(wxCloseEvent& myEvent) { if (mp_Canvas->OnCloseCanvas() ) { this->Destroy(); } else myEvent.Veto(); }
/***************************************************** ** ** SimpleChildWindow --- OnClose ** ******************************************************/ void SimpleChildWindow::OnClose( wxCloseEvent &event ) { assert( view ); if ( ! view->queryClose() ) { event.Veto(); } else ChildWindow::OnClose( event ); }
void NyqBench::OnClose(wxCloseEvent & e) { if (!Validate()) { e.Veto(); } else { Show(false); } }
void FortyFrame::OnCloseWindow(wxCloseEvent& event) { if (m_canvas->OnCloseCanvas() ) { this->Destroy(); } else event.Veto(); }
void MyFrame::OnClose(wxCloseEvent& event) { if (m_server) { delete m_server; m_server = NULL; } event.Skip(); }
void MyFrame::OnClose(wxCloseEvent& event) { if (m_client) { delete m_client; m_client = NULL; } event.Skip(); }
void wxGD::MainFrame::OnClose( wxCloseEvent &event ) { if( !SaveWarning() ) return; SaveLayout(); event.Skip(); }
void wxHtmlHelpControllerEx::OnCloseFrame(wxCloseEvent& evt) { evt.Skip(); OnQuit(); m_helpWindow->SetController(NULL); m_helpWindow = NULL; }
void MyFrame::OnClose(wxCloseEvent& event) { // Close the help frame; this will cause the config data to // get written. if ( help.GetFrame() ) // returns NULL if no help frame active help.GetFrame()->Close(true); // now we can safely delete the config pointer event.Skip(); delete wxConfig::Set(NULL); }
void DecisionLogicFrame::OnClose(wxCloseEvent& event) { if (m_worker) { SaveAndQuit(); delete m_worker; m_worker = NULL; } event.Skip(); }
void gcTaskBarIcon::onEventClose(wxCloseEvent& event) { wxGuiDelegateImplementation<wxFrame>* frame = dynamic_cast<wxGuiDelegateImplementation<wxFrame>*>(m_pEvents); if (frame) frame->cleanUpEvents(); m_pEvents = NULL; event.Skip(); }
/***** Respond to attempt to close a window. *****/ void tmwxDesignFrame::OnClose(wxCloseEvent& event) { // Clear the palettes gApp->SetPalettes(); // Continue processing the event event.Skip(); // Let document manager have a chance at quitting the app if this is the // last document. gDocManager->CheckLastDoc(); }
//------------------------------------------------------------------------------ // void OnClose(wxCloseEvent &event) //------------------------------------------------------------------------------ void GmatDialog::OnClose(wxCloseEvent &event) { #ifdef DEBUG_GMAT_DIALOG_CLOSE MessageInterface::ShowMessage ("GmatDialog::OnClose() mDataChanged=%d\n", mDataChanged); #endif if (mDataChanged) { if ( wxMessageBox(_T("Changes will be lost. \nDo you really want to close?"), _T("Please confirm"), wxICON_QUESTION | wxYES_NO) != wxYES ) { event.Veto(); return; } } event.Skip(); }
void MainWindow::OnClose( wxCloseEvent& event ) { wxConfigBase *config = wxConfigBase::Get(); if (config) { config->Write( _("/MainWindow/LastLoadDir"), m_lastLoadDir ); config->Write( _("/MainWindow/LastSaveDir"), m_lastSaveDir ); } event.Skip(); }
void ConsoleLogFrame::OnCloseWindow(wxCloseEvent& event) { if( event.CanVeto() ) { // instead of closing just hide the window to be able to Show() it later Show( false ); // In the nogui case there might not be a Main frame window. if (MainEmuFrame* mainframe = GetMainFramePtr()) mainframe->OnLogBoxHidden(); } else { // This is sent when the app is exiting typically, so do a full close. m_threadlogger = NULL; wxGetApp().OnProgramLogClosed( GetId() ); event.Skip(); } }
void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event ) { DIALOG_SHIM* dlg = NULL; wxWindowList list = GetChildren(); // Quasi modal dialogs create issues (crashes) when closing Kicad. // I am guessing they are delete too late, when deleting main frames. // AFAIK, only these DIALOG_SHIM dialogs create such issues. // The policy is do not allow closing Kicad if a Quasi modal dialog is open. // (Anyway, closing without prompting the user is certainly bad, // because an edit is in preogress) // Therefore, iterate through the child list to find at least // a DIALOG_SHIM opened in quasi modal mode for( wxWindowList::iterator iter = list.begin(); iter != list.end(); ++iter ) { if( (dlg = dynamic_cast<DIALOG_SHIM*> (*iter) ) != NULL ) { if( dlg->IsQuasiModal() ) break; else dlg = NULL; } } if( dlg ) { // Happens when a quasi modal dialog is currently open. // For example: if the Kicad manager try to close Kicad. wxMessageBox( _( "The program cannot be closed\n" "A quasi-modal dialog window is currently open, please close it first." ) ); event.Veto(); return; } wxConfigBase* cfg = config(); if( cfg ) SaveSettings( cfg ); // virtual, wxFrame specific event.Skip(); // we did not "handle" the event, only eavesdropped on it. }
void frmMain::OnCloseWindow( wxCloseEvent& event ) { // Save frame size and position wxRect rc = GetRect(); g_Config.m_xpos = rc.x; g_Config.m_ypos = rc.y; //g_Config.m_sizeWidth = rc.width; //g_Config.m_sizeHeight = rc.height; event.Skip(); }
void CDummyRepeaterFrame::onClose(wxCloseEvent& event) { if (!event.CanVeto()) { saveCalls(); Destroy(); return; } int reply = ::wxMessageBox(_("Do you want to exit Dummy Repeater"), _("Exit Dummy Repeater"), wxOK | wxCANCEL | wxICON_QUESTION); switch (reply) { case wxOK: saveCalls(); savePosition(); Destroy(); break; case wxCANCEL: event.Veto(); break; } }
void MainFrame::OnClose(wxCloseEvent& event) { std::cout << "Got MainFrame::OnClose" << std::endl; if ( event.CanVeto() ) { if ( wxMessageBox("Are you sure you want to Quit?", "Quit", wxICON_QUESTION | wxYES_NO) != wxYES ) { event.Veto(); return; } } // destroy the window. Note: we could also do event.Skip() since the default // event handler does call Destroy(), too //this->Destroy(); event.Skip(); }