Build improvements, compiler warning fixes and build fixes, and lots of clean up.

* Created separate SVN version header.
* Add true config.h for platform dependency checks.
* Add dependency check cmake module.
* Remove some leftover hand crafted make files.
* Remove non-cmake build instructions from COMPILING.txt.
* Fix split _() strings causing Visual C++ compiler error.
* Fix lots of compiler warnings.
* Change project file parameter container from wxArray to boost::vector_ptr.
* Removed lots of redundant header definitions.
* Fixed green_xpm redefinition in ercgreen.xpm.
* Remove some dead code and unnecessary class methods.
This commit is contained in:
stambaughw 2009-05-21 17:42:42 +00:00
parent 555b1c5ad9
commit 8bf7911125
132 changed files with 1161 additions and 1669 deletions

View File

@ -152,14 +152,14 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
glEnable( GL_COLOR_MATERIAL ); glEnable( GL_COLOR_MATERIAL );
SetGLColor( WHITE ); SetGLColor( WHITE );
glBegin( GL_LINES ); glBegin( GL_LINES );
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis glNormal3f( 0.0f, 0.0f, 1.0f ); // Normal is Z axis
glVertex3f( 0.0, 0.0, 0.0 ); glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 1.0, 0.0, 0.0 ); // X axis glVertex3f( 1.0f, 0.0f, 0.0f ); // X axis
glVertex3f( 0.0, 0.0, 0.0 ); glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0, -1.0, 0.0 ); // Y axis glVertex3f( 0.0f, -1.0f, 0.0f ); // Y axis
glNormal3f( 1.0, 0.0, 0.0 ); // Normal is Y axis glNormal3f( 1.0f, 0.0f, 0.0f ); // Normal is Y axis
glVertex3f( 0.0, 0.0, 0.0 ); glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0, 0.0, 0.3 ); // Z axis glVertex3f( 0.0f, 0.0f, 0.3f ); // Z axis
glEnd(); glEnd();
} }

View File

@ -13,14 +13,11 @@
#ifdef __WXMAC__ #ifdef __WXMAC__
# ifdef __DARWIN__ # ifdef __DARWIN__
# include <OpenGL/gl.h>
# include <OpenGL/glu.h> # include <OpenGL/glu.h>
# else # else
# include <gl.h>
# include <glu.h> # include <glu.h>
# endif # endif
#else #else
# include <GL/gl.h>
# include <GL/glu.h> # include <GL/glu.h>
#endif #endif

View File

@ -93,7 +93,6 @@ mark_as_advanced(KICAD_BIN
KICAD_TEMPLATE) KICAD_TEMPLATE)
#================================================ #================================================
# Find libraries that are needed to build KiCad. # 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") check_find_package_result(wxWidgets_FOUND "wxWidgets")
# Include wxWidgets macros. # Include wxWidgets macros.
include(${wxWidgets_USE_FILE}) include(${wxWidgets_USE_FILE})
# Include MinGW resource compiler. # Include MinGW resource compiler.
include(MinGWResourceCompiler) include(MinGWResourceCompiler)
# Generate build system specific header file.
include(PerformFeatureChecks)
perform_feature_checks()
# Automagically create version header file. # Automagically create version header file.
include(CreateSVNVersionHeader) include(CreateSVNVersionHeader)
create_svn_version_header() create_svn_version_header()
@ -147,7 +149,6 @@ include_directories(${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}) ${CMAKE_BINARY_DIR})
#================================================ #================================================
# Let CMake look in these directories for nested # Let CMake look in these directories for nested
# 'CMakeLists.txt' files to process # 'CMakeLists.txt' files to process
@ -175,7 +176,6 @@ add_subdirectory(internat)
add_subdirectory(template) add_subdirectory(template)
#================================================ #================================================
# Installation parameters # Installation parameters
#================================================ #================================================
@ -208,7 +208,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# CVpcb desktop file # CVpcb desktop file
install(FILES ${LINUX_DESKTOP_FILES}/cvpcb.desktop install(FILES ${LINUX_DESKTOP_FILES}/cvpcb.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
@ -219,7 +218,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# EEschema desktop file # EEschema desktop file
install(FILES ${LINUX_DESKTOP_FILES}/eeschema.desktop install(FILES ${LINUX_DESKTOP_FILES}/eeschema.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
@ -230,7 +228,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# GerbView desktop file # GerbView desktop file
install(FILES ${LINUX_DESKTOP_FILES}/gerbview.desktop install(FILES ${LINUX_DESKTOP_FILES}/gerbview.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
@ -241,7 +238,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# PCBnew desktop file # PCBnew desktop file
install(FILES ${LINUX_DESKTOP_FILES}/pcbnew.desktop install(FILES ${LINUX_DESKTOP_FILES}/pcbnew.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications

View File

@ -54,9 +54,9 @@ macro(create_svn_version_header)
# reflect this. # reflect this.
add_definitions(-DHAVE_SVN_VERSION) add_definitions(-DHAVE_SVN_VERSION)
# Generate config.h. # Generate version.h.
configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/version.h.cmake
${CMAKE_BINARY_DIR}/config.h) ${CMAKE_BINARY_DIR}/version.h)
message(STATUS "Kicad SVN version: ${KICAD_SVN_VERSION}") message(STATUS "Kicad SVN version: ${KICAD_SVN_VERSION}")
message(STATUS "Kicad about version: ${KICAD_ABOUT_VERSION}") message(STATUS "Kicad about version: ${KICAD_ABOUT_VERSION}")

View File

@ -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 <some_header_for_system_a.h>
# #elif SYSTEM_B
# # include <some_other_header_for_system_b.h>
# #elif SYSTEM_C
# # include <yet_another_header_for_system_c.h>
# #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 <iso646.h>. There should be a cmake macro
# to check if compiler supports the not keyword natively. If not,
# then check for <iso646.h> 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)

View File

@ -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__ #ifndef __CONFIG_H__
#define __KICAD_SVN_VERSION_H__ #define __CONFIG_H__
#cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@" #cmakedefine HAVE_STRCASECMP
#cmakedefine KICAD_ABOUT_VERSION "@KICAD_ABOUT_VERSION@"
#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 <malloc.h>
#endif
#cmakedefine HAVE_ISO646_H
#if defined( HAVE_ISO646_H )
#include <iso646.h>
#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__ */

View File

@ -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__ */

View File

@ -1,6 +1,6 @@
--== How to build kicad using CMAKE ==-- --== How to build kicad ==--
First Written: 19-Dec-2007 First Written: 19-Dec-2007
Last Revised: 12-Mar-2008 Last Revised: 13-May-2009
Kicad needs wxWidgets, the multi platform G.U.I. Kicad needs wxWidgets, the multi platform G.U.I.
@ -26,6 +26,7 @@ sections below.)
===== Step Details ==================================================== ===== Step Details ====================================================
1) If windows, then install "msys" and "mingw". 1) If windows, then install "msys" and "mingw".
Skip this step if on a Unix box. Get msys and mingw here: Skip this step if on a Unix box. Get msys and mingw here:
http://mingw.org/ http://mingw.org/
msys sets up a development environment that allows the bash shell to run. 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 at least the following mingw packages: make, gcc, g++, binutils, autoconf, and
automake. automake.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
2) If linux, install "mesa". Use your package manager to install the development 2) If linux, install "mesa". Use your package manager to install the
libaries. development libaries.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
3) Make sure g++ and "make" are in your path. 3) Make sure g++ and "make" are in your path.
If windows, then try running g++ and make from within your msys bash shell. If windows, then try running g++ and make from within your msys bash shell.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
4) Install wxWidgets [and build it if on windows]. 4) Install wxWidgets [and build it if on windows].
If on windows, download If on windows, download
http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.8.zip or a newer version. 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 Start msys so you have a bash shell. Decide where your wxWidgets build directory
@ -54,8 +60,8 @@ such as home/<user>. 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 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 a "debug" version of the wxWidgets library at this point, instead of the release
version, or in addition to the the release version.) version, or in addition to the the release version.)
Unzip the wmMWS zip file into the build directory. Change directories into there, Unzip the wmMWS zip file into the build directory. Change directories into
and then: there, and then:
mkdir build-release mkdir build-release
mkdir build-debug 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 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. 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 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 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 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. 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]. 5) Install zlib [and build it if on windows].
If on windows, download http://www.zlib.net/zlib123.zip or a newer version. 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 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, will be. It must be where you can access it from within the msys environment,
such as home/<user>. Edit your msys/1.0/etc/fstab file if needed to provide such as home/<user>. 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 access to this build directory from msys. Unzip the zlib123.zip file into this
build directory. Change directories into there, and then: build directory. Change directories into there, and then:
./configure ./configure
make make
make install make install
@ -107,12 +115,15 @@ If linux, use your package manager to install zlib pre-built binaries.
Note (JP Charras): Note (JP Charras):
Under Linux, zlib is usually installed. Under Linux, zlib is usually installed.
if not found by wxWidget installation, wxWidgets creates an alternate zlib 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. Under Windows, zlib is not installed, so my cmake buld try to use the
So, under windows kicad build should work without zlib install. wxWidgets zlib build. So, under windows kicad build should work without
zlib install.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
6) Install CMAKE. 6) Install CMAKE.
If windows, download the installation binary for windows from cmake.org. If windows, download the installation binary for windows from cmake.org.
Install that and choose to add cmake to your path during installation. You 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. 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 2.6.1 from source. Verify that cmake is in your path by trying to run it from a
command prompt. command prompt.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
7) Install Boost C++ Libraries 7) Install Boost C++ Libraries
Under linux, boost is already installed, but can be too old. Under linux, boost is already installed, but can be too old.
If this is the case, you *must* update boost. If this is the case, you *must* update boost.
Go to http://www.boost.org/ dowlload the latest version of boost. Go to http://www.boost.org/ dowlload the latest version of boost.
unzip (or untar) boots file. unzip (or untar) boots file.
under Windows, files can be installed (unzipped) everywhere, but when create makefiles using cmake, under Windows, files can be installed (unzipped) everywhere, but when create
you will have a message saying boost is not found, something like: makefiles using cmake, you will have a message saying boost is not found,
something like:
-- Check for installed Boost -- not found -- Check for installed Boost -- not found
CMake Error at CMakeModules/CheckFindPackageResult.cmake:6 (message): 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: and edit it to set the right path, something like:
Boost_INCLUDE_DIR:PATH=f:/boost/boost 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. 8) Install the kicad source tree.
You can use the subversion repository or a tar file for this. See the wiki. You can use the subversion repository or a tar file for this. See the wiki.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
9) Use cmake to create the kicad makefiles. 9) Use cmake to create the kicad makefiles.
@ -187,18 +204,22 @@ notice the leading <boost/ in the path.
So point your Boost_INCLUDE_DIR:PATH= variable to a directory above the So point your Boost_INCLUDE_DIR:PATH= variable to a directory above the
"boost" directory. "boost" directory.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
10) Use make to build and install kicad. 10) Use make to build and install kicad.
You compile Kicad here. You will only need to do step 8) again when one of the You compile Kicad here. You will only need to do step 8) again when one of the
CMakeLists.txt files change. If windows, you must be in your msys shell. CMakeLists.txt files change. If windows, you must be in your msys shell.
On either platform then: On either platform then:
cd <kicadSource>/build/release cd <kicadSource>/build/release
make make
[sudo] make install [sudo] make install
You are now done unless you want to make a Debug build. You are now done unless you want to make a Debug build.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
11) Making 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 <kicadSource>/build/debug cd <kicadSource>/build/debug
On either cmake command line shown below, you can optionally include On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final ../../ argument. Although -DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final ../../ argument.
normally you do not install the Debug binaries, you can debug them where they Although normally you do not install the Debug binaries, you can debug them
were built. where they were built.
If windows, run the following command: If windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../ cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
@ -219,6 +240,7 @@ If linux, run instead the following command:
Make the Debug binaries: Make the Debug binaries:
make make
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
12) Variables for fine-tuning the build process. 12) Variables for fine-tuning the build process.
@ -240,10 +262,8 @@ These should be set from command line:
CMAKE_INSTALL_PREFIX (OPTIONAL) CMAKE_INSTALL_PREFIX (OPTIONAL)
KICAD_MINIZIP ON/OFF KICAD_MINIZIP ON/OFF
KICAD_PYTHON 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 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() )

View File

@ -1,8 +1,8 @@
/* XPM */ /* XPM */
#ifndef XPMMAIN #ifndef XPMMAIN
extern const char * green_xpm[]; extern const char * erc_green_xpm[];
#else #else
const char *green_xpm[] = { const char *erc_green_xpm[] = {
/* columns rows colors const chars-per-pixel */ /* columns rows colors const chars-per-pixel */
"11 11 2 1", "11 11 2 1",
"- c Black", "- c Black",

View File

@ -13,7 +13,7 @@
wxString g_BuildVersion wxString g_BuildVersion
#ifdef HAVE_SVN_VERSION #ifdef HAVE_SVN_VERSION
#include "config.h" #include "version.h"
( wxT( KICAD_SVN_VERSION ) ) ( wxT( KICAD_SVN_VERSION ) )
#else #else
( BUILD_VERSION ) ( BUILD_VERSION )
@ -22,7 +22,7 @@ wxString g_BuildVersion
wxString g_BuildAboutVersion wxString g_BuildAboutVersion
#if defined(HAVE_SVN_VERSION) || defined(HAVE_SVN_REVISION) #if defined(HAVE_SVN_VERSION) || defined(HAVE_SVN_REVISION)
# include "config.h" # include "version.h"
( wxT( KICAD_ABOUT_VERSION ) ) ( wxT( KICAD_ABOUT_VERSION ) )
#else #else
( BUILD_VERSION ) ( BUILD_VERSION )

View File

@ -376,8 +376,8 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size )
m_Grid = nearest_grid; m_Grid = nearest_grid;
wxLogWarning( _( "Grid size( %f, %f ) not in grid list, falling back to " \ wxLogWarning( wxT( "Grid size( %f, %f ) not in grid list, falling back " ) \
"grid size( %f, %f )." ), wxT( "to grid size( %f, %f )." ),
size.x, size.y, m_Grid.x, m_Grid.y ); 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; m_Grid = m_GridList[0].m_Size;
wxLogWarning( _( "Grid ID %d not in grid list, falling back to " \ wxLogWarning( wxT( "Grid ID %d not in grid list, falling back to " ) \
"grid size( %g, %g )." ), id, m_Grid.x, m_Grid.y ); wxT( "grid size( %g, %g )." ), id, m_Grid.x, m_Grid.y );
} }
void BASE_SCREEN::AddGrid( const GRID_TYPE& grid ) 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 ) if( m_GridList[i].m_Id == grid.m_Id )
{ {
wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " \ wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " ) \
"size( %g, %g )." ), wxT( "size( %g, %g )." ),
grid.m_Id, m_GridList[i].m_Size.x, 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.y, grid.m_Size.x, grid.m_Size.y );
m_GridList[i].m_Size = grid.m_Size; m_GridList[i].m_Size = grid.m_Size;

