From 89e7f96574906c6b881e54552a1205f126633650 Mon Sep 17 00:00:00 2001 From: charras Date: Mon, 13 Apr 2009 05:58:11 +0000 Subject: [PATCH] made kicad compilable with wxWidgets 2.9 (wxWidgets 3) --- common/confirm.cpp | 9 ++--- common/copy_to_clipboard.cpp | 50 +++++++++++-------------- common/dcsvg.cpp | 9 +++++ common/drawtxt.cpp | 15 +++++--- common/edaappl.cpp | 13 +++++-- common/gr_basic.cpp | 20 ---------- common/wxwineda.cpp | 2 +- eeschema/class_pin.cpp | 19 +++++----- eeschema/class_sch_cmp_field.cpp | 6 ++- eeschema/dialog_SVG_print.cpp | 34 +++++++---------- eeschema/edit_component_in_lib.cpp | 2 +- eeschema/edit_graphic_bodyitem_text.cpp | 7 ++-- eeschema/lib_export.cpp | 2 +- eeschema/pinedit.cpp | 3 +- eeschema/plot.cpp | 8 ++-- eeschema/viewlibs.cpp | 9 ++--- include/dcsvg.h | 8 ++++ include/gr_basic.h | 1 - kicad/files-io.cpp | 10 +++-- kicad/kicad.cpp | 3 +- kicad/mainframe.cpp | 2 +- pcbnew/dialog_SVG_print.cpp | 35 +++++++---------- pcbnew/dialog_orient_footprints.h | 16 ++++---- pcbnew/dialog_orient_footprints.pjd | 26 ++++++------- pcbnew/gen_modules_placefile.cpp | 4 +- pcbnew/gpcb_exchange.cpp | 2 +- 26 files changed, 148 insertions(+), 167 deletions(-) diff --git a/common/confirm.cpp b/common/confirm.cpp index 0320c55dbb..8e35582b95 100644 --- a/common/confirm.cpp +++ b/common/confirm.cpp @@ -126,7 +126,7 @@ bool IsOK( wxWindow* parent, const wxString& text ) /***********************************************************************/ int Get_Message( const wxString& title, // The question const wxString& frame_caption, // The frame caption - wxString& buffer, // String input buffer + wxString& buffer, // String input/return buffer wxWindow* frame ) /***********************************************************************/ @@ -140,13 +140,10 @@ int Get_Message( const wxString& title, // The question * != 0 if ESCAPE */ { - wxString message, default_text; - - if( buffer ) - default_text = buffer; + wxString message; message = wxGetTextFromUser( title, frame_caption, - default_text, frame ); + buffer, frame ); if( !message.IsEmpty() ) { message.Trim( FALSE ); // Remove blanks at beginning diff --git a/common/copy_to_clipboard.cpp b/common/copy_to_clipboard.cpp index 280f0a1dc0..3fa6221842 100644 --- a/common/copy_to_clipboard.cpp +++ b/common/copy_to_clipboard.cpp @@ -94,36 +94,28 @@ bool DrawPage( WinEDA_DrawPanel* panel ) wxMetafileDC dc /*(wxT(""), DrawArea.GetWidth(), DrawArea.GetHeight())*/; - if( !dc.Ok() ) - { - DisplayError( NULL, wxT( "CopyToClipboard: DrawPage error: wxMetafileDC not OK" ) ); - success = FALSE; - } - else - { - EDA_Rect tmp = panel->m_ClipBox; - GRResetPenAndBrush( &dc ); - GRForceBlackPen( s_PlotBlackAndWhite ); - screen->m_IsPrinting = true; - dc.SetUserScale( scale, scale ); - ClipboardSizeX = dc.MaxX() + 10; - ClipboardSizeY = dc.MaxY() + 10; - panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); - panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); + EDA_Rect tmp = panel->m_ClipBox; + GRResetPenAndBrush( &dc ); + GRForceBlackPen( s_PlotBlackAndWhite ); + screen->m_IsPrinting = true; + dc.SetUserScale( scale, scale ); + ClipboardSizeX = dc.MaxX() + 10; + ClipboardSizeY = dc.MaxY() + 10; + panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); + panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); - if( DrawBlock ) - { - dc.SetClippingRegion( DrawArea ); - } - panel->PrintPage( &dc, Print_Sheet_Ref, -1, false ); - screen->m_IsPrinting = false; - panel->m_ClipBox = tmp; - wxMetafile* mf = dc.Close(); - if( mf ) - { - success = mf->SetClipboard( ClipboardSizeX, ClipboardSizeY ); - delete mf; - } + if( DrawBlock ) + { + dc.SetClippingRegion( DrawArea ); + } + panel->PrintPage( &dc, Print_Sheet_Ref, -1, false ); + screen->m_IsPrinting = false; + panel->m_ClipBox = tmp; + wxMetafile* mf = dc.Close(); + if( mf ) + { + success = mf->SetClipboard( ClipboardSizeX, ClipboardSizeY ); + delete mf; } diff --git a/common/dcsvg.cpp b/common/dcsvg.cpp index d843452b95..34207f5aed 100644 --- a/common/dcsvg.cpp +++ b/common/dcsvg.cpp @@ -8,6 +8,7 @@ ///////////////////////////////////////////////////////////////////////////// + // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -19,6 +20,12 @@ #include "wx/wx.h" #endif +#if wxCHECK_VERSION( 2, 9, 0 ) +// Do nothing, because wxWidgets 3 supports the SVG format +// previously, was a contribution library, not included in wxWidgets base + +#else + #include "dcsvg.h" #include "wx/image.h" @@ -979,3 +986,5 @@ void wxSVGFileDC::write( const wxString& s ) #pragma warn .rch #pragma warn .ccc #endif + +#endif // wxCHECK_VERSION diff --git a/common/drawtxt.cpp b/common/drawtxt.cpp index c9c38c7eb2..490f104f74 100644 --- a/common/drawtxt.cpp +++ b/common/drawtxt.cpp @@ -41,7 +41,7 @@ static void DrawGraphicTextPline( EDA_Colors aColor, int aWidth, bool sketch_mode, - int point_count, + int point_count, wxPoint *coord, void (* aCallback) (int x0, int y0, int xf, int yf)) { @@ -298,20 +298,23 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, coord[1].x = overbar_x; coord[1].y = overbar_y; /* Plot the overbar segment */ - DrawGraphicTextPline(aPanel, aDC, aColor, aWidth, + DrawGraphicTextPline(aPanel, aDC, aColor, aWidth, sketch_mode, 2, coord, aCallback); } continue; /* Skip ~ processing */ } } + + AsciiCode = aText.GetChar(ptr+overbars); + #if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC) - AsciiCode = aText.GetChar(ptr+overbars) & 0x7FF; + AsciiCode &= 0x7FF; if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF; else AsciiCode = AsciiCode & 0xFF; #else - AsciiCode = aText.GetChar(ptr+overbars) & 0xFF; + AsciiCode &= 0xFF; #endif ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description * du caractere a dessiner */ @@ -334,7 +337,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, { if( aWidth <= 1 ) aWidth = 0; - DrawGraphicTextPline(aPanel, aDC, aColor, aWidth, + DrawGraphicTextPline(aPanel, aDC, aColor, aWidth, sketch_mode, point_count, coord, aCallback); } plume = f_cod; point_count = 0; @@ -386,7 +389,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, coord[1].x = overbar_x; coord[1].y = overbar_y; /* Plot the overbar segment */ - DrawGraphicTextPline(aPanel, aDC, aColor, aWidth, + DrawGraphicTextPline(aPanel, aDC, aColor, aWidth, sketch_mode, 2, coord, aCallback); } } diff --git a/common/edaappl.cpp b/common/edaappl.cpp index 31e507c9a9..c626def9e8 100644 --- a/common/edaappl.cpp +++ b/common/edaappl.cpp @@ -698,6 +698,10 @@ void WinEDA_App::SaveSettings() /* Sdt font settings */ m_EDA_Config->Write( wxT( "SdtFontSize" ), g_StdFontPointSize ); m_EDA_Config->Write( wxT( "SdtFontType" ), g_StdFont->GetFaceName() ); + +#if wxCHECK_VERSION( 2, 9, 0 ) +#warning under wxWidgets 3.0, see how to replace the next lines +#else m_EDA_Config->Write( wxT( "SdtFontStyle" ), g_StdFont->GetStyle() ); m_EDA_Config->Write( wxT( "SdtFontWeight" ), g_StdFont->GetWeight() ); @@ -717,6 +721,7 @@ void WinEDA_App::SaveSettings() m_EDA_Config->Write( wxT( "FixedFontSize" ), g_FixedFontPointSize ); m_EDA_Config->Write( wxT( "ShowPageLimits" ), g_ShowPageLimits ); m_EDA_Config->Write( wxT( "WorkingDir" ), wxGetCwd() ); +#endif // wxCHECK_VERSION /* Save the file history list */ m_fileHistory.Save( *m_EDA_Config ); @@ -857,9 +862,11 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu ) menu = new wxMenu; for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ ) { - wxString label = s_Language_List[ii].m_DoNotTranslate ? - s_Language_List[ii].m_Lang_Label : - wxGetTranslation( s_Language_List[ii].m_Lang_Label ); + wxString label; + if ( s_Language_List[ii].m_DoNotTranslate ) + label = s_Language_List[ii].m_Lang_Label; + else + label = wxGetTranslation( s_Language_List[ii].m_Lang_Label ); item = new wxMenuItem( menu, s_Language_List[ii].m_KI_Lang_Identifier, diff --git a/common/gr_basic.cpp b/common/gr_basic.cpp index c49317ffdf..80620d20a9 100644 --- a/common/gr_basic.cpp +++ b/common/gr_basic.cpp @@ -1494,26 +1494,6 @@ void GRSetTextFgColor( wxDC* DC, wxFont*, int Color ) } -/*****************************************************************************/ -void GRGetTextExtent( wxDC* DC, const wxChar* Text, long* width, long* height ) -/*****************************************************************************/ - -/* Return the size of the text - */ -{ - long w = 0, h = 0; - - if( Text ) - { - DC->GetTextExtent( Text, &w, &h ); - } - if( width ) - *width = w; - if( height ) - *height = h; -} - - /********************************/ void GRResetTextFgColor( wxDC* DC ) /********************************/ diff --git a/common/wxwineda.cpp b/common/wxwineda.cpp index 0ed3429a86..6a0e6555cc 100644 --- a/common/wxwineda.cpp +++ b/common/wxwineda.cpp @@ -21,7 +21,7 @@ WinEDA_EnterText::WinEDA_EnterText( wxWindow* parent, const wxSize& Size ) { m_Modify = FALSE; - if( TextToEdit ) + if( ! TextToEdit.IsEmpty() ) m_NewText = TextToEdit; m_Title = new wxStaticText( parent, -1, Title ); diff --git a/eeschema/class_pin.cpp b/eeschema/class_pin.cpp index 78b05e854f..28cf63da65 100644 --- a/eeschema/class_pin.cpp +++ b/eeschema/class_pin.cpp @@ -505,7 +505,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) { // It is an horizontal line - if( m_PinName && DrawPinName ) + if( DrawPinName ) { if( orient == PIN_RIGHT ) { @@ -545,7 +545,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, else /* Its a vertical line. */ { // Text is drawn from bottom to top (i.e. to negative value for Y axis) - if( m_PinName && DrawPinName ) + if( DrawPinName ) { if( orient == PIN_DOWN ) { @@ -588,7 +588,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) { /* Its an horizontal line. */ - if( m_PinName && DrawPinName ) + if( DrawPinName ) { x = (x1 + pin_pos.x) / 2; DrawGraphicText( panel, DC, wxPoint( x, @@ -612,7 +612,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, } else /* Its a vertical line. */ { - if( m_PinName && DrawPinName ) + if( DrawPinName ) { y = (y1 + pin_pos.y) / 2; DrawGraphicText( panel, DC, wxPoint( x1 - TXTMARGE, @@ -701,7 +701,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos, { if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) /* Its an horizontal line. */ { - if( m_PinName && DrawPinName ) + if( DrawPinName ) { if( orient == PIN_RIGHT ) { @@ -740,7 +740,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos, } else /* Its a vertical line. */ { - if( m_PinName && DrawPinName ) + if( DrawPinName ) { if( orient == PIN_DOWN ) { @@ -784,7 +784,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos, if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) { /* Its an horizontal line. */ - if( m_PinName && DrawPinName ) + if( DrawPinName ) { x = (x1 + pin_pos.x) / 2; PlotGraphicText( g_PlotFormat, wxPoint( x, @@ -807,7 +807,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos, } else /* Its a vertical line. */ { - if( m_PinName && DrawPinName ) + if( DrawPinName ) { y = (y1 + pin_pos.y) / 2; PlotGraphicText( g_PlotFormat, wxPoint( x1 - TXTMARGE, @@ -937,7 +937,8 @@ void LibDrawPin::SetPinNumFromString( wxString& buffer ) len = 4; for( ii = 0; ii < len; ii++ ) { - ascii_buf[ii] = buffer.GetChar( ii ) & 0xFF; + ascii_buf[ii] = buffer.GetChar( ii ); + ascii_buf[ii] &= 0xFF; } strncpy( (char*) &m_PinNum, ascii_buf, 4 ); diff --git a/eeschema/class_sch_cmp_field.cpp b/eeschema/class_sch_cmp_field.cpp index 6133481bda..d89470df84 100644 --- a/eeschema/class_sch_cmp_field.cpp +++ b/eeschema/class_sch_cmp_field.cpp @@ -157,12 +157,14 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, /* For more than one part per package, we must add the part selection * A, B, ... or 1, 2, .. to the reference. */ wxString fulltext = m_Text; + char part_id; #if defined(KICAD_GOST) fulltext.Append( '.'); - fulltext.Append( '1' - 1 + DrawLibItem->m_Multi ); + part_id = '1' - 1 + DrawLibItem->m_Multi; #else - fulltext.Append( 'A' - 1 + DrawLibItem->m_Multi ); + part_id = 'A' - 1 + DrawLibItem->m_Multi; #endif + fulltext.Append( part_id ); DrawGraphicText( panel, DC, pos, color, fulltext, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, diff --git a/eeschema/dialog_SVG_print.cpp b/eeschema/dialog_SVG_print.cpp index 1ee9dca8be..c5c3199e23 100644 --- a/eeschema/dialog_SVG_print.cpp +++ b/eeschema/dialog_SVG_print.cpp @@ -235,30 +235,22 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi ); - if( !dc.Ok() ) - { - DisplayError( this, wxT( "SVGprint error: wxSVGFileDC not OK" ) ); - success = FALSE; - } - else - { - EDA_Rect tmp = panel->m_ClipBox; - GRResetPenAndBrush( &dc ); - g_PlotLine_Width = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); - SetPenMinWidth( g_PlotLine_Width ); - GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); + EDA_Rect tmp = panel->m_ClipBox; + GRResetPenAndBrush( &dc ); + g_PlotLine_Width = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); + SetPenMinWidth( g_PlotLine_Width ); + GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); - panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); - panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); + panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); + panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); - screen->m_IsPrinting = true; - SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed to print floating point numbers like 1.3) - panel->PrintPage( &dc, aPrint_Sheet_Ref, 1, false ); - SetLocaleTo_Default( ); // revert to the current locale - screen->m_IsPrinting = false; - panel->m_ClipBox = tmp; - } + screen->m_IsPrinting = true; + SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed to print floating point numbers like 1.3) + panel->PrintPage( &dc, aPrint_Sheet_Ref, 1, false ); + SetLocaleTo_Default( ); // revert to the current locale + screen->m_IsPrinting = false; + panel->m_ClipBox = tmp; GRForceBlackPen( FALSE ); diff --git a/eeschema/edit_component_in_lib.cpp b/eeschema/edit_component_in_lib.cpp index 558a72cb10..a3b382d681 100644 --- a/eeschema/edit_component_in_lib.cpp +++ b/eeschema/edit_component_in_lib.cpp @@ -250,7 +250,7 @@ void WinEDA_PartPropertiesFrame::BuildPanelDoc() msg_text = CurrentLibEntry->m_AliasList[m_AliasLocation + ALIAS_DOC]; else { - if( CurrentLibEntry && CurrentLibEntry->m_Doc ) + if( CurrentLibEntry ) msg_text = CurrentLibEntry->m_Doc; } m_Doc->SetValue( msg_text ); diff --git a/eeschema/edit_graphic_bodyitem_text.cpp b/eeschema/edit_graphic_bodyitem_text.cpp index e293a0f2f9..e098b2442c 100644 --- a/eeschema/edit_graphic_bodyitem_text.cpp +++ b/eeschema/edit_graphic_bodyitem_text.cpp @@ -140,8 +140,7 @@ wxString Line; -void WinEDA_LibeditFrame::EditSymbolText(wxDC * DC, - LibEDA_BaseStruct * DrawItem) +void WinEDA_LibeditFrame::EditSymbolText(wxDC * DC, LibEDA_BaseStruct * DrawItem) { int DrawMode = g_XorMode; @@ -150,7 +149,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC * DC, return; /* Effacement ancien texte */ - if( ((LibDrawText*)DrawItem)->m_Text && DC) + if( DC) DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0), DrawItem, DrawMode); @@ -162,7 +161,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC * DC, GetScreen()->SetModify(); /* Affichage nouveau texte */ - if( ((LibDrawText*)DrawItem)->m_Text && DC) + if( DC ) { if ( (DrawItem->m_Flags & IS_MOVED) == 0 ) DrawMode = GR_DEFAULT_DRAWMODE; diff --git a/eeschema/lib_export.cpp b/eeschema/lib_export.cpp index d67152dc4b..0d29815377 100644 --- a/eeschema/lib_export.cpp +++ b/eeschema/lib_export.cpp @@ -46,7 +46,7 @@ void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Import Component" ), m_LastLibImportPath, wxEmptyString, CompLibFileWildcard, - wxFD_OPEN | wxFILE_MUST_EXIST ); + wxFD_OPEN | wxFD_FILE_MUST_EXIST ); if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index 40422e385c..ce833dd595 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -502,8 +502,7 @@ void WinEDA_PinPropertiesFrame::SetPinNum( const wxString& newnum, int newsize ) continue; if( newsize >= 0 ) Pin->m_PinNumSize = newsize; - if( newnum ) - Pin->m_PinNum = CurrentPin->m_PinNum; + Pin->m_PinNum = CurrentPin->m_PinNum; } } diff --git a/eeschema/plot.cpp b/eeschema/plot.cpp index e59159bbbb..6ff26a86da 100644 --- a/eeschema/plot.cpp +++ b/eeschema/plot.cpp @@ -483,12 +483,14 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem, /* Adding A, B ... to the reference */ wxString Text; Text = field->m_Text; + char unit_id; #if defined(KICAD_GOST) - Text.Append( '.' ); - Text.Append( '1' - 1 + DrawLibItem->m_Multi ); + Text.Append( '.' ); + unit_id = '1' - 1 + DrawLibItem->m_Multi; #else - Text.Append( 'A' - 1 + DrawLibItem->m_Multi ); + unit_id = 'A' - 1 + DrawLibItem->m_Multi; #endif + Text.Append( unit_id ); PlotGraphicText( g_PlotFormat, textpos, color, Text, orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ, field->m_Size, hjustify, vjustify, diff --git a/eeschema/viewlibs.cpp b/eeschema/viewlibs.cpp index 0dc1aaaabc..a41cb726a1 100644 --- a/eeschema/viewlibs.cpp +++ b/eeschema/viewlibs.cpp @@ -312,12 +312,9 @@ void WinEDA_ViewlibFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ActiveScreen = GetScreen(); - if( *g_CurrentViewComponentName ) - { - LibEntry = FindLibPart( g_CurrentViewComponentName.GetData(), - g_CurrentViewLibraryName, FIND_ALIAS ); - ViewCmpEntry = (LibCmpEntry*) LibEntry; - } + LibEntry = FindLibPart( g_CurrentViewComponentName.GetData(), + g_CurrentViewLibraryName, FIND_ALIAS ); + ViewCmpEntry = (LibCmpEntry*) LibEntry; /* Forcage de la reinit de la brosse et plume courante */ GRResetPenAndBrush( DC ); diff --git a/include/dcsvg.h b/include/dcsvg.h index 5974c4028e..38c5bda012 100644 --- a/include/dcsvg.h +++ b/include/dcsvg.h @@ -1,3 +1,9 @@ +#if wxCHECK_VERSION( 2, 9, 0 ) +// Do nothing, because wxWidgets 3 supports the SVG format +// previously, was a contribution library, not included in wxWidgets base +#include "wx/dcsvg.h" +#else + #ifndef __DCSVG_H #define __DCSVG_H #include "wx/wfstream.h" @@ -413,3 +419,5 @@ public: #pragma warn .ccc #endif #endif + +#endif // wxCHECK_VERSION diff --git a/include/gr_basic.h b/include/gr_basic.h index 9ade97e319..78e3ac6c22 100644 --- a/include/gr_basic.h +++ b/include/gr_basic.h @@ -196,7 +196,6 @@ int GRGetTextFgColor(wxDC * DC, wxFont * Font); void GRSetTextBgColor(wxDC * DC, int Color); void GRSetTextBgColor(wxDC * DC, wxFont * Font, int Color); int GRGetTextBgColor(wxDC * DC, wxFont * Font); -void GRGetTextExtent(wxDC * DC, const wxChar * Text, long * width, long * height); #endif /* define GR_BASIC */ diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index d6b9ade5f7..6501f8fbba 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -135,9 +135,12 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event ) NULL }; - wxString cmd = wxT( "-O " ) + zip.GetPathSeparator() + zip.GetFullName(); + wxString cmd = wxT( "-O " ); + cmd += zip.GetPathSeparator() + zip.GetFullName(); - wxDir dir( wxT( "." ) + zip.GetPathSeparator() ); + wxString currdirname = wxT( "." ); + currdirname += zip.GetPathSeparator(); + wxDir dir( currdirname ); if( !dir.IsOpened() ) return; @@ -152,7 +155,8 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event ) { wxFileName fn( f ); - cmd += wxT( " ." ) + zip.GetPathSeparator() + fn.GetFullName(); + cmd += wxT( " ." ); + cmd += zip.GetPathSeparator() + fn.GetFullName(); PrintMsg( _( "Compress file " ) + fn.GetFullName() + wxT( "\n" ) ); cont = dir.GetNext( &f ); } diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index 5d1db75266..658e904b3c 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -375,8 +375,7 @@ bool WinEDA_App::OnInit() GetSettings(); // read current setup /* Make nameless project translatable */ - wxFileName namelessProject( wxGetCwd(), _( "noname" ), - + ProjectFileExtension ); + wxFileName namelessProject( wxGetCwd(), _( "noname" ), ProjectFileExtension ); frame = new WinEDA_MainFrame( NULL, wxT( "KiCad" ), wxPoint( 30, 20 ), wxSize( 600, 400 ) ); diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index ce9ff5efe2..d7fb1a554f 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -333,7 +333,7 @@ void WinEDA_MainFrame::OnOpenFileInTextEditor( wxCommandEvent& event ) if( dlg.ShowModal() == wxID_CANCEL ) return; - if( dlg.GetPath() && wxGetApp().GetEditorName() ) + if( ! dlg.GetPath().IsEmpty() && ! wxGetApp().GetEditorName().IsEmpty() ) ExecuteFile( this, wxGetApp().GetEditorName(), dlg.GetPath() ); } diff --git a/pcbnew/dialog_SVG_print.cpp b/pcbnew/dialog_SVG_print.cpp index 2bd1f65c6c..1ff3627650 100644 --- a/pcbnew/dialog_SVG_print.cpp +++ b/pcbnew/dialog_SVG_print.cpp @@ -249,31 +249,22 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi ); - if( !dc.Ok() ) - { - DisplayError( this, wxT( "SVGprint error: wxSVGFileDC not OK" ) ); - success = FALSE; - } - else - { - EDA_Rect tmp = panel->m_ClipBox; - GRResetPenAndBrush( &dc ); - s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); - SetPenMinWidth( s_PrintPenMinWidth ); - GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); + EDA_Rect tmp = panel->m_ClipBox; + GRResetPenAndBrush( &dc ); + s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); + SetPenMinWidth( s_PrintPenMinWidth ); + GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); - panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); - panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); - - screen->m_IsPrinting = true; - SetLocaleTo_C_standard(); // Switch the locale to standard C (needed to print floating point numbers like 1.3) - panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false ); - SetLocaleTo_Default(); // revert to the current locale - screen->m_IsPrinting = false; - panel->m_ClipBox = tmp; - } + panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); + panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); + screen->m_IsPrinting = true; + SetLocaleTo_C_standard(); // Switch the locale to standard C (needed to print floating point numbers like 1.3) + panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false ); + SetLocaleTo_Default(); // revert to the current locale + screen->m_IsPrinting = false; + panel->m_ClipBox = tmp; GRForceBlackPen( FALSE ); SetPenMinWidth( 1 ); diff --git a/pcbnew/dialog_orient_footprints.h b/pcbnew/dialog_orient_footprints.h index ac525317c3..2b199509bb 100644 --- a/pcbnew/dialog_orient_footprints.h +++ b/pcbnew/dialog_orient_footprints.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dialog_orient_footprints.h -// Purpose: -// Author: -// Modified by: +// Purpose: +// Author: +// Modified by: // Created: 11/07/2008 13:32:12 -// RCS-ID: -// Copyright: -// Licence: +// RCS-ID: +// Copyright: +// Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 11/07/2008 13:32:12 @@ -38,7 +38,7 @@ #define ID_TEXTCTRLROT_VALUE 10003 #define ID_TEXTCTRL_FOOTPRINTS_FILTER 10001 #define ID_CHECKBOX_APPLY_TO_LOCKED 10002 -#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxDIALOG_MODAL|wxTAB_TRAVERSAL +#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE wxDEFAULT_DIALOG_STYLE #define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_TITLE _("Footprints Orientation") #define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_IDNAME ID_DIALOG_ORIENT_FOOTPRINTS #define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_SIZE wxSize(400, 300) @@ -51,7 +51,7 @@ */ class dialog_orient_footprints: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( dialog_orient_footprints ) DECLARE_EVENT_TABLE() diff --git a/pcbnew/dialog_orient_footprints.pjd b/pcbnew/dialog_orient_footprints.pjd index 6e5dda032a..07139213b6 100644 --- a/pcbnew/dialog_orient_footprints.pjd +++ b/pcbnew/dialog_orient_footprints.pjd @@ -24,25 +24,25 @@ "2.6.4" "///////////////////////////////////////////////////////////////////////////// // Name: %HEADER-FILENAME% -// Purpose: +// Purpose: // Author: %AUTHOR% -// Modified by: +// Modified by: // Created: %DATE% -// RCS-ID: +// RCS-ID: // Copyright: %COPYRIGHT% -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// " "///////////////////////////////////////////////////////////////////////////// // Name: %SOURCE-FILENAME% -// Purpose: +// Purpose: // Author: %AUTHOR% -// Modified by: +// Modified by: // Created: %DATE% -// RCS-ID: +// RCS-ID: // Copyright: %COPYRIGHT% -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// " @@ -50,11 +50,11 @@ // Name: %SYMBOLS-FILENAME% // Purpose: Symbols file // Author: %AUTHOR% -// Modified by: +// Modified by: // Created: %DATE% -// RCS-ID: +// RCS-ID: // Copyright: %COPYRIGHT% -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// " @@ -241,7 +241,7 @@ "" "" "Tiled" - 0 + 1 1 1 1 @@ -250,7 +250,7 @@ 1 0 0 - 1 + 0 0 0 0 diff --git a/pcbnew/gen_modules_placefile.cpp b/pcbnew/gen_modules_placefile.cpp index 90c8b45fae..94c00e36f4 100644 --- a/pcbnew/gen_modules_placefile.cpp +++ b/pcbnew/gen_modules_placefile.cpp @@ -136,7 +136,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event ) fnFront = GetScreen()->m_FileName; frontLayerName = GetBoard()->GetLayerName( CMP_N ); - fnFront.SetName( fnFront.GetName() + frontLayerName.GetData() ); + fnFront.SetName( fnFront.GetName() + frontLayerName ); fnFront.SetExt( wxT( "pos") ); fpFront = wxFopen( fnFront.GetFullPath(), wxT( "wt" ) ); @@ -151,7 +151,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event ) { fnBack = GetScreen()->m_FileName; backLayerName = GetBoard()->GetLayerName( COPPER_LAYER_N ); - fnBack.SetName( fnBack.GetName() + backLayerName.GetData() ); + fnBack.SetName( fnBack.GetName() + backLayerName ); fnBack.SetExt( wxT( "pos" ) ); fpBack = wxFopen( fnBack.GetFullPath(), wxT( "wt" ) ); diff --git a/pcbnew/gpcb_exchange.cpp b/pcbnew/gpcb_exchange.cpp index f8f37f3015..998cfc86a9 100644 --- a/pcbnew/gpcb_exchange.cpp +++ b/pcbnew/gpcb_exchange.cpp @@ -440,7 +440,7 @@ static void Extract_Parameters( wxArrayString& param_list, char* text ) * last parameter is ) or ] */ { - int key; + char key; wxString tmp; while( *text != 0 )