Commit 8bf79111 authored by stambaughw's avatar stambaughw

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.
parent 555b1c5a
......@@ -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();
}
......
......@@ -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
......
......@@ -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
......
......@@ -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}")
......
#
# 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)
/* 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__ */
/* 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__ */
This diff is collapsed.
/* 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",
......
......@@ -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 )
......
......@@ -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;
......
......@@ -34,7 +34,6 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,
const wxSize& size,
long style ) :
wxFrame( father, -1, title, pos, size, style )
/**********************************************************/
{
wxSize minsize;
......
......@@ -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;
}
......
......@@ -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 ) );
wxRound( SheetPS->m_Size.y * CONV_SCALE ),
wxRound( SheetPS->m_Size.x * CONV_SCALE ) );
fputs( Line, g_Plot_PlotOutputFile );
if( PaperOrientation == wxPORTRAIT )
......
......@@ -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()
/**********************************************************************************/
......@@ -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;
......
......@@ -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
}
......
......@@ -73,7 +73,7 @@ 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" ),
wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), &m_AutoPAN_Enable,
true );
m_AutoPAN_Request = 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 );
......
......@@ -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 );
}
......
......@@ -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"
......
......@@ -10,7 +10,7 @@
#ifdef __WINDOWS__
#ifndef _MSC_VER
#include <dir.h>
//#include <dir.h>
#endif
#endif
......
......@@ -52,7 +52,7 @@ extern BASE_SCREEN* ActiveScreen;
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
static bool ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace
* sur imprimante */
static int xcliplo = 0,
ycliplo = 0,
......@@ -1490,7 +1490,7 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPoints[], in
for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit )
{
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() )
......
......@@ -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,
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 );
_( "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,
......
......@@ -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;
......
......@@ -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.
......@@ -360,11 +345,9 @@ 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,
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 );
}
}
......
#include "wx/wxprec.h"
#include <id.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "fctsys.h"
#include "common.h"
// 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 <id.h>
#include <wx/dir.h>
#include <wx/utils.h>
#include <pyhandler.h>
#include <iostream>
#include "fctsys.h"
#include "common.h"
using namespace boost::python;
......
......@@ -4,7 +4,6 @@
/*********************************************/
#include "fctsys.h"
#include <time.h>
#include "macros.h"
#include "kicad_string.h"
......
......@@ -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,
......
......@@ -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" );
......
......@@ -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,
......
......@@ -28,22 +28,22 @@
* 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,
m_projectFileParams.push_back( new PARAM_CFG_BASE( GROUPLIB,
PARAM_COMMAND_ERASE ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ModuleLibNames,
GROUPLIB ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ),
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ),
&m_AliasLibNames,
GROUPEQU ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ),
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ),
&m_NetlistFileExtension ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
&m_UserLibraryPath,
GROUPLIB ) );
......
......@@ -7,8 +7,6 @@
#include "cvpcb.h"
#include <wx/listimpl.cpp>
PIN::PIN()
{
......
......@@ -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 );
......
......@@ -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" ) );
......
......@@ -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();
......
......@@ -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
......
......@@ -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.
*/
......
......@@ -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;
......
......@@ -19,11 +19,10 @@
ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, wxWindowID id,
const wxPoint& loc, const wxSize& size ) :
LIST_BOX_TYPE( parent, id, loc, size,
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 );
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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();
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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();
}
......@@ -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)
......
......@@ -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 );
}
......@@ -206,7 +205,8 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
block->m_BlockDrawStruct = NULL;
}
SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString );
SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor,
wxEmptyString );
}
......
......@@ -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 );
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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>
......
#include <wx/checklst.h>
#include <wx/tooltip.h>
#include <algorithm>
......
......@@ -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"
......
......@@ -12,8 +12,6 @@
#include "libcmp.h"
#include "general.h"
#include "wx/checklst.h"
#include "protos.h"
......
This diff is collapsed.
......@@ -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 );
......
......@@ -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..)
......
......@@ -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"
......
......@@ -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();
......
......@@ -19,7 +19,7 @@ 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,
extern bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f,
wxString& aMsgDiag, int* aLineNum,
BASE_SCREEN* Window );
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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:
......
......@@ -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;
......
# 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
# 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
......@@ -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*
......
......@@ -132,20 +132,23 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
}
else
{
wxString val= CONV_FROM_UTF8( text );
for (;;)
wxString val = CONV_FROM_UTF8( text );
for( ;; )
{
int i=val.find(wxT("\\n"));
if (i==wxNOT_FOUND)
break;
int i=val.find( wxT( "\\n" ) );
val.erase(i,2);
val.insert(i,wxT("\n"));
if( i == wxNOT_FOUND )
break;
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 );
}
......
......@@ -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 )
......
......@@ -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
......
......@@ -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,
/* 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,
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,
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,14 +101,16 @@ 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_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 );
}
......@@ -124,7 +126,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
win_pos.y = 0;
m_CmpListWindow = new wxSashLayoutWindow( this, ID_LIBVIEW_CMPWINDOW,
win_pos, m_CmpListSize,
wxCLIP_CHILDREN | wxSW_3D, wxT( "CmpWindow" ) );
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 );
}
......@@ -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,16 +28,11 @@ 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" ),
msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ),
(unsigned) DrawStruct->Type(),
(unsigned) DrawStruct->m_Flags );
DisplayError( this, msg );
}
}
else
{
DrawStruct = GerberGeneralLocateAndDisplay();
......@@ -221,11 +213,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) );
break;
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
DrawPanel->MouseToCursorSchema();
Process_Move_Item( this, GetScreen()->GetCurItem(), &dc );
break;
case ID_TOOLBARH_PCB_SELECT_LAYER:
((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice();
DrawPanel->Refresh( TRUE );
......@@ -308,29 +295,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
}
/****************************************************************/
static void Process_Move_Item( WinEDA_GerberFrame* frame,
EDA_BaseStruct* DrawStruct, wxDC* DC )
/****************************************************************/
{
if( DrawStruct == NULL )
return;
frame->DrawPanel->MouseToCursorSchema();
switch( DrawStruct->Type() )
{
default:
wxString msg;
msg.Printf(
wxT( "WinEDA_LibeditFrame::Move_Item Error: Bad DrawType %d" ),
DrawStruct->Type() );
DisplayError( frame, msg );
break;
}
}
/**************************************************************************/
void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/**************************************************************************/
......@@ -355,16 +319,6 @@ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = GerberGeneralLocateAndDisplay();
}
if( (DrawStruct == NULL) || (DrawStruct->m_Flags != 0) )
break;
// Element localis�
switch( DrawStruct->Type() )
{
default:
break;
}
break; // end case 0
case ID_BUS_BUTT:
......
......@@ -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;
......
......@@ -105,7 +105,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
// Annulation de commande en cours
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_PcbFrame::Process_Special_Functions )
WinEDA_GerberFrame::Process_Special_Functions )
// Pop up menu
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
......@@ -133,16 +133,15 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
m_Draw_Axis = true; // true to show X and Y axis on screen
m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin�
m_Ident = GERBER_FRAME;
if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE;
// Give an icon
#ifdef __WINDOWS__
#ifdef __WINDOWS__
SetIcon( wxICON( a_icon_gerbview ) );
#else
#else
SetIcon( wxICON( icon_gerbview ) );
#endif
#endif
SetBaseScreen( ScreenPcb );
ActiveScreen = ScreenPcb;
......
......@@ -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" ) );
/*************************************************************/
......
......@@ -53,11 +53,11 @@ static PARAM_CFG_BOOL SegmFillCfg
);
static PARAM_CFG_BOOL PadFillCfg
static PARAM_CFG_INT PadFillCfg
(
INSETUP,
wxT("PadFill"), /* identification */
&DisplayOpt.DisplayPadFill, /* Adresse du parametre */
(int*)&DisplayOpt.DisplayPadFill, /* Adresse du parametre */
TRUE /* Valeur par defaut */
);
......@@ -465,4 +465,3 @@ PARAM_CFG_BASE * ParamCfgList[] =
& DisplPolairCfg,
NULL
};
......@@ -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;
......
......@@ -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 =
......
......@@ -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;
......
......@@ -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,
......
......@@ -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 */
......@@ -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* );
#define typeof (expr)BOOST_TYPEOF( expr )
#endif // #ifdef __MSVC__
BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* );
// 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__; }
/*****************************************************/
......
......@@ -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__ */
......@@ -125,7 +125,7 @@
/* Forward declaration */
class EQUIPOT;
class MARKER;
struct CHEVELU;
class CHEVELU;
//class Ki_PageDescr;
//class DrawBlockStruct;
......
......@@ -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
......@@ -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 );
......
......@@ -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 );
......
......@@ -222,7 +222,6 @@ public:
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,7 +258,6 @@ 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 OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
......
......@@ -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
......
......@@ -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 );
......
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)
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)
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)
......@@ -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( "*" ) );
......
......@@ -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 */
......
......@@ -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
*/
......
#
# 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)
#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)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment