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


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

本文整理汇总了C++中wxCloseEvent::Veto方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCloseEvent::Veto方法的具体用法?C++ wxCloseEvent::Veto怎么用?C++ wxCloseEvent::Veto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxCloseEvent的用法示例。


在下文中一共展示了wxCloseEvent::Veto方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnCloseWindow

void wxDocMDIChildFrame::OnCloseWindow(wxCloseEvent& event)
{
    // Close view but don't delete the frame while doing so!
    // ...since it will be deleted by wxWidgets if we return true.
    if (m_childView)
    {
        bool ans = event.CanVeto()
                   ? m_childView->Close(false) // false means don't delete associated window
                   : true; // Must delete.

        if (ans)
        {
            m_childView->Activate(false);
            delete m_childView;
            m_childView = (wxView *) NULL;
            m_childDocument = (wxDocument *) NULL;

            this->Destroy();
        }
        else
            event.Veto();
    }
    else
        event.Veto();
}
开发者ID:Blackbird88,项目名称:pcsx2,代码行数:25,代码来源:docmdi.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: OnQueryEndSession

// Default behaviour: close the application with prompts. The
// user can veto the close, and therefore the end session.
void wxApp::OnQueryEndSession(wxCloseEvent& event)
{
    if ( !wxDialog::OSXHasModalDialogsOpen() )
    {
        if (GetTopWindow())
        {
            if (!GetTopWindow()->Close(!event.CanVeto()))
                event.Veto(true);
        }
    }
    else
    {
        event.Veto(true);
    }
}
开发者ID:zhchbin,项目名称:wxWidgets,代码行数:17,代码来源:app.cpp

示例4: OnClose

/*****************************************************
**
**   ChildWindow   ---   OnClose
**
******************************************************/
void ChildWindow::OnClose( wxCloseEvent &event )
{
	wxLogMessage( wxT( "ChildWindow::OnClose classname %s" ), GetClassInfo()->GetClassName());

	if ( ismainwindow )
	{
		if ( ! doc->queryClose())
		{
			event.Veto();
			return;
		}
		doc->closeDependentChildWindows();
	}
	wxCommandEvent e( CHILD_CLOSED, GetId() );
	e.SetEventObject( this );

	// Issue 3.0
	//GetParent()->ProcessWindowEvent( e );
	//GetParent()->ProcessEvent( e );
	wxPostEvent( GetParent(), e );

	if ( doc ) doc->releaseChildWindow( this );
	Destroy();
	isvalid = false;
}
开发者ID:akshaykinhikar,项目名称:maitreya7,代码行数:30,代码来源:ChildWindow.cpp

示例5: 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

示例6: OnClose

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

示例7: OnClose

void WxDockingContainer::OnClose( wxCloseEvent& In )
{
	// Don't actually close these windows.  Just hide them so they can be recalled later.
	Hide();

	In.Veto();
}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:7,代码来源:Docking.cpp

示例8: OnCloseWindow

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:
            // save the board. if the board has no name,
            // the ID_SAVE_BOARD_AS will actually made
            Files_io_from_id( ID_SAVE_BOARD );
            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();
}
开发者ID:khaterahmohammadi,项目名称:kicad-source-mirror,代码行数:60,代码来源:pcbframe.cpp

示例9: OnCloseWindow

void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
    if( GetScreen()->IsModify() && GetBoard()->m_Modules )
    {
        if( !HandleUnsavedChanges( this, _( "Save changes to footprint before closing?" ),
                                   [&]()->bool { return SaveFootprint( GetBoard()->m_Modules ); } ) )
        {
            Event.Veto();
            return;
        }
    }

    GetGalCanvas()->SetEventDispatcher( NULL );
    GetGalCanvas()->StopDrawing();

    // Do not show the layer manager during closing to avoid flicker
    // on some platforms (Windows) that generate useless redraw of items in
    // the Layer Manger
    m_auimgr.GetPane( "LayersManager" ).Show( false );

    Clear_Pcb( false );

    //close the editor
    Destroy();
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:25,代码来源:footprint_edit_frame.cpp

示例10: OnWindowClose

void ExploreFrame::OnWindowClose( wxCloseEvent& event )
{
	if (m_archive && m_archive->IsModified())
	{
		wxMessageDialog msgDlg(this, _("Do you wan't to save unsaved changes?"), _("Warning"), wxICON_WARNING | wxYES_NO | wxCANCEL);
		msgDlg.SetYesNoLabels(_("Save"), _("Don't Save"));

		switch (msgDlg.ShowModal())
		{
			case wxID_YES:
			{
				wxCommandEvent evt(wxID_SAVE);
				OnSaveClicked(evt);
				event.Skip();
				break;
			}
			case wxID_NO:
				event.Skip();
				break;
			default:
				event.Veto();
				break;
		}
	} else
		event.Skip();
}
开发者ID:UnforeseenOcean,项目名称:HLMWadExplorer,代码行数:26,代码来源:ExploreFrame.cpp

示例11: OnCloseWindow

void wxPropertyFormFrame::OnCloseWindow(wxCloseEvent& event)
{
    if (m_view && m_view->OnClose())
        this->Destroy();
    else
        event.Veto();
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:7,代码来源:propform.cpp

示例12: 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

示例13: 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

示例14: OnCloseMsgWindow

void FOOTPRINT_WIZARD_MESSAGES::OnCloseMsgWindow( wxCloseEvent& aEvent )
{
    if( !m_canClose )
        aEvent.Veto();
    else
        aEvent.Skip();
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:7,代码来源:footprint_wizard_frame.cpp

示例15: 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


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