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 );
SetGLColor( WHITE );
glBegin( GL_LINES );
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
glVertex3f( 0.0, 0.0, 0.0 );
glVertex3f( 1.0, 0.0, 0.0 ); // X axis
glVertex3f( 0.0, 0.0, 0.0 );
glVertex3f( 0.0, -1.0, 0.0 ); // Y axis
glNormal3f( 1.0, 0.0, 0.0 ); // Normal is Y axis
glVertex3f( 0.0, 0.0, 0.0 );
glVertex3f( 0.0, 0.0, 0.3 ); // Z axis
glNormal3f( 0.0f, 0.0f, 1.0f ); // Normal is Z axis
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 1.0f, 0.0f, 0.0f ); // X axis
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, -1.0f, 0.0f ); // Y axis
glNormal3f( 1.0f, 0.0f, 0.0f ); // Normal is Y axis
glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, 0.0f, 0.3f ); // Z axis
glEnd();
}

View File

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

View File

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

View File

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

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__
#define __KICAD_SVN_VERSION_H__
#ifndef __CONFIG_H__
#define __CONFIG_H__
#cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@"
#cmakedefine KICAD_ABOUT_VERSION "@KICAD_ABOUT_VERSION@"
#cmakedefine HAVE_STRCASECMP
#endif /* __KICAD_SVN_VERSION_H__ */
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_ISO_STRICMP
#cmakedefine HAVE_ISO_STRNICMP
#cmakedefine HAVE_ISO_SNPRINTF
#if defined( HAVE_ISO_SNPRINTF )
#define snprintf _snprintf
#endif
#cmakedefine HAVE_ISO_HYPOT
#if defined( HAVE_ISO_HYPOT )
#define hypot _hypot
#endif
#cmakedefine MALLOC_IN_STDLIB_H
#if !defined( MALLOC_IN_STDLIB_H )
#include <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
Last Revised: 12-Mar-2008
Last Revised: 13-May-2009
Kicad needs wxWidgets, the multi platform G.U.I.
@ -26,6 +26,7 @@ sections below.)
===== Step Details ====================================================
1) If windows, then install "msys" and "mingw".
Skip this step if on a Unix box. Get msys and mingw here:
http://mingw.org/
msys sets up a development environment that allows the bash shell to run.
@ -33,19 +34,24 @@ mingw are a set of tools that run on windows or under msys. You will need
at least the following mingw packages: make, gcc, g++, binutils, autoconf, and
automake.
-----------------------------------------------------------------------------
2) If linux, install "mesa". Use your package manager to install the development
libaries.
2) If linux, install "mesa". Use your package manager to install the
development libaries.
-----------------------------------------------------------------------------
3) Make sure g++ and "make" are in your path.
If windows, then try running g++ and make from within your msys bash shell.
-----------------------------------------------------------------------------
4) Install wxWidgets [and build it if on windows].
If on windows, download
http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.8.zip or a newer version.
Start msys so you have a bash shell. Decide where your wxWidgets build directory
@ -54,8 +60,8 @@ such as home/<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
a "debug" version of the wxWidgets library at this point, instead of the release
version, or in addition to the the release version.)
Unzip the wmMWS zip file into the build directory. Change directories into there,
and then:
Unzip the wmMWS zip file into the build directory. Change directories into
there, and then:
mkdir build-release
mkdir build-debug
@ -82,21 +88,23 @@ Verify that wx-config is in your path. Modify your PATH environment variable
if need be so you can run wx-config from a command prompt. You may have to
restart your msys shell, depending on how you modify your PATH.
If on linux, use your package manager to install shared object libraries and the
development versions of the wxWidgets packages which include the C++ headers. An
alternative is to build static libaries from source. Verify that wx-config is in
your path by running it from a command prompt. Linux users then go to next step.
-----------------------------------------------------------------------------
5) Install zlib [and build it if on windows].
If on windows, download http://www.zlib.net/zlib123.zip or a newer version.
Start msys so you have a bash shell. Decide where your zlib build directory
will be. It must be where you can access it from within the msys environment,
such as home/<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
build directory. Change directories into there, and then:
./configure
make
make install
@ -107,12 +115,15 @@ If linux, use your package manager to install zlib pre-built binaries.
Note (JP Charras):
Under Linux, zlib is usually installed.
if not found by wxWidget installation, wxWidgets creates an alternate zlib
Under Windows, zlib is not installed, so my cmake buld try to use the wxWidgets zlib build.
So, under windows kicad build should work without zlib install.
Under Windows, zlib is not installed, so my cmake buld try to use the
wxWidgets zlib build. So, under windows kicad build should work without
zlib install.
-----------------------------------------------------------------------------
6) Install CMAKE.
If windows, download the installation binary for windows from cmake.org.
Install that and choose to add cmake to your path during installation. You
will have to restart and command shells for the new path to take effect.
@ -124,15 +135,18 @@ or later. If only an older one is available in your package repository, build
2.6.1 from source. Verify that cmake is in your path by trying to run it from a
command prompt.
-----------------------------------------------------------------------------
7) Install Boost C++ Libraries
Under linux, boost is already installed, but can be too old.
If this is the case, you *must* update boost.
Go to http://www.boost.org/ dowlload the latest version of boost.
unzip (or untar) boots file.
under Windows, files can be installed (unzipped) everywhere, but when create makefiles using cmake,
you will have a message saying boost is not found, something like:
under Windows, files can be installed (unzipped) everywhere, but when create
makefiles using cmake, you will have a message saying boost is not found,
something like:
-- Check for installed Boost -- not found
CMake Error at CMakeModules/CheckFindPackageResult.cmake:6 (message):
@ -145,14 +159,17 @@ Boost_INCLUDE_DIR:PATH=Boost_INCLUDE_DIR-NOTFOUND
and edit it to set the right path, something like:
Boost_INCLUDE_DIR:PATH=f:/boost/boost
(on my computer boost is unzipper in f:\boost, and boost installed files are in f:\boost\boost)
(on my computer boost is unzipper in f:\boost, and boost installed files are
in f:\boost\boost)
-----------------------------------------------------------------------------
8) Install the kicad source tree.
You can use the subversion repository or a tar file for this. See the wiki.
-----------------------------------------------------------------------------
9) Use cmake to create the kicad makefiles.
@ -187,18 +204,22 @@ notice the leading <boost/ in the path.
So point your Boost_INCLUDE_DIR:PATH= variable to a directory above the
"boost" directory.
-----------------------------------------------------------------------------
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
CMakeLists.txt files change. If windows, you must be in your msys shell.
On either platform then:
cd <kicadSource>/build/release
make
[sudo] make install
You are now done unless you want to make a Debug build.
-----------------------------------------------------------------------------
11) Making a "Debug" build.
@ -206,9 +227,9 @@ You are now done unless you want to make a Debug build.
cd <kicadSource>/build/debug
On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final ../../ argument. Although
normally you do not install the Debug binaries, you can debug them where they
were built.
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final ../../ argument.
Although normally you do not install the Debug binaries, you can debug them
where they were built.
If windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
@ -219,6 +240,7 @@ If linux, run instead the following command:
Make the Debug binaries:
make
-----------------------------------------------------------------------------
12) Variables for fine-tuning the build process.
@ -240,10 +262,8 @@ These should be set from command line:
CMAKE_INSTALL_PREFIX (OPTIONAL)
KICAD_MINIZIP ON/OFF
KICAD_PYTHON ON/OFF
@ -253,154 +273,3 @@ Note: that it is easy to build only a specific binary such as pcbnew alone:
make pcbnew
-----------------------------------------------------------------------------
End of CMAKE related building.
============= OLD STUFF NOT PERTINENT TO CMAKE ==============================
unzip sources in a working directory.
This will create the directory "kicad-dev".
First you must install wxWidgets (see www.wxWidgets.org)
See below for suggested configure command.
Linux compilation:
You must have:
wxWidgets ( I suggest you install wxWidgets in /usr/local).
(see below for suggested configure command, then make and make install)
Mesa: pcbnew and cvpcv need openGL or mesa.
(you must install mesa devel if libGL et libGLU are not found).
GTK 2 (install development libraries).
Because old version of Mesa has problem under a recent linux distrib (mandarke 10.1),
I am using Mesa version 6.2.1, statically compiled, installed in /usr/local
Mesa installation:
Get MesaLib-6.2.1.tar.gz from http://www.mesa3d.org/
in /usr/local : tar zxvf MesaLib-6.2.1.tar.gz
in /usr/local/Mesa-6.2.1 :
make linux-x86-static
make install ( libGL.a et libGLU.a are copied in /usr/local/lib, and header in /usr/local/include)
kicad compilation:
in kicad-dev:
Have a look to libs.linux (you can/must edit this file if you have problems)
Currently libs.linux uses wxWidgets 2.8.6 build (see below for suggested configure command)
lines to edit:
STD_INSTALL = 1
which can be (see comments in libs.linux)
STD_INSTALL = 0 (or 2)
after libs.linux edition:
run make -f makefile.gtk
Windows compilation:
kicad is build with mingw and msys.
Currently libs.win uses wxWidgets 2.8.6 (see below for suggested configure command)
install mingw and msys ( see mingw.org )
(opengl libs are included in mingw or windows)
Under msys:
(Warning: make.exe utility is sometime renamed mingw32-make.exe in install process
of msys.)
Build wxWidgets (currently version 2.8.6)
See below for suggested configure command, then make
In include/wx/msw/setup.h, check (and edit if needed) the defines :
#define wxUSE_GLCANVAS 1
#define wxUSE_MOUSEWHEEL 1 // Include mouse wheel support
#define wxUSE_HOTKEY 0 // Hotkey support (currently Windows only)
Exit msys.
Set environment variable WXWIN ( something as wxwin=/d/wxWidgets-2.8.6
for a wxWidget installed in d:\wxWidgets-2.8.6)
Have a look to libs.win (Currently this file handle wxWidgets 2.8.6)
Under msys:
in kicad-dev:
run make -f makefile.g95
*************************************************************************************
Building wxWidgets:
*************************************************************************************
linux:
rm *.cache
./configure --enable-monolithic --enable-unicode=no --enable-shared=no --with-opengl --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --with-regex=builtin
linux-unicode:
rm *.cache
./configure --enable-monolithic --enable-unicode=yes --enable-shared=no --with-opengl --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-zlib=builtin --with-regex=builtin
osX:
rm *.cache
./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-opengl --disable-universal --disable-compat24
osX-unicode:
rm *.cache
./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-opengl --enable-universal_binary
windows:
rm *.cache
./configure --enable-unicode=no --enable-shared=no --enable-monolithic --with-msw --with-opengl --with-odbc
windows-unicode:
rm *.cache
./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-msw --with-opengl
*************************************************************************************
Patch wxWidgets
*************************************************************************************
*************************************************************************************
wxGTK version:
*************************************************************************************
Patch for printing wide traces that were showing missing rounded end caps:
wxGTK-2.8.6/src/generic/dcpsg.cpp
line 1634
PsPrint( "%%EndProlog\n" );
must be
PsPrint( "%%EndProlog\n" );
PsPrint("%%BeginSetup\n");
PsPrint( "1 setlinecap\n" );
PsPrint("%%EndSetup\n");
patch for Arcs drawings (NOT NEEDED for wxWidgets 2.7.1, needed for versions prior to 2.7.1)
wxGTK-2.x.y/src/gtk/dcclient.cpp
in function WindowDC::DoDrawArc
line 572 for wxWidgets 2.7.0-1:
if (m_pen.GetStyle() != wxTRANSPARENT)
{
gdk_draw_arc( m_window, m_penGC, FALSE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
gdk_draw_line( m_window, m_penGC, xx1, yy1, xxc, yyc );
gdk_draw_line( m_window, m_penGC, xxc, yyc, xx2, yy2 );
}
must be
if (m_pen.GetStyle() != wxTRANSPARENT)
{
gdk_draw_arc( m_window, m_penGC, FALSE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
if (m_brush.GetStyle() != wxTRANSPARENT)
{
gdk_draw_line( m_window, m_penGC, xx1, yy1, xxc, yyc );
gdk_draw_line( m_window, m_penGC, xxc, yyc, xx2, yy2 );
}
}
*************************************************************************************
wxMSW version: for wxWMSW 2.8.1 only
*************************************************************************************
wxMSW.2.8.1/src/msw/menu.cpp
line 410
if ( !pItem->IsOwnerDrawn() )
must be
if ( !pItem->IsOwnerDrawn() && !pItem->IsSeparator() )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,19 +4,6 @@
/* test demande ESC */
/*************************/
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWindows headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "fctsys.h"
#include "common.h"
@ -44,7 +31,7 @@ public:
};
BEGIN_EVENT_TABLE( WinEDA_MessageDialog, wxMessageDialog )
EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut )
EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut )
END_EVENT_TABLE()
/**********************************************************************************/
@ -80,12 +67,12 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime )
wxMessageDialog* dialog;
if( displaytime > 0 )
dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ),
wxOK | wxICON_INFORMATION,
displaytime );
dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ),
wxOK | wxICON_INFORMATION,
displaytime );
else
dialog = new WinEDA_MessageDialog( parent, text, _( "Error" ),
wxOK | wxICON_ERROR, 0 );
dialog = new WinEDA_MessageDialog( parent, text, _( "Error" ),
wxOK | wxICON_ERROR, 0 );
dialog->ShowModal();
dialog->Destroy();
@ -116,7 +103,8 @@ bool IsOK( wxWindow* parent, const wxString& text )
{
int ii;
ii = wxMessageBox( text, _( "Confirmation" ), wxYES_NO | wxCENTRE | wxICON_HAND, parent );
ii = wxMessageBox( text, _( "Confirmation" ),
wxYES_NO | wxCENTRE | wxICON_HAND, parent );
if( ii == wxYES )
return TRUE;
return FALSE;
@ -124,9 +112,9 @@ bool IsOK( wxWindow* parent, const wxString& text )
/***********************************************************************/
int Get_Message( const wxString& title, // The question
const wxString& frame_caption, // The frame caption
wxString& buffer, // String input/return buffer
int Get_Message( const wxString& title, // The question
const wxString& frame_caption, // The frame caption
wxString& buffer, // String input/return buffer
wxWindow* frame )
/***********************************************************************/

View File

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

View File

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

View File

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

View File

@ -3,18 +3,6 @@
// 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 "eda_dde.h"
#include "wxstruct.h"

View File

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

View File

@ -49,15 +49,15 @@ void ClipAndDrawFilledPoly( EDA_Rect * ClipBox, wxDC * DC, wxPoint Points[], int
extern BASE_SCREEN* ActiveScreen;
/* Variables locales */
static int GRLastMoveToX, GRLastMoveToY;
static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0)
* (utile pour trace sur imprimante) */
static int ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace
* sur imprimante */
static int xcliplo = 0,
ycliplo = 0,
xcliphi = 2000,
ycliphi = 2000; /* coord de la surface de trace */
static int GRLastMoveToX, GRLastMoveToY;
static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0)
* (utile pour trace sur imprimante) */
static bool ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace
* sur imprimante */
static int xcliplo = 0,
ycliplo = 0,
xcliphi = 2000,
ycliphi = 2000; /* coord de la surface de trace */
static int lastcolor = -1;
static int lastwidth = -1;
static int s_Last_Pen_Style = -1;
@ -1490,7 +1490,7 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPoints[], in
for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit )
{
clippedPolygon.push_back( wxPoint( (int)round( cit->X ), (int)round( cit->Y ) ) );
clippedPolygon.push_back( wxPoint( wxRound( cit->X ), wxRound( cit->Y ) ) );
}
if ( clippedPolygon.size() )

