Commit bb8ee329 authored by charras's avatar charras
Browse files

Bug in get online help: kicad.pdf was always called instead of the suitable...

Bug in get online help: kicad.pdf was always called instead of the suitable help file. thanks to the guy who did not test its changes
eeschema: code cleaning
switch to wxWidgets 2.8.9
parent 7470a3bd
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.



2008-Sep-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema:
    code cleaning
    PartTextStruct class name changed to a name : SCH_CMP_FIELD

2008-Sep-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Sep-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+pcbnew:
+pcbnew:
+1 −1
Original line number Original line Diff line number Diff line
@@ -245,7 +245,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
        DisplayError( this, msg );
        DisplayError( this, msg );
    }
    }
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
    wxString fullfilename = FindKicadHelpPath() + _T("kicad.pdf");
    wxString fullfilename = FindKicadHelpPath() + m_Parent->m_HelpFileName;
    if ( wxFileExists(fullfilename) )
    if ( wxFileExists(fullfilename) )
        GetAssociatedDocument( this, wxEmptyString, fullfilename );
        GetAssociatedDocument( this, wxEmptyString, fullfilename );
    else    // Try to find file in English format:
    else    // Try to find file in English format:
+4 −3
Original line number Original line Diff line number Diff line
@@ -229,11 +229,12 @@ void WinEDA_App::InitEDA_Appl( const wxString& name )
            m_KicadEnv += UNIX_STRING_DIR_SEP;
            m_KicadEnv += UNIX_STRING_DIR_SEP;
    }
    }


    /* Prepare On Line Help */
    /* Prepare On Line Help. Use only lower case for help filenames,
    * in order to avoid problems with upper/lower case filenames under windows and unix */
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
    m_HelpFileName = name + wxT( ".html" );
    m_HelpFileName = name.Lower() + wxT( ".html" );
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
    m_HelpFileName = name + wxT( ".pdf" );
    m_HelpFileName = name.Lower() + wxT( ".pdf" );
#else
#else
    #error Help files format not defined
    #error Help files format not defined
#endif
#endif
+60 −19
Original line number Original line Diff line number Diff line
@@ -47,7 +47,7 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs
    wxPoint pos1, pos2, posc;
    wxPoint pos1, pos2, posc;


    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     LineWidth = MAX( m_Width, g_DrawMinimunLineWidth );
    int     linewidth = MAX( m_Width, g_DrawMinimunLineWidth );


    if( aColor < 0 )       // Used normal color or selected color
    if( aColor < 0 )       // Used normal color or selected color
    {
    {
@@ -76,7 +76,7 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs


    if( fill == FILLED_WITH_BG_BODYCOLOR )
    if( fill == FILLED_WITH_BG_BODYCOLOR )
        GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
        GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
            m_Rayon, LineWidth, color,
            m_Rayon, linewidth, color,
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
    else if( fill == FILLED_SHAPE && !aData )
    else if( fill == FILLED_SHAPE && !aData )
        GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
        GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
@@ -87,13 +87,13 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs




        GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
        GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
            m_Rayon, LineWidth, color );
            m_Rayon, linewidth, color );
#else
#else






        GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
        GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
            posc.x, posc.y, LineWidth, color );
            posc.x, posc.y, linewidth, color );
#endif
#endif
}
}


@@ -106,7 +106,7 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO
    wxPoint pos1;
    wxPoint pos1;


    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     LineWidth = MAX( m_Width, g_DrawMinimunLineWidth );
    int     linewidth = MAX( m_Width, g_DrawMinimunLineWidth );


    if( aColor < 0 )       // Used normal color or selected color
    if( aColor < 0 )       // Used normal color or selected color
    {
    {
@@ -125,14 +125,14 @@ void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO


    if( fill == FILLED_WITH_BG_BODYCOLOR )
    if( fill == FILLED_WITH_BG_BODYCOLOR )
        GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
        GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
            m_Rayon, LineWidth, color,
            m_Rayon, linewidth, color,
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
    else if( fill == FILLED_SHAPE )
    else if( fill == FILLED_SHAPE )
        GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
        GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
            m_Rayon, 0, color, color );
            m_Rayon, 0, color, color );
    else
    else
        GRCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
        GRCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
            m_Rayon, LineWidth, color );
            m_Rayon, linewidth, color );
}
}




@@ -144,7 +144,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff
    wxPoint pos1, pos2;
    wxPoint pos1, pos2;


    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     LineWidth = MAX( m_Width, g_DrawMinimunLineWidth );
    int     linewidth = MAX( m_Width, g_DrawMinimunLineWidth );


    if( aColor < 0 )       // Used normal color or selected color
    if( aColor < 0 )       // Used normal color or selected color
    {
    {
@@ -163,7 +163,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff
    DrawGraphicText( aPanel, aDC, pos1, color, m_Text,
    DrawGraphicText( aPanel, aDC, pos1, color, m_Text,
        t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
        t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
        m_Size,
        m_Size,
        GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, LineWidth );
        GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, linewidth );
}
}




@@ -175,7 +175,7 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO
    wxPoint pos1, pos2;
    wxPoint pos1, pos2;


    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     LineWidth = MAX( m_Width, g_DrawMinimunLineWidth );
    int     linewidth = MAX( m_Width, g_DrawMinimunLineWidth );


    if( aColor < 0 )       // Used normal color or selected color
    if( aColor < 0 )       // Used normal color or selected color
    {
    {
@@ -194,14 +194,14 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO


    if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
    if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
        GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
        GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
            color, LineWidth,
            color, linewidth,
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
    else if( m_Fill == FILLED_SHAPE  && !aData )
    else if( m_Fill == FILLED_SHAPE  && !aData )
        GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
        GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
            color, color );
            color, color );
    else
    else
        GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
        GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
            LineWidth, color );
            linewidth, color );
}
}




