void PL_EDITOR_FRAME::OnFileHistory( wxCommandEvent& event ) { wxString filename; filename = GetFileFromHistory( event.GetId(), _( "Page Layout Description File" ) ); if( filename != wxEmptyString ) { if( GetScreen()->IsModify() && !IsOK( this, _( "The current page layout has been modified.\n" "Do you wish to discard the changes?" ) ) ) return; m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() ); ::wxSetWorkingDirectory( ::wxPathOnly( filename ) ); if( LoadPageLayoutDescrFile( filename ) ) { wxString msg; msg.Printf( _("File <%s> loaded"), GetChars( filename ) ); SetStatusText( msg ); } OnNewPageLayout(); } }
void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event ) { wxString fn = GetFileFromHistory( event.GetId(), _( "Schematic" ) ); if( fn.size() ) OpenProjectFiles( std::vector<wxString>( 1, fn ) ); }
void KICAD_MANAGER_FRAME::OnFileHistory( wxCommandEvent& event ) { wxFileName projFileName = GetFileFromHistory( event.GetId(), _( "KiCad project file" ), &PgmTop().GetFileHistory() ); if( !projFileName.FileExists() ) return; LoadProject( projFileName ); }
void GERBVIEW_FRAME::OnJobFileHistory( wxCommandEvent& event ) { wxString filename; filename = GetFileFromHistory( event.GetId(), _( "Job files" ), &m_jobFileHistory ); if( !filename.IsEmpty() ) { LoadGerberJobFile( filename ); } }
void GERBVIEW_FRAME::OnZipFileHistory( wxCommandEvent& event ) { wxString filename; filename = GetFileFromHistory( event.GetId(), _( "Zip files" ), &m_zipFileHistory ); if( !filename.IsEmpty() ) { Erase_Current_DrawLayer( false ); LoadZipArchiveFile( filename ); } }
void GERBVIEW_FRAME::OnDrlFileHistory( wxCommandEvent& event ) { wxString fn; fn = GetFileFromHistory( event.GetId(), _( "Drill files" ), &m_drillFileHistory ); if( !fn.IsEmpty() ) { Erase_Current_DrawLayer( false ); LoadExcellonFiles( fn ); } }
void GERBVIEW_FRAME::OnGbrFileHistory( wxCommandEvent& event ) { wxString fn; fn = GetFileFromHistory( event.GetId(), _( "Gerber files" ) ); if( !fn.IsEmpty() ) { Erase_Current_DrawLayer( false ); LoadGerberFiles( fn ); } }
void KICAD_MANAGER_FRAME::OnFileHistory( wxCommandEvent& event ) { wxString fn; fn = GetFileFromHistory( event.GetId(), _( "KiCad project file" ) ); if( fn != wxEmptyString ) { wxCommandEvent cmd( 0, wxID_ANY ); m_ProjectFileName = fn; OnLoadProject( cmd ); } }
void PCB_EDIT_FRAME::OnFileHistory( wxCommandEvent& event ) { wxString fn = GetFileFromHistory( event.GetId(), _( "Printed circuit board" ) ); if( !!fn ) { int open_ctl = 0; m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() ); if( !wxFileName::IsFileReadable( fn ) ) { if( !AskLoadBoardFileName( this, &open_ctl, &fn, true ) ) return; } OpenProjectFiles( std::vector<wxString>( 1, fn ), open_ctl ); } }
void KICAD_MANAGER_FRAME::OnFileHistory( wxCommandEvent& event ) { wxString fn = GetFileFromHistory( event.GetId(), _( "KiCad project file" ), &Pgm().GetFileHistory() ); if( fn.size() ) { // Any open KIFACE's must be closed before changing the project. // We never want a KIWAY_PLAYER open on a KIWAY that isn't in the same project, // and then break one project. // Remember when saving files, the full path is build from the current project path // User is prompted here to close those KIWAY_PLAYERs: if( !Kiway.PlayersClose( false ) ) return; // We can now set the new project filename and load this project SetProjectFileName( fn ); wxCommandEvent cmd( 0, wxID_ANY ); OnLoadProject( cmd ); } }