View File

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

View File

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

View File

@ -14,16 +14,14 @@
#include <wx/apptrait.h>
#include <wx/stdpaths.h>
#include <boost/foreach.hpp>
#define CONFIG_VERSION 1
#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)
* initialise:
@ -51,8 +49,8 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
/* Check just in case the file name does not a kicad project extension. */
if( fn.GetExt() != ProjectFileExtension )
{
wxLogDebug( _( "ReCreatePrjConfig() called with project file <%s> " \
"which does not have the correct file extension." ),
wxLogDebug( wxT( "ReCreatePrjConfig() called with project file <%s> \
which does not have the correct file extension." ),
fn.GetFullPath().c_str() );
fn.SetExt( ProjectFileExtension );
}
@ -94,7 +92,7 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
return true;
else
{
delete m_ProjectConfig; // Version incorrecte
delete m_ProjectConfig; // Version incorrect
}
}
@ -182,12 +180,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
void WinEDA_App::WriteProjectConfig( const wxString& fileName,
const wxString& GroupName,
const PARAM_CFG_ARRAY& params )
PARAM_CFG_ARRAY& params )
{
PARAM_CFG_BASE* param;
wxString msg;
size_t i;
ReCreatePrjConfig( fileName, GroupName, FORCE_LOCAL_CONFIG );
/* Write date ( surtout pour eviter bug de wxFileConfig
@ -195,11 +189,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
* (en fait si groupe vide) */
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
msg = DateAndTime();
m_ProjectConfig->Write( wxT( "update" ), msg );
msg = GetAppName();
m_ProjectConfig->Write( wxT( "last_client" ), msg );
m_ProjectConfig->Write( wxT( "update" ), DateAndTime() );
m_ProjectConfig->Write( wxT( "last_client" ), GetAppName() );
/* Save parameters */
m_ProjectConfig->DeleteGroup( GroupName ); // Erase all datas
@ -209,24 +200,23 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
m_ProjectConfig->Write( wxT( "version" ), CONFIG_VERSION );
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
for( i = 0; i < params.GetCount(); i++ )
BOOST_FOREACH( PARAM_CFG_BASE& param, params )
{
param = &params[i];
if( param->m_Group )
m_ProjectConfig->SetPath( param->m_Group );
if( param.m_Group )
m_ProjectConfig->SetPath( param.m_Group );
else
m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup )
if( param.m_Setup )
continue;
if ( param->m_Type == PARAM_COMMAND_ERASE ) // Erase all data
if ( param.m_Type == PARAM_COMMAND_ERASE ) // Erase all data
{
if( param->m_Ident )
m_ProjectConfig->DeleteGroup( param->m_Ident );
if( param.m_Ident )
m_ProjectConfig->DeleteGroup( param.m_Ident );
}
else
param->SaveParam( m_ProjectConfig );
param.SaveParam( m_ProjectConfig );
}
m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP );
@ -267,28 +257,23 @@ void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
}
void WinEDA_App::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List )
void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_ARRAY& List )
{
size_t i;
PARAM_CFG_BASE* pt_cfg;
if( m_EDA_Config == NULL )
return;
for( i = 0; i < List.GetCount(); i++ )
BOOST_FOREACH( PARAM_CFG_BASE& param, List )
{
pt_cfg = &List[i];
if( pt_cfg->m_Setup == false )
if( param.m_Setup == false )
continue;
if ( pt_cfg->m_Type == PARAM_COMMAND_ERASE ) // Erase all data
if ( param.m_Type == PARAM_COMMAND_ERASE ) // Erase all data
{
if( pt_cfg->m_Ident )
m_EDA_Config->DeleteGroup( pt_cfg->m_Ident );
if( param.m_Ident )
m_EDA_Config->DeleteGroup( param.m_Ident );
}
else
pt_cfg->SaveParam( m_EDA_Config );
param.SaveParam( m_EDA_Config );
}
}
@ -298,7 +283,7 @@ void WinEDA_App::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List )
* Parameters are parameters that have the .m_Setup member set to false
* read file is the .pro file project
*
* if Load_Only_if_New == true, this file is read only if it diders from
* if Load_Only_if_New == true, this file is read only if it differs from
* the current config (different dates )
*
* @return true if read.
@ -358,13 +343,11 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
}
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName,
const PARAM_CFG_ARRAY& params,
bool Load_Only_if_New )
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName,
PARAM_CFG_ARRAY& params,
bool Load_Only_if_New )
{
size_t i;
PARAM_CFG_BASE* param;
wxString timestamp;
ReCreatePrjConfig( local_config_filename, GroupName, false );
@ -390,19 +373,17 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename
m_CurrentOptionFile = g_Prj_Config_LocalFilename;
}
for( i = 0; i < params.GetCount(); i++ )
BOOST_FOREACH( PARAM_CFG_BASE& param, params )
{
param = &params[i];
if( param->m_Group )
m_ProjectConfig->SetPath( param->m_Group );
if( param.m_Group )
m_ProjectConfig->SetPath( param.m_Group );
else
m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup )
if( param.m_Setup )
continue;
param->ReadParam( m_ProjectConfig );
param.ReadParam( m_ProjectConfig );
}
delete m_ProjectConfig;
@ -435,19 +416,14 @@ void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList )
}
void WinEDA_App::ReadCurrentSetupValues( const PARAM_CFG_ARRAY& List )
void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_ARRAY& List )
{
size_t i;
PARAM_CFG_BASE* pt_cfg;
for( i = 0; i < List.GetCount(); i++ )
BOOST_FOREACH( PARAM_CFG_BASE& param, List )
{
pt_cfg = &List[i];
if( pt_cfg->m_Setup == false )
if( param.m_Setup == false )
continue;
pt_cfg->ReadParam( m_EDA_Config );
param.ReadParam( m_EDA_Config );
}
}