View File

@ -34,7 +34,6 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,
const wxSize& size, const wxSize& size,
long style ) : long style ) :
wxFrame( father, -1, title, pos, size, style ) wxFrame( father, -1, title, pos, size, style )
/**********************************************************/
{ {
wxSize minsize; wxSize minsize;

View File

@ -323,7 +323,7 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit,
StringValue << aValue; StringValue << aValue;
else 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" ), StringValue.Printf( ( aInternal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ),
value_to_print ); value_to_print );
} }
@ -366,7 +366,7 @@ int ReturnValueFromString( int Units, const wxString& TextValue,
if( Units >= CENTIMETRE ) if( Units >= CENTIMETRE )
Value = wxRound( dtmp ); Value = wxRound( dtmp );
else else
Value = From_User_Unit( Units, dtmp, Internal_Unit ); Value = From_User_Unit( (bool)Units, dtmp, Internal_Unit );
return Value; return Value;
} }

View File

@ -331,14 +331,14 @@ void PrintHeaderPS( FILE* file, const wxString& Creator,
// the order in which they are specified is not wrong!) // the order in which they are specified is not wrong!)
if( SheetPS->m_Name.Cmp( wxT( "User" ) ) == 0 ) if( SheetPS->m_Name.Cmp( wxT( "User" ) ) == 0 )
sprintf( Line, "%%%%DocumentMedia: Custom %d %d 0 () ()\n", sprintf( Line, "%%%%DocumentMedia: Custom %d %d 0 () ()\n",
(int) round( SheetPS->m_Size.y * CONV_SCALE ), wxRound( SheetPS->m_Size.y * CONV_SCALE ),
(int) round( SheetPS->m_Size.x * CONV_SCALE ) ); wxRound( SheetPS->m_Size.x * CONV_SCALE ) );
else // ( if SheetPS->m_Name does not equal "User" ) else // ( if SheetPS->m_Name does not equal "User" )
sprintf( Line, "%%%%DocumentMedia: %s %d %d 0 () ()\n", sprintf( Line, "%%%%DocumentMedia: %s %d %d 0 () ()\n",
CONV_TO_UTF8( SheetPS->m_Name ), CONV_TO_UTF8( SheetPS->m_Name ),
(int) round( SheetPS->m_Size.y * CONV_SCALE ), wxRound( SheetPS->m_Size.y * CONV_SCALE ),
(int) round( SheetPS->m_Size.x * CONV_SCALE ) ); wxRound( SheetPS->m_Size.x * CONV_SCALE ) );
fputs( Line, g_Plot_PlotOutputFile ); fputs( Line, g_Plot_PlotOutputFile );
if( PaperOrientation == wxPORTRAIT ) if( PaperOrientation == wxPORTRAIT )

View File

@ -4,19 +4,6 @@
/* test demande ESC */ /* 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 <wx/wx.h>
#endif
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
@ -44,7 +31,7 @@ public:
}; };
BEGIN_EVENT_TABLE( WinEDA_MessageDialog, wxMessageDialog ) BEGIN_EVENT_TABLE( WinEDA_MessageDialog, wxMessageDialog )
EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut ) EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut )
END_EVENT_TABLE() END_EVENT_TABLE()
/**********************************************************************************/ /**********************************************************************************/
@ -116,7 +103,8 @@ bool IsOK( wxWindow* parent, const wxString& text )
{ {
int ii; 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 ) if( ii == wxYES )
return TRUE; return TRUE;
return FALSE; return FALSE;

View File

@ -587,18 +587,18 @@ void WinEDA_DrawFrame::AdjustScrollBars()
screen->m_ScrollbarNumber.y, screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.x,
screen->m_ScrollbarPos.y, TRUE ); screen->m_ScrollbarPos.y, TRUE );
#else // #else
BASE_SCREEN* screen = GetBaseScreen(); // BASE_SCREEN* screen = GetBaseScreen();
wxSize drawingSize = screen->ReturnPageSize() * 2; // wxSize drawingSize = screen->ReturnPageSize() * 2;
wxCoord x, y; // wxCoord x, y;
wxClientDC DC( this ); // wxClientDC DC( this );
DrawPanel->PrepareGraphicContext( &DC ); // DrawPanel->PrepareGraphicContext( &DC );
x = DC.LogicalToDeviceXRel( drawingSize.GetWidth() ); // x = DC.LogicalToDeviceXRel( drawingSize.GetWidth() );
y = DC.LogicalToDeviceYRel( drawingSize.GetHeight() ); // y = DC.LogicalToDeviceYRel( drawingSize.GetHeight() );
DrawPanel->SetScrollbars( 1, 1, x, y, // DrawPanel->SetScrollbars( 1, 1, x, y,
DC.LogicalToDeviceX( screen->m_Curseur.x ), // DC.LogicalToDeviceX( screen->m_Curseur.x ),
DC.LogicalToDeviceY( screen->m_Curseur.y ), // DC.LogicalToDeviceY( screen->m_Curseur.y ),
true ); // true );
#endif #endif
} }

View File

@ -73,7 +73,7 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id,
ForceCloseManageCurseur = NULL; ForceCloseManageCurseur = NULL;
if( wxGetApp().m_EDA_Config ) if( wxGetApp().m_EDA_Config )
m_AutoPAN_Enable = wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), &m_AutoPAN_Enable,
true ); true );
m_AutoPAN_Request = FALSE; m_AutoPAN_Request = FALSE;
@ -197,13 +197,25 @@ void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC )
GRResetPenAndBrush( DC ); GRResetPenAndBrush( DC );
DC->SetBackgroundMode( wxTRANSPARENT ); DC->SetBackgroundMode( wxTRANSPARENT );
#ifdef WX_ZOOM #ifdef WX_ZOOM
int clientWidth, clientHeight;
GetClientSize( &clientWidth, &clientHeight );
wxSize drawingSize = GetScreen()->ReturnPageSize() * 2;
double scale = GetScreen()->GetScalingFactor(); double scale = GetScreen()->GetScalingFactor();
wxPoint origin = GetScreen()->m_DrawOrg; int dx = 0, dy = 0;
int ppuX, ppuY, startX, startY; int drawingWidth = wxRound( (double)drawingSize.GetWidth() * scale );
GetScrollPixelsPerUnit( & ppuX, & ppuY ); int drawingHeight = wxRound( (double)drawingSize.GetHeight() * scale );
GetViewStart( &startX, &startY );
DC->SetDeviceOrigin( origin.x - startX * ppuX, origin.y - startY * ppuY ); 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->SetUserScale( scale, scale );
DC->SetDeviceOrigin( x + dx, y + dy );
// wxSize size = GetScreen()->ReturnPageSize() * 2 * scale; // wxSize size = GetScreen()->ReturnPageSize() * 2 * scale;
// DC->SetLogicalOrigin( origin.x, origin.y ); // DC->SetLogicalOrigin( origin.x, origin.y );
#endif #endif
@ -418,8 +430,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse )
CalcUnscrolledPosition( screenPos.x, screenPos.y, CalcUnscrolledPosition( screenPos.x, screenPos.y,
&drawingPos.x, &drawingPos.y ); &drawingPos.x, &drawingPos.y );
wxLogDebug( wxT( "MouseTo() initial screen position(%d, %d) " \ wxLogDebug( wxT( "MouseTo() initial screen position(%d, %d) " ) \
"rectangle(%d, %d, %d, %d) view(%d, %d)" ), wxT( "rectangle(%d, %d, %d, %d) view(%d, %d)" ),
screenPos.x, screenPos.y, clientRect.x, clientRect.y, screenPos.x, screenPos.y, clientRect.x, clientRect.y,
clientRect.width, clientRect.height, x, y ); clientRect.width, clientRect.height, x, y );
@ -436,8 +448,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse )
CalcScrolledPosition( drawingPos.x, drawingPos.y, CalcScrolledPosition( drawingPos.x, drawingPos.y,
&screenPos.x, &screenPos.y ); &screenPos.x, &screenPos.y );
wxLogDebug( wxT( "MouseTo() scrolled screen position(%d, %d) " \ wxLogDebug( wxT( "MouseTo() scrolled screen position(%d, %d) " ) \
"view(%d, %d)" ), screenPos.x, screenPos.y, x, y ); wxT( "view(%d, %d)" ), screenPos.x, screenPos.y, x, y );
} }
WarpPointer( screenPos.x, screenPos.y ); WarpPointer( screenPos.x, screenPos.y );
@ -936,8 +948,8 @@ void WinEDA_DrawPanel::OnMouseWheel( wxMouseEvent& event )
if( event.GetWheelRotation() == 0 || !GetParent()->IsEnabled() if( event.GetWheelRotation() == 0 || !GetParent()->IsEnabled()
|| !rect.Contains( event.GetPosition() ) ) || !rect.Contains( event.GetPosition() ) )
{ {
wxLogDebug( wxT( "OnMouseWheel() position(%d, %d) " \ wxLogDebug( wxT( "OnMouseWheel() position(%d, %d) " ) \
"rectangle(%d, %d, %d, %d)" ), wxT( "rectangle(%d, %d, %d, %d)" ),
event.GetPosition().x, event.GetPosition().y, event.GetPosition().x, event.GetPosition().y,
rect.x, rect.y, rect.width, rect.height ); rect.x, rect.y, rect.width, rect.height );

View File

@ -80,7 +80,7 @@ static void DrawGraphicTextPline(
static int overbar_position( int size_v, int thickness ) static int overbar_position( int size_v, int thickness )
{ {
return size_v * 1.1 + thickness; return wxRound( (double)size_v * 1.1 + (double)thickness );
} }

View File

@ -3,18 +3,6 @@
// Name: eda_dde.cpp // // Name: eda_dde.cpp //
/////////////////////// ///////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "fctsys.h" #include "fctsys.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "wxstruct.h" #include "wxstruct.h"

View File

@ -10,7 +10,7 @@
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#ifndef _MSC_VER #ifndef _MSC_VER
#include <dir.h> //#include <dir.h>
#endif #endif
#endif #endif

View File

@ -52,7 +52,7 @@ extern BASE_SCREEN* ActiveScreen;
static int GRLastMoveToX, GRLastMoveToY; static int GRLastMoveToX, GRLastMoveToY;
static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0) static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0)
* (utile pour trace sur imprimante) */ * (utile pour trace sur imprimante) */
static int ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace static bool ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace
* sur imprimante */ * sur imprimante */
static int xcliplo = 0, static int xcliplo = 0,
ycliplo = 0, ycliplo = 0,
@ -1490,7 +1490,7 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPoints[], in
for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit ) 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() ) if ( clippedPolygon.size() )

View File

@ -96,7 +96,7 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] =
{ wxT( "*" ), '*' }, { wxT( "*" ), '*' },
{ wxT( "+" ), '+' }, { wxT( "+" ), '+' },
{ wxT( "-" ), '-' }, { wxT( "-" ), '-' },
{ wxT( "\%" ), '%' }, { wxT( "%%" ), '%' },
{ wxT( "A" ), 'A' }, { wxT( "A" ), 'A' },
{ wxT( "B" ), 'B' }, { wxT( "B" ), 'B' },
{ wxT( "C" ), 'C' }, { wxT( "C" ), 'C' },
@ -676,11 +676,11 @@ void AddHotkeyConfigMenu( wxMenu* menu )
wxITEM_CHECK ); wxITEM_CHECK );
submenu_hkcfg->Append( item ); submenu_hkcfg->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( menu, submenu_hkcfg, -1, ADD_MENUITEM_WITH_HELP_AND_SUBMENU(
menu, submenu_hkcfg, -1,
_( "Hotkey config location" ), _( "Hotkey config location" ),
_( "Hotkey config file location " \ _( "Select hotkey config file location (home directory or kicad tree)" ),
"selection (home directory or " \ right_xpm );
"kicad tree)" ), right_xpm );
submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME,
g_ConfigFileLocationChoice == 0 ); g_ConfigFileLocationChoice == 0 );
submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD,

View File

@ -82,8 +82,9 @@ wxString g_Shapes3DExtBuffer( wxT( "wrl" ) );
const wxString ModuleFileExtension( wxT( "mod" ) ); const wxString ModuleFileExtension( wxT( "mod" ) );
/* PCB file name wild card definitions. */ /* PCB file name wild card definitions. */
const wxString ModuleFileWildcard( _( "Kicad footprint library files " \ const wxString ModuleFileWildcard(
"(*.mod)|*.mod") ); _( "Kicad footprint library files (*.mod)|*.mod" )
);
int g_CurrentVersionPCB = 1; int g_CurrentVersionPCB = 1;

View File

