Commit 6431e9c9 authored by charras's avatar charras
Browse files

pcbnew, gerbview: print&plot: error message displayed when no layer selected.

parent 6cdf7e83
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5,6 +5,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.

2009-mar-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++pcbnew:
++gerbview:
    print,plot: error message displayed when no layer selected.



2009-Mar-5 UPDATE Vesa Solonen <vesa.solonen@hut.fi>
================================================================================
++pcbnew:
+39 −34
Original line number Diff line number Diff line
@@ -21,10 +21,6 @@
#include "id.h"
#include "dialog_create_component.h"

/* Routines locales */

/* Variables locales */


/**********************************************/
void WinEDA_LibeditFrame::DisplayLibInfos()
@@ -47,7 +43,7 @@ void WinEDA_LibeditFrame::DisplayLibInfos()
        if( !CurrentAliasName.IsEmpty() )
            msg << wxT( "  Alias " ) << CurrentAliasName;
    }
    wxChar UnitLetter[] = wxT( "?ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
    static wxChar UnitLetter[] = wxT( "?ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
    msg << wxT( "   Unit " ) << UnitLetter[CurrentUnit];

    if( CurrentConvert > 1 )
@@ -66,7 +62,7 @@ void WinEDA_LibeditFrame::DisplayLibInfos()
void WinEDA_LibeditFrame::SelectActiveLibrary()
/**************************************************/

/* Routine to Select Current library
/* Function to select the current library (working library)
 */
{
    LibraryStruct* Lib;
@@ -80,10 +76,15 @@ void WinEDA_LibeditFrame::SelectActiveLibrary()
}


/*************************************************/
/* Routine to Load one selected library content. */
/*************************************************/
bool WinEDA_LibeditFrame::LoadOneLibraryPart()

/**
 * Function LoadOneLibraryPart()
 * load a library component from the current selected library
 * Prompt user for component name
 * If there is no current selected library,
 * prompt user for library name and make the selected library the current lib.
 */
{
    int      i;
    wxString msg;
@@ -96,9 +97,10 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPart()
            return FALSE;
    }

    if( CurrentLib == NULL )
    if( CurrentLib == NULL )    // No current lib, ask user for the library to use
    {
        SelectActiveLibrary();
        if( CurrentLib == NULL )
            return FALSE;
    }

@@ -109,13 +111,13 @@ bool WinEDA_LibeditFrame::LoadOneLibraryPart()
    g_ScreenLib->ClrModify();
    CurrentDrawItem = NULL;

    // Effacement ancien composant affich�
    // Delete previous library component, if any
    if( CurrentLibEntry )
    {
        SAFE_DELETE( CurrentLibEntry );
    }

    /* Chargement du composant */
    /* Load the new library component */
    LibEntry = FindLibPart( CmpName.GetData(), CurrentLib->m_Name, FIND_ALIAS );

    if( LibEntry == NULL )
@@ -199,7 +201,8 @@ int WinEDA_LibeditFrame::LoadOneLibraryPartAux(
/*********************************************************************/
void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/*********************************************************************/
/* Routine generale d'affichage a l'ecran du "PartLib" en cours d'edition */
/* Function to redraw the current loaded library component
*/
{
    if( GetScreen() == NULL )
        return;
@@ -208,9 +211,9 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )

    DC->SetBackground( *wxBLACK_BRUSH );
    DC->SetBackgroundMode( wxTRANSPARENT );
    GRResetPenAndBrush( DC );   // reinit de la brosse et plume courante
    GRResetPenAndBrush( DC );

    DrawPanel->CursorOff( DC ); // effacement curseur
    DrawPanel->CursorOff( DC ); // erase cursor
    if( DrawPanel->ManageCurseur )
    {
        DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); // effacement affichage lie au curseur
@@ -225,11 +228,11 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
        DrawLibEntry( DrawPanel, DC, CurrentLibEntry, wxPoint( 0, 0 ),
                      CurrentUnit, CurrentConvert, GR_DEFAULT_DRAWMODE );

    DrawPanel->CursorOn( DC ); // reaffichage curseur
    DrawPanel->CursorOn( DC ); // redraw cursor

    if( DrawPanel->ManageCurseur )
    {
        DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); // reaffichage lie au curseur
        DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
    }

    GetScreen()->ClrRefreshReq();
@@ -242,8 +245,8 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
void WinEDA_LibeditFrame::SaveActiveLibrary()
/*************************************************/

/* Sauvegarde en fichier la librairie pointee par CurrentLib
 *  une sauvegarde en .bak de l'ancien fichier est egalement cree
/* Save (on disk) the current library
 *  if exists the old file is renamed (.bak)
 */
{
    wxString Name, msg;
@@ -576,7 +579,8 @@ void WinEDA_LibeditFrame::DeletePartInLib( LibraryStruct* Library,
                                                           Library->m_Name,
                                                           FIND_ALIAS );
        if( AliasEntry == NULL )
        {   // Should not occurs. If happens, this is an error (or bug)
        {
            // Should not occurs. If happens, this is an error (or bug)
            wxString msg;
            msg.Printf( wxT( "Warning: Alias <%s> not found" ),
                       AliasName.GetData() );
@@ -584,7 +588,8 @@ void WinEDA_LibeditFrame::DeletePartInLib( LibraryStruct* Library,
            continue;
        }
        if( AliasEntry->Type != ALIAS )
        {   // Should not occurs. If happens, this is an error (or bug)
        {
            // Should not occurs. If happens, this is an error (or bug)
            wxString msg;
            msg.Printf( wxT( "Warning: <%s> is not an Alias" ),
                       AliasName.GetData() );
−102 B (171 KiB)

File changed.

No diff preview for this file type.

+875 −76

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -22,9 +22,9 @@ DEBUG = 0
#Define the wxWidget path (if not found in environment variables):
ifndef WXWIN
ifeq ($(DEBUG), 1)
WXWIN=f:/wxMSW-2.8.910-rc2/Debug
WXWIN=d:/wxMSW-2.8.10/Debug
else
WXWIN=f:/wxMSW-2.8.10-rc2/Release
WXWIN=d:/wxMSW-2.8.10/Release
endif
endif
LIBVERSION = 2.8
Loading