Commit b65590f7 authored by charras's avatar charras
Browse files

code cleanup in project_config.cpp and some enhancements

parent 2eaa28f0
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,17 @@ KiCad ChangeLog 2009
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.


2009-mar-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++All
    code cleanup in project_config.cpp.
    Now parameters common to all projects are saved on exit.
    (they are usally options like colors, draw options ...)

++pcbnew:
    added option to show or not netnames on pads and tracks


2009-mar-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2009-mar-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
++pcbnew:
++pcbnew:
+25 −22
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
                      void (* aCallback) (int x0, int y0, int xf, int yf))
                      void (* aCallback) (int x0, int y0, int xf, int yf))
/****************************************************************************************************/
/****************************************************************************************************/
{
{
    int            ii, kk, char_count, AsciiCode, endcar;
    int            kk, char_count, AsciiCode;
    int            x0, y0;
    int            x0, y0;
    int            size_h, size_v, pitch;
    int            size_h, size_v, pitch;
    SH_CODE        f_cod, plume = 'U';
    SH_CODE        f_cod, plume = 'U';
@@ -62,7 +62,8 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
    int            ux0, uy0, dx, dy;    // Draw coordinate for segments to draw. also used in some other calculation
    int            ux0, uy0, dx, dy;    // Draw coordinate for segments to draw. also used in some other calculation
    int            cX, cY;              // Texte center
    int            cX, cY;              // Texte center
    int            ox, oy;              // Draw coordinates for the current char
    int            ox, oy;              // Draw coordinates for the current char
    int            coord[100];          // Buffer coordinate used to draw polylines (char shapes)
    #define        BUF_SIZE 100
    wxPoint        coord[BUF_SIZE+1];          // Buffer coordinate used to draw polylines (one char shape)
    bool           sketch_mode = false;
    bool           sketch_mode = false;
	bool		   italic_reverse = false;		// true for mirrored texts with m_Size.x < 0
	bool		   italic_reverse = false;		// true for mirrored texts with m_Size.x < 0


@@ -72,7 +73,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
    if( aWidth < 0 )
    if( aWidth < 0 )
    {
    {
        aWidth = -aWidth;
        aWidth = -aWidth;
        sketch_mode = TRUE;
        sketch_mode = true;
    }
    }
    int thickness = aWidth;
    int thickness = aWidth;
	if ( aSize.x < 0 )		// text is mirrored using size.x < 0 (mirror / Y axis)
	if ( aSize.x < 0 )		// text is mirrored using size.x < 0 (mirror / Y axis)
@@ -234,7 +235,9 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
        ptcar = graphic_fonte_shape[AsciiCode];  /* ptcar pointe la description
        ptcar = graphic_fonte_shape[AsciiCode];  /* ptcar pointe la description
                                                  *  du caractere a dessiner */
                                                  *  du caractere a dessiner */


        for( ii = 0, endcar = FALSE; !endcar; ptcar++ )
        int point_count;
        bool endcar;
        for( point_count = 0, endcar = false; !endcar; ptcar++ )
        {
        {
            f_cod = *ptcar;
            f_cod = *ptcar;


@@ -242,36 +245,34 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
            switch( f_cod )
            switch( f_cod )
            {
            {
            case 'X':
            case 'X':
                endcar = TRUE;    /* fin du caractere */
                endcar = true;    /* fin du caractere */
                break;
                break;


            case 'U':
            case 'U':
                if( ii && (plume == 'D' ) )
                if( point_count && (plume == 'D' ) )
                {
                {
                    if( aWidth <= 1 )
                    if( aWidth <= 1 )
                       aWidth = 0;
                       aWidth = 0;
                    if ( aCallback )
                    if ( aCallback )
                    {
                    {
                        int ik, * coordptr;
                        for( int ik = 0; ik < (point_count - 1); ik ++ )
                        coordptr = coord;
                        {
                        for( ik = 0; ik < (ii - 2); ik += 2, coordptr += 2 )
                           aCallback( coord[ik].x, coord[ik].y,
                            aCallback( *coordptr, *(coordptr + 1),
                                     coord[ik+1].x, coord[ik+1].y );
                                     *(coordptr + 2), *(coordptr + 3) );
                        }
                    }
                    }


                    else if( sketch_mode )
                    else if( sketch_mode )
                    {
                    {
                        int ik, * coordptr;
                        for( int ik = 0; ik < (point_count - 1); ik ++ )
                        coordptr = coord;
                            GRCSegm( &aPanel->m_ClipBox, aDC, coord[ik].x, coord[ik].y,
                        for( ik = 0; ik < (ii - 2); ik += 2, coordptr += 2 )
                                     coord[ik+1].x, coord[ik+1].y, aWidth, aColor );
                            GRCSegm( &aPanel->m_ClipBox, aDC, *coordptr, *(coordptr + 1),
                                     *(coordptr + 2), *(coordptr + 3), aWidth, aColor );
                    }
                    }
                    else
                    else
                        GRPoly( &aPanel->m_ClipBox, aDC, ii / 2, (wxPoint*)coord, 0,
                        GRPoly( &aPanel->m_ClipBox, aDC, point_count, coord, 0,
                                aWidth, aColor, aColor );
                                aWidth, aColor, aColor );
                }
                }
                plume = f_cod; ii = 0;
                plume = f_cod; point_count = 0;
                break;
                break;


            case 'D':
            case 'D':
@@ -295,8 +296,10 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
                    dx    = k2 + ox; dy = k1 + oy;
                    dx    = k2 + ox; dy = k1 + oy;


                    RotatePoint( &dx, &dy, cX, cY, aOrient );
                    RotatePoint( &dx, &dy, cX, cY, aOrient );
                    coord[ii++] = dx;
                    coord[point_count].x = dx;
                    coord[ii++] = dy;
                    coord[point_count].y = dy;
                    if ( point_count < BUF_SIZE-1 )
                        point_count++;
                    break;
                    break;
                }
                }
            }
            }
+1 −0
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@


#include "appl_wxstruct.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "common.h"
#include "param_config.h"
#include "worksheet.h"
#include "worksheet.h"
#include "id.h"
#include "id.h"
#include "build_version.h"
#include "build_version.h"
+289 −219

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,8 @@
#define eda_global extern
#define eda_global extern
#endif
#endif


#include "param_config.h"

#define INSETUP TRUE
#define INSETUP TRUE


#define GROUP wxT("/cvpcb")
#define GROUP wxT("/cvpcb")
Loading