@ -14,16 +14,14 @@
#include <wx/apptrait.h> #include <wx/apptrait.h>
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
#include <boost/foreach.hpp>
#define CONFIG_VERSION 1 #define CONFIG_VERSION 1
#define FORCE_LOCAL_CONFIG true #define FORCE_LOCAL_CONFIG true
#include <wx/arrimpl.cpp>
WX_DEFINE_OBJARRAY( PARAM_CFG_ARRAY );
/** /**
* Cree ou recree la configuration locale de kicad (filename.pro) * Cree ou recree la configuration locale de kicad (filename.pro)
* initialise: * 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. */ /* Check just in case the file name does not a kicad project extension. */
if( fn.GetExt() != ProjectFileExtension ) if( fn.GetExt() != ProjectFileExtension )
{ {
wxLogDebug( _( "ReCreatePrjConfig() called with project file <%s> " \ wxLogDebug( wxT( "ReCreatePrjConfig() called with project file <%s> \
"which does not have the correct file extension." ), which does not have the correct file extension." ),
fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
fn.SetExt( ProjectFileExtension ); fn.SetExt( ProjectFileExtension );
} }
@ -94,7 +92,7 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
return true; return true;
else 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, void WinEDA_App::WriteProjectConfig( const wxString& fileName,
const wxString& GroupName, 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 ); ReCreatePrjConfig( fileName, GroupName, FORCE_LOCAL_CONFIG );
/* Write date ( surtout pour eviter bug de wxFileConfig /* Write date ( surtout pour eviter bug de wxFileConfig
@ -195,11 +189,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
* (en fait si groupe vide) */ * (en fait si groupe vide) */
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR ); m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
msg = DateAndTime(); m_ProjectConfig->Write( wxT( "update" ), DateAndTime() );
m_ProjectConfig->Write( wxT( "update" ), msg ); m_ProjectConfig->Write( wxT( "last_client" ), GetAppName() );
msg = GetAppName();
m_ProjectConfig->Write( wxT( "last_client" ), msg );
/* Save parameters */ /* Save parameters */
m_ProjectConfig->DeleteGroup( GroupName ); // Erase all datas 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->Write( wxT( "version" ), CONFIG_VERSION );
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR ); m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
for( i = 0; i < params.GetCount(); i++ ) BOOST_FOREACH( PARAM_CFG_BASE& param, params )
{ {
param = &params[i]; if( param.m_Group )
if( param->m_Group ) m_ProjectConfig->SetPath( param.m_Group );
m_ProjectConfig->SetPath( param->m_Group );
else else
m_ProjectConfig->SetPath( GroupName ); m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup ) if( param.m_Setup )
continue; 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 ) if( param.m_Ident )
m_ProjectConfig->DeleteGroup( param->m_Ident ); m_ProjectConfig->DeleteGroup( param.m_Ident );
} }
else else
param->SaveParam( m_ProjectConfig ); param.SaveParam( m_ProjectConfig );
} }
m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP ); 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 ) if( m_EDA_Config == NULL )
return; return;
for( i = 0; i < List.GetCount(); i++ ) BOOST_FOREACH( PARAM_CFG_BASE& param, List )
{ {
pt_cfg = &List[i]; if( param.m_Setup == false )
if( pt_cfg->m_Setup == false )
continue; 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 ) if( param.m_Ident )
m_EDA_Config->DeleteGroup( pt_cfg->m_Ident ); m_EDA_Config->DeleteGroup( param.m_Ident );
} }
else 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 * Parameters are parameters that have the .m_Setup member set to false
* read file is the .pro file project * 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 ) * the current config (different dates )
* *
* @return true if read. * @return true if read.
@ -360,11 +345,9 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
const PARAM_CFG_ARRAY& params, PARAM_CFG_ARRAY& params,
bool Load_Only_if_New ) bool Load_Only_if_New )
{ {
size_t i;
PARAM_CFG_BASE* param;
wxString timestamp; wxString timestamp;
ReCreatePrjConfig( local_config_filename, GroupName, false ); 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; m_CurrentOptionFile = g_Prj_Config_LocalFilename;
} }
for( i = 0; i < params.GetCount(); i++ ) BOOST_FOREACH( PARAM_CFG_BASE& param, params )
{ {
param = &params[i]; if( param.m_Group )
m_ProjectConfig->SetPath( param.m_Group );
if( param->m_Group )
m_ProjectConfig->SetPath( param->m_Group );
else else
m_ProjectConfig->SetPath( GroupName ); m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup ) if( param.m_Setup )
continue; continue;
param->ReadParam( m_ProjectConfig ); param.ReadParam( m_ProjectConfig );
} }
delete 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; BOOST_FOREACH( PARAM_CFG_BASE& param, List )
PARAM_CFG_BASE* pt_cfg;
for( i = 0; i < List.GetCount(); i++ )
{ {
pt_cfg = &List[i]; if( param.m_Setup == false )
if( pt_cfg->m_Setup == false )
continue; continue;
pt_cfg->ReadParam( m_EDA_Config ); param.ReadParam( m_EDA_Config );
} }
} }

View File

@ -1,25 +1,13 @@
#include "wx/wxprec.h" #include "fctsys.h"
#include "common.h"
#include <id.h> #include <id.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 <wx/wx.h>
#endif
#include <wx/dir.h> #include <wx/dir.h>
#include <wx/utils.h>
#include <pyhandler.h> #include <pyhandler.h>
#include <iostream> #include <iostream>
#include "fctsys.h"
#include "common.h"
using namespace boost::python; using namespace boost::python;

View File

@ -4,7 +4,6 @@
/*********************************************/ /*********************************************/
#include "fctsys.h" #include "fctsys.h"
#include <time.h>
#include "macros.h" #include "macros.h"
#include "kicad_string.h" #include "kicad_string.h"

View File

