当前位置: 首页>>代码示例>>C++>>正文


C++ wxCloseEvent::CanVeto方法代码示例

本文整理汇总了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();
}
开发者ID:search5,项目名称:pgadmin3,代码行数:25,代码来源:events.cpp

示例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();
	}
}
开发者ID:genua,项目名称:anoubis,代码行数:27,代码来源:MainFrame.cpp

示例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();
    }
}
开发者ID:WarfareCode,项目名称:gcblue,代码行数:33,代码来源:mainframe.cpp

示例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();
	}
}
开发者ID:Dangr8,项目名称:Cities3D,代码行数:26,代码来源:SettlersFrame.cpp

示例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);
}
开发者ID:dkfans,项目名称:keeperfx,代码行数:29,代码来源:GameSettings.cpp

示例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();
}
开发者ID:aseptilena,项目名称:pcsx2,代码行数:39,代码来源:MainFrame.cpp

示例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;
        }
    }
}
开发者ID:icompuiz,项目名称:grav,代码行数:27,代码来源:Frame.cpp

示例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();
	}
}
开发者ID:Amadiro,项目名称:xara-cairo,代码行数:27,代码来源:camframe.cpp

示例9: OnClose

void wxPlaylist::OnClose(wxCloseEvent &event)
{
	if (event.CanVeto()) {
		event.Veto();
		Hide();
	}
}
开发者ID:ARSekkat,项目名称:gpac,代码行数:7,代码来源:Playlist.cpp

示例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()
开发者ID:LibreGames,项目名称:bear,代码行数:37,代码来源:main_frame.cpp

示例11: OnClose

void SummaryWindow::OnClose(wxCloseEvent &event) {
	if (event.CanVeto()) {
		event.Veto();
		draw_panel->ShowSummaryWindow(false);
	} else
		Destroy();
}
开发者ID:cyclefusion,项目名称:szarp,代码行数:7,代码来源:summwin.cpp

示例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();
	}
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:30,代码来源:saga_frame.cpp

示例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();
}
开发者ID:LaloHao,项目名称:rme,代码行数:25,代码来源:application.cpp

示例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();
}
开发者ID:EdgarTx,项目名称:wx,代码行数:33,代码来源:svgtest.cpp

示例15: OnClose

void dlgFindReplace::OnClose(wxCloseEvent &ev)
{
	SaveSettings();
	this->Hide();
	if (ev.CanVeto())
		ev.Veto();
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:7,代码来源:dlgFindReplace.cpp


注:本文中的wxCloseEvent::CanVeto方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。