diff --git a/3d-viewer/3d_draw.cpp b/3d-viewer/3d_draw.cpp index a714cd0f4a..9f61aa196e 100644 --- a/3d-viewer/3d_draw.cpp +++ b/3d-viewer/3d_draw.cpp @@ -152,14 +152,14 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() glEnable( GL_COLOR_MATERIAL ); SetGLColor( WHITE ); glBegin( GL_LINES ); - glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis - glVertex3f( 0.0, 0.0, 0.0 ); - glVertex3f( 1.0, 0.0, 0.0 ); // X axis - glVertex3f( 0.0, 0.0, 0.0 ); - glVertex3f( 0.0, -1.0, 0.0 ); // Y axis - glNormal3f( 1.0, 0.0, 0.0 ); // Normal is Y axis - glVertex3f( 0.0, 0.0, 0.0 ); - glVertex3f( 0.0, 0.0, 0.3 ); // Z axis + glNormal3f( 0.0f, 0.0f, 1.0f ); // Normal is Z axis + glVertex3f( 0.0f, 0.0f, 0.0f ); + glVertex3f( 1.0f, 0.0f, 0.0f ); // X axis + glVertex3f( 0.0f, 0.0f, 0.0f ); + glVertex3f( 0.0f, -1.0f, 0.0f ); // Y axis + glNormal3f( 1.0f, 0.0f, 0.0f ); // Normal is Y axis + glVertex3f( 0.0f, 0.0f, 0.0f ); + glVertex3f( 0.0f, 0.0f, 0.3f ); // Z axis glEnd(); } diff --git a/3d-viewer/3d_viewer.h b/3d-viewer/3d_viewer.h index 78b67e3830..dac5c12a7c 100644 --- a/3d-viewer/3d_viewer.h +++ b/3d-viewer/3d_viewer.h @@ -13,14 +13,11 @@ #ifdef __WXMAC__ # ifdef __DARWIN__ -# include # include # else -# include # include # endif #else -# include # include #endif diff --git a/CMakeLists.txt b/CMakeLists.txt index 448f0baa27..7a017dd5ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,7 +93,6 @@ mark_as_advanced(KICAD_BIN KICAD_TEMPLATE) - #================================================ # Find libraries that are needed to build KiCad. #================================================ @@ -121,13 +120,16 @@ find_package(wxWidgets COMPONENTS gl html adv core net base QUIET) check_find_package_result(wxWidgets_FOUND "wxWidgets") - # Include wxWidgets macros. include(${wxWidgets_USE_FILE}) # Include MinGW resource compiler. include(MinGWResourceCompiler) +# Generate build system specific header file. +include(PerformFeatureChecks) +perform_feature_checks() + # Automagically create version header file. include(CreateSVNVersionHeader) create_svn_version_header() @@ -147,7 +149,6 @@ include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}) - #================================================ # Let CMake look in these directories for nested # 'CMakeLists.txt' files to process @@ -175,7 +176,6 @@ add_subdirectory(internat) add_subdirectory(template) - #================================================ # Installation parameters #================================================ @@ -208,7 +208,6 @@ if(UNIX) COMPONENT resources) - # CVpcb desktop file install(FILES ${LINUX_DESKTOP_FILES}/cvpcb.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications @@ -219,7 +218,6 @@ if(UNIX) COMPONENT resources) - # EEschema desktop file install(FILES ${LINUX_DESKTOP_FILES}/eeschema.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications @@ -230,7 +228,6 @@ if(UNIX) COMPONENT resources) - # GerbView desktop file install(FILES ${LINUX_DESKTOP_FILES}/gerbview.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications @@ -241,7 +238,6 @@ if(UNIX) COMPONENT resources) - # PCBnew desktop file install(FILES ${LINUX_DESKTOP_FILES}/pcbnew.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications diff --git a/CMakeModules/CreateSVNVersionHeader.cmake b/CMakeModules/CreateSVNVersionHeader.cmake index 4ad9aa6d27..f9ff6e872b 100644 --- a/CMakeModules/CreateSVNVersionHeader.cmake +++ b/CMakeModules/CreateSVNVersionHeader.cmake @@ -54,9 +54,9 @@ macro(create_svn_version_header) # reflect this. add_definitions(-DHAVE_SVN_VERSION) - # Generate config.h. - configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake - ${CMAKE_BINARY_DIR}/config.h) + # Generate version.h. + configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/version.h.cmake + ${CMAKE_BINARY_DIR}/version.h) message(STATUS "Kicad SVN version: ${KICAD_SVN_VERSION}") message(STATUS "Kicad about version: ${KICAD_ABOUT_VERSION}") diff --git a/CMakeModules/PerformFeatureChecks.cmake b/CMakeModules/PerformFeatureChecks.cmake new file mode 100644 index 0000000000..5f47f499a9 --- /dev/null +++ b/CMakeModules/PerformFeatureChecks.cmake @@ -0,0 +1,74 @@ +# +# Check for platform specific features and generate configuration header.. +# +# This cmake file was written to create a platform specific configuration +# header to handle differences between build platforms. Please add new +# feature checks to this file. Always check the wxWidgets headers first +# before adding new feature checks. The wxWidgets build system does a +# very good job of handling platform and compiler differences. +# +# Should you feel the need to do this: +# +# #ifdef SYSTEM_A +# # include +# #elif SYSTEM_B +# # include +# #elif SYSTEM_C +# # include +# #endif +# +# in your source, don't. It is not portable nor is it maintainable. +# Use cmake to detect system specific dependencies and update the +# configuration header instead. +# +# See this link for information on writing cmake system checks: +# +# http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks +# +# More importantly see "Recommendations for Writing Autoconf Macros" in: +# +# http://www.lrde.epita.fr/~adl/dl/autotools.pdf +# +# for an explanation of why you should do this. Even though this is an +# autotools tutorial. This section clearly explains why checking for +# features is superior to checking for systems. The previous section of +# this tutorial shows how to create a system independent check for _mkdir(). +# Consider it a benchmark when writing your own feature tests. +# + +macro(perform_feature_checks) + + include(CheckIncludeFile) + + check_include_file("malloc.h" HAVE_MALLOC_H) + + # FIXME: Visual C++ does not support the "not" keyword natively. It is + # defined as a macro in . There should be a cmake macro + # to check if compiler supports the not keyword natively. If not, + # then check for and include it. Although it doesn't + # appear to cause any problems with other compilers, that doesn't + # mean won't fail somewhere down the line. + check_include_file("iso646.h" HAVE_ISO646_H) + + check_include_file("strings.h" HAVE_STRINGS_H) + + include(CheckSymbolExists) + check_symbol_exists(strcasecmp "string.h" HAVE_STRCASECMP) + check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP) + check_symbol_exists(strncasecmp "string.h" HAVE_STRNCASECMP) + check_symbol_exists(strncasecmp "strings.h" HAVE_STRNCASECMP) + + # Some platforms define malloc and free in malloc.h instead of stdlib.h. + check_symbol_exists(malloc "stdlib.h" MALLOC_IN_STDLIB_H) + + # Use ISO C++ conformant names to disable Visual C++ warnings. + check_symbol_exists(_stricmp "string.h" HAVE_ISO_STRICMP) + check_symbol_exists(_strnicmp "string.h" HAVE_ISO_STRNICMP) + check_symbol_exists(_snprintf "stdio.h" HAVE_ISO_SNPRINTF) + check_symbol_exists(_hypot "math.h" HAVE_ISO_HYPOT) + + # Generate config.h. + configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake + ${CMAKE_BINARY_DIR}/config.h) + +endmacro(perform_feature_checks) diff --git a/CMakeModules/config.h.cmake b/CMakeModules/config.h.cmake index 2e947323bc..1d76a59a0b 100644 --- a/CMakeModules/config.h.cmake +++ b/CMakeModules/config.h.cmake @@ -1,9 +1,52 @@ -/* Do not modify this file, it was automatically generated by CMake */ +/* Do not modify this file, it was automatically generated by CMake. */ -#ifndef __KICAD_SVN_VERSION_H__ -#define __KICAD_SVN_VERSION_H__ +#ifndef __CONFIG_H__ +#define __CONFIG_H__ -#cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@" -#cmakedefine KICAD_ABOUT_VERSION "@KICAD_ABOUT_VERSION@" +#cmakedefine HAVE_STRCASECMP -#endif /* __KICAD_SVN_VERSION_H__ */ +#cmakedefine HAVE_STRNCASECMP + +#cmakedefine HAVE_ISO_STRICMP + +#cmakedefine HAVE_ISO_STRNICMP + +#cmakedefine HAVE_ISO_SNPRINTF + +#if defined( HAVE_ISO_SNPRINTF ) +#define snprintf _snprintf +#endif + +#cmakedefine HAVE_ISO_HYPOT + +#if defined( HAVE_ISO_HYPOT ) +#define hypot _hypot +#endif + +#cmakedefine MALLOC_IN_STDLIB_H + +#if !defined( MALLOC_IN_STDLIB_H ) +#include +#endif + +#cmakedefine HAVE_ISO646_H + +#if defined( HAVE_ISO646_H ) +#include +#endif + +#cmakedefine HAVE_STRINGS_H + +#if defined( HAVE_STRCASECMP ) +#define stricmp strcasecmp +#elif defined( HAVE_ISO_STRICMP ) +#define stricmp _stricmp +#endif + +#if defined( HAVE_STRNCASECMP ) +#define strnicmp strncasecmp +#elif defined( HAVE_ISO_STRNICMP ) +#define strnicmp _strnicmp +#endif + +#endif /* __CONFIG_H__ */ diff --git a/CMakeModules/version.h.cmake b/CMakeModules/version.h.cmake new file mode 100644 index 0000000000..555bb5b121 --- /dev/null +++ b/CMakeModules/version.h.cmake @@ -0,0 +1,14 @@ +/* Do not modify this file, it was automatically generated by CMake. */ + +/* + * Define the current source code Subversion commit number. The version + * string defined below does not update automatically when building the + * source with make. Run make rebuild_cache to update version strings. + */ +#ifndef __KICAD_SVN_VERSION_H__ +#define __KICAD_SVN_VERSION_H__ + +#cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@" +#cmakedefine KICAD_ABOUT_VERSION "@KICAD_ABOUT_VERSION@" + +#endif /* __KICAD_SVN_VERSION_H__ */ diff --git a/COMPILING.txt b/COMPILING.txt index 9d6b3ced79..09b1851ee2 100644 --- a/COMPILING.txt +++ b/COMPILING.txt @@ -1,6 +1,6 @@ ---== How to build kicad using CMAKE ==-- +--== How to build kicad ==-- First Written: 19-Dec-2007 -Last Revised: 12-Mar-2008 +Last Revised: 13-May-2009 Kicad needs wxWidgets, the multi platform G.U.I. @@ -26,6 +26,7 @@ sections below.) ===== Step Details ==================================================== 1) If windows, then install "msys" and "mingw". + Skip this step if on a Unix box. Get msys and mingw here: http://mingw.org/ msys sets up a development environment that allows the bash shell to run. @@ -33,19 +34,24 @@ mingw are a set of tools that run on windows or under msys. You will need at least the following mingw packages: make, gcc, g++, binutils, autoconf, and automake. + ----------------------------------------------------------------------------- -2) If linux, install "mesa". Use your package manager to install the development -libaries. +2) If linux, install "mesa". Use your package manager to install the + development libaries. + ----------------------------------------------------------------------------- 3) Make sure g++ and "make" are in your path. + If windows, then try running g++ and make from within your msys bash shell. + ----------------------------------------------------------------------------- 4) Install wxWidgets [and build it if on windows]. + If on windows, download http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.8.zip or a newer version. Start msys so you have a bash shell. Decide where your wxWidgets build directory @@ -54,8 +60,8 @@ such as home/. Edit your msys/1.0/etc/fstab file if needed to provide access to this build directory from msys. (Note that if you want you can build a "debug" version of the wxWidgets library at this point, instead of the release version, or in addition to the the release version.) -Unzip the wmMWS zip file into the build directory. Change directories into there, -and then: +Unzip the wmMWS zip file into the build directory. Change directories into +there, and then: mkdir build-release mkdir build-debug @@ -82,21 +88,23 @@ Verify that wx-config is in your path. Modify your PATH environment variable if need be so you can run wx-config from a command prompt. You may have to restart your msys shell, depending on how you modify your PATH. - If on linux, use your package manager to install shared object libraries and the development versions of the wxWidgets packages which include the C++ headers. An alternative is to build static libaries from source. Verify that wx-config is in your path by running it from a command prompt. Linux users then go to next step. + ----------------------------------------------------------------------------- 5) Install zlib [and build it if on windows]. + If on windows, download http://www.zlib.net/zlib123.zip or a newer version. Start msys so you have a bash shell. Decide where your zlib build directory will be. It must be where you can access it from within the msys environment, such as home/. Edit your msys/1.0/etc/fstab file if needed to provide access to this build directory from msys. Unzip the zlib123.zip file into this build directory. Change directories into there, and then: + ./configure make make install @@ -107,12 +115,15 @@ If linux, use your package manager to install zlib pre-built binaries. Note (JP Charras): Under Linux, zlib is usually installed. if not found by wxWidget installation, wxWidgets creates an alternate zlib - Under Windows, zlib is not installed, so my cmake buld try to use the wxWidgets zlib build. - So, under windows kicad build should work without zlib install. + Under Windows, zlib is not installed, so my cmake buld try to use the + wxWidgets zlib build. So, under windows kicad build should work without + zlib install. + ----------------------------------------------------------------------------- 6) Install CMAKE. + If windows, download the installation binary for windows from cmake.org. Install that and choose to add cmake to your path during installation. You will have to restart and command shells for the new path to take effect. @@ -124,15 +135,18 @@ or later. If only an older one is available in your package repository, build 2.6.1 from source. Verify that cmake is in your path by trying to run it from a command prompt. + ----------------------------------------------------------------------------- 7) Install Boost C++ Libraries + Under linux, boost is already installed, but can be too old. If this is the case, you *must* update boost. Go to http://www.boost.org/ dowlload the latest version of boost. unzip (or untar) boots file. -under Windows, files can be installed (unzipped) everywhere, but when create makefiles using cmake, -you will have a message saying boost is not found, something like: +under Windows, files can be installed (unzipped) everywhere, but when create +makefiles using cmake, you will have a message saying boost is not found, +something like: -- Check for installed Boost -- not found CMake Error at CMakeModules/CheckFindPackageResult.cmake:6 (message): @@ -145,14 +159,17 @@ Boost_INCLUDE_DIR:PATH=Boost_INCLUDE_DIR-NOTFOUND and edit it to set the right path, something like: Boost_INCLUDE_DIR:PATH=f:/boost/boost -(on my computer boost is unzipper in f:\boost, and boost installed files are in f:\boost\boost) +(on my computer boost is unzipper in f:\boost, and boost installed files are +in f:\boost\boost) ----------------------------------------------------------------------------- 8) Install the kicad source tree. + You can use the subversion repository or a tar file for this. See the wiki. + ----------------------------------------------------------------------------- 9) Use cmake to create the kicad makefiles. @@ -187,18 +204,22 @@ notice the leading /build/release make [sudo] make install You are now done unless you want to make a Debug build. + ----------------------------------------------------------------------------- 11) Making a "Debug" build. @@ -206,9 +227,9 @@ You are now done unless you want to make a Debug build. cd /build/debug On either cmake command line shown below, you can optionally include --DCMAKE_INSTALL_PREFIX= before the final ../../ argument. Although -normally you do not install the Debug binaries, you can debug them where they -were built. +-DCMAKE_INSTALL_PREFIX= before the final ../../ argument. +Although normally you do not install the Debug binaries, you can debug them +where they were built. If windows, run the following command: cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON -DwxWidgets_ROOT_DIR= ../../ @@ -219,6 +240,7 @@ If linux, run instead the following command: Make the Debug binaries: make + ----------------------------------------------------------------------------- 12) Variables for fine-tuning the build process. @@ -240,10 +262,8 @@ These should be set from command line: CMAKE_INSTALL_PREFIX (OPTIONAL) - KICAD_MINIZIP ON/OFF - KICAD_PYTHON ON/OFF @@ -253,154 +273,3 @@ Note: that it is easy to build only a specific binary such as pcbnew alone: make pcbnew ----------------------------------------------------------------------------- - -End of CMAKE related building. - - -============= OLD STUFF NOT PERTINENT TO CMAKE ============================== - -unzip sources in a working directory. -This will create the directory "kicad-dev". - -First you must install wxWidgets (see www.wxWidgets.org) -See below for suggested configure command. - -Linux compilation: -You must have: -wxWidgets ( I suggest you install wxWidgets in /usr/local). -(see below for suggested configure command, then make and make install) - -Mesa: pcbnew and cvpcv need openGL or mesa. -(you must install mesa devel if libGL et libGLU are not found). -GTK 2 (install development libraries). - -Because old version of Mesa has problem under a recent linux distrib (mandarke 10.1), -I am using Mesa version 6.2.1, statically compiled, installed in /usr/local -Mesa installation: -Get MesaLib-6.2.1.tar.gz from http://www.mesa3d.org/ -in /usr/local : tar zxvf MesaLib-6.2.1.tar.gz -in /usr/local/Mesa-6.2.1 : -make linux-x86-static -make install ( libGL.a et libGLU.a are copied in /usr/local/lib, and header in /usr/local/include) - -kicad compilation: -in kicad-dev: - Have a look to libs.linux (you can/must edit this file if you have problems) - Currently libs.linux uses wxWidgets 2.8.6 build (see below for suggested configure command) - lines to edit: - STD_INSTALL = 1 - which can be (see comments in libs.linux) - STD_INSTALL = 0 (or 2) - - after libs.linux edition: - run make -f makefile.gtk - -Windows compilation: - -kicad is build with mingw and msys. -Currently libs.win uses wxWidgets 2.8.6 (see below for suggested configure command) - -install mingw and msys ( see mingw.org ) -(opengl libs are included in mingw or windows) - -Under msys: - (Warning: make.exe utility is sometime renamed mingw32-make.exe in install process - of msys.) - -Build wxWidgets (currently version 2.8.6) - See below for suggested configure command, then make - - In include/wx/msw/setup.h, check (and edit if needed) the defines : - #define wxUSE_GLCANVAS 1 - #define wxUSE_MOUSEWHEEL 1 // Include mouse wheel support - #define wxUSE_HOTKEY 0 // Hotkey support (currently Windows only) - - -Exit msys. -Set environment variable WXWIN ( something as wxwin=/d/wxWidgets-2.8.6 -for a wxWidget installed in d:\wxWidgets-2.8.6) - -Have a look to libs.win (Currently this file handle wxWidgets 2.8.6) - -Under msys: - in kicad-dev: - run make -f makefile.g95 - -************************************************************************************* -Building wxWidgets: -************************************************************************************* -linux: - rm *.cache - ./configure --enable-monolithic --enable-unicode=no --enable-shared=no --with-opengl --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --with-regex=builtin - -linux-unicode: - rm *.cache - ./configure --enable-monolithic --enable-unicode=yes --enable-shared=no --with-opengl --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --with-regex=builtin - -osX: - rm *.cache - ./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-opengl --disable-universal --disable-compat24 - -osX-unicode: - rm *.cache - ./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-opengl --enable-universal_binary - -windows: - rm *.cache - ./configure --enable-unicode=no --enable-shared=no --enable-monolithic --with-msw --with-opengl --with-odbc - -windows-unicode: - rm *.cache - ./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-msw --with-opengl - -************************************************************************************* -Patch wxWidgets -************************************************************************************* -************************************************************************************* -wxGTK version: -************************************************************************************* -Patch for printing wide traces that were showing missing rounded end caps: -wxGTK-2.8.6/src/generic/dcpsg.cpp -line 1634 - PsPrint( "%%EndProlog\n" ); - -must be - PsPrint( "%%EndProlog\n" ); - PsPrint("%%BeginSetup\n"); - PsPrint( "1 setlinecap\n" ); - PsPrint("%%EndSetup\n"); - - -patch for Arcs drawings (NOT NEEDED for wxWidgets 2.7.1, needed for versions prior to 2.7.1) -wxGTK-2.x.y/src/gtk/dcclient.cpp -in function WindowDC::DoDrawArc -line 572 for wxWidgets 2.7.0-1: - if (m_pen.GetStyle() != wxTRANSPARENT) - { - gdk_draw_arc( m_window, m_penGC, FALSE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 ); - - gdk_draw_line( m_window, m_penGC, xx1, yy1, xxc, yyc ); - gdk_draw_line( m_window, m_penGC, xxc, yyc, xx2, yy2 ); - } -must be - if (m_pen.GetStyle() != wxTRANSPARENT) - { - gdk_draw_arc( m_window, m_penGC, FALSE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 ); - - if (m_brush.GetStyle() != wxTRANSPARENT) - { - gdk_draw_line( m_window, m_penGC, xx1, yy1, xxc, yyc ); - gdk_draw_line( m_window, m_penGC, xxc, yyc, xx2, yy2 ); - } - } - - -************************************************************************************* -wxMSW version: for wxWMSW 2.8.1 only -************************************************************************************* - -wxMSW.2.8.1/src/msw/menu.cpp -line 410 - if ( !pItem->IsOwnerDrawn() ) -must be - if ( !pItem->IsOwnerDrawn() && !pItem->IsSeparator() ) diff --git a/bitmaps/ercgreen.xpm b/bitmaps/ercgreen.xpm index b75793d08d..f54761fa82 100644 --- a/bitmaps/ercgreen.xpm +++ b/bitmaps/ercgreen.xpm @@ -1,8 +1,8 @@ /* XPM */ #ifndef XPMMAIN -extern const char * green_xpm[]; +extern const char * erc_green_xpm[]; #else -const char *green_xpm[] = { +const char *erc_green_xpm[] = { /* columns rows colors const chars-per-pixel */ "11 11 2 1", "- c Black", diff --git a/common/about_kicad.cpp b/common/about_kicad.cpp index 33e76e0eef..19214195b8 100644 --- a/common/about_kicad.cpp +++ b/common/about_kicad.cpp @@ -13,7 +13,7 @@ wxString g_BuildVersion #ifdef HAVE_SVN_VERSION -#include "config.h" +#include "version.h" ( wxT( KICAD_SVN_VERSION ) ) #else ( BUILD_VERSION ) @@ -22,7 +22,7 @@ wxString g_BuildVersion wxString g_BuildAboutVersion #if defined(HAVE_SVN_VERSION) || defined(HAVE_SVN_REVISION) -# include "config.h" +# include "version.h" ( wxT( KICAD_ABOUT_VERSION ) ) #else ( BUILD_VERSION ) diff --git a/common/base_screen.cpp b/common/base_screen.cpp index 76cd98dff3..4074fc8d3f 100644 --- a/common/base_screen.cpp +++ b/common/base_screen.cpp @@ -376,8 +376,8 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size ) m_Grid = nearest_grid; - wxLogWarning( _( "Grid size( %f, %f ) not in grid list, falling back to " \ - "grid size( %f, %f )." ), + wxLogWarning( wxT( "Grid size( %f, %f ) not in grid list, falling back " ) \ + wxT( "to grid size( %f, %f )." ), size.x, size.y, m_Grid.x, m_Grid.y ); } @@ -399,8 +399,8 @@ void BASE_SCREEN::SetGrid( int id ) m_Grid = m_GridList[0].m_Size; - wxLogWarning( _( "Grid ID %d not in grid list, falling back to " \ - "grid size( %g, %g )." ), id, m_Grid.x, m_Grid.y ); + wxLogWarning( wxT( "Grid ID %d not in grid list, falling back to " ) \ + wxT( "grid size( %g, %g )." ), id, m_Grid.x, m_Grid.y ); } void BASE_SCREEN::AddGrid( const GRID_TYPE& grid ) @@ -418,8 +418,8 @@ void BASE_SCREEN::AddGrid( const GRID_TYPE& grid ) } if( m_GridList[i].m_Id == grid.m_Id ) { - wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " \ - "size( %g, %g )." ), + wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " ) \ + wxT( "size( %g, %g )." ), grid.m_Id, m_GridList[i].m_Size.x, m_GridList[i].m_Size.y, grid.m_Size.x, grid.m_Size.y ); m_GridList[i].m_Size = grid.m_Size; diff --git a/common/basicframe.cpp b/common/basicframe.cpp index cce106b678..6cd129f239 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -34,7 +34,6 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, const wxSize& size, long style ) : wxFrame( father, -1, title, pos, size, style ) -/**********************************************************/ { wxSize minsize; diff --git a/common/common.cpp b/common/common.cpp index 842717decf..38c9435c54 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -323,7 +323,7 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, StringValue << aValue; else { - value_to_print = To_User_Unit( aUnits, aValue, aInternal_Unit ); + value_to_print = To_User_Unit( (bool)aUnits, aValue, aInternal_Unit ); StringValue.Printf( ( aInternal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), value_to_print ); } @@ -366,7 +366,7 @@ int ReturnValueFromString( int Units, const wxString& TextValue, if( Units >= CENTIMETRE ) Value = wxRound( dtmp ); else - Value = From_User_Unit( Units, dtmp, Internal_Unit ); + Value = From_User_Unit( (bool)Units, dtmp, Internal_Unit ); return Value; } diff --git a/common/common_plotPS_functions.cpp b/common/common_plotPS_functions.cpp index aed18dc49a..2414f78115 100644 --- a/common/common_plotPS_functions.cpp +++ b/common/common_plotPS_functions.cpp @@ -331,14 +331,14 @@ void PrintHeaderPS( FILE* file, const wxString& Creator, // the order in which they are specified is not wrong!) if( SheetPS->m_Name.Cmp( wxT( "User" ) ) == 0 ) sprintf( Line, "%%%%DocumentMedia: Custom %d %d 0 () ()\n", - (int) round( SheetPS->m_Size.y * CONV_SCALE ), - (int) round( SheetPS->m_Size.x * CONV_SCALE ) ); + wxRound( SheetPS->m_Size.y * CONV_SCALE ), + wxRound( SheetPS->m_Size.x * CONV_SCALE ) ); else // ( if SheetPS->m_Name does not equal "User" ) sprintf( Line, "%%%%DocumentMedia: %s %d %d 0 () ()\n", - CONV_TO_UTF8( SheetPS->m_Name ), - (int) round( SheetPS->m_Size.y * CONV_SCALE ), - (int) round( SheetPS->m_Size.x * CONV_SCALE ) ); + CONV_TO_UTF8( SheetPS->m_Name ), + wxRound( SheetPS->m_Size.y * CONV_SCALE ), + wxRound( SheetPS->m_Size.x * CONV_SCALE ) ); fputs( Line, g_Plot_PlotOutputFile ); if( PaperOrientation == wxPORTRAIT ) diff --git a/common/confirm.cpp b/common/confirm.cpp index e1063d8daf..d37abca3e5 100644 --- a/common/confirm.cpp +++ b/common/confirm.cpp @@ -4,19 +4,6 @@ /* test demande ESC */ /*************************/ -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -// for all others, include the necessary headers (this file is usually all you -// need because it includes almost all "standard" wxWindows headers -#ifndef WX_PRECOMP -#include -#endif - #include "fctsys.h" #include "common.h" @@ -44,7 +31,7 @@ public: }; BEGIN_EVENT_TABLE( WinEDA_MessageDialog, wxMessageDialog ) -EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut ) + EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut ) END_EVENT_TABLE() /**********************************************************************************/ @@ -80,12 +67,12 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime ) wxMessageDialog* dialog; if( displaytime > 0 ) - dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ), - wxOK | wxICON_INFORMATION, - displaytime ); + dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ), + wxOK | wxICON_INFORMATION, + displaytime ); else - dialog = new WinEDA_MessageDialog( parent, text, _( "Error" ), - wxOK | wxICON_ERROR, 0 ); + dialog = new WinEDA_MessageDialog( parent, text, _( "Error" ), + wxOK | wxICON_ERROR, 0 ); dialog->ShowModal(); dialog->Destroy(); @@ -116,7 +103,8 @@ bool IsOK( wxWindow* parent, const wxString& text ) { int ii; - ii = wxMessageBox( text, _( "Confirmation" ), wxYES_NO | wxCENTRE | wxICON_HAND, parent ); + ii = wxMessageBox( text, _( "Confirmation" ), + wxYES_NO | wxCENTRE | wxICON_HAND, parent ); if( ii == wxYES ) return TRUE; return FALSE; @@ -124,9 +112,9 @@ 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/return buffer +int Get_Message( const wxString& title, // The question + const wxString& frame_caption, // The frame caption + wxString& buffer, // String input/return buffer wxWindow* frame ) /***********************************************************************/ diff --git a/common/drawframe.cpp b/common/drawframe.cpp index 6ee983b3dc..a13d0785dd 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -587,18 +587,18 @@ void WinEDA_DrawFrame::AdjustScrollBars() screen->m_ScrollbarNumber.y, screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y, TRUE ); -#else - BASE_SCREEN* screen = GetBaseScreen(); - wxSize drawingSize = screen->ReturnPageSize() * 2; - wxCoord x, y; - wxClientDC DC( this ); - DrawPanel->PrepareGraphicContext( &DC ); - x = DC.LogicalToDeviceXRel( drawingSize.GetWidth() ); - y = DC.LogicalToDeviceYRel( drawingSize.GetHeight() ); - DrawPanel->SetScrollbars( 1, 1, x, y, - DC.LogicalToDeviceX( screen->m_Curseur.x ), - DC.LogicalToDeviceY( screen->m_Curseur.y ), - true ); +// #else +// BASE_SCREEN* screen = GetBaseScreen(); +// wxSize drawingSize = screen->ReturnPageSize() * 2; +// wxCoord x, y; +// wxClientDC DC( this ); +// DrawPanel->PrepareGraphicContext( &DC ); +// x = DC.LogicalToDeviceXRel( drawingSize.GetWidth() ); +// y = DC.LogicalToDeviceYRel( drawingSize.GetHeight() ); +// DrawPanel->SetScrollbars( 1, 1, x, y, +// DC.LogicalToDeviceX( screen->m_Curseur.x ), +// DC.LogicalToDeviceY( screen->m_Curseur.y ), +// true ); #endif } diff --git a/common/drawpanel.cpp b/common/drawpanel.cpp index 007fd02bcb..4c17aa233e 100644 --- a/common/drawpanel.cpp +++ b/common/drawpanel.cpp @@ -73,8 +73,8 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, ForceCloseManageCurseur = NULL; if( wxGetApp().m_EDA_Config ) - m_AutoPAN_Enable = wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), - true ); + wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), &m_AutoPAN_Enable, + true ); m_AutoPAN_Request = FALSE; m_Block_Enable = FALSE; @@ -197,13 +197,25 @@ void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC ) GRResetPenAndBrush( DC ); DC->SetBackgroundMode( wxTRANSPARENT ); #ifdef WX_ZOOM + int clientWidth, clientHeight; + GetClientSize( &clientWidth, &clientHeight ); + + wxSize drawingSize = GetScreen()->ReturnPageSize() * 2; + double scale = GetScreen()->GetScalingFactor(); - wxPoint origin = GetScreen()->m_DrawOrg; - int ppuX, ppuY, startX, startY; - GetScrollPixelsPerUnit( & ppuX, & ppuY ); - GetViewStart( &startX, &startY ); - DC->SetDeviceOrigin( origin.x - startX * ppuX, origin.y - startY * ppuY ); + int dx = 0, dy = 0; + int drawingWidth = wxRound( (double)drawingSize.GetWidth() * scale ); + int drawingHeight = wxRound( (double)drawingSize.GetHeight() * scale ); + + if( drawingWidth < clientWidth ) + dx = ( clientWidth - drawingWidth ) / 2; + if( drawingHeight < clientHeight ) + dy = ( clientHeight - drawingHeight ) / 2; + + wxCoord x, y; + DC->GetDeviceOrigin( &x, &y ); DC->SetUserScale( scale, scale ); + DC->SetDeviceOrigin( x + dx, y + dy ); // wxSize size = GetScreen()->ReturnPageSize() * 2 * scale; // DC->SetLogicalOrigin( origin.x, origin.y ); #endif @@ -418,8 +430,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse ) CalcUnscrolledPosition( screenPos.x, screenPos.y, &drawingPos.x, &drawingPos.y ); - wxLogDebug( wxT( "MouseTo() initial screen position(%d, %d) " \ - "rectangle(%d, %d, %d, %d) view(%d, %d)" ), + wxLogDebug( wxT( "MouseTo() initial screen position(%d, %d) " ) \ + wxT( "rectangle(%d, %d, %d, %d) view(%d, %d)" ), screenPos.x, screenPos.y, clientRect.x, clientRect.y, clientRect.width, clientRect.height, x, y ); @@ -436,8 +448,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse ) CalcScrolledPosition( drawingPos.x, drawingPos.y, &screenPos.x, &screenPos.y ); - wxLogDebug( wxT( "MouseTo() scrolled screen position(%d, %d) " \ - "view(%d, %d)" ), screenPos.x, screenPos.y, x, y ); + wxLogDebug( wxT( "MouseTo() scrolled screen position(%d, %d) " ) \ + wxT( "view(%d, %d)" ), screenPos.x, screenPos.y, x, y ); } WarpPointer( screenPos.x, screenPos.y ); @@ -936,8 +948,8 @@ void WinEDA_DrawPanel::OnMouseWheel( wxMouseEvent& event ) if( event.GetWheelRotation() == 0 || !GetParent()->IsEnabled() || !rect.Contains( event.GetPosition() ) ) { - wxLogDebug( wxT( "OnMouseWheel() position(%d, %d) " \ - "rectangle(%d, %d, %d, %d)" ), + wxLogDebug( wxT( "OnMouseWheel() position(%d, %d) " ) \ + wxT( "rectangle(%d, %d, %d, %d)" ), event.GetPosition().x, event.GetPosition().y, rect.x, rect.y, rect.width, rect.height ); diff --git a/common/drawtxt.cpp b/common/drawtxt.cpp index b145dae16d..1fba1e5c36 100644 --- a/common/drawtxt.cpp +++ b/common/drawtxt.cpp @@ -80,7 +80,7 @@ static void DrawGraphicTextPline( static int overbar_position( int size_v, int thickness ) { - return size_v * 1.1 + thickness; + return wxRound( (double)size_v * 1.1 + (double)thickness ); } diff --git a/common/eda_dde.cpp b/common/eda_dde.cpp index c0f9e17f85..82d61a6eee 100644 --- a/common/eda_dde.cpp +++ b/common/eda_dde.cpp @@ -3,18 +3,6 @@ // Name: eda_dde.cpp // /////////////////////// -// For compilers that support precompilation, includes "wx/wx.h". -#include - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// for all others, include the necessary headers -#ifndef WX_PRECOMP -#include -#endif - #include "fctsys.h" #include "eda_dde.h" #include "wxstruct.h" diff --git a/common/gestfich.cpp b/common/gestfich.cpp index f80ec8cb57..aff367e2ca 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -10,7 +10,7 @@ #ifdef __WINDOWS__ #ifndef _MSC_VER -#include +//#include #endif #endif diff --git a/common/gr_basic.cpp b/common/gr_basic.cpp index 83d82b62c4..458305e032 100644 --- a/common/gr_basic.cpp +++ b/common/gr_basic.cpp @@ -49,15 +49,15 @@ void ClipAndDrawFilledPoly( EDA_Rect * ClipBox, wxDC * DC, wxPoint Points[], int extern BASE_SCREEN* ActiveScreen; /* Variables locales */ -static int GRLastMoveToX, GRLastMoveToY; -static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0) - * (utile pour trace sur imprimante) */ -static int ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace - * sur imprimante */ -static int xcliplo = 0, - ycliplo = 0, - xcliphi = 2000, - ycliphi = 2000; /* coord de la surface de trace */ +static int GRLastMoveToX, GRLastMoveToY; +static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0) + * (utile pour trace sur imprimante) */ +static bool ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace + * sur imprimante */ +static int xcliplo = 0, + ycliplo = 0, + xcliphi = 2000, + ycliphi = 2000; /* coord de la surface de trace */ static int lastcolor = -1; static int lastwidth = -1; static int s_Last_Pen_Style = -1; @@ -1490,7 +1490,7 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPoints[], in for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit ) { - clippedPolygon.push_back( wxPoint( (int)round( cit->X ), (int)round( cit->Y ) ) ); + clippedPolygon.push_back( wxPoint( wxRound( cit->X ), wxRound( cit->Y ) ) ); } if ( clippedPolygon.size() ) diff --git a/common/hotkeys_basic.cpp b/common/hotkeys_basic.cpp index ecb208a7b4..936d589810 100644 --- a/common/hotkeys_basic.cpp +++ b/common/hotkeys_basic.cpp @@ -96,7 +96,7 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] = { wxT( "*" ), '*' }, { wxT( "+" ), '+' }, { wxT( "-" ), '-' }, - { wxT( "\%" ), '%' }, + { wxT( "%%" ), '%' }, { wxT( "A" ), 'A' }, { wxT( "B" ), 'B' }, { wxT( "C" ), 'C' }, @@ -676,11 +676,11 @@ void AddHotkeyConfigMenu( wxMenu* menu ) wxITEM_CHECK ); submenu_hkcfg->Append( item ); - ADD_MENUITEM_WITH_HELP_AND_SUBMENU( menu, submenu_hkcfg, -1, - _( "Hotkey config location" ), - _( "Hotkey config file location " \ - "selection (home directory or " \ - "kicad tree)" ), right_xpm ); + ADD_MENUITEM_WITH_HELP_AND_SUBMENU( + menu, submenu_hkcfg, -1, + _( "Hotkey config location" ), + _( "Select hotkey config file location (home directory or kicad tree)" ), + right_xpm ); submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, g_ConfigFileLocationChoice == 0 ); submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, diff --git a/common/pcbcommon.cpp b/common/pcbcommon.cpp index 026f38a301..cc5a24036b 100644 --- a/common/pcbcommon.cpp +++ b/common/pcbcommon.cpp @@ -82,8 +82,9 @@ wxString g_Shapes3DExtBuffer( wxT( "wrl" ) ); const wxString ModuleFileExtension( wxT( "mod" ) ); /* PCB file name wild card definitions. */ -const wxString ModuleFileWildcard( _( "Kicad footprint library files " \ - "(*.mod)|*.mod") ); +const wxString ModuleFileWildcard( + _( "Kicad footprint library files (*.mod)|*.mod" ) +); int g_CurrentVersionPCB = 1; diff --git a/common/projet_config.cpp b/common/projet_config.cpp index 272377fcc7..a839aa4ffc 100644 --- a/common/projet_config.cpp +++ b/common/projet_config.cpp @@ -14,16 +14,14 @@ #include #include +#include + #define CONFIG_VERSION 1 #define FORCE_LOCAL_CONFIG true -#include -WX_DEFINE_OBJARRAY( PARAM_CFG_ARRAY ); - - /** * Cree ou recree la configuration locale de kicad (filename.pro) * initialise: @@ -51,8 +49,8 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName, /* Check just in case the file name does not a kicad project extension. */ if( fn.GetExt() != ProjectFileExtension ) { - wxLogDebug( _( "ReCreatePrjConfig() called with project file <%s> " \ - "which does not have the correct file extension." ), + wxLogDebug( wxT( "ReCreatePrjConfig() called with project file <%s> \ +which does not have the correct file extension." ), fn.GetFullPath().c_str() ); fn.SetExt( ProjectFileExtension ); } @@ -94,7 +92,7 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName, return true; else { - delete m_ProjectConfig; // Version incorrecte + delete m_ProjectConfig; // Version incorrect } } @@ -182,12 +180,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName, void WinEDA_App::WriteProjectConfig( const wxString& fileName, const wxString& GroupName, - const PARAM_CFG_ARRAY& params ) + PARAM_CFG_ARRAY& params ) { - PARAM_CFG_BASE* param; - wxString msg; - size_t i; - ReCreatePrjConfig( fileName, GroupName, FORCE_LOCAL_CONFIG ); /* Write date ( surtout pour eviter bug de wxFileConfig @@ -195,11 +189,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName, * (en fait si groupe vide) */ m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR ); - msg = DateAndTime(); - m_ProjectConfig->Write( wxT( "update" ), msg ); - - msg = GetAppName(); - m_ProjectConfig->Write( wxT( "last_client" ), msg ); + m_ProjectConfig->Write( wxT( "update" ), DateAndTime() ); + m_ProjectConfig->Write( wxT( "last_client" ), GetAppName() ); /* Save parameters */ m_ProjectConfig->DeleteGroup( GroupName ); // Erase all datas @@ -209,24 +200,23 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName, m_ProjectConfig->Write( wxT( "version" ), CONFIG_VERSION ); m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR ); - for( i = 0; i < params.GetCount(); i++ ) + BOOST_FOREACH( PARAM_CFG_BASE& param, params ) { - param = ¶ms[i]; - if( param->m_Group ) - m_ProjectConfig->SetPath( param->m_Group ); + if( param.m_Group ) + m_ProjectConfig->SetPath( param.m_Group ); else m_ProjectConfig->SetPath( GroupName ); - if( param->m_Setup ) + if( param.m_Setup ) continue; - if ( param->m_Type == PARAM_COMMAND_ERASE ) // Erase all data + if ( param.m_Type == PARAM_COMMAND_ERASE ) // Erase all data { - if( param->m_Ident ) - m_ProjectConfig->DeleteGroup( param->m_Ident ); + if( param.m_Ident ) + m_ProjectConfig->DeleteGroup( param.m_Ident ); } else - param->SaveParam( m_ProjectConfig ); + param.SaveParam( m_ProjectConfig ); } m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP ); @@ -267,28 +257,23 @@ void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList ) } -void WinEDA_App::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List ) +void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_ARRAY& List ) { - size_t i; - PARAM_CFG_BASE* pt_cfg; - if( m_EDA_Config == NULL ) return; - for( i = 0; i < List.GetCount(); i++ ) + BOOST_FOREACH( PARAM_CFG_BASE& param, List ) { - pt_cfg = &List[i]; - - if( pt_cfg->m_Setup == false ) + if( param.m_Setup == false ) continue; - if ( pt_cfg->m_Type == PARAM_COMMAND_ERASE ) // Erase all data + if ( param.m_Type == PARAM_COMMAND_ERASE ) // Erase all data { - if( pt_cfg->m_Ident ) - m_EDA_Config->DeleteGroup( pt_cfg->m_Ident ); + if( param.m_Ident ) + m_EDA_Config->DeleteGroup( param.m_Ident ); } else - pt_cfg->SaveParam( m_EDA_Config ); + param.SaveParam( m_EDA_Config ); } } @@ -298,7 +283,7 @@ void WinEDA_App::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List ) * Parameters are parameters that have the .m_Setup member set to false * read file is the .pro file project * - * if Load_Only_if_New == true, this file is read only if it diders from + * if Load_Only_if_New == true, this file is read only if it differs from * the current config (different dates ) * * @return true if read. @@ -358,13 +343,11 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, } -bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, - const wxString& GroupName, - const PARAM_CFG_ARRAY& params, - bool Load_Only_if_New ) +bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, + const wxString& GroupName, + PARAM_CFG_ARRAY& params, + bool Load_Only_if_New ) { - size_t i; - PARAM_CFG_BASE* param; wxString timestamp; ReCreatePrjConfig( local_config_filename, GroupName, false ); @@ -390,19 +373,17 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename m_CurrentOptionFile = g_Prj_Config_LocalFilename; } - for( i = 0; i < params.GetCount(); i++ ) + BOOST_FOREACH( PARAM_CFG_BASE& param, params ) { - param = ¶ms[i]; - - if( param->m_Group ) - m_ProjectConfig->SetPath( param->m_Group ); + if( param.m_Group ) + m_ProjectConfig->SetPath( param.m_Group ); else m_ProjectConfig->SetPath( GroupName ); - if( param->m_Setup ) + if( param.m_Setup ) continue; - param->ReadParam( m_ProjectConfig ); + param.ReadParam( m_ProjectConfig ); } delete m_ProjectConfig; @@ -435,19 +416,14 @@ void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList ) } -void WinEDA_App::ReadCurrentSetupValues( const PARAM_CFG_ARRAY& List ) +void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_ARRAY& List ) { - size_t i; - PARAM_CFG_BASE* pt_cfg; - - for( i = 0; i < List.GetCount(); i++ ) + BOOST_FOREACH( PARAM_CFG_BASE& param, List ) { - pt_cfg = &List[i]; - - if( pt_cfg->m_Setup == false ) + if( param.m_Setup == false ) continue; - pt_cfg->ReadParam( m_EDA_Config ); + param.ReadParam( m_EDA_Config ); } } diff --git a/common/pyhandler.cpp b/common/pyhandler.cpp index 4bc211c67b..b9384c2729 100644 --- a/common/pyhandler.cpp +++ b/common/pyhandler.cpp @@ -1,25 +1,13 @@ -#include "wx/wxprec.h" +#include "fctsys.h" +#include "common.h" + #include -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -// for all others, include the necessary headers (this file is usually all you -// need because it includes almost all "standard" wxWindows headers -#ifndef WX_PRECOMP -#include -#endif - #include -#include #include #include -#include "fctsys.h" -#include "common.h" - using namespace boost::python; diff --git a/common/string.cpp b/common/string.cpp index 5ecf9a147e..eeff718c20 100644 --- a/common/string.cpp +++ b/common/string.cpp @@ -4,7 +4,6 @@ /*********************************************/ #include "fctsys.h" -#include #include "macros.h" #include "kicad_string.h" diff --git a/common/trigo.cpp b/common/trigo.cpp index d0b6efb7ab..a3509743ea 100644 --- a/common/trigo.cpp +++ b/common/trigo.cpp @@ -399,7 +399,7 @@ void RotatePoint( double* pX, double* pY, int angle ) } -float fsinus[3600] = +double fsinus[3600] = { 0.0000000000, 0.0017453284, 0.0034906514, 0.0052359638, 0.0069812603, 0.0087265355, 0.0104717841, 0.0122170008, 0.0139621803, @@ -1124,7 +1124,7 @@ float fsinus[3600] = -0.0017453284 }; -float fcosinus[3600] = +double fcosinus[3600] = { 1.0000000000, 0.9999984769, 0.9999939077, 0.9999862922, 0.9999756307, 0.9999619231, 0.9999451694, 0.9999253697, 0.9999025240, diff --git a/common/zoom.cpp b/common/zoom.cpp index 9ef22dde7f..764d835b92 100644 --- a/common/zoom.cpp +++ b/common/zoom.cpp @@ -107,8 +107,8 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event ) { if( DrawPanel == NULL ) { - wxLogDebug( wxT( "No DrawPanel object defined in " \ - "WinEDA_DrawFrame::OnZoom()." ) ); + wxLogDebug( wxT( "%s, %d: DrawPanel object is undefined ." ), + __TFILE__, __LINE__ ); return; } @@ -165,15 +165,10 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event ) default: i = id - ID_POPUP_ZOOM_LEVEL_START; - if( i < 0 ) + if( ( i < 0 ) || ( (size_t) i >= screen->m_ZoomList.GetCount() ) ) { - wxLogDebug( wxT( "WinEDA_DrawFram::OnZoom() invalid ID %d" ), id ); - return; - } - if( !( (size_t) i < screen->m_ZoomList.GetCount()) ) - { - wxLogDebug( _T( "Requested index %d is outside the bounds of " \ - "the zoom list." ), i ); + wxLogDebug( _T( "%s %d: index %d is outside the bounds of the zoom list." ), + __TFILE__, __LINE__, i ); return; } if( screen->SetZoom( screen->m_ZoomList[i] ) ) @@ -254,7 +249,8 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) { tmp = GetScreen()->m_GridList[i]; gridValue = To_User_Unit( g_UnitMetric, tmp.m_Size.x, - ( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits ); + m_Parent->m_InternalUnits ); + if( tmp.m_Id == ID_POPUP_GRID_USER ) { msg = _( "User Grid" ); diff --git a/cvpcb/autosel.cpp b/cvpcb/autosel.cpp index c4c6b880e7..0e731cadf8 100644 --- a/cvpcb/autosel.cpp +++ b/cvpcb/autosel.cpp @@ -90,8 +90,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event ) if( !tmp ) { - msg.Printf( _( "Footprint alias library file <%s> could not be " \ - "found in the default search paths." ), + msg.Printf( _( "Footprint alias library file <%s> could not be \ +found in the default search paths." ), fn.GetFullName().c_str() ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); continue; @@ -166,8 +166,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event ) if( component.m_Module.IsEmpty() ) { - msg.Printf( _( "Component %s: footprint %s not found in " \ - "any of the project footprint libraries." ), + msg.Printf( _( "Component %s: footprint %s not found in \ +any of the project footprint libraries." ), component.m_Reference.c_str(), alias.m_FootprintName.c_str() ); wxMessageBox( msg, _( "CVPcb Error" ), wxOK | wxICON_ERROR, diff --git a/cvpcb/cfg.cpp b/cvpcb/cfg.cpp index fafee38897..bc3e2a7d60 100644 --- a/cvpcb/cfg.cpp +++ b/cvpcb/cfg.cpp @@ -28,24 +28,24 @@ * to define local variables. The old method of statically building the array * at compile time requiring global variable definitions. */ -const PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void ) +PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void ) { - if( !m_projectFileParams.IsEmpty() ) + if( !m_projectFileParams.empty() ) return m_projectFileParams; - m_projectFileParams.Add( new PARAM_CFG_BASE( GROUPLIB, - PARAM_COMMAND_ERASE ) ); - m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), - &m_ModuleLibNames, - GROUPLIB ) ); - m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ), - &m_AliasLibNames, - GROUPEQU ) ); - m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ), - &m_NetlistFileExtension ) ); - m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ), - &m_UserLibraryPath, - GROUPLIB ) ); + m_projectFileParams.push_back( new PARAM_CFG_BASE( GROUPLIB, + PARAM_COMMAND_ERASE ) ); + m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), + &m_ModuleLibNames, + GROUPLIB ) ); + m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ), + &m_AliasLibNames, + GROUPEQU ) ); + m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ), + &m_NetlistFileExtension ) ); + m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ), + &m_UserLibraryPath, + GROUPLIB ) ); return m_projectFileParams; } diff --git a/cvpcb/class_cvpcb.cpp b/cvpcb/class_cvpcb.cpp index 0679168add..6c526a8c68 100644 --- a/cvpcb/class_cvpcb.cpp +++ b/cvpcb/class_cvpcb.cpp @@ -7,8 +7,6 @@ #include "cvpcb.h" -#include - PIN::PIN() { diff --git a/cvpcb/cvframe.cpp b/cvpcb/cvframe.cpp index 4fcbe02ad0..f2bdc53db7 100644 --- a/cvpcb/cvframe.cpp +++ b/cvpcb/cvframe.cpp @@ -261,8 +261,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) { unsigned ii; wxMessageDialog dialog( this, - _( "Net and component list modified.\nSave " \ - "before exit ?" ), + _( "Net and component list modified.\nSave before exit ?" ), _( "Confirmation" ), wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT ); diff --git a/cvpcb/cvpcb.cpp b/cvpcb/cvpcb.cpp index 5203e57e23..c171f6dd4f 100644 --- a/cvpcb/cvpcb.cpp +++ b/cvpcb/cvpcb.cpp @@ -25,10 +25,8 @@ const wxString RetroFileExtension( wxT( "stf" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) ); // Wildcard for schematic retroannotation (import footprint names in schematic): -const wxString RetroFileWildcard( _( "Kicad retroannotation files " \ - "(*.stf)|*.stf" ) ); -const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files " \ - "(*.equ)|*.equ" ) ); +const wxString RetroFileWildcard( _( "Kicad retroannotation files (*.stf)|*.stf" ) ); +const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files (*.equ)|*.equ" ) ); const wxString titleLibLoadError( _( "Library Load Error" ) ); diff --git a/cvpcb/cvstruct.h b/cvpcb/cvstruct.h index f8180209a5..5cc7e89645 100644 --- a/cvpcb/cvstruct.h +++ b/cvpcb/cvstruct.h @@ -16,7 +16,6 @@ class FootprintListBox; class ListBoxCmp; class WinEDA_DisplayFrame; -#define LIST_BOX_TYPE wxListView /******************************************************/ /* classe derivee pour la Fenetre principale de cvpcb */ @@ -98,7 +97,7 @@ public: virtual void LoadSettings(); virtual void SaveSettings(); - const PARAM_CFG_ARRAY& GetProjectFileParameters( void ); + PARAM_CFG_ARRAY& GetProjectFileParameters( void ); DECLARE_EVENT_TABLE() }; @@ -107,11 +106,8 @@ public: /***********************************************/ /* ListBox derivee pour l'affichage des listes */ /***********************************************/ -class ListBoxBase : public LIST_BOX_TYPE +class ListBoxBase : public wxListView { -public: - WinEDA_CvpcbFrame* m_Parent; - public: ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id, @@ -121,6 +117,9 @@ public: int GetSelection(); void OnSize( wxSizeEvent& event ); + + virtual WinEDA_CvpcbFrame* GetParent(); + }; /************************************************************/ @@ -205,7 +204,6 @@ public: ~WinEDA_DisplayFrame(); void OnCloseWindow( wxCloseEvent& Event ); - void Process_Special_Functions( wxCommandEvent& event ); void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void ReCreateHToolbar(); void ReCreateVToolbar(); diff --git a/cvpcb/dialog_display_options.cpp b/cvpcb/dialog_display_options.cpp index 858e0c4424..ad61992405 100644 --- a/cvpcb/dialog_display_options.cpp +++ b/cvpcb/dialog_display_options.cpp @@ -37,7 +37,8 @@ void WinEDA_DisplayFrame::InstallOptionsDisplay(wxCommandEvent& event) /*********************************************************************/ /* Creation de la fenetre d'options de la fenetre de visu */ { - WinEDA_FootprintDisplayOptionsFrame * OptionWindow = new WinEDA_FootprintDisplayOptionsFrame(this); + WinEDA_FootprintDisplayOptionsFrame* OptionWindow = + new WinEDA_FootprintDisplayOptionsFrame(this); OptionWindow->ShowModal(); OptionWindow->Destroy(); } @@ -179,7 +180,7 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls() // Set validators m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) ); m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) ); - m_IsShowPadFill->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadFill) ); + m_IsShowPadFill->SetValidator( wxGenericValidator( & DisplayOpt.DisplayPadFill) ); m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) ); ////@end WinEDA_FootprintDisplayOptionsFrame content construction diff --git a/cvpcb/displayframe.cpp b/cvpcb/displayframe.cpp index a2c62c6370..0a90f64db6 100644 --- a/cvpcb/displayframe.cpp +++ b/cvpcb/displayframe.cpp @@ -51,11 +51,11 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father, m_FrameName = wxT( "CmpFrame" ); // Give an icon - #ifdef __WINDOWS__ +#ifdef __WINDOWS__ SetIcon( wxICON( a_icon_cvpcb ) ); - #else +#else SetIcon( wxICON( icon_cvpcb ) ); - #endif +#endif SetTitle( title ); SetBoard( new BOARD( NULL, this ) ); @@ -292,30 +292,6 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) } -/*************************************************************************/ -void WinEDA_DisplayFrame::Process_Special_Functions( wxCommandEvent& event ) -/*************************************************************************/ - -/* Called when a tool is selected, or when a popup menu is clicked - * Currently : no action exists - */ -{ - int id = event.GetId(); - - wxClientDC dc( DrawPanel ); - - DrawPanel->PrepareGraphicContext( &dc ); - - switch( id ) - { - default: - wxMessageBox( wxT( "WinEDA_DisplayFrame::Process_Special_Functions error" ) ); - break; - } - - SetToolbars(); -} - /** * Display 3D frame of current footprint selection. */ diff --git a/cvpcb/init.cpp b/cvpcb/init.cpp index 0f8d871617..28f6c010e8 100644 --- a/cvpcb/init.cpp +++ b/cvpcb/init.cpp @@ -84,8 +84,7 @@ bool WinEDA_CvpcbFrame::ReadNetList() if( error_level < 0 ) { - msg.Printf( _( "File <%s> does not appear to be a valid Kicad " \ - "net list file." ), + msg.Printf( _( "File <%s> does not appear to be a valid Kicad net list file." ), m_NetlistFileName.GetFullPath().c_str() ); ::wxMessageBox( msg, _( "File Error" ), wxOK | wxICON_ERROR, this ); return false; diff --git a/cvpcb/listboxes.cpp b/cvpcb/listboxes.cpp index 72106d4d6f..c586e62d4a 100644 --- a/cvpcb/listboxes.cpp +++ b/cvpcb/listboxes.cpp @@ -19,11 +19,10 @@ ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, wxWindowID id, const wxPoint& loc, const wxSize& size ) : - LIST_BOX_TYPE( parent, id, loc, size, - wxSUNKEN_BORDER | wxLC_NO_HEADER | - wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL ) + wxListView( parent, id, loc, size, + wxSUNKEN_BORDER | wxLC_NO_HEADER | + wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL ) { - m_Parent = parent; InsertColumn( 0, wxEmptyString ); SetColumnWidth( 0, wxLIST_AUTOSIZE ); } @@ -57,6 +56,12 @@ int ListBoxBase::GetSelection() } +WinEDA_CvpcbFrame* ListBoxBase::GetParent() +{ + return (WinEDA_CvpcbFrame*) wxListView::GetParent(); +} + + /***************************************/ /* ListBox handling the footprint list */ /***************************************/ @@ -67,6 +72,7 @@ FootprintListBox::FootprintListBox( WinEDA_CvpcbFrame* parent, int nbitems, wxString choice[] ) : ListBoxBase( parent, id, loc, size ) { + m_UseFootprintFullList = true; m_ActiveFootprintList = NULL; SetActiveFootprintList( TRUE ); } @@ -106,7 +112,8 @@ wxString FootprintListBox::GetSelectedFootprint() if( ii >= 0 ) { wxString msg = (*m_ActiveFootprintList)[ii]; - msg.Trim( TRUE ); msg.Trim( FALSE ); + msg.Trim( TRUE ); + msg.Trim( FALSE ); FootprintName = msg.AfterFirst( wxChar( ' ' ) ); } @@ -172,7 +179,7 @@ ListBoxCmp::~ListBoxCmp() /* Build the events table for the schematic components list box */ -BEGIN_EVENT_TABLE( ListBoxCmp, LIST_BOX_TYPE ) +BEGIN_EVENT_TABLE( ListBoxCmp, ListBoxBase ) EVT_SIZE( ListBoxBase::OnSize ) END_EVENT_TABLE() @@ -418,8 +425,8 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) ) { - m_Parent->SetStatusText( wxEmptyString, 0 ); - m_Parent->SetStatusText( wxEmptyString, 1 ); + GetParent()->SetStatusText( wxEmptyString, 0 ); + GetParent()->SetStatusText( wxEmptyString, 1 ); } wxString msg; @@ -429,7 +436,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) else msg.Printf( _( "Footprints (filtered): %d" ), m_ActiveFootprintList->GetCount() ); - m_Parent->SetStatusText( msg, 2 ); + GetParent()->SetStatusText( msg, 2 ); } @@ -437,7 +444,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) /* Event table for the footprint list */ /**************************************/ -BEGIN_EVENT_TABLE( FootprintListBox, LIST_BOX_TYPE ) +BEGIN_EVENT_TABLE( FootprintListBox, ListBoxBase ) EVT_SIZE( ListBoxBase::OnSize ) END_EVENT_TABLE() @@ -449,21 +456,21 @@ void FootprintListBox::OnLeftClick( wxListEvent& event ) FOOTPRINT* Module; wxString FootprintName = GetSelectedFootprint(); - Module = GetModuleDescrByName( FootprintName, m_Parent->m_footprints ); - if( m_Parent->DrawFrame ) + Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints ); + if( GetParent()->DrawFrame ) { - m_Parent->CreateScreenCmp(); /* refresh general */ + GetParent()->CreateScreenCmp(); /* refresh general */ } if( Module ) { wxString msg; msg = Module->m_Doc; - m_Parent->SetStatusText( msg, 0 ); + GetParent()->SetStatusText( msg, 0 ); msg = wxT( "KeyW: " ); msg += Module->m_KeyWord; - m_Parent->SetStatusText( msg, 1 ); + GetParent()->SetStatusText( msg, 1 ); } } @@ -474,7 +481,7 @@ void FootprintListBox::OnLeftDClick( wxListEvent& event ) { wxString FootprintName = GetSelectedFootprint(); - m_Parent->SetNewPkg( FootprintName ); + GetParent()->SetNewPkg( FootprintName ); } diff --git a/cvpcb/listlib.cpp b/cvpcb/listlib.cpp index f34040111b..f565d76e6a 100644 --- a/cvpcb/listlib.cpp +++ b/cvpcb/listlib.cpp @@ -19,6 +19,7 @@ #include "cvpcb.h" #include "protos.h" + /* routines locales : */ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list ); @@ -53,9 +54,8 @@ bool LoadFootprintFiles( const wxArrayString& libNames, if( libNames.GetCount() == 0 ) { - wxMessageBox( _( "No PCB foot print libraries are listed in the " \ - "current project file." ), _( "Project File Error" ), - wxOK | wxICON_ERROR ); + wxMessageBox( _( "No PCB foot print libraries are listed in the current project file." ), + _( "Project File Error" ), wxOK | wxICON_ERROR ); return false; } @@ -70,8 +70,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames, if( !tmp ) { - msg.Printf( _( "PCB foot print library file <%s> could not be " \ - "found in the default search paths." ), + msg.Printf( _( "PCB foot print library file <%s> could not be found in the default search paths." ), fn.GetFullName().c_str() ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); continue; @@ -124,8 +123,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames, if( !end ) { - msg.Printf( _( "Unexpected end of file occurred while " \ - "parsing PCB foot print library <%s>." ), + msg.Printf( _( "Unexpected end of file occurred while parsing PCB foot print library <%s>." ), tmp.c_str() ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); } @@ -159,8 +157,8 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list ) if( ( LibDoc = wxFopen( fn.GetFullPath(), wxT( "rt" ) ) ) == NULL ) { - msg.Printf( _( "Could not open PCB foot print library document " \ - "file <%s>." ), fn.GetFullPath().c_str() ); + msg.Printf( _( "Could not open PCB foot print library document file <%s>." ), + fn.GetFullPath().c_str() ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); return; } @@ -168,8 +166,8 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list ) GetLine( LibDoc, Line, NULL, sizeof(Line) - 1 ); if( strnicmp( Line, ENTETE_LIBDOC, L_ENTETE_LIB ) != 0 ) { - msg.Printf( _( "<%s> is not a valid PCB foot print library " \ - "document file." ), fn.GetFullPath().c_str() ); + msg.Printf( _( "<%s> is not a valid PCB foot print library document file." ), + fn.GetFullPath().c_str() ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); return; } diff --git a/cvpcb/loadcmp.cpp b/cvpcb/loadcmp.cpp index 549f2d411a..ba72975aee 100644 --- a/cvpcb/loadcmp.cpp +++ b/cvpcb/loadcmp.cpp @@ -47,8 +47,7 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName ) if( !tmp ) { - msg.Printf( _( "PCB foot print library file <%s> could not be " \ - "found in the default search paths." ), + msg.Printf( _( "PCB foot print library file <%s> could not be found in the default search paths." ), fn.GetFullName().c_str() ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR, this ); continue; diff --git a/cvpcb/menucfg.cpp b/cvpcb/menucfg.cpp index e32a3de5ff..43f0b396cc 100644 --- a/cvpcb/menucfg.cpp +++ b/cvpcb/menucfg.cpp @@ -24,11 +24,12 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar() */ { wxMenuItem* item; - wxMenuBar* menuBar = GetMenuBar(); + wxMenuBar* menuBar; + /* Destroy the existing menu bar so it can be rebuilt. This allows * language changes of the menu text on the fly. */ - if( menuBar ) - SetMenuBar( NULL ); +// if( menuBar ) +// SetMenuBar( NULL ); menuBar = new wxMenuBar(); @@ -66,8 +67,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar() item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, _( "Keep Open On Save" ), - _( "Prevent CVPcb from exiting after saving " \ - "netlist file" ), + _( "Prevent CVPcb from exiting after saving netlist file" ), wxITEM_CHECK ); configmenu->Append( item ); configmenu->AppendSeparator(); diff --git a/cvpcb/readschematicnetlist.cpp b/cvpcb/readschematicnetlist.cpp index f3addc2655..82866b3945 100644 --- a/cvpcb/readschematicnetlist.cpp +++ b/cvpcb/readschematicnetlist.cpp @@ -135,7 +135,8 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() wxString msg, Lineconv = CONV_FROM_UTF8( Line ); msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() ); DisplayError( this, msg ); - fclose( source ); return -3; + fclose( source ); + return -3; } SetStatusText( _( "Netlist Format: EESchema" ), 0 ); diff --git a/cvpcb/savecmp.cpp b/cvpcb/savecmp.cpp index 24e0af3a78..2966b98e02 100644 --- a/cvpcb/savecmp.cpp +++ b/cvpcb/savecmp.cpp @@ -93,8 +93,8 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list ) /* Identification du Type de fichier CmpMod */ if( fgets( Line, 79, source ) == 0 ) { - msg.Printf( _( " <%s> does not appear to be a valid Kicad component " \ - "library." ), fn.GetFullPath().c_str() ); + msg.Printf( _( " <%s> does not appear to be a valid Kicad component library." ), + fn.GetFullPath().c_str() ); wxMessageBox( msg, titleComponentLibErr, wxOK | wxICON_ERROR ); fclose( source ); return false; diff --git a/cvpcb/tool_cvpcb.cpp b/cvpcb/tool_cvpcb.cpp index ec77a70ddd..9657886571 100644 --- a/cvpcb/tool_cvpcb.cpp +++ b/cvpcb/tool_cvpcb.cpp @@ -26,28 +26,35 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); SetToolBar( m_HToolBar ); - m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString, wxBitmap( open_xpm ), + m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString, + wxBitmap( open_xpm ), _( "Open a NetList file" ) ); - m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString, wxBitmap( save_xpm ), + m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString, + wxBitmap( save_xpm ), _( "Save NetList and Footprints List files" ) ); m_HToolBar->AddSeparator(); - m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString, wxBitmap( config_xpm ), + m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString, + wxBitmap( config_xpm ), _( "Configuration" ) ); m_HToolBar->AddSeparator(); - m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString, wxBitmap( module_xpm ), + m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString, + wxBitmap( module_xpm ), _( "View selected footprint" ) ); - m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString, wxBitmap( auto_associe_xpm ), + m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString, + wxBitmap( auto_associe_xpm ), _( "Automatic Association" ) ); m_HToolBar->AddSeparator(); - m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString, wxBitmap( left_xpm ), + m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString, + wxBitmap( left_xpm ), _( "Select previous free component" ) ); - m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString, wxBitmap( right_xpm ), + m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString, + wxBitmap( right_xpm ), _( "Select next free component" ) ); m_HToolBar->AddSeparator(); @@ -58,7 +65,8 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() m_HToolBar->AddSeparator(); m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString, wxBitmap( save_cmpstuff_xpm ), - _( "Create export file (component/footprint list, used by eeschema to fill the footprint field of components)" ) ); + _( "Create export file (component/footprint list, \ +used by eeschema to fill the footprint field of components)" ) ); m_HToolBar->AddSeparator(); m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString, @@ -89,4 +97,3 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() // the changes m_HToolBar->Realize(); } - diff --git a/eeschema/annotate_dialog.cpp b/eeschema/annotate_dialog.cpp index 569a1e1d67..05739bac36 100644 --- a/eeschema/annotate_dialog.cpp +++ b/eeschema/annotate_dialog.cpp @@ -248,8 +248,7 @@ void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event ) else message += _( "on the current sheet?" ); - message += _( "\n\nThis operation will change the current annotation and " \ - "cannot be undone." ); + message += _( "\n\nThis operation will change the current annotation and cannot be undone." ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) @@ -274,8 +273,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event ) else message += _( "the current sheet?" ); - message += _( "\n\nThis operation will clear the existing annotation " \ - "and cannot be undone." ); + message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) diff --git a/eeschema/block.cpp b/eeschema/block.cpp index aac7705c5c..1dd4a5170b 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -121,8 +121,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) { wxString msg; err = TRUE; - msg.Printf( wxT( "HandleBlockPLace() : m_BlockDrawStruct = " \ - "NULL (cmd %d, state %d)" ), + msg.Printf( wxT( "HandleBlockPLace() : m_BlockDrawStruct = NULL (cmd %d, state %d)" ), block->m_Command, block->m_State ); DisplayError( this, msg ); } @@ -202,11 +201,12 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) if( block->m_BlockDrawStruct ) { DisplayError( this, - wxT( "HandleBlockPLace() error: DrawStruct != Null" ) ); + wxT( "HandleBlockPLace() error: DrawStruct != Null" ) ); block->m_BlockDrawStruct = NULL; } - SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString ); + SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, + wxEmptyString ); } diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index e0ed1ec61f..800f900787 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -508,8 +508,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line, break; default: - errorMsg.Printf( wxT( "Undefined DRAW command in line %d\n" \ - "%s, aborted." ), *lineNum, line ); + errorMsg.Printf( wxT( "Undefined DRAW command in line %d\n%s, aborted." ), + *lineNum, line ); m_Drawings = headEntry; return false; } @@ -526,8 +526,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line, { if( GetLine( f, line, lineNum, 1024 ) == NULL ) { - errorMsg = wxT( "File ended prematurely while attempting" \ - "to flush to end of drawing section." ); + errorMsg = wxT( "File ended prematurely while attempting \ +to flush to end of drawing section." ); return false; } } while( strncmp( line, "ENDDRAW", 7 ) != 0 ); diff --git a/eeschema/class_pin.cpp b/eeschema/class_pin.cpp index 8679c8283b..e9694717b9 100644 --- a/eeschema/class_pin.cpp +++ b/eeschema/class_pin.cpp @@ -130,8 +130,7 @@ bool LibDrawPin::Load( char* line, wxString& errorMsg ) if( i < 11 ) { - errorMsg.Printf( wxT( "pin only had %d parameters of the " \ - "required 11 or 12" ), i ); + errorMsg.Printf( wxT( "pin only had %d parameters of the required 11 or 12" ), i ); return false; } diff --git a/eeschema/class_text-label.cpp b/eeschema/class_text-label.cpp index ecd2a07e82..1fd3b67b21 100644 --- a/eeschema/class_text-label.cpp +++ b/eeschema/class_text-label.cpp @@ -864,7 +864,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector & aCorner_list, c // Create outline shape : 6 points int x = symb_len + width + 3; - int y = HalfSize * 1.5 + width + 3; // 50% more for negation bar + int y = wxRound( (double)HalfSize * 1.5 + (double)width + 3.0 ); // 50% more for negation bar aCorner_list.push_back( wxPoint( 0, 0 ) ); // Starting point (anchor) aCorner_list.push_back( wxPoint( 0, -y ) ); // Up aCorner_list.push_back( wxPoint( -x, -y ) ); // left Up diff --git a/eeschema/classes_body_items.cpp b/eeschema/classes_body_items.cpp index a1736e1ab4..5a84f95db3 100644 --- a/eeschema/classes_body_items.cpp +++ b/eeschema/classes_body_items.cpp @@ -129,8 +129,8 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg ) &m_Width, tmp, &startx, &starty, &endx, &endy ); if( cnt < 8 ) { - errorMsg.Printf( wxT( "arc only had %d parameters of the " \ - "required 8" ), cnt ); + errorMsg.Printf( _( "arc only had %d parameters of the required 8" ), + cnt ); return false; } @@ -268,8 +268,8 @@ EDA_Rect LibDrawArc::GetBoundingBox() if( ( normStart == nullPoint ) || ( normEnd == nullPoint ) || ( m_Rayon == 0 ) ) { - wxLogDebug( wxT(" Invalid arc drawing definition, center(%d, %d) " \ - "start(%d, %d), end(%d, %d), radius %d" ), + wxLogDebug( wxT("Invalid arc drawing definition, center(%d, %d) \ +start(%d, %d), end(%d, %d), radius %d" ), m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x, m_ArcEnd.y, m_Rayon ); return rect; @@ -362,8 +362,8 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg ) &m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp ); if( cnt < 6 ) { - errorMsg.Printf( wxT( "circle only had %d parameters of the " \ - "required 6" ), cnt ); + errorMsg.Printf( _( "circle only had %d parameters of the required 6" ), + cnt ); return false; } @@ -501,8 +501,8 @@ bool LibDrawText::Load( char* line, wxString& errorMsg ) if( cnt < 8 ) { - errorMsg.Printf( wxT( "text only had %d parameters of the " \ - "required 8" ), cnt ); + errorMsg.Printf( _( "text only had %d parameters of the required 8" ), + cnt ); return false; } @@ -609,8 +609,8 @@ bool LibDrawSquare::Load( char* line, wxString& errorMsg ) if( cnt < 7 ) { - errorMsg.Printf( wxT( "rectangle only had %d parameters of the " \ - "required 7" ), cnt ); + errorMsg.Printf( _( "rectangle only had %d parameters of the required 7" ), + cnt ); return false; } @@ -814,13 +814,12 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg ) if( i < 4 ) { - errorMsg.Printf( wxT( "polyline only had %d parameters of the " \ - "required 4" ), i ); + errorMsg.Printf( _( "polyline only had %d parameters of the required 4" ), i ); return false; } if ( ccount <= 0 ) { - errorMsg.Printf( wxT( "polyline count parameter %d is invalid" ), + errorMsg.Printf( _( "polyline count parameter %d is invalid" ), ccount ); return false; } @@ -836,14 +835,14 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg ) p = strtok( NULL, " \t\n" ); if( sscanf( p, "%d", &pt.x ) != 1 ) { - errorMsg.Printf( wxT( "polyline point %d X position not defined" ), + errorMsg.Printf( _( "polyline point %d X position not defined" ), i ); return false; } p = strtok( NULL, " \t\n" ); if( sscanf( p, "%d", &pt.y ) != 1 ) { - errorMsg.Printf( wxT( "polyline point %d Y position not defined" ), + errorMsg.Printf( _( "polyline point %d Y position not defined" ), i ); return false; } diff --git a/eeschema/component_class.h b/eeschema/component_class.h index b4862c50ad..f2e70ba22d 100644 --- a/eeschema/component_class.h +++ b/eeschema/component_class.h @@ -6,7 +6,6 @@ #define COMPONENT_CLASS_H -#include "base_struct.h" #include "class_sch_screen.h" #include #include diff --git a/eeschema/dialog_edit_component_in_schematic.cpp b/eeschema/dialog_edit_component_in_schematic.cpp index 2598b506d4..dddb8059d8 100644 --- a/eeschema/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialog_edit_component_in_schematic.cpp @@ -1,5 +1,4 @@ -#include #include #include diff --git a/eeschema/dialog_erc.cpp b/eeschema/dialog_erc.cpp index dee7182d43..f1c7758e22 100644 --- a/eeschema/dialog_erc.cpp +++ b/eeschema/dialog_erc.cpp @@ -15,17 +15,6 @@ #pragma implementation "dialog_erc.h" #endif -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - ////@begin includes ////@end includes #include "fctsys.h" diff --git a/eeschema/edit_component_in_schematic.cpp b/eeschema/edit_component_in_schematic.cpp index e5341ec535..344191d489 100644 --- a/eeschema/edit_component_in_schematic.cpp +++ b/eeschema/edit_component_in_schematic.cpp @@ -12,8 +12,6 @@ #include "libcmp.h" #include "general.h" -#include "wx/checklst.h" - #include "protos.h" diff --git a/eeschema/eeconfig.cpp b/eeschema/eeconfig.cpp index ab5794608c..f466bb0a47 100644 --- a/eeschema/eeconfig.cpp +++ b/eeschema/eeconfig.cpp @@ -102,8 +102,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event ) break; default: - DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config " \ - "internal error" ) ); + DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config internal error" ) ); } } @@ -135,89 +134,90 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame* frame, bool verbose ) * to define local variables. The old method of statically building the array * at compile time requiring global variable definitions. */ -const PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetProjectFileParameters( void ) +PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetProjectFileParameters( void ) { - if( !m_projectFileParams.IsEmpty() ) + if( !m_projectFileParams.empty() ) return m_projectFileParams; - m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ), - &m_UserLibraryPath ) ); - m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), - &m_ComponentLibFiles, - GROUPLIB ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "NetFmt" ), - &m_NetlistFormat, - NET_TYPE_PCBNEW, - NET_TYPE_PCBNEW, - NET_TYPE_CUSTOM_MAX ) ); + m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ), + &m_UserLibraryPath ) ); + m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), + &m_ComponentLibFiles, + GROUPLIB ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "NetFmt" ), + &m_NetlistFormat, + NET_TYPE_PCBNEW, + NET_TYPE_PCBNEW, + NET_TYPE_CUSTOM_MAX ) ); /* NOTE: Left as global until supporting code can be fixed. */ - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "HPGLSpd" ), - &g_HPGL_Pen_Descr.m_Pen_Speed, - 20, 2, 45 ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "HPGLDm" ), - &g_HPGL_Pen_Descr.m_Pen_Diam, - 15, 1, 150 ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "HPGLNum" ), - &g_HPGL_Pen_Descr.m_Pen_Num, - 1, 1, 8 ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A4" ), - &g_Sheet_A4.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A4" ), - &g_Sheet_A4.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A3" ), - &g_Sheet_A3.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A3" ), - &g_Sheet_A3.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A2" ), - &g_Sheet_A2.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A2" ), - &g_Sheet_A2.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A1" ), - &g_Sheet_A1.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A1" ), - &g_Sheet_A1.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A0" ), - &g_Sheet_A0.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A0" ), - &g_Sheet_A0.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A" ), - &g_Sheet_A.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A" ), - &g_Sheet_A.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_B" ), - &g_Sheet_B.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_B" ), - &g_Sheet_B.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_C" ), - &g_Sheet_C.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_C" ), - &g_Sheet_C.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_D" ), - &g_Sheet_D.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_D" ), - &g_Sheet_D.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_E" ), - &g_Sheet_E.m_Offset.x ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_E" ), - &g_Sheet_E.m_Offset.y ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "RptD_X" ), - &g_RepeatStep.x, - 0, -1000, +1000 ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "RptD_Y" ), - &g_RepeatStep.y, - 100, -1000, +1000 ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "RptLab" ), - &g_RepeatDeltaLabel, - 1, -10, +10 ) ); - m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "SimCmd" ), - &g_SimulatorCommandLine ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "UseNetN" ), - &g_OptNetListUseNames, - 0, 0, 1 ) ); - m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "LabSize" ), - &g_DefaultTextLabelSize, - DEFAULT_SIZE_TEXT, 0, 1000 ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLSpd" ), + &g_HPGL_Pen_Descr.m_Pen_Speed, + 20, 2, 45 ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLDm" ), + &g_HPGL_Pen_Descr.m_Pen_Diam, + 15, 1, 150 ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLNum" ), + &g_HPGL_Pen_Descr.m_Pen_Num, + 1, 1, 8 ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A4" ), + &g_Sheet_A4.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A4" ), + &g_Sheet_A4.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A3" ), + &g_Sheet_A3.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A3" ), + &g_Sheet_A3.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A2" ), + &g_Sheet_A2.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A2" ), + &g_Sheet_A2.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A1" ), + &g_Sheet_A1.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A1" ), + &g_Sheet_A1.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A0" ), + &g_Sheet_A0.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A0" ), + &g_Sheet_A0.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A" ), + &g_Sheet_A.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A" ), + &g_Sheet_A.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_B" ), + &g_Sheet_B.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_B" ), + &g_Sheet_B.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_C" ), + &g_Sheet_C.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_C" ), + &g_Sheet_C.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_D" ), + &g_Sheet_D.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_D" ), + &g_Sheet_D.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_E" ), + &g_Sheet_E.m_Offset.x ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_E" ), + &g_Sheet_E.m_Offset.y ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptD_X" ), + &g_RepeatStep.x, + 0, -1000, +1000 ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptD_Y" ), + &g_RepeatStep.y, + 100, -1000, +1000 ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptLab" ), + &g_RepeatDeltaLabel, + 1, -10, +10 ) ); + m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "SimCmd" ), + &g_SimulatorCommandLine ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "UseNetN" ), + &g_OptNetListUseNames, + 0, 0, 1 ) ); + m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ), + &g_DefaultTextLabelSize, + DEFAULT_SIZE_TEXT, 0, + 1000 ) ); return m_projectFileParams; } @@ -320,92 +320,92 @@ static const wxString HorzVertLinesOnlyEntry( wxT( "HorizVertLinesOnly" ) ); * global variables or move them to the object class where they are * used. */ -const PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetConfigurationSettings( void ) +PARAM_CFG_ARRAY& WinEDA_SchematicFrame::GetConfigurationSettings( void ) { - if( !m_configSettings.IsEmpty() ) + if( !m_configSettings.empty() ) return m_configSettings; - m_configSettings.Add( new PARAM_CFG_INT( true, wxT( "Unite" ), - &g_UnitMetric, 0, 0, 1 ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ), - &g_LayerDescr.LayerColor[LAYER_WIRE], - GREEN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBus" ), - &g_LayerDescr.LayerColor[LAYER_BUS], - BLUE ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorConn" ), - &g_LayerDescr.LayerColor[LAYER_JUNCTION], - GREEN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorLlab" ), - &g_LayerDescr.LayerColor[LAYER_LOCLABEL], - BLACK ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorHlab" ), - &g_LayerDescr.LayerColor[LAYER_HIERLABEL], - BROWN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGbllab" ), - &g_LayerDescr.LayerColor[LAYER_GLOBLABEL], - RED ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPinF" ), - &g_LayerDescr.LayerColor[LAYER_PINFUN], - MAGENTA ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColPinN" ), - &g_LayerDescr.LayerColor[LAYER_PINNUM], - RED ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPNam" ), - &g_LayerDescr.LayerColor[LAYER_PINNAM], - CYAN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorField" ), - &g_LayerDescr.LayerColor[LAYER_FIELDS], - MAGENTA ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorRef" ), - &g_LayerDescr.LayerColor[LAYER_REFERENCEPART], - CYAN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorValue" ), - &g_LayerDescr.LayerColor[LAYER_VALUEPART], - CYAN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNote" ), - &g_LayerDescr.LayerColor[LAYER_NOTES], - LIGHTBLUE ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBody" ), - &g_LayerDescr.LayerColor[LAYER_DEVICE], - RED ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBodyBg" ), - &g_LayerDescr.LayerColor[LAYER_DEVICE_BACKGROUND], - LIGHTYELLOW ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNetN" ), - &g_LayerDescr.LayerColor[LAYER_NETNAM], - DARKGRAY ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPin" ), - &g_LayerDescr.LayerColor[LAYER_PIN], - RED ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheet" ), - &g_LayerDescr.LayerColor[LAYER_SHEET], - MAGENTA ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, - wxT( "ColorSheetFileName" ), - &g_LayerDescr.LayerColor[LAYER_SHEETFILENAME], - BROWN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetName" ), - &g_LayerDescr.LayerColor[LAYER_SHEETNAME], - CYAN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetLab" ), - &g_LayerDescr.LayerColor[LAYER_SHEETLABEL], - BROWN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNoCo" ), - &g_LayerDescr.LayerColor[LAYER_NOCONNECT], - BLUE ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcW" ), - &g_LayerDescr.LayerColor[LAYER_ERC_WARN], - GREEN ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcE" ), - &g_LayerDescr.LayerColor[LAYER_ERC_ERR], - RED ) ); - m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGrid" ), - &g_GridColor, - DARKDARKGRAY ) ); - m_configSettings.Add( new PARAM_CFG_INT( true, wxT( "Pltmarg" ), - &g_PlotMargin, - 300, 0, 10000 ) ); + m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Unite" ), + &g_UnitMetric, 0, 0, 1 ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ), + &g_LayerDescr.LayerColor[LAYER_WIRE], + GREEN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBus" ), + &g_LayerDescr.LayerColor[LAYER_BUS], + BLUE ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorConn" ), + &g_LayerDescr.LayerColor[LAYER_JUNCTION], + GREEN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorLlab" ), + &g_LayerDescr.LayerColor[LAYER_LOCLABEL], + BLACK ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorHlab" ), + &g_LayerDescr.LayerColor[LAYER_HIERLABEL], + BROWN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGbllab" ), + &g_LayerDescr.LayerColor[LAYER_GLOBLABEL], + RED ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPinF" ), + &g_LayerDescr.LayerColor[LAYER_PINFUN], + MAGENTA ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColPinN" ), + &g_LayerDescr.LayerColor[LAYER_PINNUM], + RED ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPNam" ), + &g_LayerDescr.LayerColor[LAYER_PINNAM], + CYAN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorField" ), + &g_LayerDescr.LayerColor[LAYER_FIELDS], + MAGENTA ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorRef" ), + &g_LayerDescr.LayerColor[LAYER_REFERENCEPART], + CYAN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorValue" ), + &g_LayerDescr.LayerColor[LAYER_VALUEPART], + CYAN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNote" ), + &g_LayerDescr.LayerColor[LAYER_NOTES], + LIGHTBLUE ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBody" ), + &g_LayerDescr.LayerColor[LAYER_DEVICE], + RED ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBodyBg" ), + &g_LayerDescr.LayerColor[LAYER_DEVICE_BACKGROUND], + LIGHTYELLOW ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNetN" ), + &g_LayerDescr.LayerColor[LAYER_NETNAM], + DARKGRAY ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPin" ), + &g_LayerDescr.LayerColor[LAYER_PIN], + RED ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheet" ), + &g_LayerDescr.LayerColor[LAYER_SHEET], + MAGENTA ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, + wxT( "ColorSheetFileName" ), + &g_LayerDescr.LayerColor[LAYER_SHEETFILENAME], + BROWN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetName" ), + &g_LayerDescr.LayerColor[LAYER_SHEETNAME], + CYAN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetLab" ), + &g_LayerDescr.LayerColor[LAYER_SHEETLABEL], + BROWN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNoCo" ), + &g_LayerDescr.LayerColor[LAYER_NOCONNECT], + BLUE ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcW" ), + &g_LayerDescr.LayerColor[LAYER_ERC_WARN], + GREEN ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcE" ), + &g_LayerDescr.LayerColor[LAYER_ERC_ERR], + RED ) ); + m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGrid" ), + &g_GridColor, + DARKDARKGRAY ) ); + m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Pltmarg" ), + &g_PlotMargin, + 300, 0, 10000 ) ); return m_configSettings; } diff --git a/eeschema/eelibs_read_libraryfiles.cpp b/eeschema/eelibs_read_libraryfiles.cpp index e63b709554..3994db2169 100644 --- a/eeschema/eelibs_read_libraryfiles.cpp +++ b/eeschema/eelibs_read_libraryfiles.cpp @@ -539,12 +539,10 @@ EDA_LibComponentStruct* Read_Component_Definition( WinEDA_DrawFrame* frame, if( !Res ) { /* Something went wrong there. */ if( errorMsg.IsEmpty() ) - Msg.Printf( wxT( "Error at line %d of library \n\"%s\",\n" \ - "library not loaded" ), + Msg.Printf( wxT( "Error at line %d of library \n\"%s\",\nlibrary not loaded" ), *LineNum, currentLibraryName.GetData() ); else - Msg.Printf( wxT( "Error <%s> at line %d of library \n\"%s\"," \ - "\nlibrary not loaded" ), + Msg.Printf( wxT( "Error <%s> at line %d of library \n\"%s\",\nlibrary not loaded" ), errorMsg.c_str(), *LineNum, currentLibraryName.GetData() ); DisplayError( frame, Msg ); @@ -621,18 +619,17 @@ static LibEDA_BaseStruct* GetDrawEntry (WinEDA_DrawFrame* frame, FILE* f, break; default: - MsgLine.Printf( wxT( "Undefined DRAW command in line %d\n" \ - "%s, aborted." ), *LineNum, Line ); + MsgLine.Printf( wxT( "Undefined DRAW command in line %d\n%s, aborted." ), + *LineNum, Line ); DisplayError( frame, MsgLine ); return Head; } if( !entryLoaded ) { - MsgLine.Printf( wxT( "> in DRAW command %c in line %d" ), Line[0], - *LineNum ); - MsgLine = wxT( "Error <" ) + errorMsg + MsgLine + - wxT( ", aborted." ); + MsgLine.Printf( wxT( "Error <%s %s> in DRAW command %c in line %d, aborted." ), + errorMsg.c_str(), MsgLine.c_str(), + Line[0], *LineNum ); DisplayError( frame, MsgLine ); SAFE_DELETE( New ); diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 6940d62e4c..82f2a3dce2 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -81,8 +81,7 @@ wxString g_SymbolExtBuffer( wxT( "sym" ) ); const wxString CompLibFileExtension( wxT( "lib" ) ); -const wxString CompLibFileWildcard( wxT( "Kicad component library file " \ - "(*.lib)|*.lib" ) ); +const wxString CompLibFileWildcard( wxT( "Kicad component library file (*.lib)|*.lib" ) ); wxString g_SimulatorCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..) wxString g_NetListerCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..) diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index 2b09c0f0a4..610ddc26d3 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -12,9 +12,6 @@ #include "libcmp.h" #include "general.h" -//#include "protos.h" - -#include "wx/image.h" #include "wx/imaglist.h" #include "wx/treectrl.h" diff --git a/eeschema/lib_export.cpp b/eeschema/lib_export.cpp index 0d5090fae2..0c17066c58 100644 --- a/eeschema/lib_export.cpp +++ b/eeschema/lib_export.cpp @@ -144,9 +144,9 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) if( createLib && success ) { msg = fn.GetFullPath() + _( " - OK" ); - DisplayInfoMessage( this, _( "Note: this new library will be available " \ - "only if it is loaded by eeschema.\nModify " - "eeschema config if you want use it." ) ); + DisplayInfoMessage( this, + _( "Note: this new library will be available only \ +if it is loaded by eeschema.\nModify eeschema config if you want use it." ) ); } else msg = _( "Error creating " ) + fn.GetFullName(); diff --git a/eeschema/load_one_schematic_file.cpp b/eeschema/load_one_schematic_file.cpp index 3d998ff404..a4f6a13726 100644 --- a/eeschema/load_one_schematic_file.cpp +++ b/eeschema/load_one_schematic_file.cpp @@ -19,9 +19,9 @@ extern int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, int* aLineNum, BASE_SCREEN* Window ); -extern int ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, - wxString& aMsgDiag, int* aLineNum, - BASE_SCREEN* Window ); +extern bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, + wxString& aMsgDiag, int* aLineNum, + BASE_SCREEN* Window ); extern int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, int* aLineNum, @@ -90,9 +90,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, int ver = version - '0'; if( ver > EESCHEMA_VERSION ) { - MsgDiag = FullFileName + _( " was created by a more recent " \ - "version of EESchema and may not load " \ - "correctly. Please consider updating!" ); + MsgDiag = FullFileName + _( " was created by a more recent \ +version of EESchema and may not load correctly. Please consider updating!" ); DisplayInfoMessage( this, MsgDiag ); } @@ -100,10 +99,10 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, // Compile it if the new version is unreadable by previous eeschema versions else if( ver < EESCHEMA_VERSION ) { - MsgDiag = FullFileName + _( " was created by an older version of " \ - "EESchema. It will be stored in the new " \ - "file format when you save this file " \ - "again." ); + MsgDiag = FullFileName + _( " was created by an older version of \ +EESchema. It will be stored in the new file format when you save this file \ +again." ); + DisplayInfoMessage( this, MsgDiag ); } #endif @@ -173,8 +172,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, case 'W': /* Its a Segment (WIRE or BUS) item. */ if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 ) { - MsgDiag.Printf( wxT( "EESchema file Segment struct error " \ - "at line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file Segment struct error at line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; break; @@ -193,8 +192,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, &SegmentStruct->m_Start.y, &SegmentStruct->m_End.x, &SegmentStruct->m_End.y ) != 4 ) { - MsgDiag.Printf( wxT( "EESchema file Segment struct error " \ - "at line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file Segment struct error at line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; SAFE_DELETE( SegmentStruct ); @@ -212,8 +211,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, case 'E': /* Its a Raccord (WIRE or BUS) item. */ if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 ) { - MsgDiag.Printf( wxT( "EESchema file record struct error at " \ - "line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file record struct error at line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; break; @@ -230,8 +229,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, &RaccordStruct->m_Pos.y, &RaccordStruct->m_Size.x, &RaccordStruct->m_Size.y ) != 4 ) { - MsgDiag.Printf( wxT( "EESchema file Bus Entry struct error " \ - "at line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file Bus Entry struct error at line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; SAFE_DELETE( RaccordStruct ); @@ -250,8 +249,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, case 'P': /* Its a polyline item. */ if( sscanf( SLine, "%s %s %d", Name1, Name2, &ii ) != 3 ) { - MsgDiag.Printf( wxT( "EESchema file polyline struct error " \ - "at line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file polyline struct error at line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; break; @@ -270,8 +269,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, if( fgets( Line, 256 - 1, f ) == NULL || sscanf( Line, "%d %d", &point.x, &point.y ) != 2 ) { - MsgDiag.Printf( wxT( "EESchema file polyline struct " \ - "error at line %d, aborted" ), + MsgDiag.Printf( wxT( "EESchema file polyline struct error \ +at line %d, aborted" ), LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; @@ -295,8 +294,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, if( sscanf( SLine, "%s %d %d", Name1, &ConnectionStruct->m_Pos.x, &ConnectionStruct->m_Pos.y ) != 3 ) { - MsgDiag.Printf( wxT( "EESchema file connection struct error " \ - "at line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file connection struct error \ + at line %d, aborted" ), LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; SAFE_DELETE( ConnectionStruct ); @@ -311,8 +310,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, case 'N': /* It is a NoConnect item. */ if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 ) { - MsgDiag.Printf( wxT( "EESchema file NoConnect struct error " \ - "at line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file NoConnect struct error at line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; } @@ -327,8 +326,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, case 'K': /* It is a Marker item. */ if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 ) { - MsgDiag.Printf( wxT( "EESchema file marker struct error " \ - "line %d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file marker struct error line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); Failed = true; } @@ -372,8 +371,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, default: Failed = true; - MsgDiag.Printf( wxT( "EESchema file undefined object at line " \ - "%d, aborted" ), LineCount ); + MsgDiag.Printf( wxT( "EESchema file undefined object at line %d, aborted" ), + LineCount ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); break; } diff --git a/eeschema/locate.cpp b/eeschema/locate.cpp index 32ff5710e7..ad90f4345d 100644 --- a/eeschema/locate.cpp +++ b/eeschema/locate.cpp @@ -733,7 +733,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen, break; dx = aRefPoint.x - Circle->m_Pos.x; dy = aRefPoint.y + Circle->m_Pos.y; - int dist = (int) sqrt( dx * dx + dy * dy ); + int dist = (int) sqrt( (double)( dx * dx + dy * dy ) ); if( abs( dist - Circle->m_Rayon ) <= seuil ) return DrawItem; } diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index cf89debd2a..c0643418c6 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -40,21 +40,6 @@ static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction, WinEDA_SchematicFrame* frame ); -/***********************************************************************/ -void WinEDA_SchematicFrame::ToolOnRightClick( wxCommandEvent& event ) -/***********************************************************************/ -{ - int id = event.GetId(); - - switch( id ) - { - default: - DisplayError( this, wxT( "ToolOnRightClick() error" ) ); - break; - } -} - - /*****************************************************************/ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) @@ -66,7 +51,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, */ { SCH_ITEM* DrawStruct = (SCH_ITEM*) GetScreen()->GetCurItem(); - bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE); + bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE); DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index 481a22899e..04f59151cc 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -774,8 +774,9 @@ static void CreateImagePins( LibDrawPin* Pin ) * creation d'une pin */ { - int ii, CreateConv = false; + int ii; LibDrawPin* NewPin; + bool CreateConv = false; if( g_EditPinByPinIsOn ) return; diff --git a/eeschema/plothpgl.cpp b/eeschema/plothpgl.cpp index 02843c7e55..0090570889 100644 --- a/eeschema/plothpgl.cpp +++ b/eeschema/plothpgl.cpp @@ -681,7 +681,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FullFileName, #undef STRUCT #define STRUCT ( (DrawJunctionStruct*) DrawList ) x1 = STRUCT->m_Pos.x; y1 = STRUCT->m_Pos.y; - PlotCercle( wxPoint( x1, y1 ), true, DRAWJUNCTION_SIZE * 2 ); + PlotCercle( wxPoint( x1, y1 ), DRAWJUNCTION_SIZE * 2, true ); break; case TYPE_SCH_TEXT: diff --git a/eeschema/plotps.cpp b/eeschema/plotps.cpp index 052595d6bd..8a229bfa6d 100644 --- a/eeschema/plotps.cpp +++ b/eeschema/plotps.cpp @@ -16,16 +16,6 @@ #pragma implementation "plotps.h" #endif -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif #include "fctsys.h" #include "gr_basic.h" @@ -37,8 +27,6 @@ #include "plot_common.h" #include "protos.h" -#include "wx/defs.h" - // coeff de conversion dim en 1 mil -> dim en unite PS: const double SCALE_PS = 0.001; diff --git a/eeschema/plugins/makefile.gtk b/eeschema/plugins/makefile.gtk deleted file mode 100644 index 612be5f675..0000000000 --- a/eeschema/plugins/makefile.gtk +++ /dev/null @@ -1,23 +0,0 @@ -# File: makefile for eeschema, mingw - -#used only to define (KICAD_PLUGINS) : -include ../../libs.linux - -all: netlist_form_pads-pcb - -deps: - $(CXX) $(CPPFLAGS) -E -MMD -MG *.cpp >/dev/null - --include *.d - -netlist_form_pads-pcb: netlist_form_pads-pcb.cpp makefile.gtk - g++ -D__UNIX__ -Wall netlist_form_pads-pcb.cpp -o netlist_form_pads-pcb - -install: netlist_form_pads-pcb - mkdir -p $(KICAD_PLUGINS) - cp netlist_form_pads-pcb $(KICAD_PLUGINS) - -clean : - rm -f netlist_form_pads-pcb - rm -f *.o *.rsc *.res *.exe *.bak *.d - diff --git a/eeschema/plugins/makefile.mingw b/eeschema/plugins/makefile.mingw deleted file mode 100644 index c04b94f9dd..0000000000 --- a/eeschema/plugins/makefile.mingw +++ /dev/null @@ -1,19 +0,0 @@ -# File: makefile for eeschema, mingw - -#used only to define (KICAD_BIN) : -include ../../libs.win - - -all: netlist_form_pads-pcb.exe - -netlist_form_pads-pcb.exe: netlist_form_pads-pcb.cpp - gcc -Wall netlist_form_pads-pcb.cpp -o netlist_form_pads-pcb.exe - -install: - cp -v *.exe $(KICAD_BIN)/plugins/ - -clean : - -$(RM) *.o - -$(RM) *.exe - -$(RM) *.bak - diff --git a/eeschema/plugins/netlist_form_pads-pcb.cpp b/eeschema/plugins/netlist_form_pads-pcb.cpp index 98e44458b8..c38db645a1 100644 --- a/eeschema/plugins/netlist_form_pads-pcb.cpp +++ b/eeschema/plugins/netlist_form_pads-pcb.cpp @@ -4,17 +4,18 @@ /* read the generic netlist created by eeschema and convert it to a pads-pcb form */ +#include "config.h" + #include #include #include -#include -#include -#ifdef __UNIX__ -#define stricmp strcasecmp -#define strnicmp strncasecmp +#if defined( HAVE_STRINGS_H ) +#include #endif +#include + /* Pads-pcb sample: *PADS-PCB* *PART* diff --git a/eeschema/read_from_file_schematic_items_descriptions.cpp b/eeschema/read_from_file_schematic_items_descriptions.cpp index 04861e9d61..f4cf602fad 100644 --- a/eeschema/read_from_file_schematic_items_descriptions.cpp +++ b/eeschema/read_from_file_schematic_items_descriptions.cpp @@ -132,20 +132,23 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, } else { - wxString val= CONV_FROM_UTF8( text ); - for (;;) - { - int i=val.find(wxT("\\n")); - if (i==wxNOT_FOUND) - break; + wxString val = CONV_FROM_UTF8( text ); + + for( ;; ) + { + int i=val.find( wxT( "\\n" ) ); + + if( i == wxNOT_FOUND ) + break; + val.erase( i, 2 ); + val.insert( i, wxT( "\n" ) ); + } - val.erase(i,2); - val.insert(i,wxT("\n")); - } SCH_TEXT* TextStruct = new SCH_TEXT( pos, val ); TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->SetSchematicTextOrientation( orient ); + if( isdigit( Name3[0] ) ) { thickness = atol( Name3 ); @@ -265,8 +268,9 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, { if( sscanf( ptcar, "%d", &size ) != 1 ) { - aMsgDiag.Printf( wxT( "EESchema file sheet Label Caract " \ - "error line %d, aborted\n" ), *aLineNum ); + aMsgDiag.Printf( wxT( "EESchema file sheet Label Caract \ +error line %d, aborted\n" ), + *aLineNum ); aMsgDiag << CONV_FROM_UTF8( Line ); DisplayError( frame, aMsgDiag ); } @@ -304,8 +308,9 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, &SheetLabelStruct->m_Pos.x, &SheetLabelStruct->m_Pos.y, &size ) != 5 ) { - aMsgDiag.Printf( wxT( "EESchema file Sheet Label Caract " \ - "error line %d, aborted\n" ), *aLineNum ); + aMsgDiag.Printf( wxT( "EESchema file Sheet Label Caract \ +error line %d, aborted\n" ), + *aLineNum ); aMsgDiag << CONV_FROM_UTF8( Line ); DisplayError( frame, aMsgDiag ); continue; @@ -341,8 +346,8 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, if( strnicmp( "$End", Line, 4 ) != 0 ) { - aMsgDiag.Printf( wxT( "**EESchema file end_sheet struct error at " \ - "line %d, aborted\n" ), *aLineNum ); + aMsgDiag.Printf( wxT( "**EESchema file end_sheet struct error at line %d, aborted\n" ), + *aLineNum ); aMsgDiag << CONV_FROM_UTF8( Line ); Failed = TRUE; } @@ -394,8 +399,8 @@ bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, if( SheetFormatList[ii] == NULL ) { /* Erreur ici: descr non trouvee */ - aMsgDiag.Printf( wxT( "EESchema file Dims Caract error line %d, " \ - "aborted\n" ), *aLineNum ); + aMsgDiag.Printf( wxT( "EESchema file Dims Caract error line %d, \aborted\n" ), + *aLineNum ); aMsgDiag << CONV_FROM_UTF8( Line ); DisplayError( frame, aMsgDiag ); } diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index a446ccd680..7a8d67fc4a 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -102,11 +102,6 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) ID_SCHEMATIC_VERTICAL_TOOLBAR_END, WinEDA_SchematicFrame::Process_Special_Functions ) - EVT_TOOL_RCLICKED( ID_LABEL_BUTT, WinEDA_SchematicFrame::ToolOnRightClick ) - EVT_TOOL_RCLICKED( ID_GLABEL_BUTT, WinEDA_SchematicFrame::ToolOnRightClick ) - EVT_TOOL_RCLICKED( ID_HIERLABEL_BUTT, - WinEDA_SchematicFrame::ToolOnRightClick ) - EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE, WinEDA_SchematicFrame::Process_Special_Functions ) diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index ea3154a1fd..3d69703d2c 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -266,10 +266,8 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event ) if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() ) || ( m_CurrentSheet->m_AssociatedScreen == NULL) ) { - msg = _( "Changing a Filename can change all the schematic " \ - "structures and cannot be undone." ); - msg << wxT( "\n" ); - msg << _( "Ok to continue renaming?" ); + msg = _( "Changing a Filename can change all the schematic \ + structures and cannot be undone.\nOk to continue renaming?" ); if( m_CurrentSheet->m_AssociatedScreen == NULL || IsOK( NULL, msg ) ) { //do not prompt on a new sheet. in fact, we should not allow a sheet to be created diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 3826f49359..aee52d968b 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -17,28 +17,28 @@ /* class WinEDA_ViewlibFrame */ /*****************************/ BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame ) -/* Window events */ -EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow ) -EVT_SIZE( WinEDA_ViewlibFrame::OnSize ) -EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate ) + /* Window events */ + EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow ) + EVT_SIZE( WinEDA_ViewlibFrame::OnSize ) + EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate ) -/* Sash drag events */ -EVT_SASH_DRAGGED( ID_LIBVIEW_LIBWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) -EVT_SASH_DRAGGED( ID_LIBVIEW_CMPWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) + /* Sash drag events */ + EVT_SASH_DRAGGED( ID_LIBVIEW_LIBWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) + EVT_SASH_DRAGGED( ID_LIBVIEW_CMPWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) -/* Toolbar events */ -EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL, - WinEDA_ViewlibFrame::Process_Special_Functions ) -EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom ) -EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, - WinEDA_ViewlibFrame::ExportToSchematicLibraryPart ) -EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER, - WinEDA_ViewlibFrame::Process_Special_Functions ) + /* Toolbar events */ + EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL, + WinEDA_ViewlibFrame::Process_Special_Functions ) + EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom ) + EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, + WinEDA_ViewlibFrame::ExportToSchematicLibraryPart ) + EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER, + WinEDA_ViewlibFrame::Process_Special_Functions ) -/* listbox events */ -EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList ) -EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList ) + /* listbox events */ + EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList ) + EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList ) END_EVENT_TABLE() @@ -58,13 +58,13 @@ static wxAcceleratorEntry accels[] = #define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) ) #define EXTRA_BORDER_SIZE 2 -/******************************************************************************/ + + WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, LibraryStruct* Library, wxSemaphore* semaphore ) : WinEDA_DrawFrame( father, VIEWER_FRAME, _( "Library browser" ), wxDefaultPosition, wxDefaultSize ) -/******************************************************************************/ { wxAcceleratorTable table( ACCEL_TABLE_CNT, accels ); @@ -101,16 +101,18 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, { // Creates the libraries window display m_LibListWindow = - new wxSashLayoutWindow( this, ID_LIBVIEW_LIBWINDOW, win_pos, m_LibListSize, - wxCLIP_CHILDREN | wxSW_3D, wxT( - "LibWindow" ) ); + new wxSashLayoutWindow( this, ID_LIBVIEW_LIBWINDOW, win_pos, + m_LibListSize, wxCLIP_CHILDREN | wxSW_3D, + wxT( "LibWindow" ) ); m_LibListWindow->SetOrientation( wxLAYOUT_VERTICAL ); m_LibListWindow->SetAlignment( wxLAYOUT_LEFT ); m_LibListWindow->SetSashVisible( wxSASH_RIGHT, TRUE ); m_LibListWindow->SetExtraBorderSize( EXTRA_BORDER_SIZE ); - m_LibList = new wxListBox( m_LibListWindow, ID_LIBVIEW_LIB_LIST, wxPoint( 0, 0 ), - m_LibListWindow->GetClientSize() - wxSize(EXTRA_BORDER_SIZE*2,0), - 0, NULL, wxLB_HSCROLL ); + m_LibList = + new wxListBox( m_LibListWindow, ID_LIBVIEW_LIB_LIST, + wxPoint( 0, 0 ), + m_LibListWindow->GetClientSize() - wxSize(EXTRA_BORDER_SIZE*2,0), + 0, NULL, wxLB_HSCROLL ); } else { @@ -123,8 +125,9 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, win_pos.x = m_LibListSize.x; win_pos.y = 0; m_CmpListWindow = new wxSashLayoutWindow( this, ID_LIBVIEW_CMPWINDOW, - win_pos, m_CmpListSize, - wxCLIP_CHILDREN | wxSW_3D, wxT( "CmpWindow" ) ); + win_pos, m_CmpListSize, + wxCLIP_CHILDREN | wxSW_3D, + wxT( "CmpWindow" ) ); m_CmpListWindow->SetOrientation( wxLAYOUT_VERTICAL ); // m_CmpListWindow->SetAlignment( wxLAYOUT_LEFT ); @@ -467,4 +470,3 @@ void WinEDA_ViewlibFrame::SaveSettings() cfg->Write( LIBLIST_WIDTH_KEY, m_LibListSize.x ); cfg->Write( CMPLIST_WIDTH_KEY, m_CmpListSize.x ); } - diff --git a/gerbview/edit.cpp b/gerbview/edit.cpp index ecee8145dc..5caba41d44 100644 --- a/gerbview/edit.cpp +++ b/gerbview/edit.cpp @@ -13,9 +13,6 @@ #include "pcbplot.h" #include "protos.h" -static void Process_Move_Item( WinEDA_GerberFrame* frame, - EDA_BaseStruct* DrawStruct, wxDC* DC ); - /************************************************************************/ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) /************************************************************************/ @@ -31,15 +28,10 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { if( DrawStruct && DrawStruct->m_Flags ) // Commande "POPUP" en cours { - switch( DrawStruct->Type() ) - { - default: - msg.Printf( - wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ), - (unsigned) DrawStruct->Type(), - (unsigned) DrawStruct->m_Flags ); - DisplayError( this, msg ); - } + msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ), + (unsigned) DrawStruct->Type(), + (unsigned) DrawStruct->m_Flags ); + DisplayError( this, msg ); } else { @@ -221,11 +213,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) ); break; - case ID_POPUP_SCH_MOVE_ITEM_REQUEST: - DrawPanel->MouseToCursorSchema(); - Process_Move_Item( this, GetScreen()->GetCurItem(), &dc ); - break; - case ID_TOOLBARH_PCB_SELECT_LAYER: ((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice(); DrawPanel->Refresh( TRUE ); @@ -308,29 +295,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) } -/****************************************************************/ -static void Process_Move_Item( WinEDA_GerberFrame* frame, - EDA_BaseStruct* DrawStruct, wxDC* DC ) -/****************************************************************/ -{ - if( DrawStruct == NULL ) - return; - - frame->DrawPanel->MouseToCursorSchema(); - - switch( DrawStruct->Type() ) - { - default: - wxString msg; - msg.Printf( - wxT( "WinEDA_LibeditFrame::Move_Item Error: Bad DrawType %d" ), - DrawStruct->Type() ); - DisplayError( frame, msg ); - break; - } -} - - /**************************************************************************/ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) /**************************************************************************/ @@ -355,16 +319,6 @@ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) DrawStruct = GerberGeneralLocateAndDisplay(); } - if( (DrawStruct == NULL) || (DrawStruct->m_Flags != 0) ) - break; - - // Element localis� - switch( DrawStruct->Type() ) - { - default: - break; - } - break; // end case 0 case ID_BUS_BUTT: diff --git a/gerbview/files.cpp b/gerbview/files.cpp index 035ee0c212..37a1eb0aa2 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -130,8 +130,8 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName, if( !fn.IsOk() ) { - wildcard.Printf( _( "Gerber files (.%s .gbr .gbx .lgr .ger .pho)|" \ - "*.%s;*.gbr;*.gbx;*.lgr;*.ger;*.pho|" ), + wildcard.Printf( _( "Gerber files (.%s .gbr .gbx .lgr .ger .pho)| \ +*.%s;*.gbr;*.gbx;*.lgr;*.ger;*.pho|" ), g_PenFilenameExt.c_str(), g_PenFilenameExt.c_str()); wildcard += AllFilesWildcard; diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index b3f541adb5..ed52d94884 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -105,7 +105,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) // Annulation de commande en cours EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, - WinEDA_PcbFrame::Process_Special_Functions ) + WinEDA_GerberFrame::Process_Special_Functions ) // Pop up menu EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, @@ -133,16 +133,15 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, m_Draw_Axis = true; // true to show X and Y axis on screen m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin� - m_Ident = GERBER_FRAME; if( DrawPanel ) DrawPanel->m_Block_Enable = TRUE; // Give an icon - #ifdef __WINDOWS__ +#ifdef __WINDOWS__ SetIcon( wxICON( a_icon_gerbview ) ); - #else +#else SetIcon( wxICON( icon_gerbview ) ); - #endif +#endif SetBaseScreen( ScreenPcb ); ActiveScreen = ScreenPcb; diff --git a/gerbview/gerbview_config.cpp b/gerbview/gerbview_config.cpp index d95b06a47b..c2d0578023 100644 --- a/gerbview/gerbview_config.cpp +++ b/gerbview/gerbview_config.cpp @@ -23,8 +23,7 @@ const wxString GerbviewProjectFileExt( wxT( "cnf" ) ); -const wxString GerbviewProjectFileWildcard( _( "GerbView project files " \ - "(.cnf)|*.cnf" ) ); +const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) ); /*************************************************************/ diff --git a/gerbview/gerbview_config.h b/gerbview/gerbview_config.h index 9ab8f4b253..3e8af5b95d 100644 --- a/gerbview/gerbview_config.h +++ b/gerbview/gerbview_config.h @@ -13,456 +13,455 @@ static PARAM_CFG_WXSTRING PhotoExtBufCfg ( - wxT("PhoExt"), /* identification */ - &g_PhotoFilenameExt /* Adresse du parametre */ + wxT("PhoExt"), /* identification */ + &g_PhotoFilenameExt /* Adresse du parametre */ ); static PARAM_CFG_WXSTRING PenExtBufCfg ( - wxT("PenExt"), /* identification */ - &g_PenFilenameExt /* Adresse du parametre */ + wxT("PenExt"), /* identification */ + &g_PenFilenameExt /* Adresse du parametre */ ); static PARAM_CFG_WXSTRING DrillExtBufCfg ( - wxT("DrilExt"), /* identification */ - &g_DrillFilenameExt /* Adresse du parametre */ + wxT("DrilExt"), /* identification */ + &g_DrillFilenameExt /* Adresse du parametre */ ); -static PARAM_CFG_INT UnitCfg // Unites; 0 inche, 1 mm +static PARAM_CFG_INT UnitCfg // Unites; 0 inche, 1 mm ( - wxT("Unite"), /* identification */ - &g_UnitMetric, /* Adresse du parametre */ - FALSE /* Valeur par defaut */ + wxT("Unite"), /* identification */ + &g_UnitMetric, /* Adresse du parametre */ + FALSE /* Valeur par defaut */ ); -static PARAM_CFG_INT GerberScaleCfg // default scale; 0 2.3, 1 3.4 +static PARAM_CFG_INT GerberScaleCfg // default scale; 0 2.3, 1 3.4 ( - wxT("Def_fmt"), /* identification */ - &g_Default_GERBER_Format, /* Adresse du parametre */ - 23, /* Valeur par defaut */ - 23, 66 /* Valeurs extremes */ + wxT("Def_fmt"), /* identification */ + &g_Default_GERBER_Format, /* Adresse du parametre */ + 23, /* Valeur par defaut */ + 23, 66 /* Valeurs extremes */ ); static PARAM_CFG_BOOL SegmFillCfg ( - INSETUP, - wxT("SegFill"), /* identification */ - &DisplayOpt.DisplayPcbTrackFill, /* Adresse du parametre */ - TRUE /* Valeur par defaut */ + INSETUP, + wxT("SegFill"), /* identification */ + &DisplayOpt.DisplayPcbTrackFill, /* Adresse du parametre */ + TRUE /* Valeur par defaut */ ); -static PARAM_CFG_BOOL PadFillCfg +static PARAM_CFG_INT PadFillCfg ( - INSETUP, - wxT("PadFill"), /* identification */ - &DisplayOpt.DisplayPadFill, /* Adresse du parametre */ - TRUE /* Valeur par defaut */ + INSETUP, + wxT("PadFill"), /* identification */ + (int*)&DisplayOpt.DisplayPadFill, /* Adresse du parametre */ + TRUE /* Valeur par defaut */ ); -static PARAM_CFG_BOOL PadShowNumCfg // Affiche DCodes +static PARAM_CFG_BOOL PadShowNumCfg // Affiche DCodes ( - INSETUP, - wxT("PadSNum"), /* identification */ - &DisplayOpt.DisplayPadNum, /* Adresse du parametre */ - TRUE /* Valeur par defaut */ + INSETUP, + wxT("PadSNum"), /* identification */ + &DisplayOpt.DisplayPadNum, /* Adresse du parametre */ + TRUE /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer0Cfg ( - INSETUP, - wxT("ColLay0"), /* identification */ - &g_DesignSettings.m_LayerColor[0], /* Adresse du parametre */ - GREEN /* Valeur par defaut */ + INSETUP, + wxT("ColLay0"), /* identification */ + &g_DesignSettings.m_LayerColor[0], /* Adresse du parametre */ + GREEN /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer1Cfg ( - INSETUP, - wxT("ColLay1"), /* identification */ - &g_DesignSettings.m_LayerColor[1], /* Adresse du parametre */ - BLUE /* Valeur par defaut */ + INSETUP, + wxT("ColLay1"), /* identification */ + &g_DesignSettings.m_LayerColor[1], /* Adresse du parametre */ + BLUE /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer2Cfg ( - INSETUP, - wxT("ColLay2"), /* identification */ - &g_DesignSettings.m_LayerColor[2], /* Adresse du parametre */ - LIGHTGRAY /* Valeur par defaut */ + INSETUP, + wxT("ColLay2"), /* identification */ + &g_DesignSettings.m_LayerColor[2], /* Adresse du parametre */ + LIGHTGRAY /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer3Cfg ( - INSETUP, - wxT("ColLay3"), /* identification */ - &g_DesignSettings.m_LayerColor[3], /* Adresse du parametre */ - 5 /* Valeur par defaut */ + INSETUP, + wxT("ColLay3"), /* identification */ + &g_DesignSettings.m_LayerColor[3], /* Adresse du parametre */ + 5 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer4Cfg ( - INSETUP, - wxT("ColLay4"), /* identification */ - &g_DesignSettings.m_LayerColor[4], /* Adresse du parametre */ - 4 /* Valeur par defaut */ + INSETUP, + wxT("ColLay4"), /* identification */ + &g_DesignSettings.m_LayerColor[4], /* Adresse du parametre */ + 4 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer5Cfg ( - INSETUP, - wxT("ColLay5"), /* identification */ - &g_DesignSettings.m_LayerColor[5], /* Adresse du parametre */ - 5 /* Valeur par defaut */ + INSETUP, + wxT("ColLay5"), /* identification */ + &g_DesignSettings.m_LayerColor[5], /* Adresse du parametre */ + 5 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer6Cfg ( - INSETUP, - wxT("ColLay6"), /* identification */ - &g_DesignSettings.m_LayerColor[6], /* Adresse du parametre */ - 6 /* Valeur par defaut */ + INSETUP, + wxT("ColLay6"), /* identification */ + &g_DesignSettings.m_LayerColor[6], /* Adresse du parametre */ + 6 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer7Cfg ( - INSETUP, - wxT("ColLay7"), /* identification */ - &g_DesignSettings.m_LayerColor[7], /* Adresse du parametre */ - 5 /* Valeur par defaut */ + INSETUP, + wxT("ColLay7"), /* identification */ + &g_DesignSettings.m_LayerColor[7], /* Adresse du parametre */ + 5 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer8Cfg ( - INSETUP, - wxT("ColLay8"), /* identification */ - &g_DesignSettings.m_LayerColor[8], /* Adresse du parametre */ - 7 /* Valeur par defaut */ + INSETUP, + wxT("ColLay8"), /* identification */ + &g_DesignSettings.m_LayerColor[8], /* Adresse du parametre */ + 7 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer9Cfg ( - INSETUP, - wxT("ColLay9"), /* identification */ - &g_DesignSettings.m_LayerColor[9], /* Adresse du parametre */ - 1 /* Valeur par defaut */ + INSETUP, + wxT("ColLay9"), /* identification */ + &g_DesignSettings.m_LayerColor[9], /* Adresse du parametre */ + 1 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer10Cfg ( - INSETUP, - wxT("ColLayA"), /* identification */ - &g_DesignSettings.m_LayerColor[10], /* Adresse du parametre */ - 2 /* Valeur par defaut */ + INSETUP, + wxT("ColLayA"), /* identification */ + &g_DesignSettings.m_LayerColor[10], /* Adresse du parametre */ + 2 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer11Cfg ( - INSETUP, - wxT("ColLayB"), /* identification */ - &g_DesignSettings.m_LayerColor[11], /* Adresse du parametre */ - 3 /* Valeur par defaut */ + INSETUP, + wxT("ColLayB"), /* identification */ + &g_DesignSettings.m_LayerColor[11], /* Adresse du parametre */ + 3 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer12Cfg ( - INSETUP, - wxT("ColLayC"), /* identification */ - &g_DesignSettings.m_LayerColor[12], /* Adresse du parametre */ - 12 /* Valeur par defaut */ + INSETUP, + wxT("ColLayC"), /* identification */ + &g_DesignSettings.m_LayerColor[12], /* Adresse du parametre */ + 12 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer13Cfg ( - INSETUP, - wxT("ColLayD"), /* identification */ - &g_DesignSettings.m_LayerColor[13], /* Adresse du parametre */ - 13 /* Valeur par defaut */ + INSETUP, + wxT("ColLayD"), /* identification */ + &g_DesignSettings.m_LayerColor[13], /* Adresse du parametre */ + 13 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer14Cfg ( - INSETUP, - wxT("ColLayE"), /* identification */ - &g_DesignSettings.m_LayerColor[14], /* Adresse du parametre */ - 14 /* Valeur par defaut */ + INSETUP, + wxT("ColLayE"), /* identification */ + &g_DesignSettings.m_LayerColor[14], /* Adresse du parametre */ + 14 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer15Cfg ( - INSETUP, - wxT("ColLayF"), /* identification */ - &g_DesignSettings.m_LayerColor[15], /* Adresse du parametre */ - RED /* Valeur par defaut */ + INSETUP, + wxT("ColLayF"), /* identification */ + &g_DesignSettings.m_LayerColor[15], /* Adresse du parametre */ + RED /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer16Cfg ( - INSETUP, - wxT("ColLayG"), /* identification */ - &g_DesignSettings.m_LayerColor[16], /* Adresse du parametre */ - 1 /* Valeur par defaut */ + INSETUP, + wxT("ColLayG"), /* identification */ + &g_DesignSettings.m_LayerColor[16], /* Adresse du parametre */ + 1 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer17Cfg ( - INSETUP, - wxT("ColLayH"), /* identification */ - &g_DesignSettings.m_LayerColor[17], /* Adresse du parametre */ - 5 /* Valeur par defaut */ + INSETUP, + wxT("ColLayH"), /* identification */ + &g_DesignSettings.m_LayerColor[17], /* Adresse du parametre */ + 5 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer18Cfg ( - INSETUP, - wxT("ColLayI"), /* identification */ - &g_DesignSettings.m_LayerColor[18], /* Adresse du parametre */ - 11 /* Valeur par defaut */ + INSETUP, + wxT("ColLayI"), /* identification */ + &g_DesignSettings.m_LayerColor[18], /* Adresse du parametre */ + 11 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer19Cfg ( - INSETUP, - wxT("ColLayJ"), /* identification */ - &g_DesignSettings.m_LayerColor[19], /* Adresse du parametre */ - 4 /* Valeur par defaut */ + INSETUP, + wxT("ColLayJ"), /* identification */ + &g_DesignSettings.m_LayerColor[19], /* Adresse du parametre */ + 4 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer20Cfg ( - INSETUP, - wxT("ColLayK"), /* identification */ - &g_DesignSettings.m_LayerColor[20], /* Adresse du parametre */ - 5 /* Valeur par defaut */ + INSETUP, + wxT("ColLayK"), /* identification */ + &g_DesignSettings.m_LayerColor[20], /* Adresse du parametre */ + 5 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer21Cfg ( - INSETUP, - wxT("ColLayL"), /* identification */ - &g_DesignSettings.m_LayerColor[21], /* Adresse du parametre */ - 3 /* Valeur par defaut */ + INSETUP, + wxT("ColLayL"), /* identification */ + &g_DesignSettings.m_LayerColor[21], /* Adresse du parametre */ + 3 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer22Cfg ( - INSETUP, - wxT("ColLayM"), /* identification */ - &g_DesignSettings.m_LayerColor[22], /* Adresse du parametre */ - 6 /* Valeur par defaut */ + INSETUP, + wxT("ColLayM"), /* identification */ + &g_DesignSettings.m_LayerColor[22], /* Adresse du parametre */ + 6 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer23Cfg ( - INSETUP, - wxT("ColLayN"), /* identification */ - &g_DesignSettings.m_LayerColor[23], /* Adresse du parametre */ - 5 /* Valeur par defaut */ + INSETUP, + wxT("ColLayN"), /* identification */ + &g_DesignSettings.m_LayerColor[23], /* Adresse du parametre */ + 5 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer24Cfg ( - INSETUP, - wxT("ColLayO"), /* identification */ - &g_DesignSettings.m_LayerColor[24], /* Adresse du parametre */ - LIGHTGRAY /* Valeur par defaut */ + INSETUP, + wxT("ColLayO"), /* identification */ + &g_DesignSettings.m_LayerColor[24], /* Adresse du parametre */ + LIGHTGRAY /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer25Cfg ( - INSETUP, - wxT("ColLayP"), /* identification */ - &g_DesignSettings.m_LayerColor[25], /* Adresse du parametre */ - 1 /* Valeur par defaut */ + INSETUP, + wxT("ColLayP"), /* identification */ + &g_DesignSettings.m_LayerColor[25], /* Adresse du parametre */ + 1 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer26Cfg ( - INSETUP, - wxT("ColLayQ"), /* identification */ - &g_DesignSettings.m_LayerColor[26], /* Adresse du parametre */ - 2 /* Valeur par defaut */ + INSETUP, + wxT("ColLayQ"), /* identification */ + &g_DesignSettings.m_LayerColor[26], /* Adresse du parametre */ + 2 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer27Cfg ( - INSETUP, - wxT("ColLayR"), /* identification */ - &g_DesignSettings.m_LayerColor[27], /* Adresse du parametre */ - 14 /* Valeur par defaut */ + INSETUP, + wxT("ColLayR"), /* identification */ + &g_DesignSettings.m_LayerColor[27], /* Adresse du parametre */ + 14 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer28Cfg ( - INSETUP, - wxT("ColLayS"), /* identification */ - &g_DesignSettings.m_LayerColor[28], /* Adresse du parametre */ - YELLOW /* Valeur par defaut */ + INSETUP, + wxT("ColLayS"), /* identification */ + &g_DesignSettings.m_LayerColor[28], /* Adresse du parametre */ + YELLOW /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer29Cfg ( - INSETUP, - wxT("ColLayT"), /* identification */ - &g_DesignSettings.m_LayerColor[29], /* Adresse du parametre */ - 13 /* Valeur par defaut */ + INSETUP, + wxT("ColLayT"), /* identification */ + &g_DesignSettings.m_LayerColor[29], /* Adresse du parametre */ + 13 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer30Cfg ( - INSETUP, - wxT("ColLayU"), /* identification */ - &g_DesignSettings.m_LayerColor[30], /* Adresse du parametre */ - 14 /* Valeur par defaut */ + INSETUP, + wxT("ColLayU"), /* identification */ + &g_DesignSettings.m_LayerColor[30], /* Adresse du parametre */ + 14 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorLayer31Cfg ( - INSETUP, - wxT("ColLayV"), /* identification */ - &g_DesignSettings.m_LayerColor[31], /* Adresse du parametre */ - 7 /* Valeur par defaut */ + INSETUP, + wxT("ColLayV"), /* identification */ + &g_DesignSettings.m_LayerColor[31], /* Adresse du parametre */ + 7 /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorpcbGrilleCfg ( - INSETUP, - wxT("CoPcbGr"), /* identification */ - &g_DesignSettings.m_PcbGridColor, /* Adresse du parametre */ - DARKGRAY /* Valeur par defaut */ + INSETUP, + wxT("CoPcbGr"), /* identification */ + &g_DesignSettings.m_PcbGridColor, /* Adresse du parametre */ + DARKGRAY /* Valeur par defaut */ ); static PARAM_CFG_SETCOLOR ColorDCodesCfg ( - INSETUP, - wxT("CoDCode"), /* identification */ - &g_DCodesColor, /* Adresse du parametre */ - WHITE /* Valeur par defaut */ + INSETUP, + wxT("CoDCode"), /* identification */ + &g_DCodesColor, /* Adresse du parametre */ + WHITE /* Valeur par defaut */ ); static PARAM_CFG_INT HPGLpenNumCfg ( - wxT("HPGLnum"), /* identification */ - &g_HPGL_Pen_Num, /* Adresse du parametre */ - 1, /* Valeur par defaut */ - 1, 16 /* Valeurs extremes */ + wxT("HPGLnum"), /* identification */ + &g_HPGL_Pen_Num, /* Adresse du parametre */ + 1, /* Valeur par defaut */ + 1, 16 /* Valeurs extremes */ ); static PARAM_CFG_INT HPGLdiamCfg ( - wxT("HPGdiam"), /* identification */ - &g_HPGL_Pen_Diam, /* Adresse du parametre */ - 15, /* Valeur par defaut */ - 0,0xFFFF /* Valeurs extremes */ + wxT("HPGdiam"), /* identification */ + &g_HPGL_Pen_Diam, /* Adresse du parametre */ + 15, /* Valeur par defaut */ + 0,0xFFFF /* Valeurs extremes */ ); static PARAM_CFG_INT HPGLspeedCfg ( - wxT("HPGLSpd"), /* identification */ - &g_HPGL_Pen_Speed, /* Adresse du parametre */ - 25, /* Valeur par defaut */ - 0,100 /* Valeurs extremes */ + wxT("HPGLSpd"), /* identification */ + &g_HPGL_Pen_Speed, /* Adresse du parametre */ + 25, /* Valeur par defaut */ + 0,100 /* Valeurs extremes */ ); static PARAM_CFG_INT HPGLrecouvrementCfg ( - wxT("HPGLrec"), /* identification */ - &g_HPGL_Pen_Recouvrement, /* Adresse du parametre */ - 2, /* Valeur par defaut */ - 0, 100 /* Valeurs extremes */ + wxT("HPGLrec"), /* identification */ + &g_HPGL_Pen_Recouvrement, /* Adresse du parametre */ + 2, /* Valeur par defaut */ + 0, 100 /* Valeurs extremes */ ); static PARAM_CFG_INT GERBERSpotMiniCfg ( - wxT("GERBmin"), /* identification */ - &g_Plot_Spot_Mini, /* Adresse du parametre */ - 15, /* Valeur par defaut */ - 2,0xFFFF /* Valeurs extremes */ + wxT("GERBmin"), /* identification */ + &g_Plot_Spot_Mini, /* Adresse du parametre */ + 15, /* Valeur par defaut */ + 2,0xFFFF /* Valeurs extremes */ ); static PARAM_CFG_INT DrawSegmLargeurCfg ( - wxT("DrawLar"), /* identification */ - &g_DesignSettings.m_DrawSegmentWidth, /* Adresse du parametre */ - 120, /* Valeur par defaut */ - 0,10000 /* Valeurs extremes */ + wxT("DrawLar"), /* identification */ + &g_DesignSettings.m_DrawSegmentWidth, /* Adresse du parametre */ + 120, /* Valeur par defaut */ + 0,10000 /* Valeurs extremes */ ); static PARAM_CFG_INT EdgeSegmLargeurCfg ( - wxT("EdgeLar"), /* identification */ - &g_DesignSettings.m_EdgeSegmentWidth, /* Adresse du parametre */ - 120, /* Valeur par defaut */ - 0,10000 /* Valeurs extremes */ + wxT("EdgeLar"), /* identification */ + &g_DesignSettings.m_EdgeSegmentWidth, /* Adresse du parametre */ + 120, /* Valeur par defaut */ + 0,10000 /* Valeurs extremes */ ); static PARAM_CFG_INT TimeOutCfg ( - wxT("TimeOut"), /* identification */ - &g_TimeOut, /* Adresse du parametre */ - 600, /* Valeur par defaut */ - 0,60000 /* Valeurs extremes */ + wxT("TimeOut"), /* identification */ + &g_TimeOut, /* Adresse du parametre */ + 600, /* Valeur par defaut */ + 0,60000 /* Valeurs extremes */ ); static PARAM_CFG_BOOL DisplPolairCfg ( - INSETUP, - wxT("DPolair"), /* identification */ - &DisplayOpt.DisplayPolarCood, /* Adresse du parametre */ - FALSE /* Valeur par defaut */ + INSETUP, + wxT("DPolair"), /* identification */ + &DisplayOpt.DisplayPolarCood, /* Adresse du parametre */ + FALSE /* Valeur par defaut */ ); PARAM_CFG_BASE * ParamCfgList[] = { - & PhotoExtBufCfg, - & PenExtBufCfg, - & DrillExtBufCfg, - & UnitCfg, - & GerberScaleCfg, - & SegmFillCfg, - & PadFillCfg, - & PadShowNumCfg, - & ColorLayer0Cfg, - & ColorLayer1Cfg, - & ColorLayer2Cfg, - & ColorLayer3Cfg, - & ColorLayer4Cfg, - & ColorLayer5Cfg, - & ColorLayer6Cfg, - & ColorLayer7Cfg, - & ColorLayer8Cfg, - & ColorLayer9Cfg, - & ColorLayer10Cfg, - & ColorLayer11Cfg, - & ColorLayer12Cfg, - & ColorLayer13Cfg, - & ColorLayer14Cfg, - & ColorLayer15Cfg, - & ColorLayer16Cfg, - & ColorLayer17Cfg, - & ColorLayer18Cfg, - & ColorLayer19Cfg, - & ColorLayer20Cfg, - & ColorLayer21Cfg, - & ColorLayer22Cfg, - & ColorLayer23Cfg, - & ColorLayer24Cfg, - & ColorLayer25Cfg, - & ColorLayer26Cfg, - & ColorLayer27Cfg, - & ColorLayer28Cfg, - & ColorLayer29Cfg, - & ColorLayer30Cfg, - & ColorLayer31Cfg, - & ColorpcbGrilleCfg, - & ColorDCodesCfg, - & GERBERSpotMiniCfg, - & DrawSegmLargeurCfg, - & EdgeSegmLargeurCfg, - & TimeOutCfg, - & DisplPolairCfg, - NULL + & PhotoExtBufCfg, + & PenExtBufCfg, + & DrillExtBufCfg, + & UnitCfg, + & GerberScaleCfg, + & SegmFillCfg, + & PadFillCfg, + & PadShowNumCfg, + & ColorLayer0Cfg, + & ColorLayer1Cfg, + & ColorLayer2Cfg, + & ColorLayer3Cfg, + & ColorLayer4Cfg, + & ColorLayer5Cfg, + & ColorLayer6Cfg, + & ColorLayer7Cfg, + & ColorLayer8Cfg, + & ColorLayer9Cfg, + & ColorLayer10Cfg, + & ColorLayer11Cfg, + & ColorLayer12Cfg, + & ColorLayer13Cfg, + & ColorLayer14Cfg, + & ColorLayer15Cfg, + & ColorLayer16Cfg, + & ColorLayer17Cfg, + & ColorLayer18Cfg, + & ColorLayer19Cfg, + & ColorLayer20Cfg, + & ColorLayer21Cfg, + & ColorLayer22Cfg, + & ColorLayer23Cfg, + & ColorLayer24Cfg, + & ColorLayer25Cfg, + & ColorLayer26Cfg, + & ColorLayer27Cfg, + & ColorLayer28Cfg, + & ColorLayer29Cfg, + & ColorLayer30Cfg, + & ColorLayer31Cfg, + & ColorpcbGrilleCfg, + & ColorDCodesCfg, + & GERBERSpotMiniCfg, + & DrawSegmLargeurCfg, + & EdgeSegmLargeurCfg, + & TimeOutCfg, + & DisplPolairCfg, + NULL }; - diff --git a/gerbview/options.cpp b/gerbview/options.cpp index 3c1d63ce20..48be122e97 100644 --- a/gerbview/options.cpp +++ b/gerbview/options.cpp @@ -64,13 +64,11 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event ) case ID_TB_OPTIONS_SHOW_PADS_SKETCH: if( m_OptionsToolBar->GetToolState( id ) ) { - m_DisplayPadFill = FALSE; - DisplayOpt.DisplayPadFill = FALSE; + DisplayOpt.DisplayPadFill = m_DisplayPadFill = false; } else { - m_DisplayPadFill = TRUE; - DisplayOpt.DisplayPadFill = TRUE; + DisplayOpt.DisplayPadFill = m_DisplayPadFill = true; } DrawPanel->Refresh( TRUE ); break; @@ -364,9 +362,9 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event ) DisplayOpt.DisplayPcbTrackFill = FALSE; if( m_OptDisplayFlashes->GetSelection() == 1 ) - DisplayOpt.DisplayPadFill = TRUE; + DisplayOpt.DisplayPadFill = true; else - DisplayOpt.DisplayPadFill = FALSE; + DisplayOpt.DisplayPadFill = false; if( m_OptDisplayPolygons->GetSelection() == 0 ) g_DisplayPolygonsModeSketch = 1; diff --git a/gerbview/rs274d.cpp b/gerbview/rs274d.cpp index 32efa39e29..b1b76f5dfc 100644 --- a/gerbview/rs274d.cpp +++ b/gerbview/rs274d.cpp @@ -984,8 +984,8 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, break; default: - msg.Printf( wxT( "Execute_DCODE_Command: interpol error " \ - "(type %X)" ), m_Iterpolation ); + msg.Printf( wxT( "Execute_DCODE_Command: interpol error (type %X)" ), + m_Iterpolation ); DisplayError( frame, msg ); break; } @@ -1193,7 +1193,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, m_GerbMetric ); int gap = scale( p->params[4].GetValue( tool ), m_GerbMetric ); - int numCircles = p->params[5].GetValue( tool ); + int numCircles = (int)p->params[5].GetValue( tool ); int crossHairThickness = scale( p->params[6].GetValue( tool ), m_GerbMetric ); int crossHairLength = diff --git a/gerbview/tracepcb.cpp b/gerbview/tracepcb.cpp index b68cd5f69e..e240553a37 100644 --- a/gerbview/tracepcb.cpp +++ b/gerbview/tracepcb.cpp @@ -34,9 +34,9 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl save_opt = DisplayOpt; if( printmasklayer & ALL_CU_LAYERS ) - DisplayOpt.DisplayPadFill = FILLED; + DisplayOpt.DisplayPadFill = true; else - DisplayOpt.DisplayPadFill = SKETCH; + DisplayOpt.DisplayPadFill = false; DisplayOpt.DisplayPadNum = 0; DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadIsol = 0; diff --git a/include/appl_wxstruct.h b/include/appl_wxstruct.h index 18310a3e17..03c6e4ca6c 100644 --- a/include/appl_wxstruct.h +++ b/include/appl_wxstruct.h @@ -123,7 +123,7 @@ public: PARAM_CFG_BASE** List ); void WriteProjectConfig( const wxString& fileName, const wxString& GroupName, - const PARAM_CFG_ARRAY& params ); + PARAM_CFG_ARRAY& params ); /** Function SaveCurrentSetupValues() * Save the current setup values in m_EDA_Config @@ -131,7 +131,7 @@ public: * @param aList = array of PARAM_CFG_BASE pointers */ void SaveCurrentSetupValues( PARAM_CFG_BASE** aList ); - void SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List ); + void SaveCurrentSetupValues( PARAM_CFG_ARRAY& List ); /** Function ReadCurrentSetupValues() * Raed the current setup values previously saved, from m_EDA_Config @@ -139,7 +139,7 @@ public: * @param aList = array of PARAM_CFG_BASE pointers */ void ReadCurrentSetupValues( PARAM_CFG_BASE** aList ); - void ReadCurrentSetupValues( const PARAM_CFG_ARRAY& List ); + void ReadCurrentSetupValues( PARAM_CFG_ARRAY& List ); bool ReadProjectConfig( const wxString& local_config_filename, const wxString& GroupName, @@ -147,7 +147,7 @@ public: bool Load_Only_if_New ); bool ReadProjectConfig( const wxString& local_config_filename, const wxString& GroupName, - const PARAM_CFG_ARRAY& List, + PARAM_CFG_ARRAY& List, bool Load_Only_if_New ); bool ReCreatePrjConfig( const wxString& local_config_filename, const wxString& GroupName, diff --git a/include/base_struct.h b/include/base_struct.h index 10db3cf66d..80d78082e6 100644 --- a/include/base_struct.h +++ b/include/base_struct.h @@ -472,13 +472,13 @@ enum GRTextVertJustifyType { /* Options to show solid segments (segments, texts...) */ enum GRFillMode { - FILAIRE = 0, // segments are drawn as lines - FILLED, // normal mode: segments have thickness - SKETCH // skect mode: segments have thickness, but are not filled + FILAIRE = 0, // segments are drawn as lines + FILLED, // normal mode: segments have thickness + SKETCH // skect mode: segments have thickness, but are not filled }; -#define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */ +#define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */ /** * Class EDA_TextStruct diff --git a/include/fctsys.h b/include/fctsys.h index abbc8f7b12..47709587d6 100644 --- a/include/fctsys.h +++ b/include/fctsys.h @@ -17,19 +17,10 @@ #include #endif -#include -#ifdef __FreeBSD__ -#include -#else -#ifndef __DARWIN__ -#include // MacOSX (DARWIN): malloc() and free() are in stdlib.h -#endif -#endif -#include -#include -#include -#include - +/* + * FIXME: This appears to already be included in the OSX build of wxWidgets. + * Will someone with OSX please remove this and see if it compiles. + */ #ifdef __WXMAC__ #include #endif @@ -41,11 +32,6 @@ #define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch #define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch -#ifdef __UNIX__ -#define stricmp strcasecmp -#define strnicmp strncasecmp -#endif - #ifdef __WINDOWS__ #define DIR_SEP '\\' #define STRING_DIR_SEP wxT( "\\" ) @@ -60,7 +46,6 @@ #define D(x) // nothing #endif - #define UNIX_STRING_DIR_SEP wxT( "/" ) #define WIN_STRING_DIR_SEP wxT( "\\" ) @@ -76,4 +61,6 @@ #define MAYBE_RESIZE_BORDER 0 // no resizeable border #endif +#include "config.h" + #endif /* FCTSYS_H */ diff --git a/include/macros.h b/include/macros.h index 0e77528016..3890c2594b 100644 --- a/include/macros.h +++ b/include/macros.h @@ -74,11 +74,15 @@ static inline const wxChar* GetChars( wxString s ) /* macro to exchange 2 items */ /*****************************/ -/* this macro uses the typeof keyword - * for compilers that do not know typeof (MSVC ) - * the boost libs have a workaround for the typeof problem +/* + * The EXCHG macro uses BOOST_TYPEOF for compilers that do not have native + * typeof support (MSVC). Please do not attempt to qualify these macros + * within #ifdef compiler definitions pragmas. BOOST_TYPEOF is smart enough + * to check for native typeof support and use it instead of it's own + * implementation. These macros effectively compile to nothing on platforms + * with native typeof support. */ -#ifdef __MSVC__ // MSCV does not know typeof. Others def can be added here + #include "boost/typeof/typeof.hpp" // we have to register the types used with the typeof keyword with boost @@ -93,13 +97,11 @@ class D_PAD; BOOST_TYPEOF_REGISTER_TYPE( D_PAD* ); BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* ); class BOARD_ITEM; -BOOST_TYPEOF_REGISTER_TYPE( BOARD_ ITEM* ); +BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* ); -#define typeof (expr)BOOST_TYPEOF( expr ) -#endif // #ifdef __MSVC__ - -// here is the macro: -#define EXCHG( a, b ) { typeof(a)__temp__ = (a); (a) = (b); (b) = __temp__; } +#define EXCHG( a, b ) { BOOST_TYPEOF(a) __temp__ = (a); \ + (a) = (b); \ + (b) = __temp__; } /*****************************************************/ diff --git a/include/param_config.h b/include/param_config.h index 1361640001..76f19ffabd 100644 --- a/include/param_config.h +++ b/include/param_config.h @@ -8,7 +8,7 @@ #include "wx/confbase.h" #include "wx/fileconf.h" -#include +#include /* definifition des types de parametre des files de configuration */ @@ -207,6 +207,6 @@ public: virtual void SaveParam( wxConfigBase* aConfig ); }; -WX_DECLARE_OBJARRAY( PARAM_CFG_BASE, PARAM_CFG_ARRAY ); +typedef boost::ptr_vector< PARAM_CFG_BASE > PARAM_CFG_ARRAY; #endif /* __PARAM_CONFIG_H__ */ diff --git a/include/pcbstruct.h b/include/pcbstruct.h index 1149712b10..529f533934 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -125,7 +125,7 @@ /* Forward declaration */ class EQUIPOT; class MARKER; -struct CHEVELU; +class CHEVELU; //class Ki_PageDescr; //class DrawBlockStruct; @@ -289,7 +289,7 @@ public: * 1 show netnames on pads * 2 show netnames on tracks * 3 show netnames on tracks and pads - */ + */ bool Show_Modules_Cmp; bool Show_Modules_Cu; diff --git a/include/trigo.h b/include/trigo.h index d11c87dce9..51279474ee 100644 --- a/include/trigo.h +++ b/include/trigo.h @@ -46,7 +46,7 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY ); } while( 0 ); -extern float fsinus[]; -extern float fcosinus[]; +extern double fsinus[]; +extern double fcosinus[]; #endif diff --git a/include/wxEeschemaStruct.h b/include/wxEeschemaStruct.h index 5b897c9518..fff9cced14 100644 --- a/include/wxEeschemaStruct.h +++ b/include/wxEeschemaStruct.h @@ -90,11 +90,11 @@ public: void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ); - const PARAM_CFG_ARRAY& GetProjectFileParameters( void ); + PARAM_CFG_ARRAY& GetProjectFileParameters( void ); void SaveProjectFile( wxWindow* displayframe ); bool LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig ); - const PARAM_CFG_ARRAY& GetConfigurationSettings( void ); + PARAM_CFG_ARRAY& GetConfigurationSettings( void ); void LoadSettings(); void SaveSettings(); @@ -131,7 +131,6 @@ public: void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); void OnSelectOptionToolbar( wxCommandEvent& event ); - void ToolOnRightClick( wxCommandEvent& event ); int BestZoom(); // Retourne le meilleur zoom SCH_ITEM* SchematicGeneralLocateAndDisplay( bool IncludePin = TRUE ); diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 934735ec2b..c66826358a 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -92,8 +92,7 @@ public: // General virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; - virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; - virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; + virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { } virtual void ReCreateHToolbar() = 0; virtual void ReCreateVToolbar() = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; @@ -112,8 +111,6 @@ public: virtual void Show3D_Frame( wxCommandEvent& event ); - // Undo and redo functions -public: virtual void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, int flag_type_command = 0 ); @@ -983,6 +980,7 @@ public: void Show3D_Frame( wxCommandEvent& event ); void GeneralControle( wxDC* DC, wxPoint Mouse ); virtual void OnSelectGrid( wxCommandEvent& event ); + void LoadModuleFromBoard( wxCommandEvent& event ); /* handlers for block commands */ int ReturnBlockCommand( int key ); diff --git a/include/wxstruct.h b/include/wxstruct.h index e2afd38ad4..f48d5d49ee 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -218,11 +218,10 @@ public: virtual void OnSelectGrid( wxCommandEvent& event ); virtual void OnSelectZoom( wxCommandEvent& event ); - virtual void GeneralControle( wxDC* DC, wxPoint Mouse ) { /* dummy */ } + virtual void GeneralControle( wxDC* DC, wxPoint Mouse ) { /* dummy */ } virtual void OnSize( wxSizeEvent& event ); void OnEraseBackground( wxEraseEvent& SizeEvent ); -// void OnChar(wxKeyEvent& event); void SetToolbarBgColor( int color_num ); virtual void OnZoom( wxCommandEvent& event ); void OnGrid( int grid_type ); @@ -259,8 +258,7 @@ public: void Process_Zoom( wxCommandEvent& event ); void Process_Grid( wxCommandEvent& event ); virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; - virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; - virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; + virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual void ToolOnRightClick( wxCommandEvent& event ); diff --git a/kicad/buildmnu.cpp b/kicad/buildmnu.cpp index 62ae03826b..758664084b 100644 --- a/kicad/buildmnu.cpp +++ b/kicad/buildmnu.cpp @@ -257,29 +257,34 @@ void WinEDA_MainFrame::RecreateBaseHToolbar() SetToolBar( m_HToolBar ); // Set up toolbar - m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_project_xpm ), + m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, + wxBitmap( new_project_xpm ), _( "Start a new project" ) ); // Load project - m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString, wxBitmap( open_project_xpm ), + m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString, + wxBitmap( open_project_xpm ), _( "Load existing project" ) ); // Save project - m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString, wxBitmap( save_project_xpm ), + m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString, + wxBitmap( save_project_xpm ), _( "Save current project" ) ); // Separator m_HToolBar->AddSeparator(); // Save and archive files - m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString, wxBitmap( zip_xpm ), + m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString, + wxBitmap( zip_xpm ), _( "Archive all project files" ) ); // Tooltip // Separator m_HToolBar->AddSeparator(); // Refresh project tree - m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString, wxBitmap( reload_xpm ), + m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString, + wxBitmap( reload_xpm ), _( "Refresh project tree" ) ); m_HToolBar->Realize(); // Create m_HToolBar diff --git a/kicad/kicad.h b/kicad/kicad.h index 8905de6c58..36d413c060 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -278,7 +278,7 @@ public: WinEDA_PrjFrame( WinEDA_MainFrame* parent, const wxPoint& pos, const wxSize& size ); - ~WinEDA_PrjFrame() { } + ~WinEDA_PrjFrame(); void OnSelect( wxTreeEvent& Event ); void OnRenameAsk( wxTreeEvent& Event ); void OnRename( wxTreeEvent& Event ); diff --git a/kicad/minizip/makefile b/kicad/minizip/makefile deleted file mode 100644 index dd8e72c609..0000000000 --- a/kicad/minizip/makefile +++ /dev/null @@ -1,14 +0,0 @@ -WXDIR = $(WXWIN) - -CC=gcc -LD=gcc -CFLAGS=-O2 -Wall -I$(WXDIR)/src/zlib -EXTRALIBS= $(WXDIR)/lib/libwxzlib.a - -ZIP_OBJS = minizip.o zip.o ioapi.o - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -minizip: $(ZIP_OBJS) - $(LD) $(LFLAGS) -o $@ $(ZIP_OBJS) $(EXTRALIBS) diff --git a/kicad/minizip/makefile.unx b/kicad/minizip/makefile.unx deleted file mode 100644 index fc6142e0d6..0000000000 --- a/kicad/minizip/makefile.unx +++ /dev/null @@ -1,15 +0,0 @@ -WXDIR = /usr/local/wxGTK2-2.5.1 - -CC=gcc -LD=gcc -CFLAGS=-O2 -Wall -I$(WXDIR)/src/zlib -#EXTRALIBS= $(WXDIR)/lib/libwxzlib.a -EXTRALIBS= -lz - -ZIP_OBJS = minizip.o zip.o ioapi.o - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -minizip: $(ZIP_OBJS) - $(LD) $(LFLAGS) -o $@ $(ZIP_OBJS) $(EXTRALIBS) diff --git a/kicad/minizip/makefile.win b/kicad/minizip/makefile.win deleted file mode 100644 index dd8e72c609..0000000000 --- a/kicad/minizip/makefile.win +++ /dev/null @@ -1,14 +0,0 @@ -WXDIR = $(WXWIN) - -CC=gcc -LD=gcc -CFLAGS=-O2 -Wall -I$(WXDIR)/src/zlib -EXTRALIBS= $(WXDIR)/lib/libwxzlib.a - -ZIP_OBJS = minizip.o zip.o ioapi.o - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -minizip: $(ZIP_OBJS) - $(LD) $(LFLAGS) -o $@ $(ZIP_OBJS) $(EXTRALIBS) diff --git a/kicad/preferences.cpp b/kicad/preferences.cpp index 4088b09875..c97b9d03f0 100644 --- a/kicad/preferences.cpp +++ b/kicad/preferences.cpp @@ -42,11 +42,10 @@ void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event ) { bool select = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME; - if( !wxGetApp().m_PdfBrowser || select ) + if( !wxGetApp().m_PdfBrowser && !select ) { - if( !select ) - DisplayError( this, _( "You must choose a PDF viewer before use " \ - "this option" ) ); + DisplayError( this, + _( "You must choose a PDF viewer before using this option." ) ); } wxString wildcard( wxT( "*" ) ); diff --git a/kicad/treeprj_datas.cpp b/kicad/treeprj_datas.cpp index 3bb92b2891..a227f11092 100644 --- a/kicad/treeprj_datas.cpp +++ b/kicad/treeprj_datas.cpp @@ -57,6 +57,13 @@ WinEDA_TreePrj::WinEDA_TreePrj( WinEDA_PrjFrame* parent ) : } +WinEDA_TreePrj::~WinEDA_TreePrj() +{ + if( m_ImageList ) + delete m_ImageList; +} + + /***************************************************************************************/ int WinEDA_TreePrj::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 ) /***************************************************************************************/ @@ -215,8 +222,8 @@ void TreePrjItemData::Move( TreePrjItemData* dest ) if( !wxRenameFile( GetFileName(), destName, false ) ) #endif { - wxMessageDialog( m_Parent, _( "Unable to move file ... " ), _( - "Permission error ?" ), wxICON_ERROR | wxOK ); + wxMessageDialog( m_Parent, _( "Unable to move file ... " ), + _( "Permission error ?" ), wxICON_ERROR | wxOK ); return; } @@ -390,8 +397,8 @@ void TreePrjItemData::Activate( WinEDA_PrjFrame* prjframe ) it in treeprj_frame.cpp in the line looking like this: m_Filters.push_back( wxT( "^no kicad files found" ) ); */ - prjframe->AddFile( wxString( _( "no kicad files found in " \ - "this directory" ) ), id ); + prjframe->AddFile( + _( "no kicad files found in this directory" ), id ); } /* Sort filenames by alphabetic order */ diff --git a/kicad/treeprj_frame.cpp b/kicad/treeprj_frame.cpp index 94ddd9a0d7..3a220154ce 100644 --- a/kicad/treeprj_frame.cpp +++ b/kicad/treeprj_frame.cpp @@ -100,7 +100,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, m_Filters.push_back( wxT( "^no kicad files found" ) ); - #ifdef KICAD_PYTHON +#ifdef KICAD_PYTHON m_Filters.push_back( wxT( "^.*\\.py$" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RunScript" ) ); @@ -112,7 +112,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::DeleteFile" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) ); - #endif /* KICAD_PYTHON */ +#endif /* KICAD_PYTHON */ for( int i = 0; i < TREE_MAX; i++ ) @@ -121,13 +121,13 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, wxMenu* menu = m_ContextMenus[TREE_PY]; // Python script context menu - #ifdef KICAD_PYTHON +#ifdef KICAD_PYTHON item = new wxMenuItem( menu, ID_PROJECT_RUNPY, _( "&Run" ), _( "Run the Python Script" ) ); item->SetBitmap( icon_python_small_xpm ); menu->Append( item ); - #endif /* KICAD_PYTHON */ +#endif /* KICAD_PYTHON */ // ID_PROJECT_TXTEDIT @@ -228,6 +228,21 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, ReCreateTreePrj(); } +WinEDA_PrjFrame::~WinEDA_PrjFrame() +{ + size_t i; + wxMenu* menu; + + for( i = 0; i < m_ContextMenus.size(); i++ ) + { + menu = m_ContextMenus[i]; + delete menu; + } + + if( m_PopupMenu ) + delete m_PopupMenu; +} + /*****************************************************************************/ BEGIN_EVENT_TABLE( WinEDA_PrjFrame, wxSashLayoutWindow ) @@ -258,13 +273,6 @@ END_EVENT_TABLE() /*****************************************************************************/ -/*****************************************************************************/ -WinEDA_TreePrj::~WinEDA_TreePrj() -/*****************************************************************************/ -{ -} - - /** * @brief Allowing drag & drop of file other than the currently opened project */ diff --git a/libs.linux b/libs.linux deleted file mode 100644 index 761a0e5230..0000000000 --- a/libs.linux +++ /dev/null @@ -1,140 +0,0 @@ -# -# Configuration for kicad build & install if not using cmake -# and wxWidgets 2.8.8 -# - -# You must comment or uncomment this line to disable/enable python support -#KICAD_PYTHON = 1 - -# Locations for install targets. All can be overriden on the make command. -# Normally you'd only expect to override the PREFIX if you want to install to -# a non standard install dir (or a temp location for packaging). -# For packaging you can override and install anywhere, but to run from a -# non-standard location edit common/gestfich.ccp so it knows where to -# load help/data/etc. files from. -# Current supported PREFIXes are /usr and /usr/local (standard install for distributions) -# /usr/local/kicad is used when STD_INSTALL = 0, or STD_INSTALL = 2 -# all kicad files will be in /usr/local/kicad -# STD_INSTALL = 2 is used only to make static link (only useful when kicad run on an other -# linux distribution than the distributions used to compil kicad. - -STD_INSTALL = 0 - -#******************************************* -#******************************************* - -ifndef KICAD_PYTHON -ifeq ($(STD_INSTALL), 2) -KICAD_STATIC_LINK = 1 -endif -endif - -ifndef KICAD_STATIC_LINK -KICAD_STATIC_LINK = 0 -endif - -ifeq ($(STD_INSTALL), 1) # Used to build linux distribs -PREFIX = /usr # (can also be /usr/local) -KICAD_BIN = $(PREFIX)/bin # Install main binaries here -KICAD_PLUGINS = $(KICAD_BIN) # Install other binaries here -KICAD_DOCS=$(PREFIX)/share/doc/kicad # Install doc files here -KICAD_DATA=$(PREFIX)/share/kicad # Install libraries and others files here - -else # Install ALL files in /usr/local/kicad -# when STD_INSTALL = 0 or STD_INSTALL = 2 -# STD_INSTALL = 0 is used to build kicad intalled in /usr/local -# STD_INSTALL = 2 is used by myself (JP Charras) to build a statically linked distribution intalled in /usr/local -PREFIX = /usr/local/kicad -KICAD_BIN = $(PREFIX)/bin -KICAD_PLUGINS = $(KICAD_BIN)/plugins -KICAD_DOCS=$(PREFIX)/help -KICAD_DATA=$(PREFIX)/share -endif - -KICAD_MODULES=$(KICAD_DATA)/modules -KICAD_LIBRARY=$(KICAD_DATA)/library -KICAD_INTERNAT=$(KICAD_DATA)/internat -KICAD_TEMPLATE=$(KICAD_DATA)/template - -# define compil and link -CXX = gcc -LD = g++ - -SRCSUFF = .cpp -OBJSUFF = .o -FINAL = 1 - - -# turn ON/OFF debugging for all executables, only tested without KICAD_PYTHON -DEBUG = 0 - - -# common CPPFLAGS to all components, further CPPFLAGS customization in -# directory specific makefile.gtk files. -ifeq ($(DEBUG), 1) -WXXFLAGS := $(shell wx-config --debug --cxxflags) -CPPFLAGS = -Wall -g3 -ggdb3 ${WXXFLAGS} -fno-strict-aliasing -DDEBUG -D_UNICODE -LDFLAGS = -g3 -ggdb3 #-v -else -WXXFLAGS := $(shell wx-config --cxxflags) -CPPFLAGS = -Wall -O2 ${WXXFLAGS} -fno-strict-aliasing -D_UNICODE -LDFLAGS = -s #-v -endif - - -# a command line define which affects pcbnew only, causing it to match current layer -ifdef USE_MATCH_LAYER -CPPFLAGS += -DUSE_MATCH_LAYER -endif - -CPPFLAGS += -I $(BOOST_LIB) - -ifdef KICAD_PYTHON -PYTHON_VERSION=2.5 -PYLIBS= -L/usr/lib -PYLIBS+= -L /usr/include/python -PYLIBS+= -lpython$(PYTHON_VERSION) -PYLIBS+= -lboost_python-mt -EXTRACPPFLAGS+=-I /usr/include/python$(PYTHON_VERSION) -DKICAD_PYTHON -fno-strict-aliasing -endif - -# mesa (free opengl library) libs -MESALIBSPATH = /usr/local/lib - -# Boost headers (location of boost/) -BOOST_LIB = ../ - -#for static link: add wx gl lib -LIBVERSION=`wx-config --release` -WXPATH = `wx-config --prefix`/lib -PREFIX_WX_LIBS = lib`wx-config --basename` -SUFFIX_WX_LIBGL = _gl-$(LIBVERSION).a - -ifeq ($(DEBUG), 1) -# debug wxWidgets -WXSYSLIB= `wx-config --debug --libs std` -else -# or use "standard command" for wxWidgets -WXSYSLIB= `wx-config --libs std` -endif - -# use link static -ifeq ($(KICAD_STATIC_LINK), 1) -LIBS3D = $(WXPATH)/$(PREFIX_WX_LIBS)$(SUFFIX_WX_LIBGL) $(MESALIBSPATH)/libGL.a $(MESALIBSPATH)/libGLU.a -WXSYSLIB_WITH_GL= $(WXSYSLIB) $(LIBS3D) - -else -ifeq ($(DEBUG), 1) -WXSYSLIB_WITH_GL= `wx-config --debug --libs std,gl` -else -WXSYSLIB_WITH_GL= `wx-config --libs std,gl` -endif -endif - - -# attention a l'ordre des libairies -LIBS = -L/usr/local/lib -L/usr/X11R6/lib\ - $(EXTRALIBS) $(WXSYSLIB) $(PYLIBS) - -LIBS_WITH_GL = -L/usr/local/lib -L/usr/X11R6/lib\ - $(EXTRALIBS) $(WXSYSLIB_WITH_GL) $(PYLIBS) diff --git a/libs.macosx b/libs.macosx deleted file mode 100644 index 1349b99936..0000000000 --- a/libs.macosx +++ /dev/null @@ -1,41 +0,0 @@ -#Configuration for build kicad -KICAD_BIN = $(HOME)/install/kicad/macosx - -RESCOMP = /Developer/Tools/Rez -d __DARWIN__ -t APPL -d __WXMAC__ -i . -SETFILE = /Developer/Tools/SetFile - -CPPFLAGS = -D__UNIX__ -Wall -I../include `wx-config --cxxflags` -LDFLAGS = -CC = g++ -LD = g++ - -# turn on/off debugging for all executables, only tested without KICAD_PYTHON -DEBUG = 1 - -ifeq ($(DEBUG), 1) -CPPFLAGS += -g -else -CPPFLAGS += -O2 -endif - -# turn on/off universal binaries -UNIVERSAL = 0 - -ifeq ($(UNIVERSAL), 1) -CPPFLAGS += -arch i386 -arch ppc -endif - -# You must comment or uncomment this line to disable/enable python support -#KICAD_PYTHON = 1 - -ifdef KICAD_PYTHON -PYLIBS= -L/usr/lib -PYLIBS+= -L /usr/include/python -PYLIBS+= -lpython2.4 -PYLIBS+= -lboost_python -EXTRACPPFLAGS+=-I /usr/include/python2.4 -DKICAD_PYTHON -fno-strict-aliasing -endif - -LIBS = ../common/common.a `wx-config --libs` $(PYLIBS) -LIBS3D = ../common/common.a `wx-config --libs std,gl` -framework OpenGL $(PYLIBS) - diff --git a/libs.win b/libs.win deleted file mode 100644 index 28fbbe08cd..0000000000 --- a/libs.win +++ /dev/null @@ -1,72 +0,0 @@ -# File: libs.win -#binaries path: -KICAD_BIN = /f/kicad/bin - - - -# Target WXMAKINGDLL WXUSINGDLL WXBUILDDLL -# wxWin DLL 1 0 1 -# wxWin STATIC 0 0 0 -# App use wxWin DLL 0 1 0 -# DLL use wxWin DLL 0 1 1 -# DLL use wxWin STATIC 0 0 1 -# - -# turn on/OFF debugging for all executables, only tested without KICAD_PYTHON -DEBUG = 0 - - -#comment this for static wxWidgets link -#WXUSINGDLL = 1 - -#Define the wxWidget path (if not found in environment variables): -ifndef WXWIN -ifeq ($(DEBUG), 1) -WXWIN=d:/wxMSW-2.8.10/Debug -else -WXWIN=d:/wxMSW-2.8.10/Release -endif -endif -LIBVERSION = 2.8 - -BOOST_LIB=/f/boost/boost - - -# You must comment or uncomment this line to disable/enable python support -#KICAD_PYTHON = 1 - - -ifeq ($(DEBUG), 1) -CPPFLAGS = -Wall -g3 -ggdb3 -DDEBUG ${WXXFLAGS} -fno-strict-aliasing -ALL_LDFLAGS = -g3 -ggdb3 #-v -else -CPPFLAGS = -Wall -O2 ${WXXFLAGS} -fno-strict-aliasing -ALL_LDFLAGS = -s #-v -FINAL = 1 -endif - -CPPFLAGS += -I $(BOOST_LIB) - -ALL_CPPFLAGS = `$(WXWIN)/wx-config --cppflags` $(CPPFLAGS) -EDACPPFLAGS = $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) $(EXTRACPPFLAGS) -EDALIBS = $(EXTRALIBS) - -ifdef KICAD_PYTHON -PYTHON_PATH=/c/Python25 -PYLIBS= -L$(PYTHON_PATH)/libs -PYLIBS+= -L $(PYTHON_PATH)/Lib -PYLIBS+= -lpython2.5 -EXTRACPPFLAGS+=-I $(PYTHON_PATH)/include -DKICAD_PYTHON -ggdb -endif - -SYSWXLIB = `$(WXWIN)/wx-config --libs gl`\ - -lwxpng-$(LIBVERSION) -lwxjpeg-$(LIBVERSION) -lwxzlib-$(LIBVERSION) $(PYLIBS) - - -CC = gcc - -.cpp.o: - g++ -c -Wall $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) $(EXTRACPPFLAGS) -o $@ $*.cpp - -# Settings for Mingw32 -RESCOMP=`$(WXWIN)/wx-config --rescomp` diff --git a/pcbnew/automove.cpp b/pcbnew/automove.cpp index e79b9aaef9..ac863bcaa1 100644 --- a/pcbnew/automove.cpp +++ b/pcbnew/automove.cpp @@ -200,7 +200,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb ) MODULE* Module; wxPoint start, current; int Ymax_size, Xsize_allowed; - int pas_grille = GetScreen()->GetGrid().x; + int pas_grille = (int)GetScreen()->GetGrid().x; bool EdgeExists; float surface; @@ -218,8 +218,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb ) if( PlaceModulesHorsPcb && !EdgeExists ) { DisplayError( this, - _( - "Autoplace modules: No board edges detected. Unable to place modules" ), + _( "Autoplace modules: No board edges detected. Unable to place modules" ), 20 ); return; } diff --git a/pcbnew/autoplac.cpp b/pcbnew/autoplac.cpp index b299f4b310..99284bebe9 100644 --- a/pcbnew/autoplac.cpp +++ b/pcbnew/autoplac.cpp @@ -29,17 +29,17 @@ * Le cout est ici donne en majoration */ static const float OrientPenality[11] = { - 2.0, /* CntRot = 0 en fait rotation interdite */ - 1.9, /* CntRot = 1 */ - 1.8, /* CntRot = 2 */ - 1.7, /* CntRot = 3 */ - 1.6, /* CntRot = 4 */ - 1.5, /* CntRot = 5 */ - 1.4, /* CntRot = 5 */ - 1.3, /* CntRot = 7 */ - 1.2, /* CntRot = 8 */ - 1.1, /* CntRot = 9 */ - 1.0 /* CntRot = 10 rotation autorisee, penalite nulle */ + 2.0f, /* CntRot = 0 en fait rotation interdite */ + 1.9f, /* CntRot = 1 */ + 1.8f, /* CntRot = 2 */ + 1.7f, /* CntRot = 3 */ + 1.6f, /* CntRot = 4 */ + 1.5f, /* CntRot = 5 */ + 1.4f, /* CntRot = 5 */ + 1.3f, /* CntRot = 7 */ + 1.2f, /* CntRot = 8 */ + 1.1f, /* CntRot = 9 */ + 1.0f /* CntRot = 10 rotation autorisee, penalite nulle */ }; /* Etat d'une cellule */ @@ -121,7 +121,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC lay_tmp_TOP = Route_Layer_TOP; OldPasRoute = g_GridRoutingSize; - g_GridRoutingSize = GetScreen()->GetGrid().x; + g_GridRoutingSize = (int)GetScreen()->GetGrid().x; // Ensure g_GridRoutingSize has a reasonnable value: if( g_GridRoutingSize < 10 ) diff --git a/pcbnew/autorout.cpp b/pcbnew/autorout.cpp index 7b1d5c207a..da28af81b4 100644 --- a/pcbnew/autorout.cpp +++ b/pcbnew/autorout.cpp @@ -135,7 +135,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode ) start = time( NULL ); /* Calcul du pas de routage fixe a 5 mils et plus */ - g_GridRoutingSize = GetScreen()->GetGrid().x; + g_GridRoutingSize = (int)GetScreen()->GetGrid().x; if( g_GridRoutingSize < 50 ) g_GridRoutingSize = 50; E_scale = g_GridRoutingSize / 50; if( E_scale < 1 ) diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 6197f069a3..d36afba2a8 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -280,10 +280,10 @@ bool EDGE_MODULE::Save( FILE* aFile ) const case S_POLYGON: ret = fprintf( aFile, "DP %d %d %d %d %d %d %d\n", - m_Start0.x, m_Start0.y, - m_End0.x, m_End0.y, - m_PolyPoints.size(), - m_Width, m_Layer ); + m_Start0.x, m_Start0.y, + m_End0.x, m_End0.y, + (int)m_PolyPoints.size(), + m_Width, m_Layer ); for( unsigned i=0; im_Ident != PCB_FRAME ) flag = TRUE; pos = 1; - Affiche_1_Parametre( frame, pos, m_Reference->m_Text, m_Value->m_Text, DARKCYAN ); + Affiche_1_Parametre( frame, pos, m_Reference->m_Text, m_Value->m_Text, + DARKCYAN ); /* Affiche signature temporelle ou date de modif (en edition de modules) */ pos += 6; @@ -933,11 +934,12 @@ void MODULE::DisplayInfo( WinEDA_DrawFrame* frame ) else { msg.Printf( wxT( "%8.8lX" ), m_TimeStamp ); - Affiche_1_Parametre( frame, pos, _( "Netlist path" ), /*msg*/ m_Path, BROWN ); + Affiche_1_Parametre( frame, pos, _( "Netlist path" ), m_Path, BROWN ); } pos += 12; - Affiche_1_Parametre( frame, pos, _( "Layer" ), board->GetLayerName( m_Layer ), RED ); + Affiche_1_Parametre( frame, pos, _( "Layer" ), + board->GetLayerName( m_Layer ), RED ); pos += 6; EDA_BaseStruct* PtStruct = m_Pads; diff --git a/pcbnew/classpcb.cpp b/pcbnew/classpcb.cpp index 3237acb252..87aeb9b0d0 100644 --- a/pcbnew/classpcb.cpp +++ b/pcbnew/classpcb.cpp @@ -134,7 +134,7 @@ bool PCB_SCREEN::IsMicroViaAcceptable( void ) DISPLAY_OPTIONS::DISPLAY_OPTIONS() { - DisplayPadFill = TRUE; + DisplayPadFill = FILLED; DisplayPadNum = TRUE; DisplayPadNoConn = TRUE; DisplayPadIsol = TRUE; diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index e35e016808..74fb8b5121 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -28,7 +28,7 @@ static TRACK* AlignSegment( BOARD* Pcb, TRACK* pt_ref, TRACK* pt_segm, int ext static void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC ); /* Local Variables: */ -static bool a_color; /* message color */ +static int a_color; /* message color */ static bool s_CleanVias = true; static bool s_MergeSegments = true; static bool s_DeleteUnconnectedSegm = true; diff --git a/pcbnew/dialog_general_options.cpp b/pcbnew/dialog_general_options.cpp index 00e30e6f2a..a05822b8b8 100644 --- a/pcbnew/dialog_general_options.cpp +++ b/pcbnew/dialog_general_options.cpp @@ -217,8 +217,9 @@ void Dialog_Display_Options::OnOkClick(wxCommandEvent& event) m_OptDisplayModEdges->GetSelection(); if (m_OptDisplayPads->GetSelection() == 1 ) - DisplayOpt.DisplayPadFill = TRUE; - else DisplayOpt.DisplayPadFill = FALSE; + DisplayOpt.DisplayPadFill = true; + else + DisplayOpt.DisplayPadFill = false; m_Parent->m_DisplayPadFill = DisplayOpt.DisplayPadFill; @@ -231,7 +232,6 @@ void Dialog_Display_Options::OnOkClick(wxCommandEvent& event) DisplayOpt.DisplayDrawItems = m_OptDisplayDrawings->GetSelection(); DisplayOpt.DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection(); - m_Parent->DrawPanel->Refresh(TRUE); EndModal(1); @@ -377,8 +377,14 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event ) break; case ID_TB_OPTIONS_SHOW_PADS_SKETCH: - m_DisplayPadFill = DisplayOpt.DisplayPadFill = - !m_OptionsToolBar->GetToolState( id ); + if( m_OptionsToolBar->GetToolState( id ) ) + { + m_DisplayPadFill = DisplayOpt.DisplayPadFill = true; + } + else + { + m_DisplayPadFill = DisplayOpt.DisplayPadFill = false; + } DrawPanel->Refresh( ); break; diff --git a/pcbnew/dialog_print_using_printer.cpp b/pcbnew/dialog_print_using_printer.cpp index d2ac4e7ae9..acddfded79 100644 --- a/pcbnew/dialog_print_using_printer.cpp +++ b/pcbnew/dialog_print_using_printer.cpp @@ -16,9 +16,7 @@ #include "dialog_print_using_printer_base.h" #include "pcbnew.h" - #include "protos.h" - #include "pcbplot.h" #define DEFAULT_ORIENTATION_PAPER wxLANDSCAPE // other option is wxPORTRAIT diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index 1d85479efc..c7e8e6321e 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -309,9 +309,9 @@ bool WinEDA_PcbFrame::Add_45_degrees_Segment( wxDC* DC ) return false; } - pas_45 = GetScreen()->GetGrid().x / 2; + pas_45 = (int)GetScreen()->GetGrid().x / 2; if( pas_45 < curTrack->m_Width ) - pas_45 = GetScreen()->GetGrid().x; + pas_45 = (int)GetScreen()->GetGrid().x; while( pas_45 < curTrack->m_Width ) pas_45 *= 2; @@ -666,11 +666,12 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase { D( g_CurrentTrackList.VerifyListIntegrity(); ); - int IsolTmp, Track_fill_copy; + int IsolTmp; + bool Track_fill_copy; PCB_SCREEN* screen = (PCB_SCREEN*) panel->GetScreen(); Track_fill_copy = DisplayOpt.DisplayPcbTrackFill; - DisplayOpt.DisplayPcbTrackFill = SKETCH; + DisplayOpt.DisplayPcbTrackFill = true; IsolTmp = DisplayOpt.DisplayTrackIsol; if( g_ShowIsolDuringCreateTrack ) diff --git a/pcbnew/gen_drill_report_files.cpp b/pcbnew/gen_drill_report_files.cpp index 8a233da0e8..764243c0ca 100644 --- a/pcbnew/gen_drill_report_files.cpp +++ b/pcbnew/gen_drill_report_files.cpp @@ -72,7 +72,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w Scale_X = Scale_Y = 1.0; scale_x = Scale_X * SCALE_HPGL; scale_y = Scale_Y * SCALE_HPGL; - fTextScale = SCALE_HPGL; + fTextScale = (float)SCALE_HPGL; SheetSize = aSheetSize; SheetSize.x *= U_PCB; SheetSize.y *= U_PCB; @@ -162,7 +162,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w } // Set Drill Symbols width in 1/10000 mils - LineWidth = 50 / scale_x; // real scale will be CharScale * scale_x + LineWidth = wxRound( 50.0 / scale_x ); // real scale will be CharScale * scale_x int tmpPlotLineWidth = g_PlotLine_Width; // Plot board outlines and drill map if ( format == PLOT_FORMAT_POST) diff --git a/pcbnew/gendrill.cpp b/pcbnew/gendrill.cpp index 02da3687ca..0770e73dcb 100644 --- a/pcbnew/gendrill.cpp +++ b/pcbnew/gendrill.cpp @@ -283,9 +283,9 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event ) m_Parent->MsgPanel->EraseMsgBox(); /* Set conversion scale depending on drill file units */ - s_ConversionUnits = 0.0001; /* unites = INCHES */ + s_ConversionUnits = 0.0001f; /* unites = INCHES */ if( !s_Unit_Drill_is_Inch ) - s_ConversionUnits = 0.000254; /* unites = mm */ + s_ConversionUnits = 0.000254f; /* unites = mm */ if( m_MicroViasCount || m_BlindOrBuriedViasCount ) ExistsBuriedVias = true; diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index c9417dc3e4..18e5427342 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -30,8 +30,7 @@ const wxString ModExportFileExtension( wxT( "emp" ) ); -const wxString ModExportFileWildcard( _( "Kicad foot print export files " \ - "(*.emp)|*.emp" ) ); +const wxString ModExportFileWildcard( _( "Kicad foot print export files (*.emp)|*.emp" ) ); /* Fonctions locales */ diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index 27a343caa5..8d4ae27dc6 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -207,8 +207,8 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module( const wxString& aLibraryFullF if( !tmp ) { - msg.Printf( _( "PCB footprint library file <%s> not found in " \ - "search paths." ), fn.GetFullName().c_str() ); + msg.Printf( _( "PCB footprint library file <%s> not found in search paths." ), + fn.GetFullName().c_str() ); wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, this ); continue; @@ -234,8 +234,8 @@ MODULE* WinEDA_BasePcbFrame::Get_Librairie_Module( const wxString& aLibraryFullF StrPurge( Line ); if( strnicmp( Line, ENTETE_LIBRAIRIE, L_ENTETE_LIB ) != 0 ) { - msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library " \ - "file." ), tmp.c_str() ); + msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library file." ), + tmp.c_str() ); wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, this ); fclose( file ); @@ -358,8 +358,8 @@ wxString WinEDA_BasePcbFrame::Select_1_Module_From_List( if( !tmp ) { - msg.Printf( _( "PCB footprint library file <%s> not found in " \ - "search paths." ), fn.GetFullName().c_str() ); + msg.Printf( _( "PCB footprint library file <%s> not found in search paths." ), + fn.GetFullName().c_str() ); wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, this ); continue; @@ -394,8 +394,8 @@ wxString WinEDA_BasePcbFrame::Select_1_Module_From_List( if( strnicmp( Line, ENTETE_LIBRAIRIE, L_ENTETE_LIB ) != 0 ) { - msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library " \ - "file." ), tmp.c_str() ); + msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library file." ), + tmp.c_str() ); wxMessageBox( msg, _( "Library Load Error" ), wxOK | wxICON_ERROR, this ); fclose( file ); diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index b8cc972903..477de4cc74 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -122,6 +122,17 @@ BOARD_ITEM* WinEDA_ModuleEditFrame::ModeditLocateAndDisplay( int aHotKeyCode ) } +void WinEDA_ModuleEditFrame::LoadModuleFromBoard( wxCommandEvent& event ) +{ + GetScreen()->ClearUndoRedoList(); + Load_Module_Module_From_BOARD( NULL ); + GetScreen()->ClrModify(); + + if( m_Draw3DFrame ) + m_Draw3DFrame->NewDisplay(); +} + + /****************************************************************************/ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event ) /****************************************************************************/ @@ -240,14 +251,6 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event ) break; } - case ID_MODEDIT_LOAD_MODULE_FROM_BOARD: - GetScreen()->ClearUndoRedoList(); - Load_Module_Module_From_BOARD( NULL ); - GetScreen()->ClrModify(); - if( m_Draw3DFrame ) - m_Draw3DFrame->NewDisplay(); - break; - case ID_MODEDIT_INSERT_MODULE_IN_BOARD: case ID_MODEDIT_UPDATE_MODULE_IN_BOARD: { diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 7a04091bcf..e980e34844 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -62,7 +62,7 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) EVT_TOOL( ID_MODEDIT_PAD_SETTINGS, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, - WinEDA_ModuleEditFrame::Process_Special_Functions ) + WinEDA_ModuleEditFrame::LoadModuleFromBoard ) EVT_TOOL( ID_MODEDIT_INSERT_MODULE_IN_BOARD, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_UPDATE_MODULE_IN_BOARD, diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index 3cc68f3c0f..16d401d7e0 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -45,7 +45,7 @@ void Show_Pads_On_Off( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module ) return; pad_fill_tmp = DisplayOpt.DisplayPadFill; - DisplayOpt.DisplayPadFill = FALSE; /* Trace en SKETCH */ + DisplayOpt.DisplayPadFill = true; /* Trace en SKETCH */ pt_pad = module->m_Pads; for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) { @@ -794,7 +794,7 @@ void DrawModuleOutlines( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module ) if( g_Show_Pads_Module_in_Move ) { pad_fill_tmp = DisplayOpt.DisplayPadFill; - DisplayOpt.DisplayPadFill = SKETCH; /* Trace en SKETCH en deplacement */ + DisplayOpt.DisplayPadFill = true; /* Trace en SKETCH en deplacement */ pt_pad = module->m_Pads; for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) diff --git a/pcbnew/muonde.cpp b/pcbnew/muonde.cpp index b37b6ed844..6d0cd6af63 100644 --- a/pcbnew/muonde.cpp +++ b/pcbnew/muonde.cpp @@ -251,7 +251,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC ) DisplayError( this, _( "Incorrect number, abort" ) ); return NULL; } - Mself.lng = (int) round( fval * fcoeff ); + Mself.lng = wxRound( fval * fcoeff ); /* Controle des valeurs ( ii = valeur minimale de la longueur */ if( Mself.lng < Mself.m_Size.y ) @@ -690,7 +690,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( int shape_type ) wxString value; if( g_UnitMetric ) { - fcoeff = 10000.0 / 25.4; + fcoeff = 10000.0f / 25.4f; value.Printf( wxT( "%2.4f" ), gap_size / fcoeff ); msg += _( " (mm):" ); } @@ -1191,7 +1191,7 @@ void WinEDA_PcbFrame::Edit_Gap( wxDC* DC, MODULE* Module ) /* Entree de la longueur desiree du gap*/ if( g_UnitMetric ) { - fcoeff = 10000.0 / 25.4; + fcoeff = 10000.0f / 25.4f; msg.Printf( wxT( "%2.3f" ), gap_size / fcoeff ); Get_Message( _( "Gap (mm):" ), _("Create Microwave Gap"), msg, this ); } diff --git a/pcbnew/pcbcfg.cpp b/pcbnew/pcbcfg.cpp index a4ea1ac135..9e44b9ac3b 100644 --- a/pcbnew/pcbcfg.cpp +++ b/pcbnew/pcbcfg.cpp @@ -165,9 +165,9 @@ bool Read_Config( const wxString& projectFileName ) if( fn.GetExt() != ProjectFileExtension ) { - wxLogDebug( wxT( "Attempting to open project file <%s>. Changing " \ - "file extension to a Kicad project file extension " \ - "(.pro)." ), fn.GetFullPath().c_str() ); + wxLogDebug( wxT( "Attempting to open project file <%s>. Changing \ +file extension to a Kicad project file extension (.pro)." ), + fn.GetFullPath().c_str() ); fn.SetExt( ProjectFileExtension ); } diff --git a/pcbnew/pcbcfg.h b/pcbnew/pcbcfg.h index 544f088170..5154c20aa6 100644 --- a/pcbnew/pcbcfg.h +++ b/pcbnew/pcbcfg.h @@ -210,11 +210,11 @@ static PARAM_CFG_BOOL TrackAfficheGardeCfg FALSE /* Default value */ ); -static PARAM_CFG_BOOL PadFillCfg +static PARAM_CFG_INT PadFillCfg ( INSETUP, wxT( "PadFill" ), /* Keyword */ - &DisplayOpt.DisplayPadFill, /* Parameter address */ + (int*)&DisplayOpt.DisplayPadFill, /* Parameter address */ TRUE /* Default value */ ); diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index ae44a85132..b7d5423cde 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -124,7 +124,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_TOOL( ID_UNDO_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_GEN_PRINT, WinEDA_DrawFrame::ToPrinter ) EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print ) - EVT_TOOL( ID_GEN_PLOT, WinEDA_DrawFrame::Process_Special_Functions ) + EVT_TOOL( ID_GEN_PLOT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_DRC_CONTROL, WinEDA_PcbFrame::Process_Special_Functions ) diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index d8b358bef3..089cb5ec29 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -88,8 +88,8 @@ bool Plot_Pads_All_Layers; /* Plot pads meme n'appartenant pas a la // Wildcard for footprint libraries filesnames -const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file " \ - "(*.mod)|*.mod" ) ); +const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file (*.mod)|*.mod" ) ); + /* Name of the document footprint list * usually located in share/modules/footprints_doc * this is of the responsability to users to create this file @@ -123,8 +123,8 @@ bool WinEDA_App::OnInit() if( fn.GetExt() != BoardFileExtension ) { - wxLogDebug( wxT( "PcbNew file <%s> has the wrong extension." \ - " Changing extension to .brd." ), + wxLogDebug( wxT( "PcbNew file <%s> has the wrong extension. \ +Changing extension to .brd." ), fn.GetFullPath().c_str() ); fn.SetExt( BoardFileExtension ); } diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index f26256c819..442e4ff2d6 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -848,7 +848,7 @@ void PlotPolygon( int format_plot, int nbpoints, int* coord, int width ) // Compute pen_dim (from g_HPGL_Pen_Diam in mils) in pcb units, // with plot scale (if Scale is 2, pen diametre is always g_HPGL_Pen_Diam // so apparent pen diam is real pen diam / Scale - int pen_diam = (int) round( (g_HPGL_Pen_Diam * U_PCB) / Scale_X ); // Assume Scale_X # Scale_Y + int pen_diam = wxRound( (g_HPGL_Pen_Diam * U_PCB) / Scale_X ); // Assume Scale_X # Scale_Y wxString msg; if( pen_diam >= width ) PlotPolyHPGL( nbpoints, coord, false, width ); // PlotPolyHPGL does not handle width diff --git a/pcbnew/plotgerb.cpp b/pcbnew/plotgerb.cpp index e517035a3e..6ceaa96b82 100644 --- a/pcbnew/plotgerb.cpp +++ b/pcbnew/plotgerb.cpp @@ -743,7 +743,7 @@ int Gen_D_CODE_File( FILE* penfile ) while( ptr_tool && ( ptr_tool->m_Type >= 0 ) ) { - float fscale = 0.0001; // For 3.4 format + float fscale = 0.0001f; // For 3.4 format char* text; sprintf( cbuf, "%%ADD%d", ptr_tool->m_NumDcode ); text = cbuf + strlen( cbuf ); diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index 199a4663e0..3668adfa0b 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -35,9 +35,9 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa save_opt = DisplayOpt; if( aPrintMaskLayer & ALL_CU_LAYERS ) - DisplayOpt.DisplayPadFill = FILLED; + DisplayOpt.DisplayPadFill = true; else - DisplayOpt.DisplayPadFill = SKETCH; + DisplayOpt.DisplayPadFill = false; frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill; frame->m_DisplayPadNum = DisplayOpt.DisplayPadNum = false; DisplayOpt.DisplayPadNoConn = false; diff --git a/pcbnew/xchgmod.cpp b/pcbnew/xchgmod.cpp index ab1dcf9981..195f5f6fae 100644 --- a/pcbnew/xchgmod.cpp +++ b/pcbnew/xchgmod.cpp @@ -532,8 +532,8 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff, if( (OldModule->Type() != TYPE_MODULE) || (NewModule->Type() != TYPE_MODULE) ) { - DisplayError( winaff, wxT( "WinEDA_BasePcbFrame::Exchange_Module() " \ - "StuctType error" ) ); + DisplayError( winaff, + wxT( "WinEDA_BasePcbFrame::Exchange_Module() StuctType error" ) ); } NewModule->SetParent( GetBoard() ); diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index fa0dd52e74..f8ededa05c 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -4,8 +4,6 @@ // Licence: GPL License ///////////////////////////////////////////////////////////////////////////// -using namespace std; - #include "fctsys.h" #include "appl_wxstruct.h" #include "common.h" @@ -16,6 +14,8 @@ using namespace std; #include "id.h" #include "protos.h" +using namespace std; + bool verbose = false; // false if zone outline diags must not be shown // Outline creation: diff --git a/pcbnew/zones_convert_brd_items_to_polygons.cpp b/pcbnew/zones_convert_brd_items_to_polygons.cpp index a07501043a..11d55868d1 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons.cpp @@ -19,8 +19,6 @@ * - shapes are smoothed. */ -using namespace std; - #include #include @@ -31,9 +29,11 @@ using namespace std; #include "zones.h" - #include "PolyLine.h" +using namespace std; + + extern void Test_For_Copper_Island_And_Remove( BOARD* aPcb, ZONE_CONTAINER* aZone_container ); diff --git a/pcbnew/zones_test_and_combine_areas.cpp b/pcbnew/zones_test_and_combine_areas.cpp index 5339739779..3bc884c0a8 100644 --- a/pcbnew/zones_test_and_combine_areas.cpp +++ b/pcbnew/zones_test_and_combine_areas.cpp @@ -684,7 +684,9 @@ int BOARD::TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_ int BOARD::CombineAreas( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_combine ) { if( area_ref == area_to_combine ) + { ASSERT( 0 ); + } // polygons intersect, combine them std::vector arc_array1; diff --git a/polygon/PolyLine.cpp b/polygon/PolyLine.cpp index b03566ca8e..2f5981e6af 100644 --- a/polygon/PolyLine.cpp +++ b/polygon/PolyLine.cpp @@ -3,16 +3,15 @@ // // implementation for kicad and kbool polygon clipping library // -using namespace std; - #include #include #include "fctsys.h" - #include "PolyLine.h" +using namespace std; + #define pi 3.14159265359 diff --git a/polygon/math_for_graphics.cpp b/polygon/math_for_graphics.cpp index 81d3ad303f..7e047c7f68 100644 --- a/polygon/math_for_graphics.cpp +++ b/polygon/math_for_graphics.cpp @@ -1,7 +1,5 @@ // math for graphics utility routines, from FreePCB -using namespace std; - #include #include @@ -12,6 +10,8 @@ using namespace std; #include "PolyLine.h" +using namespace std; + // test for hit on line segment // i.e. cursor within a given distance from segment