@ -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.0000000000, 0.0017453284, 0.0034906514, 0.0052359638,
0.0069812603, 0.0087265355, 0.0104717841, 0.0122170008, 0.0139621803, 0.0069812603, 0.0087265355, 0.0104717841, 0.0122170008, 0.0139621803,
@ -1124,7 +1124,7 @@ float fsinus[3600] =
-0.0017453284 -0.0017453284
}; };
float fcosinus[3600] = double fcosinus[3600] =
{ {
1.0000000000, 0.9999984769, 0.9999939077, 0.9999862922, 1.0000000000, 0.9999984769, 0.9999939077, 0.9999862922,
0.9999756307, 0.9999619231, 0.9999451694, 0.9999253697, 0.9999025240, 0.9999756307, 0.9999619231, 0.9999451694, 0.9999253697, 0.9999025240,

View File

@ -107,8 +107,8 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
{ {
if( DrawPanel == NULL ) if( DrawPanel == NULL )
{ {
wxLogDebug( wxT( "No DrawPanel object defined in " \ wxLogDebug( wxT( "%s, %d: DrawPanel object is undefined ." ),
"WinEDA_DrawFrame::OnZoom()." ) ); __TFILE__, __LINE__ );
return; return;
} }
@ -165,15 +165,10 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
default: default:
i = id - ID_POPUP_ZOOM_LEVEL_START; 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 ); wxLogDebug( _T( "%s %d: index %d is outside the bounds of the zoom list." ),
return; __TFILE__, __LINE__, i );
}
if( !( (size_t) i < screen->m_ZoomList.GetCount()) )
{
wxLogDebug( _T( "Requested index %d is outside the bounds of " \
"the zoom list." ), i );
return; return;
} }
if( screen->SetZoom( screen->m_ZoomList[i] ) ) if( screen->SetZoom( screen->m_ZoomList[i] ) )
@ -254,7 +249,8 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
{ {
tmp = GetScreen()->m_GridList[i]; tmp = GetScreen()->m_GridList[i];
gridValue = To_User_Unit( g_UnitMetric, tmp.m_Size.x, 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 ) if( tmp.m_Id == ID_POPUP_GRID_USER )
{ {
msg = _( "User Grid" ); msg = _( "User Grid" );

View File

@ -90,8 +90,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
if( !tmp ) if( !tmp )
{ {
msg.Printf( _( "Footprint alias library file <%s> could not be " \ msg.Printf( _( "Footprint alias library file <%s> could not be \
"found in the default search paths." ), found in the default search paths." ),
fn.GetFullName().c_str() ); fn.GetFullName().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
continue; continue;
@ -166,8 +166,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
if( component.m_Module.IsEmpty() ) if( component.m_Module.IsEmpty() )
{ {
msg.Printf( _( "Component %s: footprint %s not found in " \ msg.Printf( _( "Component %s: footprint %s not found in \
"any of the project footprint libraries." ), any of the project footprint libraries." ),
component.m_Reference.c_str(), component.m_Reference.c_str(),
alias.m_FootprintName.c_str() ); alias.m_FootprintName.c_str() );
wxMessageBox( msg, _( "CVPcb Error" ), wxOK | wxICON_ERROR, wxMessageBox( msg, _( "CVPcb Error" ), wxOK | wxICON_ERROR,

View File

@ -28,22 +28,22 @@
* to define local variables. The old method of statically building the array * to define local variables. The old method of statically building the array
* at compile time requiring global variable definitions. * 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; return m_projectFileParams;
m_projectFileParams.Add( new PARAM_CFG_BASE( GROUPLIB, m_projectFileParams.push_back( new PARAM_CFG_BASE( GROUPLIB,
PARAM_COMMAND_ERASE ) ); PARAM_COMMAND_ERASE ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ModuleLibNames, &m_ModuleLibNames,
GROUPLIB ) ); GROUPLIB ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ), m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ),
&m_AliasLibNames, &m_AliasLibNames,
GROUPEQU ) ); GROUPEQU ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ),
&m_NetlistFileExtension ) ); &m_NetlistFileExtension ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
&m_UserLibraryPath, &m_UserLibraryPath,
GROUPLIB ) ); GROUPLIB ) );

View File

@ -7,8 +7,6 @@
#include "cvpcb.h" #include "cvpcb.h"
#include <wx/listimpl.cpp>
PIN::PIN() PIN::PIN()
{ {

View File

@ -261,8 +261,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
{ {
unsigned ii; unsigned ii;
wxMessageDialog dialog( this, wxMessageDialog dialog( this,
_( "Net and component list modified.\nSave " \ _( "Net and component list modified.\nSave before exit ?" ),
"before exit ?" ),
_( "Confirmation" ), _( "Confirmation" ),
wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT ); wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT );

View File

@ -25,10 +25,8 @@ const wxString RetroFileExtension( wxT( "stf" ) );
const wxString FootprintAliasFileExtension( wxT( "equ" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) );
// Wildcard for schematic retroannotation (import footprint names in schematic): // Wildcard for schematic retroannotation (import footprint names in schematic):
const wxString RetroFileWildcard( _( "Kicad retroannotation files " \ const wxString RetroFileWildcard( _( "Kicad retroannotation files (*.stf)|*.stf" ) );
"(*.stf)|*.stf" ) ); const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files (*.equ)|*.equ" ) );
const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files " \
"(*.equ)|*.equ" ) );
const wxString titleLibLoadError( _( "Library Load Error" ) ); const wxString titleLibLoadError( _( "Library Load Error" ) );

View File

@ -16,7 +16,6 @@ class FootprintListBox;
class ListBoxCmp; class ListBoxCmp;
class WinEDA_DisplayFrame; class WinEDA_DisplayFrame;
#define LIST_BOX_TYPE wxListView
/******************************************************/ /******************************************************/
/* classe derivee pour la Fenetre principale de cvpcb */ /* classe derivee pour la Fenetre principale de cvpcb */
@ -98,7 +97,7 @@ public:
virtual void LoadSettings(); virtual void LoadSettings();
virtual void SaveSettings(); virtual void SaveSettings();
const PARAM_CFG_ARRAY& GetProjectFileParameters( void ); PARAM_CFG_ARRAY& GetProjectFileParameters( void );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
@ -107,11 +106,8 @@ public:
/***********************************************/ /***********************************************/
/* ListBox derivee pour l'affichage des listes */ /* ListBox derivee pour l'affichage des listes */
/***********************************************/ /***********************************************/
class ListBoxBase : public LIST_BOX_TYPE class ListBoxBase : public wxListView
{ {
public:
WinEDA_CvpcbFrame* m_Parent;
public: public:
ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id, ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id,
@ -121,6 +117,9 @@ public:
int GetSelection(); int GetSelection();
void OnSize( wxSizeEvent& event ); void OnSize( wxSizeEvent& event );
virtual WinEDA_CvpcbFrame* GetParent();
}; };
/************************************************************/ /************************************************************/
@ -205,7 +204,6 @@ public:
~WinEDA_DisplayFrame(); ~WinEDA_DisplayFrame();
void OnCloseWindow( wxCloseEvent& Event ); void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event );
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar(); void ReCreateHToolbar();
void ReCreateVToolbar(); void ReCreateVToolbar();

View File

@ -37,7 +37,8 @@ void WinEDA_DisplayFrame::InstallOptionsDisplay(wxCommandEvent& event)
/*********************************************************************/ /*********************************************************************/
/* Creation de la fenetre d'options de la fenetre de visu */ /* 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->ShowModal();
OptionWindow->Destroy(); OptionWindow->Destroy();
} }
@ -179,7 +180,7 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls()
// Set validators // Set validators
m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) ); m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) );
m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) ); m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) );
m_IsShowPadFill->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadFill) ); m_IsShowPadFill->SetValidator( wxGenericValidator( & DisplayOpt.DisplayPadFill) );
m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) ); m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) );
////@end WinEDA_FootprintDisplayOptionsFrame content construction ////@end WinEDA_FootprintDisplayOptionsFrame content construction

View File

@ -51,11 +51,11 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
m_FrameName = wxT( "CmpFrame" ); m_FrameName = wxT( "CmpFrame" );
// Give an icon // Give an icon
#ifdef __WINDOWS__ #ifdef __WINDOWS__
SetIcon( wxICON( a_icon_cvpcb ) ); SetIcon( wxICON( a_icon_cvpcb ) );
#else #else
SetIcon( wxICON( icon_cvpcb ) ); SetIcon( wxICON( icon_cvpcb ) );
#endif #endif
SetTitle( title ); SetTitle( title );
SetBoard( new BOARD( NULL, this ) ); 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. * Display 3D frame of current footprint selection.
*/ */

View File

@ -84,8 +84,7 @@ bool WinEDA_CvpcbFrame::ReadNetList()
if( error_level < 0 ) if( error_level < 0 )
{ {
msg.Printf( _( "File <%s> does not appear to be a valid Kicad " \ msg.Printf( _( "File <%s> does not appear to be a valid Kicad net list file." ),
"net list file." ),
m_NetlistFileName.GetFullPath().c_str() ); m_NetlistFileName.GetFullPath().c_str() );
::wxMessageBox( msg, _( "File Error" ), wxOK | wxICON_ERROR, this ); ::wxMessageBox( msg, _( "File Error" ), wxOK | wxICON_ERROR, this );
return false; return false;

View File

@ -19,11 +19,10 @@
ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, wxWindowID id, ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, wxWindowID id,
const wxPoint& loc, const wxSize& size ) : const wxPoint& loc, const wxSize& size ) :
LIST_BOX_TYPE( parent, id, loc, size, wxListView( parent, id, loc, size,
wxSUNKEN_BORDER | wxLC_NO_HEADER | wxSUNKEN_BORDER | wxLC_NO_HEADER |
wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL ) wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL )
{ {
m_Parent = parent;
InsertColumn( 0, wxEmptyString ); InsertColumn( 0, wxEmptyString );
SetColumnWidth( 0, wxLIST_AUTOSIZE ); 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 */ /* ListBox handling the footprint list */
/***************************************/ /***************************************/
@ -67,6 +72,7 @@ FootprintListBox::FootprintListBox( WinEDA_CvpcbFrame* parent,
int nbitems, wxString choice[] ) : int nbitems, wxString choice[] ) :
ListBoxBase( parent, id, loc, size ) ListBoxBase( parent, id, loc, size )
{ {
m_UseFootprintFullList = true;
m_ActiveFootprintList = NULL; m_ActiveFootprintList = NULL;
SetActiveFootprintList( TRUE ); SetActiveFootprintList( TRUE );
} }
@ -106,7 +112,8 @@ wxString FootprintListBox::GetSelectedFootprint()
if( ii >= 0 ) if( ii >= 0 )
{ {
wxString msg = (*m_ActiveFootprintList)[ii]; wxString msg = (*m_ActiveFootprintList)[ii];
msg.Trim( TRUE ); msg.Trim( FALSE ); msg.Trim( TRUE );
msg.Trim( FALSE );
FootprintName = msg.AfterFirst( wxChar( ' ' ) ); FootprintName = msg.AfterFirst( wxChar( ' ' ) );
} }
@ -172,7 +179,7 @@ ListBoxCmp::~ListBoxCmp()
/* Build the events table for the schematic components list box /* 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 ) EVT_SIZE( ListBoxBase::OnSize )
END_EVENT_TABLE() END_EVENT_TABLE()
@ -418,8 +425,8 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) ) if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) )
{ {
m_Parent->SetStatusText( wxEmptyString, 0 ); GetParent()->SetStatusText( wxEmptyString, 0 );
m_Parent->SetStatusText( wxEmptyString, 1 ); GetParent()->SetStatusText( wxEmptyString, 1 );
} }
wxString msg; wxString msg;
@ -429,7 +436,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
else else
msg.Printf( _( "Footprints (filtered): %d" ), msg.Printf( _( "Footprints (filtered): %d" ),
m_ActiveFootprintList->GetCount() ); 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 */ /* Event table for the footprint list */
/**************************************/ /**************************************/
BEGIN_EVENT_TABLE( FootprintListBox, LIST_BOX_TYPE ) BEGIN_EVENT_TABLE( FootprintListBox, ListBoxBase )
EVT_SIZE( ListBoxBase::OnSize ) EVT_SIZE( ListBoxBase::OnSize )
END_EVENT_TABLE() END_EVENT_TABLE()
@ -449,21 +456,21 @@ void FootprintListBox::OnLeftClick( wxListEvent& event )
FOOTPRINT* Module; FOOTPRINT* Module;
wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint();
Module = GetModuleDescrByName( FootprintName, m_Parent->m_footprints ); Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints );
if( m_Parent->DrawFrame ) if( GetParent()->DrawFrame )
{ {
m_Parent->CreateScreenCmp(); /* refresh general */ GetParent()->CreateScreenCmp(); /* refresh general */
} }
if( Module ) if( Module )
{ {
wxString msg; wxString msg;
msg = Module->m_Doc; msg = Module->m_Doc;
m_Parent->SetStatusText( msg, 0 ); GetParent()->SetStatusText( msg, 0 );
msg = wxT( "KeyW: " ); msg = wxT( "KeyW: " );
msg += Module->m_KeyWord; 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(); wxString FootprintName = GetSelectedFootprint();
m_Parent->SetNewPkg( FootprintName ); GetParent()->SetNewPkg( FootprintName );
} }

View File

@ -19,6 +19,7 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
/* routines locales : */ /* routines locales : */
static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list ); static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
@ -53,9 +54,8 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if( libNames.GetCount() == 0 ) if( libNames.GetCount() == 0 )
{ {
wxMessageBox( _( "No PCB foot print libraries are listed in the " \ wxMessageBox( _( "No PCB foot print libraries are listed in the current project file." ),
"current project file." ), _( "Project File Error" ), _( "Project File Error" ), wxOK | wxICON_ERROR );
wxOK | wxICON_ERROR );
return false; return false;
} }
@ -70,8 +70,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if( !tmp ) if( !tmp )
{ {
msg.Printf( _( "PCB foot print library file <%s> could not be " \ msg.Printf( _( "PCB foot print library file <%s> could not be found in the default search paths." ),
"found in the default search paths." ),
fn.GetFullName().c_str() ); fn.GetFullName().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
continue; continue;
@ -124,8 +123,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if( !end ) if( !end )
{ {
msg.Printf( _( "Unexpected end of file occurred while " \ msg.Printf( _( "Unexpected end of file occurred while parsing PCB foot print library <%s>." ),
"parsing PCB foot print library <%s>." ),
tmp.c_str() ); tmp.c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); 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 ) if( ( LibDoc = wxFopen( fn.GetFullPath(), wxT( "rt" ) ) ) == NULL )
{ {
msg.Printf( _( "Could not open PCB foot print library document " \ msg.Printf( _( "Could not open PCB foot print library document file <%s>." ),
"file <%s>." ), fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
return; return;
} }
@ -168,8 +166,8 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list )
GetLine( LibDoc, Line, NULL, sizeof(Line) - 1 ); GetLine( LibDoc, Line, NULL, sizeof(Line) - 1 );
if( strnicmp( Line, ENTETE_LIBDOC, L_ENTETE_LIB ) != 0 ) if( strnicmp( Line, ENTETE_LIBDOC, L_ENTETE_LIB ) != 0 )
{ {
msg.Printf( _( "<%s> is not a valid PCB foot print library " \ msg.Printf( _( "<%s> is not a valid PCB foot print library document file." ),
"document file." ), fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
return; return;
} }

View File

@ -47,8 +47,7 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
if( !tmp ) if( !tmp )
{ {
msg.Printf( _( "PCB foot print library file <%s> could not be " \ msg.Printf( _( "PCB foot print library file <%s> could not be found in the default search paths." ),
"found in the default search paths." ),
fn.GetFullName().c_str() ); fn.GetFullName().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR, this ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR, this );
continue; continue;

View File

@ -24,11 +24,12 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
*/ */
{ {
wxMenuItem* item; wxMenuItem* item;
wxMenuBar* menuBar = GetMenuBar(); wxMenuBar* menuBar;
/* Destroy the existing menu bar so it can be rebuilt. This allows /* Destroy the existing menu bar so it can be rebuilt. This allows
* language changes of the menu text on the fly. */ * language changes of the menu text on the fly. */
if( menuBar ) // if( menuBar )
SetMenuBar( NULL ); // SetMenuBar( NULL );
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
@ -66,8 +67,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
_( "Keep Open On Save" ), _( "Keep Open On Save" ),
_( "Prevent CVPcb from exiting after saving " \ _( "Prevent CVPcb from exiting after saving netlist file" ),
"netlist file" ),
wxITEM_CHECK ); wxITEM_CHECK );
configmenu->Append( item ); configmenu->Append( item );
configmenu->AppendSeparator(); configmenu->AppendSeparator();

View File

@ -135,7 +135,8 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
wxString msg, Lineconv = CONV_FROM_UTF8( Line ); wxString msg, Lineconv = CONV_FROM_UTF8( Line );
msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() ); msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() );
DisplayError( this, msg ); DisplayError( this, msg );
fclose( source ); return -3; fclose( source );
return -3;
} }
SetStatusText( _( "Netlist Format: EESchema" ), 0 ); SetStatusText( _( "Netlist Format: EESchema" ), 0 );

View File

@ -93,8 +93,8 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
/* Identification du Type de fichier CmpMod */ /* Identification du Type de fichier CmpMod */
if( fgets( Line, 79, source ) == 0 ) if( fgets( Line, 79, source ) == 0 )
{ {
msg.Printf( _( " <%s> does not appear to be a valid Kicad component " \ msg.Printf( _( " <%s> does not appear to be a valid Kicad component library." ),
"library." ), fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
wxMessageBox( msg, titleComponentLibErr, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleComponentLibErr, wxOK | wxICON_ERROR );
fclose( source ); fclose( source );
return false; return false;

View File

@ -26,28 +26,35 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar ); 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" ) ); _( "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" ) ); _( "Save NetList and Footprints List files" ) );
m_HToolBar->AddSeparator(); 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" ) ); _( "Configuration" ) );
m_HToolBar->AddSeparator(); 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" ) ); _( "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" ) ); _( "Automatic Association" ) );
m_HToolBar->AddSeparator(); 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" ) ); _( "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" ) ); _( "Select next free component" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
@ -58,7 +65,8 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString, m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString,
wxBitmap( save_cmpstuff_xpm ), 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->AddSeparator();
m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString, m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
@ -89,4 +97,3 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
// the changes // the changes
m_HToolBar->Realize(); m_HToolBar->Realize();
} }

View File

@ -248,8 +248,7 @@ void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event )
else else
message += _( "on the current sheet?" ); message += _( "on the current sheet?" );
message += _( "\n\nThis operation will change the current annotation and " \ message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
"cannot be undone." );
response = wxMessageBox( message, wxT( "" ), response = wxMessageBox( message, wxT( "" ),
wxICON_EXCLAMATION | wxOK | wxCANCEL ); wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
@ -274,8 +273,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event )
else else
message += _( "the current sheet?" ); message += _( "the current sheet?" );
message += _( "\n\nThis operation will clear the existing annotation " \ message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." );
"and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), response = wxMessageBox( message, wxT( "" ),
wxICON_EXCLAMATION | wxOK | wxCANCEL ); wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)

View File

@ -121,8 +121,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
{ {
wxString msg; wxString msg;
err = TRUE; err = TRUE;
msg.Printf( wxT( "HandleBlockPLace() : m_BlockDrawStruct = " \ msg.Printf( wxT( "HandleBlockPLace() : m_BlockDrawStruct = NULL (cmd %d, state %d)" ),
"NULL (cmd %d, state %d)" ),
block->m_Command, block->m_State ); block->m_Command, block->m_State );
DisplayError( this, msg ); DisplayError( this, msg );
} }
@ -206,7 +205,8 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
block->m_BlockDrawStruct = NULL; block->m_BlockDrawStruct = NULL;
} }
SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString ); SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor,
wxEmptyString );
} }

View File

@ -508,8 +508,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line,
break; break;
default: default:
errorMsg.Printf( wxT( "Undefined DRAW command in line %d\n" \ errorMsg.Printf( wxT( "Undefined DRAW command in line %d\n%s, aborted." ),
"%s, aborted." ), *lineNum, line ); *lineNum, line );
m_Drawings = headEntry; m_Drawings = headEntry;
return false; return false;
} }
@ -526,8 +526,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line,
{ {
if( GetLine( f, line, lineNum, 1024 ) == NULL ) if( GetLine( f, line, lineNum, 1024 ) == NULL )
{ {
errorMsg = wxT( "File ended prematurely while attempting" \ errorMsg = wxT( "File ended prematurely while attempting \
"to flush to end of drawing section." ); to flush to end of drawing section." );
return false; return false;
} }
} while( strncmp( line, "ENDDRAW", 7 ) != 0 ); } while( strncmp( line, "ENDDRAW", 7 ) != 0 );

View File

@ -130,8 +130,7 @@ bool LibDrawPin::Load( char* line, wxString& errorMsg )
if( i < 11 ) if( i < 11 )
{ {
errorMsg.Printf( wxT( "pin only had %d parameters of the " \ errorMsg.Printf( wxT( "pin only had %d parameters of the required 11 or 12" ), i );
"required 11 or 12" ), i );
return false; return false;
} }

View File

@ -864,7 +864,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, c
// Create outline shape : 6 points // Create outline shape : 6 points
int x = symb_len + width + 3; 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, 0 ) ); // Starting point (anchor)
aCorner_list.push_back( wxPoint( 0, -y ) ); // Up aCorner_list.push_back( wxPoint( 0, -y ) ); // Up
aCorner_list.push_back( wxPoint( -x, -y ) ); // left Up aCorner_list.push_back( wxPoint( -x, -y ) ); // left Up

View File