@@ -213,7 +213,7 @@ void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& a
    wxPoint pos1, pos2;
    wxPoint pos1, pos2;


    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     color     = ReturnLayerColor( LAYER_DEVICE );
    int     LineWidth = MAX( m_Width, g_DrawMinimunLineWidth );
    int     linewidth = MAX( m_Width, g_DrawMinimunLineWidth );


    if( aColor < 0 )       // Used normal color or selected color
    if( aColor < 0 )       // Used normal color or selected color
    {
    {
@@ -226,7 +226,7 @@ void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& a
    pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
    pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
    pos2 = TransformCoordinate( aTransformMatrix, m_End ) + aOffset;
    pos2 = TransformCoordinate( aTransformMatrix, m_End ) + aOffset;


    GRLine( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, LineWidth, color );
    GRLine( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, linewidth, color );
}
}




@@ -240,7 +240,7 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
    wxPoint     pos1;
    wxPoint     pos1;


    int         color     = ReturnLayerColor( LAYER_DEVICE );
    int         color     = ReturnLayerColor( LAYER_DEVICE );
    int         LineWidth = MAX( m_Width, g_DrawMinimunLineWidth );
    int         linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
    static int* Buf_Poly_Drawings = NULL;               // Buffer used to store current corners coordinates for drawings
    static int* Buf_Poly_Drawings = NULL;               // Buffer used to store current corners coordinates for drawings
    static int  Buf_Poly_Size = 0;                      // Buffer used to store current corners coordinates for drawings
    static int  Buf_Poly_Size = 0;                      // Buffer used to store current corners coordinates for drawings


@@ -282,14 +282,14 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,


    if( fill == FILLED_WITH_BG_BODYCOLOR )
    if( fill == FILLED_WITH_BG_BODYCOLOR )
        GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
        GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
            Buf_Poly_Drawings, 1, LineWidth, color,
            Buf_Poly_Drawings, 1, linewidth, color,
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
            ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
    else if( fill == FILLED_SHAPE  )
    else if( fill == FILLED_SHAPE  )
        GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
        GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
            Buf_Poly_Drawings, 1, LineWidth, color, color );
            Buf_Poly_Drawings, 1, linewidth, color, color );
    else
    else
        GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
        GRPoly( &aPanel->m_ClipBox, aDC, m_CornersCount,
            Buf_Poly_Drawings, 0, LineWidth, color, color );
            Buf_Poly_Drawings, 0, linewidth, color, color );
}
}




@@ -297,5 +297,46 @@ void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
                         int aDrawMode, void* aData, int aTransformMatrix[2][2] )
                         int aDrawMode, void* aData, int aTransformMatrix[2][2] )
/*************************************************************************************************/
/*************************************************************************************************/
/* if aData not NULL, adat must point a wxString which is used instead of the m_Text
*/
{
    wxPoint     text_pos;

    int         color     = aColor;
    int         linewidth = MAX( m_Width, g_DrawMinimunLineWidth );

    if( aColor < 0 )                                    // Used normal color or selected color
    {
        if( (m_Selected & IS_SELECTED) )
            color = g_ItemSelectetColor;
    }
    else
        color = aColor;

    if( color < 0 )
    {
        switch( m_FieldId )
        {
        {
        case REFERENCE:
            color = ReturnLayerColor( LAYER_REFERENCEPART );
            break;

        case VALUE:
            color = ReturnLayerColor( LAYER_VALUEPART );
            break;

        default:
            color = ReturnLayerColor( LAYER_FIELDS );
            break;
        }
    }
    text_pos = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;

    wxString * text = aData ? (wxString *) aData : &m_Text;
    GRSetDrawMode( aDC, aDrawMode );
    DrawGraphicText( aPanel, aDC, text_pos,
        color, text->GetData(),
        m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
        m_Size,
        m_HJustify, m_VJustify, linewidth );
}
}
+7 −4
Original line number Original line Diff line number Diff line
@@ -381,18 +381,21 @@ public:
/* Fields , same as component fields.
/* Fields , same as component fields.
 * can be defined in libraries (mandatory for ref and value, ca be useful for footprints)
 * can be defined in libraries (mandatory for ref and value, ca be useful for footprints)
 * 2 Fields are always defined :
 * 2 Fields are always defined :
 *     Prefix (U, IC..) with gives the reference in scxhematic)
 *     Prefix (U, IC..) with gives the reference in schematic)
 *     Name (74LS00..) used to find the component in libraries, and give the default value in schematic
 *     Name (74LS00..) used to find the component in libraries, and give the default value in schematic
 */
 */
class LibDrawField :  public LibEDA_BaseStruct
class LibDrawField :  public LibEDA_BaseStruct
{
{
public:
public:
    int      m_FieldId;         // 0 a 11
    int      m_FieldId;         /* 0 a 11
                                // 0 = Name; 1 = Valeur; 2 .. 11 other fields
                                * 0 = Reference; 1 = Value
                                * 2 = Default footprint, 3 = subsheet (not used, reserved)
                                * .. 11 other fields
                                */
    wxSize   m_Size;
    wxSize   m_Size;
    int      m_Orient;                  /* Orientation */
    int      m_Orient;                  /* Orientation */
    int      m_Attributs;               /* Attributes (Non visible ...) */
    int      m_Attributs;               /* Attributes (Non visible ...) */
    int      m_HJustify, m_VJustify;    /* Horiz an  Vert Texte Justifications  */
    int      m_HJustify, m_VJustify;    /* Horiz and Vert Text Justifications  */
    wxString m_Text;                    /* Field Data */
    wxString m_Text;                    /* Field Data */
    wxString m_Name;                    /* Field Name */
    wxString m_Name;                    /* Field Name */


Loading