Commit a61b48ec authored by charras's avatar charras
Browse files

Code cleaning. Use new font.

parent d84087c0
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -68,7 +68,6 @@ const wxString AllFilesWildcard( _( "All files (*)|*" ) );


wxString       g_ProductName    = wxT( "KiCad E.D.A.  " );
wxString       g_ProductName    = wxT( "KiCad E.D.A.  " );
bool           g_ShowPageLimits = true;
bool           g_ShowPageLimits = true;
int            g_GridColor = DARKGRAY;
wxString       g_UserLibDirBuffer;
wxString       g_UserLibDirBuffer;
int            g_DebugLevel;
int            g_DebugLevel;
int            g_MouseOldButtons;
int            g_MouseOldButtons;
+15 −7
Original line number Original line Diff line number Diff line
@@ -22,8 +22,9 @@




/* Configuration entry names. */
/* Configuration entry names. */
static const wxString CursorShapeEntry( wxT( "CuShape" ) );
static const wxString CursorShapeEntryKeyword( wxT( "CursorShape" ) );
static const wxString ShowGridEntry( wxT( "ShGrid" ) );
static const wxString ShowGridEntryKeyword( wxT( "ShowGrid" ) );
static const wxString GridColorEntryKeyword( wxT( "GridColor" ) );
static const wxString LastGridSizeId( wxT( "_LastGridSize" ) );
static const wxString LastGridSizeId( wxT( "_LastGridSize" ) );




@@ -60,13 +61,14 @@ WinEDA_DrawFrame::WinEDA_DrawFrame( wxWindow* father, int idtype,
    m_ID_last_state       = 0;
    m_ID_last_state       = 0;
    m_HTOOL_current_state = 0;
    m_HTOOL_current_state = 0;
    m_Draw_Axis           = FALSE;  // TRUE to draw axis.
    m_Draw_Axis           = FALSE;  // TRUE to draw axis.
    m_Draw_Grid           = FALSE;  // TRUE to show grid.
    m_Draw_Sheet_Ref      = FALSE;  // TRUE to display reference sheet.
    m_Draw_Sheet_Ref      = FALSE;  // TRUE to display reference sheet.
    m_Print_Sheet_Ref     = TRUE;   // TRUE to print reference sheet.
    m_Print_Sheet_Ref     = TRUE;   // TRUE to print reference sheet.
    m_Draw_Auxiliary_Axis = FALSE;  // TRUE draw auxilary axis.
    m_Draw_Auxiliary_Axis = FALSE;  // TRUE draw auxilary axis.
    m_UnitType            = INTERNAL_UNIT_TYPE;    // Internal unit = inch
    m_UnitType            = INTERNAL_UNIT_TYPE;    // Internal unit = inch
    m_CursorShape         = 0;
    m_CursorShape         = 0;
    m_LastGridSizeId      = 0;
    m_LastGridSizeId      = 0;
    m_DrawGrid            = true;   // hide/Show grid. default = show
    m_GridColor           = DARKGRAY;   // Grid color


    // Internal units per inch: = 1000 for schema, = 10000 for PCB
    // Internal units per inch: = 1000 for schema, = 10000 for PCB
    m_InternalUnits       = EESCHEMA_INTERNAL_UNIT;
    m_InternalUnits       = EESCHEMA_INTERNAL_UNIT;
@@ -720,8 +722,13 @@ void WinEDA_DrawFrame::LoadSettings()
    wxConfig* cfg = wxGetApp().m_EDA_Config;
    wxConfig* cfg = wxGetApp().m_EDA_Config;


    WinEDA_BasicFrame::LoadSettings();
    WinEDA_BasicFrame::LoadSettings();
    cfg->Read( m_FrameName + CursorShapeEntry, &m_CursorShape, ( long )0 );
    cfg->Read( m_FrameName + CursorShapeEntryKeyword, &m_CursorShape, ( long )0 );
    cfg->Read( m_FrameName + ShowGridEntry, &m_Draw_Grid, true );
    bool btmp;
    if ( cfg->Read( m_FrameName + ShowGridEntryKeyword, &btmp ) )
        SetGridVisibility( btmp);
    int itmp;
    if( cfg->Read( m_FrameName + GridColorEntryKeyword, &itmp ) )
        SetGridColor(itmp);
    cfg->Read( m_FrameName + LastGridSizeId, &m_LastGridSizeId, 0L );
    cfg->Read( m_FrameName + LastGridSizeId, &m_LastGridSizeId, 0L );
}
}


