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(); }
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(); }
void WinEDA_PcbFrame::RedrawActiveWindow(wxDC * DC, bool EraseBg) /****************************************************************/ /* Trace le PCB, et les elements complementaires ( axes, grille .. ) pour l'ecran actif et ses sous ecran */ { PCB_SCREEN * Screen = GetScreen(); if ( ! m_Pcb || ! Screen ) return; ActiveScreen = GetScreen(); GRSetDrawMode(DC, GR_COPY); if ( EraseBg ) DrawPanel->EraseScreen(DC); DrawPanel->DrawBackGround(DC); Trace_Pcb(DC, GR_OR); TraceWorkSheet(DC, GetScreen()); Affiche_Status_Box(); /* Reaffichage des curseurs */ for( Screen = GetScreen(); Screen != NULL; Screen = Screen->Next() ) { if( m_CurrentScreen->ManageCurseur ) m_CurrentScreen->ManageCurseur(DrawPanel, DC, FALSE); Screen->Trace_Curseur(DrawPanel, DC); } }