@ -129,8 +129,8 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg )
&m_Width, tmp, &startx, &starty, &endx, &endy ); &m_Width, tmp, &startx, &starty, &endx, &endy );
if( cnt < 8 ) if( cnt < 8 )
{ {
errorMsg.Printf( wxT( "arc only had %d parameters of the " \ errorMsg.Printf( _( "arc only had %d parameters of the required 8" ),
"required 8" ), cnt ); cnt );
return false; return false;
} }
@ -268,8 +268,8 @@ EDA_Rect LibDrawArc::GetBoundingBox()
if( ( normStart == nullPoint ) || ( normEnd == nullPoint ) if( ( normStart == nullPoint ) || ( normEnd == nullPoint )
|| ( m_Rayon == 0 ) ) || ( m_Rayon == 0 ) )
{ {
wxLogDebug( wxT(" Invalid arc drawing definition, center(%d, %d) " \ wxLogDebug( wxT("Invalid arc drawing definition, center(%d, %d) \
"start(%d, %d), end(%d, %d), radius %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_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x,
m_ArcEnd.y, m_Rayon ); m_ArcEnd.y, m_Rayon );
return rect; return rect;
@ -362,8 +362,8 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg )
&m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp ); &m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp );
if( cnt < 6 ) if( cnt < 6 )
{ {
errorMsg.Printf( wxT( "circle only had %d parameters of the " \ errorMsg.Printf( _( "circle only had %d parameters of the required 6" ),
"required 6" ), cnt ); cnt );
return false; return false;
} }
@ -501,8 +501,8 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
if( cnt < 8 ) if( cnt < 8 )
{ {
errorMsg.Printf( wxT( "text only had %d parameters of the " \ errorMsg.Printf( _( "text only had %d parameters of the required 8" ),
"required 8" ), cnt ); cnt );
return false; return false;
} }
@ -609,8 +609,8 @@ bool LibDrawSquare::Load( char* line, wxString& errorMsg )
if( cnt < 7 ) if( cnt < 7 )
{ {
errorMsg.Printf( wxT( "rectangle only had %d parameters of the " \ errorMsg.Printf( _( "rectangle only had %d parameters of the required 7" ),
"required 7" ), cnt ); cnt );
return false; return false;
} }
@ -814,13 +814,12 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
if( i < 4 ) if( i < 4 )
{ {
errorMsg.Printf( wxT( "polyline only had %d parameters of the " \ errorMsg.Printf( _( "polyline only had %d parameters of the required 4" ), i );
"required 4" ), i );
return false; return false;
} }
if ( ccount <= 0 ) if ( ccount <= 0 )
{ {
errorMsg.Printf( wxT( "polyline count parameter %d is invalid" ), errorMsg.Printf( _( "polyline count parameter %d is invalid" ),
ccount ); ccount );
return false; return false;
} }
@ -836,14 +835,14 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
p = strtok( NULL, " \t\n" ); p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.x ) != 1 ) 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 ); i );
return false; return false;
} }
p = strtok( NULL, " \t\n" ); p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.y ) != 1 ) 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 ); i );
return false; return false;
} }

View File

@ -6,7 +6,6 @@
#define COMPONENT_CLASS_H #define COMPONENT_CLASS_H
#include "base_struct.h"
#include "class_sch_screen.h" #include "class_sch_screen.h"
#include <wx/arrstr.h> #include <wx/arrstr.h>
#include <wx/dynarray.h> #include <wx/dynarray.h>

View File

@ -1,5 +1,4 @@
#include <wx/checklst.h>
#include <wx/tooltip.h> #include <wx/tooltip.h>
#include <algorithm> #include <algorithm>

View File

@ -15,17 +15,6 @@
#pragma implementation "dialog_erc.h" #pragma implementation "dialog_erc.h"
#endif #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 ////@begin includes
////@end includes ////@end includes
#include "fctsys.h" #include "fctsys.h"

View File

@ -12,8 +12,6 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "wx/checklst.h"
#include "protos.h" #include "protos.h"

View File

@ -102,8 +102,7 @@ void WinEDA_SchematicFrame::Process_Config( wxCommandEvent& event )
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config " \ DisplayError( this, wxT( "WinEDA_SchematicFrame::Process_Config internal error" ) );
"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 * to define local variables. The old method of statically building the array
* at compile time requiring global variable definitions. * 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; return m_projectFileParams;
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
&m_UserLibraryPath ) ); &m_UserLibraryPath ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ComponentLibFiles, &m_ComponentLibFiles,
GROUPLIB ) ); GROUPLIB ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "NetFmt" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "NetFmt" ),
&m_NetlistFormat, &m_NetlistFormat,
NET_TYPE_PCBNEW, NET_TYPE_PCBNEW,
NET_TYPE_PCBNEW, NET_TYPE_PCBNEW,
NET_TYPE_CUSTOM_MAX ) ); NET_TYPE_CUSTOM_MAX ) );
/* NOTE: Left as global until supporting code can be fixed. */ /* NOTE: Left as global until supporting code can be fixed. */
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "HPGLSpd" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLSpd" ),
&g_HPGL_Pen_Descr.m_Pen_Speed, &g_HPGL_Pen_Descr.m_Pen_Speed,
20, 2, 45 ) ); 20, 2, 45 ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "HPGLDm" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLDm" ),
&g_HPGL_Pen_Descr.m_Pen_Diam, &g_HPGL_Pen_Descr.m_Pen_Diam,
15, 1, 150 ) ); 15, 1, 150 ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "HPGLNum" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "HPGLNum" ),
&g_HPGL_Pen_Descr.m_Pen_Num, &g_HPGL_Pen_Descr.m_Pen_Num,
1, 1, 8 ) ); 1, 1, 8 ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A4" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A4" ),
&g_Sheet_A4.m_Offset.x ) ); &g_Sheet_A4.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A4" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A4" ),
&g_Sheet_A4.m_Offset.y ) ); &g_Sheet_A4.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A3" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A3" ),
&g_Sheet_A3.m_Offset.x ) ); &g_Sheet_A3.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A3" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A3" ),
&g_Sheet_A3.m_Offset.y ) ); &g_Sheet_A3.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A2" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A2" ),
&g_Sheet_A2.m_Offset.x ) ); &g_Sheet_A2.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A2" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A2" ),
&g_Sheet_A2.m_Offset.y ) ); &g_Sheet_A2.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A1" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A1" ),
&g_Sheet_A1.m_Offset.x ) ); &g_Sheet_A1.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A1" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A1" ),
&g_Sheet_A1.m_Offset.y ) ); &g_Sheet_A1.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A0" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A0" ),
&g_Sheet_A0.m_Offset.x ) ); &g_Sheet_A0.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A0" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A0" ),
&g_Sheet_A0.m_Offset.y ) ); &g_Sheet_A0.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_A" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A" ),
&g_Sheet_A.m_Offset.x ) ); &g_Sheet_A.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_A" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A" ),
&g_Sheet_A.m_Offset.y ) ); &g_Sheet_A.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_B" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_B" ),
&g_Sheet_B.m_Offset.x ) ); &g_Sheet_B.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_B" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_B" ),
&g_Sheet_B.m_Offset.y ) ); &g_Sheet_B.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_C" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_C" ),
&g_Sheet_C.m_Offset.x ) ); &g_Sheet_C.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_C" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_C" ),
&g_Sheet_C.m_Offset.y ) ); &g_Sheet_C.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_D" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_D" ),
&g_Sheet_D.m_Offset.x ) ); &g_Sheet_D.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_D" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_D" ),
&g_Sheet_D.m_Offset.y ) ); &g_Sheet_D.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offX_E" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_E" ),
&g_Sheet_E.m_Offset.x ) ); &g_Sheet_E.m_Offset.x ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "offY_E" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_E" ),
&g_Sheet_E.m_Offset.y ) ); &g_Sheet_E.m_Offset.y ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "RptD_X" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptD_X" ),
&g_RepeatStep.x, &g_RepeatStep.x,
0, -1000, +1000 ) ); 0, -1000, +1000 ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "RptD_Y" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptD_Y" ),
&g_RepeatStep.y, &g_RepeatStep.y,
100, -1000, +1000 ) ); 100, -1000, +1000 ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "RptLab" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "RptLab" ),
&g_RepeatDeltaLabel, &g_RepeatDeltaLabel,
1, -10, +10 ) ); 1, -10, +10 ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "SimCmd" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "SimCmd" ),
&g_SimulatorCommandLine ) ); &g_SimulatorCommandLine ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "UseNetN" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "UseNetN" ),
&g_OptNetListUseNames, &g_OptNetListUseNames,
0, 0, 1 ) ); 0, 0, 1 ) );
m_projectFileParams.Add( new PARAM_CFG_INT( wxT( "LabSize" ), m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
&g_DefaultTextLabelSize, &g_DefaultTextLabelSize,
DEFAULT_SIZE_TEXT, 0, 1000 ) ); DEFAULT_SIZE_TEXT, 0,
1000 ) );
return m_projectFileParams; return m_projectFileParams;
} }
@ -320,90 +320,90 @@ static const wxString HorzVertLinesOnlyEntry( wxT( "HorizVertLinesOnly" ) );
* global variables or move them to the object class where they are * global variables or move them to the object class where they are
* used. * 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; return m_configSettings;
m_configSettings.Add( new PARAM_CFG_INT( true, wxT( "Unite" ), m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Unite" ),
&g_UnitMetric, 0, 0, 1 ) ); &g_UnitMetric, 0, 0, 1 ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColWire" ),
&g_LayerDescr.LayerColor[LAYER_WIRE], &g_LayerDescr.LayerColor[LAYER_WIRE],
GREEN ) ); GREEN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBus" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBus" ),
&g_LayerDescr.LayerColor[LAYER_BUS], &g_LayerDescr.LayerColor[LAYER_BUS],
BLUE ) ); BLUE ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorConn" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorConn" ),
&g_LayerDescr.LayerColor[LAYER_JUNCTION], &g_LayerDescr.LayerColor[LAYER_JUNCTION],
GREEN ) ); GREEN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorLlab" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorLlab" ),
&g_LayerDescr.LayerColor[LAYER_LOCLABEL], &g_LayerDescr.LayerColor[LAYER_LOCLABEL],
BLACK ) ); BLACK ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorHlab" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorHlab" ),
&g_LayerDescr.LayerColor[LAYER_HIERLABEL], &g_LayerDescr.LayerColor[LAYER_HIERLABEL],
BROWN ) ); BROWN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGbllab" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGbllab" ),
&g_LayerDescr.LayerColor[LAYER_GLOBLABEL], &g_LayerDescr.LayerColor[LAYER_GLOBLABEL],
RED ) ); RED ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPinF" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPinF" ),
&g_LayerDescr.LayerColor[LAYER_PINFUN], &g_LayerDescr.LayerColor[LAYER_PINFUN],
MAGENTA ) ); MAGENTA ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColPinN" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColPinN" ),
&g_LayerDescr.LayerColor[LAYER_PINNUM], &g_LayerDescr.LayerColor[LAYER_PINNUM],
RED ) ); RED ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPNam" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPNam" ),
&g_LayerDescr.LayerColor[LAYER_PINNAM], &g_LayerDescr.LayerColor[LAYER_PINNAM],
CYAN ) ); CYAN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorField" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorField" ),
&g_LayerDescr.LayerColor[LAYER_FIELDS], &g_LayerDescr.LayerColor[LAYER_FIELDS],
MAGENTA ) ); MAGENTA ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorRef" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorRef" ),
&g_LayerDescr.LayerColor[LAYER_REFERENCEPART], &g_LayerDescr.LayerColor[LAYER_REFERENCEPART],
CYAN ) ); CYAN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorValue" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorValue" ),
&g_LayerDescr.LayerColor[LAYER_VALUEPART], &g_LayerDescr.LayerColor[LAYER_VALUEPART],
CYAN ) ); CYAN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNote" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNote" ),
&g_LayerDescr.LayerColor[LAYER_NOTES], &g_LayerDescr.LayerColor[LAYER_NOTES],
LIGHTBLUE ) ); LIGHTBLUE ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBody" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBody" ),
&g_LayerDescr.LayerColor[LAYER_DEVICE], &g_LayerDescr.LayerColor[LAYER_DEVICE],
RED ) ); RED ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBodyBg" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorBodyBg" ),
&g_LayerDescr.LayerColor[LAYER_DEVICE_BACKGROUND], &g_LayerDescr.LayerColor[LAYER_DEVICE_BACKGROUND],
LIGHTYELLOW ) ); LIGHTYELLOW ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNetN" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNetN" ),
&g_LayerDescr.LayerColor[LAYER_NETNAM], &g_LayerDescr.LayerColor[LAYER_NETNAM],
DARKGRAY ) ); DARKGRAY ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPin" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorPin" ),
&g_LayerDescr.LayerColor[LAYER_PIN], &g_LayerDescr.LayerColor[LAYER_PIN],
RED ) ); RED ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheet" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheet" ),
&g_LayerDescr.LayerColor[LAYER_SHEET], &g_LayerDescr.LayerColor[LAYER_SHEET],
MAGENTA ) ); MAGENTA ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true,
wxT( "ColorSheetFileName" ), wxT( "ColorSheetFileName" ),
&g_LayerDescr.LayerColor[LAYER_SHEETFILENAME], &g_LayerDescr.LayerColor[LAYER_SHEETFILENAME],
BROWN ) ); BROWN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetName" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetName" ),
&g_LayerDescr.LayerColor[LAYER_SHEETNAME], &g_LayerDescr.LayerColor[LAYER_SHEETNAME],
CYAN ) ); CYAN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetLab" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorSheetLab" ),
&g_LayerDescr.LayerColor[LAYER_SHEETLABEL], &g_LayerDescr.LayerColor[LAYER_SHEETLABEL],
BROWN ) ); BROWN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNoCo" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorNoCo" ),
&g_LayerDescr.LayerColor[LAYER_NOCONNECT], &g_LayerDescr.LayerColor[LAYER_NOCONNECT],
BLUE ) ); BLUE ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcW" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcW" ),
&g_LayerDescr.LayerColor[LAYER_ERC_WARN], &g_LayerDescr.LayerColor[LAYER_ERC_WARN],
GREEN ) ); GREEN ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcE" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorErcE" ),
&g_LayerDescr.LayerColor[LAYER_ERC_ERR], &g_LayerDescr.LayerColor[LAYER_ERC_ERR],
RED ) ); RED ) );
m_configSettings.Add( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGrid" ), m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorGrid" ),
&g_GridColor, &g_GridColor,
DARKDARKGRAY ) ); DARKDARKGRAY ) );
m_configSettings.Add( new PARAM_CFG_INT( true, wxT( "Pltmarg" ), m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Pltmarg" ),
&g_PlotMargin, &g_PlotMargin,
300, 0, 10000 ) ); 300, 0, 10000 ) );

