예제 #1
0
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();
    }
}
예제 #2
0
void SCH_EDIT_FRAME::OnLoadFile( wxCommandEvent& event )
{
    wxString fn = GetFileFromHistory( event.GetId(), _( "Schematic" ) );

    if( fn.size() )
        OpenProjectFiles( std::vector<wxString>( 1, fn ) );
}
예제 #3
0
void KICAD_MANAGER_FRAME::OnFileHistory( wxCommandEvent& event )
{
    wxFileName projFileName = GetFileFromHistory( event.GetId(), _( "KiCad project file" ),
                                                  &PgmTop().GetFileHistory() );
    if( !projFileName.FileExists() )
        return;

    LoadProject( projFileName );
}
예제 #4
0
파일: files.cpp 프로젝트: cpavlina/kicad
void GERBVIEW_FRAME::OnJobFileHistory( wxCommandEvent& event )
{
    wxString filename;
    filename = GetFileFromHistory( event.GetId(), _( "Job files" ), &m_jobFileHistory );

    if( !filename.IsEmpty() )
    {
        LoadGerberJobFile( filename );
    }
}
예제 #5
0
파일: files.cpp 프로젝트: cpavlina/kicad
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 );
    }
}
예제 #6
0
파일: files.cpp 프로젝트: cpavlina/kicad
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 );
    }
}
예제 #7
0
파일: files.cpp 프로젝트: cpavlina/kicad
void GERBVIEW_FRAME::OnGbrFileHistory( wxCommandEvent& event )
{
    wxString fn;

    fn = GetFileFromHistory( event.GetId(), _( "Gerber files" ) );

    if( !fn.IsEmpty() )
    {
        Erase_Current_DrawLayer( false );
        LoadGerberFiles( fn );
    }
}
예제 #8
0
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 );
    }
}
예제 #9
0
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 );
    }
}
예제 #10
0
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 );
    }
}