void WinEDA_GerberFrame::OnCloseWindow(wxCloseEvent & Event)
/***********************************************************/
{
PCB_SCREEN * screen;

	screen = ScreenPcb ;
	while( screen )
		{
		if(screen->IsModify()) break;
		screen = screen->Next();
		}

	if ( screen )
		{
		if( ! IsOK(this, _("Layer modified,  Continue ?")) )
			{
			Event.Veto();
			return;
			}
		}

	while( screen )	// suppression flag modify pour eviter d'autres message
		{
		screen->ClrModify();
		screen = screen->Next();
		}

	/* Reselection de l'ecran de base,
		pour les evenements de refresh générés par wxWindows */
	m_CurrentScreen = ActiveScreen = ScreenPcb;

	SaveSettings();
	Destroy();
}
示例#2
0
void WinEDA_PcbFrame::OnCloseWindow(wxCloseEvent & Event)
/********************************************************/
{
PCB_SCREEN * screen;

	DrawPanel->m_AbortRequest = TRUE;

	screen = ScreenPcb ;
	while( screen )
	{
		if(screen->IsModify()) break;
		screen = screen->Next();
	}

	if ( screen )
	{
	unsigned ii;
		wxMessageDialog dialog(this, _("Board modified, Save before exit ?"),
			_("Confirmation"), wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT);
		ii = dialog.ShowModal();
		switch ( ii )
		{
			case wxID_CANCEL:
			Event.Veto();
			return;

			case wxID_NO:
				break;

			case wxID_OK:
			case wxID_YES:
				SavePcbFile(GetScreen()->m_FileName);
				break;
		}
	}

	while( screen )	// suppression flag modify pour eviter d'autres message
	{
		screen->ClrModify();
		screen = screen->Next();
	}

	/* Reselection de l'ecran de base,
		pour les evenements de refresh générés par wxWindows */
	m_CurrentScreen = ActiveScreen = ScreenPcb;

	SaveSettings();
	Destroy();
}