View File

@ -539,12 +539,10 @@ EDA_LibComponentStruct* Read_Component_Definition( WinEDA_DrawFrame* frame,
if( !Res ) if( !Res )
{ /* Something went wrong there. */ { /* Something went wrong there. */
if( errorMsg.IsEmpty() ) if( errorMsg.IsEmpty() )
Msg.Printf( wxT( "Error at line %d of library \n\"%s\",\n" \ Msg.Printf( wxT( "Error at line %d of library \n\"%s\",\nlibrary not loaded" ),
"library not loaded" ),
*LineNum, currentLibraryName.GetData() ); *LineNum, currentLibraryName.GetData() );
else else
Msg.Printf( wxT( "Error <%s> at line %d of library \n\"%s\"," \ Msg.Printf( wxT( "Error <%s> at line %d of library \n\"%s\",\nlibrary not loaded" ),
"\nlibrary not loaded" ),
errorMsg.c_str(), *LineNum, errorMsg.c_str(), *LineNum,
currentLibraryName.GetData() ); currentLibraryName.GetData() );
DisplayError( frame, Msg ); DisplayError( frame, Msg );
@ -621,18 +619,17 @@ static LibEDA_BaseStruct* GetDrawEntry (WinEDA_DrawFrame* frame, FILE* f,
break; break;
default: default:
MsgLine.Printf( wxT( "Undefined DRAW command in line %d\n" \ MsgLine.Printf( wxT( "Undefined DRAW command in line %d\n%s, aborted." ),
"%s, aborted." ), *LineNum, Line ); *LineNum, Line );
DisplayError( frame, MsgLine ); DisplayError( frame, MsgLine );
return Head; return Head;
} }
if( !entryLoaded ) if( !entryLoaded )
{ {
MsgLine.Printf( wxT( "> in DRAW command %c in line %d" ), Line[0], MsgLine.Printf( wxT( "Error <%s %s> in DRAW command %c in line %d, aborted." ),
*LineNum ); errorMsg.c_str(), MsgLine.c_str(),
MsgLine = wxT( "Error <" ) + errorMsg + MsgLine + Line[0], *LineNum );
wxT( ", aborted." );
DisplayError( frame, MsgLine ); DisplayError( frame, MsgLine );
SAFE_DELETE( New ); SAFE_DELETE( New );

View File

@ -81,8 +81,7 @@ wxString g_SymbolExtBuffer( wxT( "sym" ) );
const wxString CompLibFileExtension( wxT( "lib" ) ); const wxString CompLibFileExtension( wxT( "lib" ) );
const wxString CompLibFileWildcard( wxT( "Kicad component library file " \ const wxString CompLibFileWildcard( wxT( "Kicad component library file (*.lib)|*.lib" ) );
"(*.lib)|*.lib" ) );
wxString g_SimulatorCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..) 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..) wxString g_NetListerCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..)

View File

@ -12,9 +12,6 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
//#include "protos.h"
#include "wx/image.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/treectrl.h" #include "wx/treectrl.h"

View File

@ -144,9 +144,9 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event )
if( createLib && success ) if( createLib && success )
{ {
msg = fn.GetFullPath() + _( " - OK" ); msg = fn.GetFullPath() + _( " - OK" );
DisplayInfoMessage( this, _( "Note: this new library will be available " \ DisplayInfoMessage( this,
"only if it is loaded by eeschema.\nModify " _( "Note: this new library will be available only \
"eeschema config if you want use it." ) ); if it is loaded by eeschema.\nModify eeschema config if you want use it." ) );
} }
else else
msg = _( "Error creating " ) + fn.GetFullName(); msg = _( "Error creating " ) + fn.GetFullName();

View File

@ -19,7 +19,7 @@ extern int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f,
wxString& aMsgDiag, int* aLineNum, wxString& aMsgDiag, int* aLineNum,
BASE_SCREEN* Window ); BASE_SCREEN* Window );
extern int ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, extern bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f,
wxString& aMsgDiag, int* aLineNum, wxString& aMsgDiag, int* aLineNum,
BASE_SCREEN* Window ); BASE_SCREEN* Window );
@ -90,9 +90,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
int ver = version - '0'; int ver = version - '0';
if( ver > EESCHEMA_VERSION ) if( ver > EESCHEMA_VERSION )
{ {
MsgDiag = FullFileName + _( " was created by a more recent " \ MsgDiag = FullFileName + _( " was created by a more recent \
"version of EESchema and may not load " \ version of EESchema and may not load correctly. Please consider updating!" );
"correctly. Please consider updating!" );
DisplayInfoMessage( this, MsgDiag ); 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 // Compile it if the new version is unreadable by previous eeschema versions
else if( ver < EESCHEMA_VERSION ) else if( ver < EESCHEMA_VERSION )
{ {
MsgDiag = FullFileName + _( " was created by an older version of " \ MsgDiag = FullFileName + _( " was created by an older version of \
"EESchema. It will be stored in the new " \ EESchema. It will be stored in the new file format when you save this file \
"file format when you save this file " \ again." );
"again." );
DisplayInfoMessage( this, MsgDiag ); DisplayInfoMessage( this, MsgDiag );
} }
#endif #endif
@ -173,8 +172,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'W': /* Its a Segment (WIRE or BUS) item. */ case 'W': /* Its a Segment (WIRE or BUS) item. */
if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 ) if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 )
{ {
MsgDiag.Printf( wxT( "EESchema file Segment struct error " \ MsgDiag.Printf( wxT( "EESchema file Segment struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
break; break;
@ -193,8 +192,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
&SegmentStruct->m_Start.y, &SegmentStruct->m_End.x, &SegmentStruct->m_Start.y, &SegmentStruct->m_End.x,
&SegmentStruct->m_End.y ) != 4 ) &SegmentStruct->m_End.y ) != 4 )
{ {
MsgDiag.Printf( wxT( "EESchema file Segment struct error " \ MsgDiag.Printf( wxT( "EESchema file Segment struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
SAFE_DELETE( SegmentStruct ); SAFE_DELETE( SegmentStruct );
@ -212,8 +211,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'E': /* Its a Raccord (WIRE or BUS) item. */ case 'E': /* Its a Raccord (WIRE or BUS) item. */
if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 ) if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 )
{ {
MsgDiag.Printf( wxT( "EESchema file record struct error at " \ MsgDiag.Printf( wxT( "EESchema file record struct error at line %d, aborted" ),
"line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
break; break;
@ -230,8 +229,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
&RaccordStruct->m_Pos.y, &RaccordStruct->m_Size.x, &RaccordStruct->m_Pos.y, &RaccordStruct->m_Size.x,
&RaccordStruct->m_Size.y ) != 4 ) &RaccordStruct->m_Size.y ) != 4 )
{ {
MsgDiag.Printf( wxT( "EESchema file Bus Entry struct error " \ MsgDiag.Printf( wxT( "EESchema file Bus Entry struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
SAFE_DELETE( RaccordStruct ); SAFE_DELETE( RaccordStruct );
@ -250,8 +249,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'P': /* Its a polyline item. */ case 'P': /* Its a polyline item. */
if( sscanf( SLine, "%s %s %d", Name1, Name2, &ii ) != 3 ) if( sscanf( SLine, "%s %s %d", Name1, Name2, &ii ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file polyline struct error " \ MsgDiag.Printf( wxT( "EESchema file polyline struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
break; break;
@ -270,8 +269,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
if( fgets( Line, 256 - 1, f ) == NULL if( fgets( Line, 256 - 1, f ) == NULL
|| sscanf( Line, "%d %d", &point.x, &point.y ) != 2 ) || sscanf( Line, "%d %d", &point.x, &point.y ) != 2 )
{ {
MsgDiag.Printf( wxT( "EESchema file polyline struct " \ MsgDiag.Printf( wxT( "EESchema file polyline struct error \
"error at line %d, aborted" ), at line %d, aborted" ),
LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
@ -295,8 +294,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
if( sscanf( SLine, "%s %d %d", Name1, &ConnectionStruct->m_Pos.x, if( sscanf( SLine, "%s %d %d", Name1, &ConnectionStruct->m_Pos.x,
&ConnectionStruct->m_Pos.y ) != 3 ) &ConnectionStruct->m_Pos.y ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file connection struct error " \ MsgDiag.Printf( wxT( "EESchema file connection struct error \
"at line %d, aborted" ), LineCount ); at line %d, aborted" ), LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
SAFE_DELETE( ConnectionStruct ); SAFE_DELETE( ConnectionStruct );
@ -311,8 +310,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'N': /* It is a NoConnect item. */ case 'N': /* It is a NoConnect item. */
if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 ) if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file NoConnect struct error " \ MsgDiag.Printf( wxT( "EESchema file NoConnect struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
} }
@ -327,8 +326,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'K': /* It is a Marker item. */ case 'K': /* It is a Marker item. */
if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 ) if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file marker struct error " \ MsgDiag.Printf( wxT( "EESchema file marker struct error line %d, aborted" ),
"line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
} }
@ -372,8 +371,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
default: default:
Failed = true; Failed = true;
MsgDiag.Printf( wxT( "EESchema file undefined object at line " \ MsgDiag.Printf( wxT( "EESchema file undefined object at line %d, aborted" ),
"%d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
break; break;
} }

View File

@ -733,7 +733,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
break; break;
dx = aRefPoint.x - Circle->m_Pos.x; dx = aRefPoint.x - Circle->m_Pos.x;
dy = aRefPoint.y + Circle->m_Pos.y; 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 ) if( abs( dist - Circle->m_Rayon ) <= seuil )
return DrawItem; return DrawItem;
} }

View File

@ -40,21 +40,6 @@ static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame ); 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, bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu ) wxMenu* PopMenu )

View File

@ -774,8 +774,9 @@ static void CreateImagePins( LibDrawPin* Pin )
* creation d'une pin * creation d'une pin
*/ */
{ {
int ii, CreateConv = false; int ii;
LibDrawPin* NewPin; LibDrawPin* NewPin;
bool CreateConv = false;
if( g_EditPinByPinIsOn ) if( g_EditPinByPinIsOn )
return; return;

View File

@ -681,7 +681,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FullFileName,
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawJunctionStruct*) DrawList ) #define STRUCT ( (DrawJunctionStruct*) DrawList )
x1 = STRUCT->m_Pos.x; y1 = STRUCT->m_Pos.y; 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; break;
case TYPE_SCH_TEXT: case TYPE_SCH_TEXT:

View File

@ -16,16 +16,6 @@
#pragma implementation "plotps.h" #pragma implementation "plotps.h"
#endif #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 "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
@ -37,8 +27,6 @@
#include "plot_common.h" #include "plot_common.h"
#include "protos.h" #include "protos.h"
#include "wx/defs.h"
// coeff de conversion dim en 1 mil -> dim en unite PS: // coeff de conversion dim en 1 mil -> dim en unite PS:
const double SCALE_PS = 0.001; const double SCALE_PS = 0.001;

View File

@ -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

View File

@ -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

View File

@ -4,17 +4,18 @@
/* read the generic netlist created by eeschema and convert it to a pads-pcb form /* read the generic netlist created by eeschema and convert it to a pads-pcb form
*/ */
#include "config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h>
#include <ctype.h>
#ifdef __UNIX__ #if defined( HAVE_STRINGS_H )
#define stricmp strcasecmp #include <strings.h>
#define strnicmp strncasecmp
#endif #endif
#include <ctype.h>
/* Pads-pcb sample: /* Pads-pcb sample:
*PADS-PCB* *PADS-PCB*
*PART* *PART*

View File

@ -132,20 +132,23 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
} }
else else
{ {
wxString val= CONV_FROM_UTF8( text ); wxString val = CONV_FROM_UTF8( text );
for (;;)
{
int i=val.find(wxT("\\n"));
if (i==wxNOT_FOUND)
break;
val.erase(i,2); for( ;; )
val.insert(i,wxT("\n")); {
int i=val.find( wxT( "\\n" ) );
if( i == wxNOT_FOUND )
break;
val.erase( i, 2 );
val.insert( i, wxT( "\n" ) );
} }
SCH_TEXT* TextStruct = new SCH_TEXT( pos, val ); SCH_TEXT* TextStruct = new SCH_TEXT( pos, val );
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->SetSchematicTextOrientation( orient ); TextStruct->SetSchematicTextOrientation( orient );
if( isdigit( Name3[0] ) ) if( isdigit( Name3[0] ) )
{ {
thickness = atol( Name3 ); thickness = atol( Name3 );
@ -265,8 +268,9 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
{ {
if( sscanf( ptcar, "%d", &size ) != 1 ) if( sscanf( ptcar, "%d", &size ) != 1 )
{ {
aMsgDiag.Printf( wxT( "EESchema file sheet Label Caract " \ aMsgDiag.Printf( wxT( "EESchema file sheet Label Caract \
"error line %d, aborted\n" ), *aLineNum ); error line %d, aborted\n" ),
*aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
DisplayError( frame, aMsgDiag ); 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, &SheetLabelStruct->m_Pos.x, &SheetLabelStruct->m_Pos.y,
&size ) != 5 ) &size ) != 5 )
{ {
aMsgDiag.Printf( wxT( "EESchema file Sheet Label Caract " \ aMsgDiag.Printf( wxT( "EESchema file Sheet Label Caract \
"error line %d, aborted\n" ), *aLineNum ); error line %d, aborted\n" ),
*aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
DisplayError( frame, aMsgDiag ); DisplayError( frame, aMsgDiag );
continue; continue;
@ -341,8 +346,8 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
if( strnicmp( "$End", Line, 4 ) != 0 ) if( strnicmp( "$End", Line, 4 ) != 0 )
{ {
aMsgDiag.Printf( wxT( "**EESchema file end_sheet struct error at " \ aMsgDiag.Printf( wxT( "**EESchema file end_sheet struct error at line %d, aborted\n" ),
"line %d, aborted\n" ), *aLineNum ); *aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
Failed = TRUE; Failed = TRUE;
} }
@ -394,8 +399,8 @@ bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
if( SheetFormatList[ii] == NULL ) if( SheetFormatList[ii] == NULL )
{ {
/* Erreur ici: descr non trouvee */ /* Erreur ici: descr non trouvee */
aMsgDiag.Printf( wxT( "EESchema file Dims Caract error line %d, " \ aMsgDiag.Printf( wxT( "EESchema file Dims Caract error line %d, \aborted\n" ),
"aborted\n" ), *aLineNum ); *aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
DisplayError( frame, aMsgDiag ); DisplayError( frame, aMsgDiag );
} }

View File

@ -102,11 +102,6 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
ID_SCHEMATIC_VERTICAL_TOOLBAR_END, ID_SCHEMATIC_VERTICAL_TOOLBAR_END,
WinEDA_SchematicFrame::Process_Special_Functions ) 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, EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
WinEDA_SchematicFrame::Process_Special_Functions ) WinEDA_SchematicFrame::Process_Special_Functions )

View File

@ -266,10 +266,8 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event )
if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() ) if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() )
|| ( m_CurrentSheet->m_AssociatedScreen == NULL) ) || ( m_CurrentSheet->m_AssociatedScreen == NULL) )
{ {
msg = _( "Changing a Filename can change all the schematic " \ msg = _( "Changing a Filename can change all the schematic \
"structures and cannot be undone." ); structures and cannot be undone.\nOk to continue renaming?" );
msg << wxT( "\n" );
msg << _( "Ok to continue renaming?" );
if( m_CurrentSheet->m_AssociatedScreen == NULL || IsOK( NULL, msg ) ) 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 { //do not prompt on a new sheet. in fact, we should not allow a sheet to be created

View File

@ -17,28 +17,28 @@
/* class WinEDA_ViewlibFrame */ /* class WinEDA_ViewlibFrame */
/*****************************/ /*****************************/
BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame ) BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame )
/* Window events */ /* Window events */
EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow ) EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow )
EVT_SIZE( WinEDA_ViewlibFrame::OnSize ) EVT_SIZE( WinEDA_ViewlibFrame::OnSize )
EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate ) EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate )
/* Sash drag events */ /* Sash drag events */
EVT_SASH_DRAGGED( ID_LIBVIEW_LIBWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) EVT_SASH_DRAGGED( ID_LIBVIEW_LIBWINDOW, WinEDA_ViewlibFrame::OnSashDrag )
EVT_SASH_DRAGGED( ID_LIBVIEW_CMPWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) EVT_SASH_DRAGGED( ID_LIBVIEW_CMPWINDOW, WinEDA_ViewlibFrame::OnSashDrag )
/* Toolbar events */ /* Toolbar events */
EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL, EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL,
WinEDA_ViewlibFrame::Process_Special_Functions ) WinEDA_ViewlibFrame::Process_Special_Functions )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom )
EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
WinEDA_ViewlibFrame::ExportToSchematicLibraryPart ) WinEDA_ViewlibFrame::ExportToSchematicLibraryPart )
EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER, EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER,
WinEDA_ViewlibFrame::Process_Special_Functions ) WinEDA_ViewlibFrame::Process_Special_Functions )
/* listbox events */ /* listbox events */
EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList ) EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList )
EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList ) EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList )
END_EVENT_TABLE() END_EVENT_TABLE()
@ -58,13 +58,13 @@ static wxAcceleratorEntry accels[] =
#define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) ) #define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) )
#define EXTRA_BORDER_SIZE 2 #define EXTRA_BORDER_SIZE 2
/******************************************************************************/
WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
LibraryStruct* Library, LibraryStruct* Library,
wxSemaphore* semaphore ) : wxSemaphore* semaphore ) :
WinEDA_DrawFrame( father, VIEWER_FRAME, _( "Library browser" ), WinEDA_DrawFrame( father, VIEWER_FRAME, _( "Library browser" ),
wxDefaultPosition, wxDefaultSize ) wxDefaultPosition, wxDefaultSize )
/******************************************************************************/
{ {
wxAcceleratorTable table( ACCEL_TABLE_CNT, accels ); wxAcceleratorTable table( ACCEL_TABLE_CNT, accels );
@ -101,14 +101,16 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
{ {
// Creates the libraries window display // Creates the libraries window display
m_LibListWindow = m_LibListWindow =
new wxSashLayoutWindow( this, ID_LIBVIEW_LIBWINDOW, win_pos, m_LibListSize, new wxSashLayoutWindow( this, ID_LIBVIEW_LIBWINDOW, win_pos,
wxCLIP_CHILDREN | wxSW_3D, wxT( m_LibListSize, wxCLIP_CHILDREN | wxSW_3D,
"LibWindow" ) ); wxT( "LibWindow" ) );
m_LibListWindow->SetOrientation( wxLAYOUT_VERTICAL ); m_LibListWindow->SetOrientation( wxLAYOUT_VERTICAL );
m_LibListWindow->SetAlignment( wxLAYOUT_LEFT ); m_LibListWindow->SetAlignment( wxLAYOUT_LEFT );
m_LibListWindow->SetSashVisible( wxSASH_RIGHT, TRUE ); m_LibListWindow->SetSashVisible( wxSASH_RIGHT, TRUE );
m_LibListWindow->SetExtraBorderSize( EXTRA_BORDER_SIZE ); m_LibListWindow->SetExtraBorderSize( EXTRA_BORDER_SIZE );
m_LibList = new wxListBox( m_LibListWindow, ID_LIBVIEW_LIB_LIST, wxPoint( 0, 0 ), m_LibList =
new wxListBox( m_LibListWindow, ID_LIBVIEW_LIB_LIST,
wxPoint( 0, 0 ),
m_LibListWindow->GetClientSize() - wxSize(EXTRA_BORDER_SIZE*2,0), m_LibListWindow->GetClientSize() - wxSize(EXTRA_BORDER_SIZE*2,0),
0, NULL, wxLB_HSCROLL ); 0, NULL, wxLB_HSCROLL );
} }
@ -124,7 +126,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
win_pos.y = 0; win_pos.y = 0;
m_CmpListWindow = new wxSashLayoutWindow( this, ID_LIBVIEW_CMPWINDOW, m_CmpListWindow = new wxSashLayoutWindow( this, ID_LIBVIEW_CMPWINDOW,
win_pos, m_CmpListSize, win_pos, m_CmpListSize,
wxCLIP_CHILDREN | wxSW_3D, wxT( "CmpWindow" ) ); wxCLIP_CHILDREN | wxSW_3D,
wxT( "CmpWindow" ) );
m_CmpListWindow->SetOrientation( wxLAYOUT_VERTICAL ); m_CmpListWindow->SetOrientation( wxLAYOUT_VERTICAL );
// m_CmpListWindow->SetAlignment( wxLAYOUT_LEFT ); // m_CmpListWindow->SetAlignment( wxLAYOUT_LEFT );
@ -467,4 +470,3 @@ void WinEDA_ViewlibFrame::SaveSettings()
cfg->Write( LIBLIST_WIDTH_KEY, m_LibListSize.x ); cfg->Write( LIBLIST_WIDTH_KEY, m_LibListSize.x );
cfg->Write( CMPLIST_WIDTH_KEY, m_CmpListSize.x ); cfg->Write( CMPLIST_WIDTH_KEY, m_CmpListSize.x );
} }