View File

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

View File

@ -4,7 +4,6 @@
/*********************************************/
#include "fctsys.h"
#include <time.h>
#include "macros.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.0069812603, 0.0087265355, 0.0104717841, 0.0122170008, 0.0139621803,
@ -1124,7 +1124,7 @@ float fsinus[3600] =
-0.0017453284
};
float fcosinus[3600] =
double fcosinus[3600] =
{
1.0000000000, 0.9999984769, 0.9999939077, 0.9999862922,
0.9999756307, 0.9999619231, 0.9999451694, 0.9999253697, 0.9999025240,

View File

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

View File

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

View File

@ -28,24 +28,24 @@
* to define local variables. The old method of statically building the array
* at compile time requiring global variable definitions.
*/
const PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void )
PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void )
{
if( !m_projectFileParams.IsEmpty() )
if( !m_projectFileParams.empty() )
return m_projectFileParams;
m_projectFileParams.Add( new PARAM_CFG_BASE( GROUPLIB,
PARAM_COMMAND_ERASE ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ModuleLibNames,
GROUPLIB ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ),
&m_AliasLibNames,
GROUPEQU ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ),
&m_NetlistFileExtension ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
&m_UserLibraryPath,
GROUPLIB ) );
m_projectFileParams.push_back( new PARAM_CFG_BASE( GROUPLIB,
PARAM_COMMAND_ERASE ) );
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ModuleLibNames,
GROUPLIB ) );
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ),
&m_AliasLibNames,
GROUPEQU ) );
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ),
&m_NetlistFileExtension ) );
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
&m_UserLibraryPath,
GROUPLIB ) );
return m_projectFileParams;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -51,11 +51,11 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
m_FrameName = wxT( "CmpFrame" );
// Give an icon
#ifdef __WINDOWS__
#ifdef __WINDOWS__
SetIcon( wxICON( a_icon_cvpcb ) );
#else
#else
SetIcon( wxICON( icon_cvpcb ) );
#endif
#endif
SetTitle( title );
SetBoard( new BOARD( NULL, this ) );
@ -292,30 +292,6 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
}
/*************************************************************************/
void WinEDA_DisplayFrame::Process_Special_Functions( wxCommandEvent& event )
/*************************************************************************/
/* Called when a tool is selected, or when a popup menu is clicked
* Currently : no action exists
*/
{
int id = event.GetId();
wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext( &dc );
switch( id )
{
default:
wxMessageBox( wxT( "WinEDA_DisplayFrame::Process_Special_Functions error" ) );
break;
}
SetToolbars();
}
/**
* Display 3D frame of current footprint selection.
*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,28 +26,35 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString, wxBitmap( open_xpm ),
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
wxBitmap( open_xpm ),
_( "Open a NetList file" ) );
m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString, wxBitmap( save_xpm ),
m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString,
wxBitmap( save_xpm ),
_( "Save NetList and Footprints List files" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString, wxBitmap( config_xpm ),
m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
wxBitmap( config_xpm ),
_( "Configuration" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString, wxBitmap( module_xpm ),
m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
wxBitmap( module_xpm ),
_( "View selected footprint" ) );
m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString, wxBitmap( auto_associe_xpm ),
m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
wxBitmap( auto_associe_xpm ),
_( "Automatic Association" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString, wxBitmap( left_xpm ),
m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
wxBitmap( left_xpm ),
_( "Select previous free component" ) );
m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString, wxBitmap( right_xpm ),
m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
wxBitmap( right_xpm ),
_( "Select next free component" ) );
m_HToolBar->AddSeparator();
@ -58,7 +65,8 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString,
wxBitmap( save_cmpstuff_xpm ),
_( "Create export file (component/footprint list, used by eeschema to fill the footprint field of components)" ) );
_( "Create export file (component/footprint list, \
used by eeschema to fill the footprint field of components)" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
@ -89,4 +97,3 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
// the changes
m_HToolBar->Realize();
}

View File

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

View File

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

View File

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

View File

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

View File

@ -864,7 +864,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, c
// Create outline shape : 6 points
int x = symb_len + width + 3;
int y = HalfSize * 1.5 + width + 3; // 50% more for negation bar
int y = wxRound( (double)HalfSize * 1.5 + (double)width + 3.0 ); // 50% more for negation bar
aCorner_list.push_back( wxPoint( 0, 0 ) ); // Starting point (anchor)
aCorner_list.push_back( wxPoint( 0, -y ) ); // Up
aCorner_list.push_back( wxPoint( -x, -y ) ); // left Up

View File

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

View File

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

View File

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

View File

@ -15,17 +15,6 @@
#pragma implementation "dialog_erc.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "fctsys.h"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,21 +40,6 @@ static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame );
/***********************************************************************/
void WinEDA_SchematicFrame::ToolOnRightClick( wxCommandEvent& event )
/***********************************************************************/
{
int id = event.GetId();
switch( id )
{
default:
DisplayError( this, wxT( "ToolOnRightClick() error" ) );
break;
}
}
/*****************************************************************/
bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu )
@ -66,7 +51,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
*/
{
SCH_ITEM* DrawStruct = (SCH_ITEM*) GetScreen()->GetCurItem();
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu

View File

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

View File

@ -681,7 +681,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FullFileName,
#undef STRUCT
#define STRUCT ( (DrawJunctionStruct*) DrawList )
x1 = STRUCT->m_Pos.x; y1 = STRUCT->m_Pos.y;
PlotCercle( wxPoint( x1, y1 ), true, DRAWJUNCTION_SIZE * 2 );
PlotCercle( wxPoint( x1, y1 ), DRAWJUNCTION_SIZE * 2, true );
break;
case TYPE_SCH_TEXT:

View File

@ -16,16 +16,6 @@
#pragma implementation "plotps.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "fctsys.h"
#include "gr_basic.h"
@ -37,8 +27,6 @@
#include "plot_common.h"
#include "protos.h"
#include "wx/defs.h"
// coeff de conversion dim en 1 mil -> dim en unite PS:
const double SCALE_PS = 0.001;

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
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#ifdef __UNIX__
#define stricmp strcasecmp
#define strnicmp strncasecmp
#if defined( HAVE_STRINGS_H )
#include <strings.h>
#endif
#include <ctype.h>
/* Pads-pcb sample:
*PADS-PCB*
*PART*

View File

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

View File

@ -102,11 +102,6 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
ID_SCHEMATIC_VERTICAL_TOOLBAR_END,
WinEDA_SchematicFrame::Process_Special_Functions )
EVT_TOOL_RCLICKED( ID_LABEL_BUTT, WinEDA_SchematicFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_GLABEL_BUTT, WinEDA_SchematicFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_HIERLABEL_BUTT,
WinEDA_SchematicFrame::ToolOnRightClick )
EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
WinEDA_SchematicFrame::Process_Special_Functions )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,456 +13,455 @@
static PARAM_CFG_WXSTRING PhotoExtBufCfg
(
wxT("PhoExt"), /* identification */
&g_PhotoFilenameExt /* Adresse du parametre */
wxT("PhoExt"), /* identification */
&g_PhotoFilenameExt /* Adresse du parametre */
);
static PARAM_CFG_WXSTRING PenExtBufCfg
(
wxT("PenExt"), /* identification */
&g_PenFilenameExt /* Adresse du parametre */
wxT("PenExt"), /* identification */
&g_PenFilenameExt /* Adresse du parametre */
);
static PARAM_CFG_WXSTRING DrillExtBufCfg
(
wxT("DrilExt"), /* identification */
&g_DrillFilenameExt /* Adresse du parametre */
wxT("DrilExt"), /* identification */
&g_DrillFilenameExt /* Adresse du parametre */
);
static PARAM_CFG_INT UnitCfg // Unites; 0 inche, 1 mm
static PARAM_CFG_INT UnitCfg // Unites; 0 inche, 1 mm
(
wxT("Unite"), /* identification */
&g_UnitMetric, /* Adresse du parametre */
FALSE /* Valeur par defaut */
wxT("Unite"), /* identification */
&g_UnitMetric, /* Adresse du parametre */
FALSE /* Valeur par defaut */
);
static PARAM_CFG_INT GerberScaleCfg // default scale; 0 2.3, 1 3.4
static PARAM_CFG_INT GerberScaleCfg // default scale; 0 2.3, 1 3.4
(
wxT("Def_fmt"), /* identification */
&g_Default_GERBER_Format, /* Adresse du parametre */
23, /* Valeur par defaut */
23, 66 /* Valeurs extremes */
wxT("Def_fmt"), /* identification */
&g_Default_GERBER_Format, /* Adresse du parametre */
23, /* Valeur par defaut */
23, 66 /* Valeurs extremes */
);
static PARAM_CFG_BOOL SegmFillCfg
(
INSETUP,
wxT("SegFill"), /* identification */
&DisplayOpt.DisplayPcbTrackFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */
INSETUP,
wxT("SegFill"), /* identification */
&DisplayOpt.DisplayPcbTrackFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */
);
static PARAM_CFG_BOOL PadFillCfg
static PARAM_CFG_INT PadFillCfg
(
INSETUP,
wxT("PadFill"), /* identification */
&DisplayOpt.DisplayPadFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */
INSETUP,
wxT("PadFill"), /* identification */
(int*)&DisplayOpt.DisplayPadFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */
);
static PARAM_CFG_BOOL PadShowNumCfg // Affiche DCodes
static PARAM_CFG_BOOL PadShowNumCfg // Affiche DCodes
(
INSETUP,
wxT("PadSNum"), /* identification */
&DisplayOpt.DisplayPadNum, /* Adresse du parametre */
TRUE /* Valeur par defaut */
INSETUP,
wxT("PadSNum"), /* identification */
&DisplayOpt.DisplayPadNum, /* Adresse du parametre */
TRUE /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer0Cfg
(
INSETUP,
wxT("ColLay0"), /* identification */
&g_DesignSettings.m_LayerColor[0], /* Adresse du parametre */
GREEN /* Valeur par defaut */
INSETUP,
wxT("ColLay0"), /* identification */
&g_DesignSettings.m_LayerColor[0], /* Adresse du parametre */
GREEN /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer1Cfg
(
INSETUP,
wxT("ColLay1"), /* identification */
&g_DesignSettings.m_LayerColor[1], /* Adresse du parametre */
BLUE /* Valeur par defaut */
INSETUP,
wxT("ColLay1"), /* identification */
&g_DesignSettings.m_LayerColor[1], /* Adresse du parametre */
BLUE /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer2Cfg
(
INSETUP,
wxT("ColLay2"), /* identification */
&g_DesignSettings.m_LayerColor[2], /* Adresse du parametre */
LIGHTGRAY /* Valeur par defaut */
INSETUP,
wxT("ColLay2"), /* identification */
&g_DesignSettings.m_LayerColor[2], /* Adresse du parametre */
LIGHTGRAY /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer3Cfg
(
INSETUP,
wxT("ColLay3"), /* identification */
&g_DesignSettings.m_LayerColor[3], /* Adresse du parametre */
5 /* Valeur par defaut */
INSETUP,
wxT("ColLay3"), /* identification */
&g_DesignSettings.m_LayerColor[3], /* Adresse du parametre */
5 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer4Cfg
(
INSETUP,
wxT("ColLay4"), /* identification */
&g_DesignSettings.m_LayerColor[4], /* Adresse du parametre */
4 /* Valeur par defaut */
INSETUP,
wxT("ColLay4"), /* identification */
&g_DesignSettings.m_LayerColor[4], /* Adresse du parametre */
4 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer5Cfg
(
INSETUP,
wxT("ColLay5"), /* identification */
&g_DesignSettings.m_LayerColor[5], /* Adresse du parametre */
5 /* Valeur par defaut */
INSETUP,
wxT("ColLay5"), /* identification */
&g_DesignSettings.m_LayerColor[5], /* Adresse du parametre */
5 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer6Cfg
(
INSETUP,
wxT("ColLay6"), /* identification */
&g_DesignSettings.m_LayerColor[6], /* Adresse du parametre */
6 /* Valeur par defaut */
INSETUP,
wxT("ColLay6"), /* identification */
&g_DesignSettings.m_LayerColor[6], /* Adresse du parametre */
6 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer7Cfg
(
INSETUP,
wxT("ColLay7"), /* identification */
&g_DesignSettings.m_LayerColor[7], /* Adresse du parametre */
5 /* Valeur par defaut */
INSETUP,
wxT("ColLay7"), /* identification */
&g_DesignSettings.m_LayerColor[7], /* Adresse du parametre */
5 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer8Cfg
(
INSETUP,
wxT("ColLay8"), /* identification */
&g_DesignSettings.m_LayerColor[8], /* Adresse du parametre */
7 /* Valeur par defaut */
INSETUP,
wxT("ColLay8"), /* identification */
&g_DesignSettings.m_LayerColor[8], /* Adresse du parametre */
7 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer9Cfg
(
INSETUP,
wxT("ColLay9"), /* identification */
&g_DesignSettings.m_LayerColor[9], /* Adresse du parametre */
1 /* Valeur par defaut */
INSETUP,
wxT("ColLay9"), /* identification */
&g_DesignSettings.m_LayerColor[9], /* Adresse du parametre */
1 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer10Cfg
(
INSETUP,
wxT("ColLayA"), /* identification */
&g_DesignSettings.m_LayerColor[10], /* Adresse du parametre */
2 /* Valeur par defaut */
INSETUP,
wxT("ColLayA"), /* identification */
&g_DesignSettings.m_LayerColor[10], /* Adresse du parametre */
2 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer11Cfg
(
INSETUP,
wxT("ColLayB"), /* identification */
&g_DesignSettings.m_LayerColor[11], /* Adresse du parametre */
3 /* Valeur par defaut */
INSETUP,
wxT("ColLayB"), /* identification */
&g_DesignSettings.m_LayerColor[11], /* Adresse du parametre */
3 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer12Cfg
(
INSETUP,
wxT("ColLayC"), /* identification */
&g_DesignSettings.m_LayerColor[12], /* Adresse du parametre */
12 /* Valeur par defaut */
INSETUP,
wxT("ColLayC"), /* identification */
&g_DesignSettings.m_LayerColor[12], /* Adresse du parametre */
12 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer13Cfg
(
INSETUP,
wxT("ColLayD"), /* identification */
&g_DesignSettings.m_LayerColor[13], /* Adresse du parametre */
13 /* Valeur par defaut */
INSETUP,
wxT("ColLayD"), /* identification */
&g_DesignSettings.m_LayerColor[13], /* Adresse du parametre */
13 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer14Cfg
(
INSETUP,
wxT("ColLayE"), /* identification */
&g_DesignSettings.m_LayerColor[14], /* Adresse du parametre */
14 /* Valeur par defaut */
INSETUP,
wxT("ColLayE"), /* identification */
&g_DesignSettings.m_LayerColor[14], /* Adresse du parametre */
14 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer15Cfg
(
INSETUP,
wxT("ColLayF"), /* identification */
&g_DesignSettings.m_LayerColor[15], /* Adresse du parametre */
RED /* Valeur par defaut */
INSETUP,
wxT("ColLayF"), /* identification */
&g_DesignSettings.m_LayerColor[15], /* Adresse du parametre */
RED /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer16Cfg
(
INSETUP,
wxT("ColLayG"), /* identification */
&g_DesignSettings.m_LayerColor[16], /* Adresse du parametre */
1 /* Valeur par defaut */
INSETUP,
wxT("ColLayG"), /* identification */
&g_DesignSettings.m_LayerColor[16], /* Adresse du parametre */
1 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer17Cfg
(
INSETUP,
wxT("ColLayH"), /* identification */
&g_DesignSettings.m_LayerColor[17], /* Adresse du parametre */
5 /* Valeur par defaut */
INSETUP,
wxT("ColLayH"), /* identification */
&g_DesignSettings.m_LayerColor[17], /* Adresse du parametre */
5 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer18Cfg
(
INSETUP,
wxT("ColLayI"), /* identification */
&g_DesignSettings.m_LayerColor[18], /* Adresse du parametre */
11 /* Valeur par defaut */
INSETUP,
wxT("ColLayI"), /* identification */
&g_DesignSettings.m_LayerColor[18], /* Adresse du parametre */
11 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer19Cfg
(
INSETUP,
wxT("ColLayJ"), /* identification */
&g_DesignSettings.m_LayerColor[19], /* Adresse du parametre */
4 /* Valeur par defaut */
INSETUP,
wxT("ColLayJ"), /* identification */
&g_DesignSettings.m_LayerColor[19], /* Adresse du parametre */
4 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer20Cfg
(
INSETUP,
wxT("ColLayK"), /* identification */
&g_DesignSettings.m_LayerColor[20], /* Adresse du parametre */
5 /* Valeur par defaut */
INSETUP,
wxT("ColLayK"), /* identification */
&g_DesignSettings.m_LayerColor[20], /* Adresse du parametre */
5 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer21Cfg
(
INSETUP,
wxT("ColLayL"), /* identification */
&g_DesignSettings.m_LayerColor[21], /* Adresse du parametre */
3 /* Valeur par defaut */
INSETUP,
wxT("ColLayL"), /* identification */
&g_DesignSettings.m_LayerColor[21], /* Adresse du parametre */
3 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer22Cfg
(
INSETUP,
wxT("ColLayM"), /* identification */
&g_DesignSettings.m_LayerColor[22], /* Adresse du parametre */
6 /* Valeur par defaut */
INSETUP,
wxT("ColLayM"), /* identification */
&g_DesignSettings.m_LayerColor[22], /* Adresse du parametre */
6 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer23Cfg
(
INSETUP,
wxT("ColLayN"), /* identification */
&g_DesignSettings.m_LayerColor[23], /* Adresse du parametre */
5 /* Valeur par defaut */
INSETUP,
wxT("ColLayN"), /* identification */
&g_DesignSettings.m_LayerColor[23], /* Adresse du parametre */
5 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer24Cfg
(
INSETUP,
wxT("ColLayO"), /* identification */
&g_DesignSettings.m_LayerColor[24], /* Adresse du parametre */
LIGHTGRAY /* Valeur par defaut */
INSETUP,
wxT("ColLayO"), /* identification */
&g_DesignSettings.m_LayerColor[24], /* Adresse du parametre */
LIGHTGRAY /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer25Cfg
(
INSETUP,
wxT("ColLayP"), /* identification */
&g_DesignSettings.m_LayerColor[25], /* Adresse du parametre */
1 /* Valeur par defaut */
INSETUP,
wxT("ColLayP"), /* identification */
&g_DesignSettings.m_LayerColor[25], /* Adresse du parametre */
1 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer26Cfg
(
INSETUP,
wxT("ColLayQ"), /* identification */
&g_DesignSettings.m_LayerColor[26], /* Adresse du parametre */
2 /* Valeur par defaut */
INSETUP,
wxT("ColLayQ"), /* identification */
&g_DesignSettings.m_LayerColor[26], /* Adresse du parametre */
2 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer27Cfg
(
INSETUP,
wxT("ColLayR"), /* identification */
&g_DesignSettings.m_LayerColor[27], /* Adresse du parametre */
14 /* Valeur par defaut */
INSETUP,
wxT("ColLayR"), /* identification */
&g_DesignSettings.m_LayerColor[27], /* Adresse du parametre */
14 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer28Cfg
(
INSETUP,
wxT("ColLayS"), /* identification */
&g_DesignSettings.m_LayerColor[28], /* Adresse du parametre */
YELLOW /* Valeur par defaut */
INSETUP,
wxT("ColLayS"), /* identification */
&g_DesignSettings.m_LayerColor[28], /* Adresse du parametre */
YELLOW /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer29Cfg
(
INSETUP,
wxT("ColLayT"), /* identification */
&g_DesignSettings.m_LayerColor[29], /* Adresse du parametre */
13 /* Valeur par defaut */
INSETUP,
wxT("ColLayT"), /* identification */
&g_DesignSettings.m_LayerColor[29], /* Adresse du parametre */
13 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer30Cfg
(
INSETUP,
wxT("ColLayU"), /* identification */
&g_DesignSettings.m_LayerColor[30], /* Adresse du parametre */
14 /* Valeur par defaut */
INSETUP,
wxT("ColLayU"), /* identification */
&g_DesignSettings.m_LayerColor[30], /* Adresse du parametre */
14 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorLayer31Cfg
(
INSETUP,
wxT("ColLayV"), /* identification */
&g_DesignSettings.m_LayerColor[31], /* Adresse du parametre */
7 /* Valeur par defaut */
INSETUP,
wxT("ColLayV"), /* identification */
&g_DesignSettings.m_LayerColor[31], /* Adresse du parametre */
7 /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorpcbGrilleCfg
(
INSETUP,
wxT("CoPcbGr"), /* identification */
&g_DesignSettings.m_PcbGridColor, /* Adresse du parametre */
DARKGRAY /* Valeur par defaut */
INSETUP,
wxT("CoPcbGr"), /* identification */
&g_DesignSettings.m_PcbGridColor, /* Adresse du parametre */
DARKGRAY /* Valeur par defaut */
);
static PARAM_CFG_SETCOLOR ColorDCodesCfg
(
INSETUP,
wxT("CoDCode"), /* identification */
&g_DCodesColor, /* Adresse du parametre */
WHITE /* Valeur par defaut */
INSETUP,
wxT("CoDCode"), /* identification */
&g_DCodesColor, /* Adresse du parametre */
WHITE /* Valeur par defaut */
);
static PARAM_CFG_INT HPGLpenNumCfg
(
wxT("HPGLnum"), /* identification */
&g_HPGL_Pen_Num, /* Adresse du parametre */
1, /* Valeur par defaut */
1, 16 /* Valeurs extremes */
wxT("HPGLnum"), /* identification */
&g_HPGL_Pen_Num, /* Adresse du parametre */
1, /* Valeur par defaut */
1, 16 /* Valeurs extremes */
);
static PARAM_CFG_INT HPGLdiamCfg
(
wxT("HPGdiam"), /* identification */
&g_HPGL_Pen_Diam, /* Adresse du parametre */
15, /* Valeur par defaut */
0,0xFFFF /* Valeurs extremes */
wxT("HPGdiam"), /* identification */
&g_HPGL_Pen_Diam, /* Adresse du parametre */
15, /* Valeur par defaut */
0,0xFFFF /* Valeurs extremes */
);
static PARAM_CFG_INT HPGLspeedCfg
(
wxT("HPGLSpd"), /* identification */
&g_HPGL_Pen_Speed, /* Adresse du parametre */
25, /* Valeur par defaut */
0,100 /* Valeurs extremes */
wxT("HPGLSpd"), /* identification */
&g_HPGL_Pen_Speed, /* Adresse du parametre */
25, /* Valeur par defaut */
0,100 /* Valeurs extremes */
);
static PARAM_CFG_INT HPGLrecouvrementCfg
(
wxT("HPGLrec"), /* identification */
&g_HPGL_Pen_Recouvrement, /* Adresse du parametre */
2, /* Valeur par defaut */
0, 100 /* Valeurs extremes */
wxT("HPGLrec"), /* identification */
&g_HPGL_Pen_Recouvrement, /* Adresse du parametre */
2, /* Valeur par defaut */
0, 100 /* Valeurs extremes */
);
static PARAM_CFG_INT GERBERSpotMiniCfg
(
wxT("GERBmin"), /* identification */
&g_Plot_Spot_Mini, /* Adresse du parametre */
15, /* Valeur par defaut */
2,0xFFFF /* Valeurs extremes */
wxT("GERBmin"), /* identification */
&g_Plot_Spot_Mini, /* Adresse du parametre */
15, /* Valeur par defaut */
2,0xFFFF /* Valeurs extremes */
);
static PARAM_CFG_INT DrawSegmLargeurCfg
(
wxT("DrawLar"), /* identification */
&g_DesignSettings.m_DrawSegmentWidth, /* Adresse du parametre */
120, /* Valeur par defaut */
0,10000 /* Valeurs extremes */
wxT("DrawLar"), /* identification */
&g_DesignSettings.m_DrawSegmentWidth, /* Adresse du parametre */
120, /* Valeur par defaut */
0,10000 /* Valeurs extremes */
);
static PARAM_CFG_INT EdgeSegmLargeurCfg
(
wxT("EdgeLar"), /* identification */
&g_DesignSettings.m_EdgeSegmentWidth, /* Adresse du parametre */
120, /* Valeur par defaut */
0,10000 /* Valeurs extremes */
wxT("EdgeLar"), /* identification */
&g_DesignSettings.m_EdgeSegmentWidth, /* Adresse du parametre */
120, /* Valeur par defaut */
0,10000 /* Valeurs extremes */
);
static PARAM_CFG_INT TimeOutCfg
(
wxT("TimeOut"), /* identification */
&g_TimeOut, /* Adresse du parametre */
600, /* Valeur par defaut */
0,60000 /* Valeurs extremes */
wxT("TimeOut"), /* identification */
&g_TimeOut, /* Adresse du parametre */
600, /* Valeur par defaut */
0,60000 /* Valeurs extremes */
);
static PARAM_CFG_BOOL DisplPolairCfg
(
INSETUP,
wxT("DPolair"), /* identification */
&DisplayOpt.DisplayPolarCood, /* Adresse du parametre */
FALSE /* Valeur par defaut */
INSETUP,
wxT("DPolair"), /* identification */
&DisplayOpt.DisplayPolarCood, /* Adresse du parametre */
FALSE /* Valeur par defaut */
);
PARAM_CFG_BASE * ParamCfgList[] =
{
& PhotoExtBufCfg,
& PenExtBufCfg,
& DrillExtBufCfg,
& UnitCfg,
& GerberScaleCfg,
& SegmFillCfg,
& PadFillCfg,
& PadShowNumCfg,
& ColorLayer0Cfg,
& ColorLayer1Cfg,
& ColorLayer2Cfg,
& ColorLayer3Cfg,
& ColorLayer4Cfg,
& ColorLayer5Cfg,
& ColorLayer6Cfg,
& ColorLayer7Cfg,
& ColorLayer8Cfg,
& ColorLayer9Cfg,
& ColorLayer10Cfg,
& ColorLayer11Cfg,
& ColorLayer12Cfg,
& ColorLayer13Cfg,
& ColorLayer14Cfg,
& ColorLayer15Cfg,
& ColorLayer16Cfg,
& ColorLayer17Cfg,
& ColorLayer18Cfg,
& ColorLayer19Cfg,
& ColorLayer20Cfg,
& ColorLayer21Cfg,
& ColorLayer22Cfg,
& ColorLayer23Cfg,
& ColorLayer24Cfg,
& ColorLayer25Cfg,
& ColorLayer26Cfg,
& ColorLayer27Cfg,
& ColorLayer28Cfg,
& ColorLayer29Cfg,
& ColorLayer30Cfg,
& ColorLayer31Cfg,
& ColorpcbGrilleCfg,
& ColorDCodesCfg,
& GERBERSpotMiniCfg,
& DrawSegmLargeurCfg,
& EdgeSegmLargeurCfg,
& TimeOutCfg,
& DisplPolairCfg,
NULL
& PhotoExtBufCfg,
& PenExtBufCfg,
& DrillExtBufCfg,
& UnitCfg,
& GerberScaleCfg,
& SegmFillCfg,
& PadFillCfg,
& PadShowNumCfg,
& ColorLayer0Cfg,
& ColorLayer1Cfg,
& ColorLayer2Cfg,
& ColorLayer3Cfg,
& ColorLayer4Cfg,
& ColorLayer5Cfg,
& ColorLayer6Cfg,
& ColorLayer7Cfg,
& ColorLayer8Cfg,
& ColorLayer9Cfg,
& ColorLayer10Cfg,
& ColorLayer11Cfg,
& ColorLayer12Cfg,
& ColorLayer13Cfg,
& ColorLayer14Cfg,
& ColorLayer15Cfg,
& ColorLayer16Cfg,
& ColorLayer17Cfg,
& ColorLayer18Cfg,
& ColorLayer19Cfg,
& ColorLayer20Cfg,
& ColorLayer21Cfg,
& ColorLayer22Cfg,
& ColorLayer23Cfg,
& ColorLayer24Cfg,
& ColorLayer25Cfg,
& ColorLayer26Cfg,
& ColorLayer27Cfg,
& ColorLayer28Cfg,
& ColorLayer29Cfg,
& ColorLayer30Cfg,
& ColorLayer31Cfg,
& ColorpcbGrilleCfg,
& ColorDCodesCfg,
& GERBERSpotMiniCfg,
& DrawSegmLargeurCfg,
& EdgeSegmLargeurCfg,
& TimeOutCfg,
& DisplPolairCfg,
NULL
};

View File

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

View File

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

View File

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

View File

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

View File

@ -472,13 +472,13 @@ enum GRTextVertJustifyType {
/* Options to show solid segments (segments, texts...) */
enum GRFillMode {
FILAIRE = 0, // segments are drawn as lines
FILLED, // normal mode: segments have thickness
SKETCH // skect mode: segments have thickness, but are not filled
FILAIRE = 0, // segments are drawn as lines
FILLED, // normal mode: segments have thickness
SKETCH // skect mode: segments have thickness, but are not filled
};
#define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */
#define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */
/**
* Class EDA_TextStruct

View File

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

View File

@ -74,11 +74,15 @@ static inline const wxChar* GetChars( wxString s )
/* macro to exchange 2 items */
/*****************************/
/* this macro uses the typeof keyword
* for compilers that do not know typeof (MSVC )
* the boost libs have a workaround for the typeof problem
/*
* The EXCHG macro uses BOOST_TYPEOF for compilers that do not have native
* typeof support (MSVC). Please do not attempt to qualify these macros
* within #ifdef compiler definitions pragmas. BOOST_TYPEOF is smart enough
* to check for native typeof support and use it instead of it's own
* implementation. These macros effectively compile to nothing on platforms
* with native typeof support.
*/
#ifdef __MSVC__ // MSCV does not know typeof. Others def can be added here
#include "boost/typeof/typeof.hpp"
// we have to register the types used with the typeof keyword with boost
@ -93,13 +97,11 @@ class D_PAD;
BOOST_TYPEOF_REGISTER_TYPE( D_PAD* );
BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* );
class BOARD_ITEM;
BOOST_TYPEOF_REGISTER_TYPE( BOARD_ ITEM* );
BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* );
#define typeof (expr)BOOST_TYPEOF( expr )
#endif // #ifdef __MSVC__
// here is the macro:
#define EXCHG( a, b ) { typeof(a)__temp__ = (a); (a) = (b); (b) = __temp__; }
#define EXCHG( a, b ) { BOOST_TYPEOF(a) __temp__ = (a); \
(a) = (b); \
(b) = __temp__; }
/*****************************************************/

View File

@ -8,7 +8,7 @@
#include "wx/confbase.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 */
@ -207,6 +207,6 @@ public:
virtual void SaveParam( wxConfigBase* aConfig );
};
WX_DECLARE_OBJARRAY( PARAM_CFG_BASE, PARAM_CFG_ARRAY );
typedef boost::ptr_vector< PARAM_CFG_BASE > PARAM_CFG_ARRAY;
#endif /* __PARAM_CONFIG_H__ */

View File

@ -125,7 +125,7 @@
/* Forward declaration */
class EQUIPOT;
class MARKER;
struct CHEVELU;
class CHEVELU;
//class Ki_PageDescr;
//class DrawBlockStruct;
@ -289,7 +289,7 @@ public:
* 1 show netnames on pads
* 2 show netnames on tracks
* 3 show netnames on tracks and pads
*/
*/
bool Show_Modules_Cmp;
bool Show_Modules_Cu;

View File

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

View File

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

View File

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

View File

@ -218,11 +218,10 @@ public:
virtual void OnSelectGrid( wxCommandEvent& event );
virtual void OnSelectZoom( wxCommandEvent& event );
virtual void GeneralControle( wxDC* DC, wxPoint Mouse ) { /* dummy */ }
virtual void GeneralControle( wxDC* DC, wxPoint Mouse ) { /* dummy */ }
virtual void OnSize( wxSizeEvent& event );
void OnEraseBackground( wxEraseEvent& SizeEvent );
// void OnChar(wxKeyEvent& event);
void SetToolbarBgColor( int color_num );
virtual void OnZoom( wxCommandEvent& event );
void OnGrid( int grid_type );
@ -259,8 +258,7 @@ public:
void Process_Zoom( wxCommandEvent& event );
void Process_Grid( wxCommandEvent& event );
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event );

View File

@ -257,29 +257,34 @@ void WinEDA_MainFrame::RecreateBaseHToolbar()
SetToolBar( m_HToolBar );
// Set up toolbar
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_project_xpm ),
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
wxBitmap( new_project_xpm ),
_( "Start a new project" ) );
// Load project
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString, wxBitmap( open_project_xpm ),
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
wxBitmap( open_project_xpm ),
_( "Load existing project" ) );
// Save project
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString, wxBitmap( save_project_xpm ),
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
wxBitmap( save_project_xpm ),
_( "Save current project" ) );
// Separator
m_HToolBar->AddSeparator();
// Save and archive files
m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString, wxBitmap( zip_xpm ),
m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
wxBitmap( zip_xpm ),
_( "Archive all project files" ) ); // Tooltip
// Separator
m_HToolBar->AddSeparator();
// Refresh project tree
m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString, wxBitmap( reload_xpm ),
m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
wxBitmap( reload_xpm ),
_( "Refresh project tree" ) );
m_HToolBar->Realize(); // Create m_HToolBar

View File

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

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;
if( !wxGetApp().m_PdfBrowser || select )
if( !wxGetApp().m_PdfBrowser && !select )
{
if( !select )
DisplayError( this, _( "You must choose a PDF viewer before use " \
"this option" ) );
DisplayError( this,
_( "You must choose a PDF viewer before using this option." ) );
}
wxString wildcard( wxT( "*" ) );

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

View File

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

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)

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