void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
{
    SEARCH_STACK&    lib_search = Prj().SchSearchS();

    // Recreate the user lib path
    if( m_LibPathChanged )
    {
        for( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii++ )
            lib_search.RemovePaths( m_listUserPaths->GetString(ii) );

        lib_search.AddPaths( m_Parent->GetUserLibraryPath(), 1 );
    }

    EndModal( wxID_CANCEL );
}
void DIALOG_EESCHEMA_CONFIG::Init()
{
    wxString msg;

    SetFocus();

    m_LibListChanged = false;
    m_LibPathChanged = false;
    m_UserLibDirBufferImg = m_Parent->GetUserLibraryPath();

    m_ListLibr->InsertItems( m_Parent->GetComponentLibraries(), 0 );

    // Load user libs paths:
    wxStringTokenizer tokenizer( m_UserLibDirBufferImg, wxT( ";\n\r" ) );

    while( tokenizer.HasMoreTokens() )
    {
        wxString path = tokenizer.GetNextToken();

        if( wxFileName::DirExists( path ) )
            m_listUserPaths->Append( path );
    }

    // Display actual libraries paths:
    SEARCH_STACK& libpaths = Prj().SchSearchS();

    for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ )
    {
        m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
    }

    // select the first path after the current path project
    if ( libpaths.GetCount() > 1 )
        m_DefaultLibraryPathslistBox->Select( 1 );

    m_sdbSizer1OK->SetDefault();
}