本文整理汇总了C++中wxCloseEvent::CanVeto方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCloseEvent::CanVeto方法的具体用法?C++ wxCloseEvent::CanVeto怎么用?C++ wxCloseEvent::CanVeto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxCloseEvent
的用法示例。
在下文中一共展示了wxCloseEvent::CanVeto方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClose
void frmMain::OnClose(wxCloseEvent &event)
{
wxWindow *fr;
windowList::Node *node;
while ((node = frames.GetFirst()) != NULL)
{
fr = node->GetData();
// if crashes occur here when closing the app,
// some actionFactory::StartDialog returned a wxWindow* (which is registered in frames)
// without code to handle OnClose (esp. removing itself with RemoveFrame)
if (!fr->Close(!event.CanVeto()))
{
if (event.CanVeto())
{
event.Veto();
return;
}
}
delete node;
fr->Destroy();
}
Destroy();
}
示例2: anMessageBox
void
MainFrame::OnClose(wxCloseEvent &event)
{
if (exit_) {
/* Really close the window */
uint8_t answer = anMessageBox(
_("Do you really want to close xanoubis?"), _("Confirm"),
wxYES_NO, this);
if (answer == wxYES) {
event.Skip();
} else {
if (event.CanVeto())
event.Veto();
else
Destroy();
}
} else {
/* Hide the window */
if (event.CanVeto())
event.Veto();
else
Destroy();
this->Hide();
}
}
示例3: OnClose
void MyFrame::OnClose(wxCloseEvent& event)
{
tcDatabaseManager* databaseManager = tcDatabaseManager::Get();
if (databaseManager->AreChangesPending())
{
wxMessageDialog dialog(this, "Save changes before closing?", "Save?", wxYES | wxNO | wxCANCEL, wxDefaultPosition);
int response = dialog.ShowModal();
if (response == wxID_YES)
{
databaseManager->Commit(false);
wxWindow::Destroy();
}
else if (response == wxID_CANCEL)
{
if (event.CanVeto())
{
event.Veto();
}
else
{
Shutdown();
}
}
else
{
Shutdown();
}
}
else
{
Shutdown();
}
}
示例4: OnClose
void wxSettlersFrame::OnClose(wxCloseEvent& event)
{
bool destroy = true;
// If we're allowed to veto the event, we need to run our quit handler.
if( (true == event.CanVeto()) &&
(false == GUI.CanQuit(this)))
{
// They had a change of heart.
destroy = false;
event.Veto();
}
if(true == destroy)
{
// We only need to do this cleanup if this is happening from the main
// window, not the context menu.
if(false == sInExit)
{
Controller::get().Transmit(shEventClose, 0);
}
// Shut down.
Destroy();
}
}
示例5: OnClose
void GameSettings::OnClose(wxCloseEvent& event)
{
int msgRet;
msgRet = wxMessageBox(_T("You've made changes to the configuration options. Do you want to store these changes?\n")
_T("If you answer Yes, the previous configuration file will be replaced with the new settings you've selected."),
_T("Save KeeperFX configuration"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_QUESTION, this);
switch (msgRet)
{
case wxYES: // Save, then quit dialog
writeConfiguration();
wxLogMessage(wxT("Configuration saved."));
break;
case wxNO: // Don't save; just quit dialog
wxLogMessage(wxT("Changed discarded."));
break;
case wxCANCEL: // Do nothing - so don't quit dialog
default:
if (event.CanVeto()) {
event.Veto(); // Notify the calling code that we didn't agreed to quit
return;
}
break;
}
GetParent()->Enable(true);
event.Skip();
EndModal(1);
}
示例6: OnCloseWindow
// Close out the console log windows along with the main emu window.
// Note: This event only happens after a close event has occurred and was *not* veto'd. Ie,
// it means it's time to provide an unconditional closure of said window.
//
void MainEmuFrame::OnCloseWindow(wxCloseEvent& evt)
{
if( IsBeingDeleted() ) return;
CoreThread.Suspend();
bool isClosing = false;
if( !evt.CanVeto() )
{
// Mandatory destruction...
isClosing = true;
}
else
{
// TODO : Add confirmation prior to exit here!
// Problem: Suspend is often slow because it needs to wait until the current EE frame
// has finished processing (if the GS or logging has incurred severe overhead this makes
// closing PCSX2 difficult). A non-blocking suspend with modal dialog might suffice
// however. --air
//evt.Veto( true );
}
sApp.OnMainFrameClosed( GetId() );
if( m_menubar.FindItem(MenuId_IsoSelector) )
m_menuCDVD.Remove(MenuId_IsoSelector);
RemoveEventHandler( &wxGetApp().GetRecentIsoManager() );
wxGetApp().PostIdleAppMethod( &Pcsx2App::PrepForExit );
evt.Skip();
}
示例7: OnCloseWindow
void Frame::OnCloseWindow( wxCloseEvent& evt )
{
// if the event can't be vetoed (ie, force close) then force close
if ( !evt.CanVeto() )
{
cleanupAndDestroy();
}
else
{
// otherwise show "really quit" dialog, close window if OK clicked
wxMessageDialog* exitDialog = new wxMessageDialog( this,
_("Really quit?"), _("grav"), wxOK | wxCANCEL );
int result = exitDialog->ShowModal();
exitDialog->Destroy();
switch( result )
{
case wxID_OK:
cleanupAndDestroy();
break;
case wxID_CANCEL:
default:
evt.Veto();
break;
}
}
}
示例8: OnCloseWindow
void CCamFrame::OnCloseWindow(wxCloseEvent& event)
{
Camelot.ShuttingDown(TRUE);
if (m_docManager->Clear(!event.CanVeto()))
{
PORTNOTE("other","Removed ExternalClipboard usage")
#if !defined(EXCLUDE_FROM_XARALX)
// Put any stuff the user wants to keep on the clipboard before we depart.
// We want this to happen before the window closes and progress displays are lost.
ExternalClipboard::PrepareForShutdown();
#endif
// We must DeInit the dialog manager before any windows are destroyed.
// This needs to be here because Popup windows (Dialogs/Floating bars)
// seem to be destroyed before the MainFrame receives an OnDestroy message
DialogManager::DeInit();
this->Destroy();
}
else
{
// We cancelled for some reason.
Camelot.ShuttingDown(FALSE);
event.Veto();
}
}
示例9: OnClose
void wxPlaylist::OnClose(wxCloseEvent &event)
{
if (event.CanVeto()) {
event.Veto();
Hide();
}
}
示例10: if
/**
* \brief Procedure called when closing the window.
* \param event This event occured.
*/
void bf::main_frame::on_close( wxCloseEvent& event )
{
save_config();
bool quit = !event.CanVeto();
if ( !quit )
{
quit = true;
m_animation_edit->validate();
if ( is_changed() )
{
wxMessageDialog dlg
( this,
_("The animation is not saved."
" Do you want to save it now?"),
_("Animation is not saved."), wxYES_NO | wxCANCEL );
int answer = dlg.ShowModal();
if ( answer == wxID_CANCEL )
quit = false;
else if ( answer == wxID_YES )
quit = save();
}
}
if ( quit )
event.Skip();
else
event.Veto();
} // main_frame::on_close()
示例11: OnClose
void SummaryWindow::OnClose(wxCloseEvent &event) {
if (event.CanVeto()) {
event.Veto();
draw_panel->ShowSummaryWindow(false);
} else
Destroy();
}
示例12: On_Close
//---------------------------------------------------------
void CSAGA_Frame::On_Close(wxCloseEvent &event)
{
if( event.CanVeto() )
{
if( !g_pModule && DLG_Message_Confirm(ID_DLG_CLOSE) && g_pData->Close(true) )
{
g_pModules->Finalise();
Destroy();
}
else
{
if( g_pModule )
{
DLG_Message_Show(_TL("Please stop tool execution before exiting SAGA."), _TL("Exit SAGA"));
}
event.Veto();
}
}
else
{
g_pModules->Finalise();
g_pData->Close(true);
event.Skip();
}
}
示例13: OnExit
void MainFrame::OnExit(wxCloseEvent& event)
{
while(gui.IsEditorOpen())
{
if(!DoQuerySave())
{
if(event.CanVeto())
{
event.Veto();
return;
}
else
{
break;
}
}
}
gui.aui_manager->UnInit();
((Application&)wxGetApp()).Unload();
#ifdef __RELEASE__
// Hack, "crash" gracefully in release builds, let OS handle cleanup of windows
exit(0);
#endif
Destroy();
}
示例14: OnClose
void MyFrame::OnClose(wxCloseEvent& event)
{
if ( !event.CanVeto() )
{
event.Skip();
return ;
}
if ( m_children.GetCount () < 1 )
{
event.Skip();
return ;
}
// now try the children
wxObjectList::compatibility_iterator pNode = m_children.GetFirst ();
wxObjectList::compatibility_iterator pNext ;
MyChild * pChild ;
while ( pNode )
{
pNext = pNode -> GetNext ();
pChild = (MyChild*) pNode -> GetData ();
if (pChild -> Close ())
{
m_children.Erase(pNode) ;
}
else
{
event.Veto();
return;
}
pNode = pNext ;
}
event.Skip();
}
示例15: OnClose
void dlgFindReplace::OnClose(wxCloseEvent &ev)
{
SaveSettings();
this->Hide();
if (ev.CanVeto())
ev.Veto();
}