View File

@ -13,9 +13,6 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.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 ) void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/************************************************************************/ /************************************************************************/
@ -31,16 +28,11 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
if( DrawStruct && DrawStruct->m_Flags ) // Commande "POPUP" en cours if( DrawStruct && DrawStruct->m_Flags ) // Commande "POPUP" en cours
{ {
switch( DrawStruct->Type() ) msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ),
{
default:
msg.Printf(
wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ),
(unsigned) DrawStruct->Type(), (unsigned) DrawStruct->Type(),
(unsigned) DrawStruct->m_Flags ); (unsigned) DrawStruct->m_Flags );
DisplayError( this, msg ); DisplayError( this, msg );
} }
}
else else
{ {
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
@ -221,11 +213,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) ); SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) );
break; break;
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
DrawPanel->MouseToCursorSchema();
Process_Move_Item( this, GetScreen()->GetCurItem(), &dc );
break;
case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER:
((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice(); ((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice();
DrawPanel->Refresh( TRUE ); 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 ) void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/**************************************************************************/ /**************************************************************************/
@ -355,16 +319,6 @@ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
} }
if( (DrawStruct == NULL) || (DrawStruct->m_Flags != 0) )
break;
// Element localis<69>
switch( DrawStruct->Type() )
{
default:
break;
}
break; // end case 0 break; // end case 0
case ID_BUS_BUTT: case ID_BUS_BUTT:

View File

@ -130,8 +130,8 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
if( !fn.IsOk() ) if( !fn.IsOk() )
{ {
wildcard.Printf( _( "Gerber files (.%s .gbr .gbx .lgr .ger .pho)|" \ wildcard.Printf( _( "Gerber files (.%s .gbr .gbx .lgr .ger .pho)| \
"*.%s;*.gbr;*.gbx;*.lgr;*.ger;*.pho|" ), *.%s;*.gbr;*.gbx;*.lgr;*.ger;*.pho|" ),
g_PenFilenameExt.c_str(), g_PenFilenameExt.c_str()); g_PenFilenameExt.c_str(), g_PenFilenameExt.c_str());
wildcard += AllFilesWildcard; wildcard += AllFilesWildcard;

View File

@ -105,7 +105,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
// Annulation de commande en cours // Annulation de commande en cours
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, 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 // Pop up menu
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, 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_Axis = true; // true to show X and Y axis on screen
m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin<69> m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin<69>
m_Ident = GERBER_FRAME;
if( DrawPanel ) if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE; DrawPanel->m_Block_Enable = TRUE;
// Give an icon // Give an icon
#ifdef __WINDOWS__ #ifdef __WINDOWS__
SetIcon( wxICON( a_icon_gerbview ) ); SetIcon( wxICON( a_icon_gerbview ) );
#else #else
SetIcon( wxICON( icon_gerbview ) ); SetIcon( wxICON( icon_gerbview ) );
#endif #endif
SetBaseScreen( ScreenPcb ); SetBaseScreen( ScreenPcb );
ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb;

View File

@ -23,8 +23,7 @@
const wxString GerbviewProjectFileExt( wxT( "cnf" ) ); const wxString GerbviewProjectFileExt( wxT( "cnf" ) );
const wxString GerbviewProjectFileWildcard( _( "GerbView project files " \ const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) );
"(.cnf)|*.cnf" ) );
/*************************************************************/ /*************************************************************/

View File

@ -53,11 +53,11 @@ static PARAM_CFG_BOOL SegmFillCfg
); );
static PARAM_CFG_BOOL PadFillCfg static PARAM_CFG_INT PadFillCfg
( (
INSETUP, INSETUP,
wxT("PadFill"), /* identification */ wxT("PadFill"), /* identification */
&DisplayOpt.DisplayPadFill, /* Adresse du parametre */ (int*)&DisplayOpt.DisplayPadFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */ TRUE /* Valeur par defaut */
); );
@ -465,4 +465,3 @@ PARAM_CFG_BASE * ParamCfgList[] =
& DisplPolairCfg, & DisplPolairCfg,
NULL NULL
}; };

View File

@ -64,13 +64,11 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_PADS_SKETCH: case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
if( m_OptionsToolBar->GetToolState( id ) ) if( m_OptionsToolBar->GetToolState( id ) )
{ {
m_DisplayPadFill = FALSE; DisplayOpt.DisplayPadFill = m_DisplayPadFill = false;
DisplayOpt.DisplayPadFill = FALSE;
} }
else else
{ {
m_DisplayPadFill = TRUE; DisplayOpt.DisplayPadFill = m_DisplayPadFill = true;
DisplayOpt.DisplayPadFill = TRUE;
} }
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
@ -364,9 +362,9 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event )
DisplayOpt.DisplayPcbTrackFill = FALSE; DisplayOpt.DisplayPcbTrackFill = FALSE;
if( m_OptDisplayFlashes->GetSelection() == 1 ) if( m_OptDisplayFlashes->GetSelection() == 1 )
DisplayOpt.DisplayPadFill = TRUE; DisplayOpt.DisplayPadFill = true;
else else
DisplayOpt.DisplayPadFill = FALSE; DisplayOpt.DisplayPadFill = false;
if( m_OptDisplayPolygons->GetSelection() == 0 ) if( m_OptDisplayPolygons->GetSelection() == 0 )
g_DisplayPolygonsModeSketch = 1; g_DisplayPolygonsModeSketch = 1;

View File

@ -984,8 +984,8 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
break; break;
default: default:
msg.Printf( wxT( "Execute_DCODE_Command: interpol error " \ msg.Printf( wxT( "Execute_DCODE_Command: interpol error (type %X)" ),
"(type %X)" ), m_Iterpolation ); m_Iterpolation );
DisplayError( frame, msg ); DisplayError( frame, msg );
break; break;
} }
@ -1193,7 +1193,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
m_GerbMetric ); m_GerbMetric );
int gap = scale( p->params[4].GetValue( tool ), int gap = scale( p->params[4].GetValue( tool ),
m_GerbMetric ); m_GerbMetric );
int numCircles = p->params[5].GetValue( tool ); int numCircles = (int)p->params[5].GetValue( tool );
int crossHairThickness = int crossHairThickness =
scale( p->params[6].GetValue( tool ), m_GerbMetric ); scale( p->params[6].GetValue( tool ), m_GerbMetric );
int crossHairLength = int crossHairLength =