@@ -739,8 +746,9 @@ void WinEDA_DrawFrame::SaveSettings()
    wxConfig* cfg = wxGetApp().m_EDA_Config;
    wxConfig* cfg = wxGetApp().m_EDA_Config;


    WinEDA_BasicFrame::SaveSettings();
    WinEDA_BasicFrame::SaveSettings();
    cfg->Write( m_FrameName + CursorShapeEntry, m_CursorShape );
    cfg->Write( m_FrameName + CursorShapeEntryKeyword, m_CursorShape );
    cfg->Write( m_FrameName + ShowGridEntry, m_Draw_Grid );
    cfg->Write( m_FrameName + ShowGridEntryKeyword, IsGridVisible() );
    cfg->Write( m_FrameName + GridColorEntryKeyword, GetGridColor() );
    cfg->Write( m_FrameName + LastGridSizeId, ( long ) m_LastGridSizeId );
    cfg->Write( m_FrameName + LastGridSizeId, ( long ) m_LastGridSizeId );
}
}


+3 −3
Original line number Original line Diff line number Diff line
@@ -703,7 +703,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )


    GRSetDrawMode( DC, GR_COPY );
    GRSetDrawMode( DC, GR_COPY );


    if( m_Parent->m_Draw_Grid )
    if( m_Parent->IsGridVisible() )
        DrawGrid( DC );
        DrawGrid( DC );


    /* Draw axis */
    /* Draw axis */
@@ -789,7 +789,7 @@ void WinEDA_DrawPanel::DrawGrid( wxDC* DC )
#endif
#endif


    m_Parent->PutOnGrid( &org );
    m_Parent->PutOnGrid( &org );
    GRSetColorPen( DC, g_GridColor );
    GRSetColorPen( DC, m_Parent->GetGridColor() );
    int xpos, ypos;
    int xpos, ypos;




@@ -842,7 +842,7 @@ void WinEDA_DrawPanel::DrawGrid( wxDC* DC )
    tmpDC.SelectObject( tmpBM );
    tmpDC.SelectObject( tmpBM );
    GRSetColorPen( &tmpDC, g_DrawBgColor );
    GRSetColorPen( &tmpDC, g_DrawBgColor );
    tmpDC.DrawLine( 0, 0, 0, screenSize.y-1 );        // init background
    tmpDC.DrawLine( 0, 0, 0, screenSize.y-1 );        // init background
    GRSetColorPen( &tmpDC, g_GridColor );
    GRSetColorPen( &tmpDC, m_Parent->GetGridColor() );
    for( jj = 0; ; jj++ )   // draw grid points
    for( jj = 0; ; jj++ )   // draw grid points
    {
    {
        yg = wxRound( jj * screen_grid_size.y );
        yg = wxRound( jj * screen_grid_size.y );
+5 −3
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@
#endif
#endif


#define EDA_DRAWBASE
#define EDA_DRAWBASE
#include "hershey_fonts.h"
#include "newstroke_font.h"
#include "plot_common.h"
#include "plot_common.h"


/* factor used to calculate actual size of shapes from hershey fonts (could be adjusted depending on the font name)
/* factor used to calculate actual size of shapes from hershey fonts (could be adjusted depending on the font name)
@@ -122,13 +122,15 @@ static const char* GetHersheyShapeDescription( int AsciiCode )
    }
    }
#endif
#endif


    if ( AsciiCode > 0x7F )
    /* calculate font length */
    int font_length_max = sizeof(newstroke_font)/sizeof(*newstroke_font);
    if ( AsciiCode >= (32 + font_length_max) )
        AsciiCode = '?';
        AsciiCode = '?';
    if( AsciiCode < 32 )
    if( AsciiCode < 32 )
        AsciiCode = 32;                 /* Clamp control chars */
        AsciiCode = 32;                 /* Clamp control chars */
    AsciiCode -= 32;
    AsciiCode -= 32;


    return hershey_simplex[AsciiCode];
    return newstroke_font[AsciiCode];
}
}




+1 −1
Original line number Original line Diff line number Diff line
@@ -21,13 +21,13 @@ set(CVPCB_SRCS
    cfg.cpp
    cfg.cpp
    class_cvpcb.cpp
    class_cvpcb.cpp
	class_components_listbox.cpp
	class_components_listbox.cpp
    class_DisplayFootprintsFrame.cpp
	class_footprints_listbox.cpp
	class_footprints_listbox.cpp
    cvframe.cpp
    cvframe.cpp
    cvpcb.cpp
    cvpcb.cpp
    dialog_cvpcb_config.cpp
    dialog_cvpcb_config.cpp
    dialog_cvpcb_config_fbp.cpp
    dialog_cvpcb_config_fbp.cpp
    dialog_display_options.cpp
    dialog_display_options.cpp
    displayframe.cpp
    dummy_functions.cpp
    dummy_functions.cpp
    genequiv.cpp
    genequiv.cpp
    init.cpp
    init.cpp
Loading