View File

@ -34,9 +34,9 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
save_opt = DisplayOpt; save_opt = DisplayOpt;
if( printmasklayer & ALL_CU_LAYERS ) if( printmasklayer & ALL_CU_LAYERS )
DisplayOpt.DisplayPadFill = FILLED; DisplayOpt.DisplayPadFill = true;
else else
DisplayOpt.DisplayPadFill = SKETCH; DisplayOpt.DisplayPadFill = false;
DisplayOpt.DisplayPadNum = 0; DisplayOpt.DisplayPadNum = 0;
DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadNoConn = 0;
DisplayOpt.DisplayPadIsol = 0; DisplayOpt.DisplayPadIsol = 0;

View File

@ -123,7 +123,7 @@ public:
PARAM_CFG_BASE** List ); PARAM_CFG_BASE** List );
void WriteProjectConfig( const wxString& fileName, void WriteProjectConfig( const wxString& fileName,
const wxString& GroupName, const wxString& GroupName,
const PARAM_CFG_ARRAY& params ); PARAM_CFG_ARRAY& params );
/** Function SaveCurrentSetupValues() /** Function SaveCurrentSetupValues()
* Save the current setup values in m_EDA_Config * Save the current setup values in m_EDA_Config
@ -131,7 +131,7 @@ public:
* @param aList = array of PARAM_CFG_BASE pointers * @param aList = array of PARAM_CFG_BASE pointers
*/ */
void SaveCurrentSetupValues( PARAM_CFG_BASE** aList ); void SaveCurrentSetupValues( PARAM_CFG_BASE** aList );
void SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List ); void SaveCurrentSetupValues( PARAM_CFG_ARRAY& List );
/** Function ReadCurrentSetupValues() /** Function ReadCurrentSetupValues()
* Raed the current setup values previously saved, from m_EDA_Config * Raed the current setup values previously saved, from m_EDA_Config
@ -139,7 +139,7 @@ public:
* @param aList = array of PARAM_CFG_BASE pointers * @param aList = array of PARAM_CFG_BASE pointers
*/ */
void ReadCurrentSetupValues( PARAM_CFG_BASE** aList ); 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, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
@ -147,7 +147,7 @@ public:
bool Load_Only_if_New ); bool Load_Only_if_New );
bool ReadProjectConfig( const wxString& local_config_filename, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
const PARAM_CFG_ARRAY& List, PARAM_CFG_ARRAY& List,
bool Load_Only_if_New ); bool Load_Only_if_New );
bool ReCreatePrjConfig( const wxString& local_config_filename, bool ReCreatePrjConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,

View File

@ -17,19 +17,10 @@
#include <wx/wx.h> #include <wx/wx.h>
#endif #endif
#include <stdio.h> /*
#ifdef __FreeBSD__ * FIXME: This appears to already be included in the OSX build of wxWidgets.
#include <stdlib.h> * Will someone with OSX please remove this and see if it compiles.
#else */
#ifndef __DARWIN__
#include <malloc.h> // MacOSX (DARWIN): malloc() and free() are in stdlib.h
#endif
#endif
#include <time.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#ifdef __WXMAC__ #ifdef __WXMAC__
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#endif #endif
@ -41,11 +32,6 @@
#define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch #define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch
#define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch #define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch
#ifdef __UNIX__
#define stricmp strcasecmp
#define strnicmp strncasecmp
#endif
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#define DIR_SEP '\\' #define DIR_SEP '\\'
#define STRING_DIR_SEP wxT( "\\" ) #define STRING_DIR_SEP wxT( "\\" )
@ -60,7 +46,6 @@
#define D(x) // nothing #define D(x) // nothing
#endif #endif
#define UNIX_STRING_DIR_SEP wxT( "/" ) #define UNIX_STRING_DIR_SEP wxT( "/" )
#define WIN_STRING_DIR_SEP wxT( "\\" ) #define WIN_STRING_DIR_SEP wxT( "\\" )
@ -76,4 +61,6 @@
#define MAYBE_RESIZE_BORDER 0 // no resizeable border #define MAYBE_RESIZE_BORDER 0 // no resizeable border
#endif #endif
#include "config.h"
#endif /* FCTSYS_H */ #endif /* FCTSYS_H */

View File

@ -74,11 +74,15 @@ static inline const wxChar* GetChars( wxString s )
/* macro to exchange 2 items */ /* macro to exchange 2 items */
/*****************************/ /*****************************/
/* this macro uses the typeof keyword /*
* for compilers that do not know typeof (MSVC ) * The EXCHG macro uses BOOST_TYPEOF for compilers that do not have native
* the boost libs have a workaround for the typeof problem * 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" #include "boost/typeof/typeof.hpp"
// we have to register the types used with the typeof keyword with boost // 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( D_PAD* );
BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* ); BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* );
class BOARD_ITEM; class BOARD_ITEM;
BOOST_TYPEOF_REGISTER_TYPE( BOARD_ ITEM* ); BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* );
#define typeof (expr)BOOST_TYPEOF( expr ) #define EXCHG( a, b ) { BOOST_TYPEOF(a) __temp__ = (a); \
#endif // #ifdef __MSVC__ (a) = (b); \
(b) = __temp__; }
// here is the macro:
#define EXCHG( a, b ) { typeof(a)__temp__ = (a); (a) = (b); (b) = __temp__; }
/*****************************************************/ /*****************************************************/

View File

@ -8,7 +8,7 @@
#include "wx/confbase.h" #include "wx/confbase.h"
#include "wx/fileconf.h" #include "wx/fileconf.h"
#include <wx/dynarray.h> #include <boost/ptr_container/ptr_vector.hpp>
/* definifition des types de parametre des files de configuration */ /* definifition des types de parametre des files de configuration */
@ -207,6 +207,6 @@ public:
virtual void SaveParam( wxConfigBase* aConfig ); 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__ */ #endif /* __PARAM_CONFIG_H__ */

View File

@ -125,7 +125,7 @@
/* Forward declaration */ /* Forward declaration */
class EQUIPOT; class EQUIPOT;
class MARKER; class MARKER;
struct CHEVELU; class CHEVELU;
//class Ki_PageDescr; //class Ki_PageDescr;
//class DrawBlockStruct; //class DrawBlockStruct;

View File

@ -46,7 +46,7 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
} while( 0 ); } while( 0 );
extern float fsinus[]; extern double fsinus[];
extern float fcosinus[]; extern double fcosinus[];
#endif #endif

View File

@ -90,11 +90,11 @@ public:
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ); void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
const PARAM_CFG_ARRAY& GetProjectFileParameters( void ); PARAM_CFG_ARRAY& GetProjectFileParameters( void );
void SaveProjectFile( wxWindow* displayframe ); void SaveProjectFile( wxWindow* displayframe );
bool LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig ); bool LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig );
const PARAM_CFG_ARRAY& GetConfigurationSettings( void ); PARAM_CFG_ARRAY& GetConfigurationSettings( void );
void LoadSettings(); void LoadSettings();
void SaveSettings(); void SaveSettings();
@ -131,7 +131,6 @@ public:
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event );
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Retourne le meilleur zoom
SCH_ITEM* SchematicGeneralLocateAndDisplay( bool IncludePin = TRUE ); SCH_ITEM* SchematicGeneralLocateAndDisplay( bool IncludePin = TRUE );

View File

@ -92,8 +92,7 @@ public:
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { }
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
@ -112,8 +111,6 @@ public:
virtual void Show3D_Frame( wxCommandEvent& event ); virtual void Show3D_Frame( wxCommandEvent& event );
// Undo and redo functions
public:
virtual void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, virtual void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
int flag_type_command = 0 ); int flag_type_command = 0 );
@ -983,6 +980,7 @@ public:
void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event );
void GeneralControle( wxDC* DC, wxPoint Mouse ); void GeneralControle( wxDC* DC, wxPoint Mouse );
virtual void OnSelectGrid( wxCommandEvent& event ); virtual void OnSelectGrid( wxCommandEvent& event );
void LoadModuleFromBoard( wxCommandEvent& event );
/* handlers for block commands */ /* handlers for block commands */
int ReturnBlockCommand( int key ); int ReturnBlockCommand( int key );

View File

@ -222,7 +222,6 @@ public:
virtual void OnSize( wxSizeEvent& event ); virtual void OnSize( wxSizeEvent& event );
void OnEraseBackground( wxEraseEvent& SizeEvent ); void OnEraseBackground( wxEraseEvent& SizeEvent );
// void OnChar(wxKeyEvent& event);
void SetToolbarBgColor( int color_num ); void SetToolbarBgColor( int color_num );
virtual void OnZoom( wxCommandEvent& event ); virtual void OnZoom( wxCommandEvent& event );
void OnGrid( int grid_type ); void OnGrid( int grid_type );
@ -259,7 +258,6 @@ public:
void Process_Zoom( wxCommandEvent& event ); void Process_Zoom( wxCommandEvent& event );
void Process_Grid( wxCommandEvent& event ); void Process_Grid( wxCommandEvent& event );
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; 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 void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;

View File

@ -257,29 +257,34 @@ void WinEDA_MainFrame::RecreateBaseHToolbar()
SetToolBar( m_HToolBar ); SetToolBar( m_HToolBar );
// Set up toolbar // 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" ) ); _( "Start a new project" ) );
// Load 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" ) ); _( "Load existing project" ) );
// Save 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" ) ); _( "Save current project" ) );
// Separator // Separator
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
// Save and archive files // 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 _( "Archive all project files" ) ); // Tooltip
// Separator // Separator
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
// Refresh project tree // 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" ) ); _( "Refresh project tree" ) );
m_HToolBar->Realize(); // Create m_HToolBar m_HToolBar->Realize(); // Create m_HToolBar

View File

@ -278,7 +278,7 @@ public:
WinEDA_PrjFrame( WinEDA_MainFrame* parent, WinEDA_PrjFrame( WinEDA_MainFrame* parent,
const wxPoint& pos, const wxSize& size ); const wxPoint& pos, const wxSize& size );
~WinEDA_PrjFrame() { } ~WinEDA_PrjFrame();
void OnSelect( wxTreeEvent& Event ); void OnSelect( wxTreeEvent& Event );
void OnRenameAsk( wxTreeEvent& Event ); void OnRenameAsk( wxTreeEvent& Event );
void OnRename( wxTreeEvent& Event ); void OnRename( wxTreeEvent& Event );

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -42,11 +42,10 @@ void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
{ {
bool select = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME; bool select = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME;
if( !wxGetApp().m_PdfBrowser || select ) if( !wxGetApp().m_PdfBrowser && !select )
{ {
if( !select ) DisplayError( this,
DisplayError( this, _( "You must choose a PDF viewer before use " \ _( "You must choose a PDF viewer before using this option." ) );
"this option" ) );
} }
wxString wildcard( wxT( "*" ) ); wxString wildcard( wxT( "*" ) );

View File

@ -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 ) int WinEDA_TreePrj::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 )
/***************************************************************************************/ /***************************************************************************************/
@ -215,8 +222,8 @@ void TreePrjItemData::Move( TreePrjItemData* dest )
if( !wxRenameFile( GetFileName(), destName, false ) ) if( !wxRenameFile( GetFileName(), destName, false ) )
#endif #endif
{ {
wxMessageDialog( m_Parent, _( "Unable to move file ... " ), _( wxMessageDialog( m_Parent, _( "Unable to move file ... " ),
"Permission error ?" ), wxICON_ERROR | wxOK ); _( "Permission error ?" ), wxICON_ERROR | wxOK );
return; return;
} }
@ -390,8 +397,8 @@ void TreePrjItemData::Activate( WinEDA_PrjFrame* prjframe )
it in treeprj_frame.cpp in the line looking like this: it in treeprj_frame.cpp in the line looking like this:
m_Filters.push_back( wxT( "^no kicad files found" ) ); m_Filters.push_back( wxT( "^no kicad files found" ) );
*/ */
prjframe->AddFile( wxString( _( "no kicad files found in " \ prjframe->AddFile(
"this directory" ) ), id ); _( "no kicad files found in this directory" ), id );
} }
/* Sort filenames by alphabetic order */ /* Sort filenames by alphabetic order */

View File

@ -100,7 +100,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
m_Filters.push_back( wxT( "^no kicad files found" ) ); m_Filters.push_back( wxT( "^no kicad files found" ) );
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
m_Filters.push_back( wxT( "^.*\\.py$" ) ); m_Filters.push_back( wxT( "^.*\\.py$" ) );
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RunScript" ) ); 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::DeleteFile" ) );
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) );
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) );
#endif /* KICAD_PYTHON */ #endif /* KICAD_PYTHON */
for( int i = 0; i < TREE_MAX; i++ ) 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]; wxMenu* menu = m_ContextMenus[TREE_PY];
// Python script context menu // Python script context menu
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
item = new wxMenuItem( menu, ID_PROJECT_RUNPY, item = new wxMenuItem( menu, ID_PROJECT_RUNPY,
_( "&Run" ), _( "&Run" ),
_( "Run the Python Script" ) ); _( "Run the Python Script" ) );
item->SetBitmap( icon_python_small_xpm ); item->SetBitmap( icon_python_small_xpm );
menu->Append( item ); menu->Append( item );
#endif /* KICAD_PYTHON */ #endif /* KICAD_PYTHON */
// ID_PROJECT_TXTEDIT // ID_PROJECT_TXTEDIT
@ -228,6 +228,21 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
ReCreateTreePrj(); 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 ) 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 * @brief Allowing drag & drop of file other than the currently opened project
*/ */

View File

@ -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)

View File

@ -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)

View File

@ -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`

Some files were not shown because too many files have changed in this diff Show More