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() ...@@ -152,14 +152,14 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
glEnable( GL_COLOR_MATERIAL ); glEnable( GL_COLOR_MATERIAL );
SetGLColor( WHITE ); SetGLColor( WHITE );
glBegin( GL_LINES ); glBegin( GL_LINES );
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis glNormal3f( 0.0f, 0.0f, 1.0f ); // Normal is Z axis
glVertex3f( 0.0, 0.0, 0.0 ); glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 1.0, 0.0, 0.0 ); // X axis glVertex3f( 1.0f, 0.0f, 0.0f ); // X axis
glVertex3f( 0.0, 0.0, 0.0 ); glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0, -1.0, 0.0 ); // Y axis glVertex3f( 0.0f, -1.0f, 0.0f ); // Y axis
glNormal3f( 1.0, 0.0, 0.0 ); // Normal is Y axis glNormal3f( 1.0f, 0.0f, 0.0f ); // Normal is Y axis
glVertex3f( 0.0, 0.0, 0.0 ); glVertex3f( 0.0f, 0.0f, 0.0f );
glVertex3f( 0.0, 0.0, 0.3 ); // Z axis glVertex3f( 0.0f, 0.0f, 0.3f ); // Z axis
glEnd(); glEnd();
} }
......
...@@ -13,14 +13,11 @@ ...@@ -13,14 +13,11 @@
#ifdef __WXMAC__ #ifdef __WXMAC__
# ifdef __DARWIN__ # ifdef __DARWIN__
# include <OpenGL/gl.h>
# include <OpenGL/glu.h> # include <OpenGL/glu.h>
# else # else
# include <gl.h>
# include <glu.h> # include <glu.h>
# endif # endif
#else #else
# include <GL/gl.h>
# include <GL/glu.h> # include <GL/glu.h>
#endif #endif
......
...@@ -93,7 +93,6 @@ mark_as_advanced(KICAD_BIN ...@@ -93,7 +93,6 @@ mark_as_advanced(KICAD_BIN
KICAD_TEMPLATE) KICAD_TEMPLATE)
#================================================ #================================================
# Find libraries that are needed to build KiCad. # Find libraries that are needed to build KiCad.
#================================================ #================================================
...@@ -121,13 +120,16 @@ find_package(wxWidgets COMPONENTS gl html adv core net base QUIET) ...@@ -121,13 +120,16 @@ find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
check_find_package_result(wxWidgets_FOUND "wxWidgets") check_find_package_result(wxWidgets_FOUND "wxWidgets")
# Include wxWidgets macros. # Include wxWidgets macros.
include(${wxWidgets_USE_FILE}) include(${wxWidgets_USE_FILE})
# Include MinGW resource compiler. # Include MinGW resource compiler.
include(MinGWResourceCompiler) include(MinGWResourceCompiler)
# Generate build system specific header file.
include(PerformFeatureChecks)
perform_feature_checks()
# Automagically create version header file. # Automagically create version header file.
include(CreateSVNVersionHeader) include(CreateSVNVersionHeader)
create_svn_version_header() create_svn_version_header()
...@@ -147,7 +149,6 @@ include_directories(${CMAKE_SOURCE_DIR}/include ...@@ -147,7 +149,6 @@ include_directories(${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}) ${CMAKE_BINARY_DIR})
#================================================ #================================================
# Let CMake look in these directories for nested # Let CMake look in these directories for nested
# 'CMakeLists.txt' files to process # 'CMakeLists.txt' files to process
...@@ -175,7 +176,6 @@ add_subdirectory(internat) ...@@ -175,7 +176,6 @@ add_subdirectory(internat)
add_subdirectory(template) add_subdirectory(template)
#================================================ #================================================
# Installation parameters # Installation parameters
#================================================ #================================================
...@@ -208,7 +208,6 @@ if(UNIX) ...@@ -208,7 +208,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# CVpcb desktop file # CVpcb desktop file
install(FILES ${LINUX_DESKTOP_FILES}/cvpcb.desktop install(FILES ${LINUX_DESKTOP_FILES}/cvpcb.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
...@@ -219,7 +218,6 @@ if(UNIX) ...@@ -219,7 +218,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# EEschema desktop file # EEschema desktop file
install(FILES ${LINUX_DESKTOP_FILES}/eeschema.desktop install(FILES ${LINUX_DESKTOP_FILES}/eeschema.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
...@@ -230,7 +228,6 @@ if(UNIX) ...@@ -230,7 +228,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# GerbView desktop file # GerbView desktop file
install(FILES ${LINUX_DESKTOP_FILES}/gerbview.desktop install(FILES ${LINUX_DESKTOP_FILES}/gerbview.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
...@@ -241,7 +238,6 @@ if(UNIX) ...@@ -241,7 +238,6 @@ if(UNIX)
COMPONENT resources) COMPONENT resources)
# PCBnew desktop file # PCBnew desktop file
install(FILES ${LINUX_DESKTOP_FILES}/pcbnew.desktop install(FILES ${LINUX_DESKTOP_FILES}/pcbnew.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
......
...@@ -54,9 +54,9 @@ macro(create_svn_version_header) ...@@ -54,9 +54,9 @@ macro(create_svn_version_header)
# reflect this. # reflect this.
add_definitions(-DHAVE_SVN_VERSION) add_definitions(-DHAVE_SVN_VERSION)
# Generate config.h. # Generate version.h.
configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/version.h.cmake
${CMAKE_BINARY_DIR}/config.h) ${CMAKE_BINARY_DIR}/version.h)
message(STATUS "Kicad SVN version: ${KICAD_SVN_VERSION}") message(STATUS "Kicad SVN version: ${KICAD_SVN_VERSION}")
message(STATUS "Kicad about version: ${KICAD_ABOUT_VERSION}") message(STATUS "Kicad about version: ${KICAD_ABOUT_VERSION}")
......
#
# 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__ #ifndef __CONFIG_H__
#define __KICAD_SVN_VERSION_H__ #define __CONFIG_H__
#cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@" #cmakedefine HAVE_STRCASECMP
#cmakedefine KICAD_ABOUT_VERSION "@KICAD_ABOUT_VERSION@"
#endif /* __KICAD_SVN_VERSION_H__ */ #cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_ISO_STRICMP
#cmakedefine HAVE_ISO_STRNICMP
#cmakedefine HAVE_ISO_SNPRINTF
#if defined( HAVE_ISO_SNPRINTF )
#define snprintf _snprintf
#endif
#cmakedefine HAVE_ISO_HYPOT
#if defined( HAVE_ISO_HYPOT )
#define hypot _hypot
#endif
#cmakedefine MALLOC_IN_STDLIB_H
#if !defined( MALLOC_IN_STDLIB_H )
#include <malloc.h>
#endif
#cmakedefine HAVE_ISO646_H
#if defined( HAVE_ISO646_H )
#include <iso646.h>
#endif
#cmakedefine HAVE_STRINGS_H
#if defined( HAVE_STRCASECMP )
#define stricmp strcasecmp
#elif defined( HAVE_ISO_STRICMP )
#define stricmp _stricmp
#endif
#if defined( HAVE_STRNCASECMP )
#define strnicmp strncasecmp
#elif defined( HAVE_ISO_STRNICMP )
#define strnicmp _strnicmp
#endif
#endif /* __CONFIG_H__ */
/* 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 */ /* XPM */
#ifndef XPMMAIN #ifndef XPMMAIN
extern const char * green_xpm[]; extern const char * erc_green_xpm[];
#else #else
const char *green_xpm[] = { const char *erc_green_xpm[] = {
/* columns rows colors const chars-per-pixel */ /* columns rows colors const chars-per-pixel */
"11 11 2 1", "11 11 2 1",
"- c Black", "- c Black",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
wxString g_BuildVersion wxString g_BuildVersion
#ifdef HAVE_SVN_VERSION #ifdef HAVE_SVN_VERSION
#include "config.h" #include "version.h"
( wxT( KICAD_SVN_VERSION ) ) ( wxT( KICAD_SVN_VERSION ) )
#else #else
( BUILD_VERSION ) ( BUILD_VERSION )
...@@ -22,7 +22,7 @@ wxString g_BuildVersion ...@@ -22,7 +22,7 @@ wxString g_BuildVersion
wxString g_BuildAboutVersion wxString g_BuildAboutVersion
#if defined(HAVE_SVN_VERSION) || defined(HAVE_SVN_REVISION) #if defined(HAVE_SVN_VERSION) || defined(HAVE_SVN_REVISION)
# include "config.h" # include "version.h"
( wxT( KICAD_ABOUT_VERSION ) ) ( wxT( KICAD_ABOUT_VERSION ) )
#else #else
( BUILD_VERSION ) ( BUILD_VERSION )
......
...@@ -376,8 +376,8 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size ) ...@@ -376,8 +376,8 @@ void BASE_SCREEN::SetGrid( const wxRealPoint& size )
m_Grid = nearest_grid; m_Grid = nearest_grid;
wxLogWarning( _( "Grid size( %f, %f ) not in grid list, falling back to " \ wxLogWarning( wxT( "Grid size( %f, %f ) not in grid list, falling back " ) \
"grid size( %f, %f )." ), wxT( "to grid size( %f, %f )." ),
size.x, size.y, m_Grid.x, m_Grid.y ); size.x, size.y, m_Grid.x, m_Grid.y );
} }
...@@ -399,8 +399,8 @@ void BASE_SCREEN::SetGrid( int id ) ...@@ -399,8 +399,8 @@ void BASE_SCREEN::SetGrid( int id )
m_Grid = m_GridList[0].m_Size; m_Grid = m_GridList[0].m_Size;
wxLogWarning( _( "Grid ID %d not in grid list, falling back to " \ wxLogWarning( wxT( "Grid ID %d not in grid list, falling back to " ) \
"grid size( %g, %g )." ), id, m_Grid.x, m_Grid.y ); wxT( "grid size( %g, %g )." ), id, m_Grid.x, m_Grid.y );
} }
void BASE_SCREEN::AddGrid( const GRID_TYPE& grid ) void BASE_SCREEN::AddGrid( const GRID_TYPE& grid )
...@@ -418,8 +418,8 @@ void BASE_SCREEN::AddGrid( const GRID_TYPE& grid ) ...@@ -418,8 +418,8 @@ void BASE_SCREEN::AddGrid( const GRID_TYPE& grid )
} }
if( m_GridList[i].m_Id == grid.m_Id ) if( m_GridList[i].m_Id == grid.m_Id )
{ {
wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " \ wxLogDebug( wxT( "Changing grid ID %d from size( %g, %g ) to " ) \
"size( %g, %g )." ), wxT( "size( %g, %g )." ),
grid.m_Id, m_GridList[i].m_Size.x, grid.m_Id, m_GridList[i].m_Size.x,
m_GridList[i].m_Size.y, grid.m_Size.x, grid.m_Size.y ); m_GridList[i].m_Size.y, grid.m_Size.x, grid.m_Size.y );
m_GridList[i].m_Size = grid.m_Size; m_GridList[i].m_Size = grid.m_Size;
......
...@@ -34,7 +34,6 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father, ...@@ -34,7 +34,6 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,
const wxSize& size, const wxSize& size,
long style ) : long style ) :
wxFrame( father, -1, title, pos, size, style ) wxFrame( father, -1, title, pos, size, style )
/**********************************************************/
{ {
wxSize minsize; wxSize minsize;
......
...@@ -323,7 +323,7 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, ...@@ -323,7 +323,7 @@ wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit,
StringValue << aValue; StringValue << aValue;
else else
{ {
value_to_print = To_User_Unit( aUnits, aValue, aInternal_Unit ); value_to_print = To_User_Unit( (bool)aUnits, aValue, aInternal_Unit );
StringValue.Printf( ( aInternal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ), StringValue.Printf( ( aInternal_Unit > 1000 ) ? wxT( "%.4f" ) : wxT( "%.3f" ),
value_to_print ); value_to_print );
} }
...@@ -366,7 +366,7 @@ int ReturnValueFromString( int Units, const wxString& TextValue, ...@@ -366,7 +366,7 @@ int ReturnValueFromString( int Units, const wxString& TextValue,
if( Units >= CENTIMETRE ) if( Units >= CENTIMETRE )
Value = wxRound( dtmp ); Value = wxRound( dtmp );
else else
Value = From_User_Unit( Units, dtmp, Internal_Unit ); Value = From_User_Unit( (bool)Units, dtmp, Internal_Unit );
return Value; return Value;
} }
......
...@@ -331,14 +331,14 @@ void PrintHeaderPS( FILE* file, const wxString& Creator, ...@@ -331,14 +331,14 @@ void PrintHeaderPS( FILE* file, const wxString& Creator,
// the order in which they are specified is not wrong!) // the order in which they are specified is not wrong!)
if( SheetPS->m_Name.Cmp( wxT( "User" ) ) == 0 ) if( SheetPS->m_Name.Cmp( wxT( "User" ) ) == 0 )
sprintf( Line, "%%%%DocumentMedia: Custom %d %d 0 () ()\n", sprintf( Line, "%%%%DocumentMedia: Custom %d %d 0 () ()\n",
(int) round( SheetPS->m_Size.y * CONV_SCALE ), wxRound( SheetPS->m_Size.y * CONV_SCALE ),
(int) round( SheetPS->m_Size.x * CONV_SCALE ) ); wxRound( SheetPS->m_Size.x * CONV_SCALE ) );
else // ( if SheetPS->m_Name does not equal "User" ) else // ( if SheetPS->m_Name does not equal "User" )
sprintf( Line, "%%%%DocumentMedia: %s %d %d 0 () ()\n", sprintf( Line, "%%%%DocumentMedia: %s %d %d 0 () ()\n",
CONV_TO_UTF8( SheetPS->m_Name ), CONV_TO_UTF8( SheetPS->m_Name ),
(int) round( SheetPS->m_Size.y * CONV_SCALE ), wxRound( SheetPS->m_Size.y * CONV_SCALE ),
(int) round( SheetPS->m_Size.x * CONV_SCALE ) ); wxRound( SheetPS->m_Size.x * CONV_SCALE ) );
fputs( Line, g_Plot_PlotOutputFile ); fputs( Line, g_Plot_PlotOutputFile );
if( PaperOrientation == wxPORTRAIT ) if( PaperOrientation == wxPORTRAIT )
......
...@@ -4,19 +4,6 @@ ...@@ -4,19 +4,6 @@
/* test demande ESC */ /* test demande ESC */
/*************************/ /*************************/
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWindows headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
...@@ -44,7 +31,7 @@ public: ...@@ -44,7 +31,7 @@ public:
}; };
BEGIN_EVENT_TABLE( WinEDA_MessageDialog, wxMessageDialog ) BEGIN_EVENT_TABLE( WinEDA_MessageDialog, wxMessageDialog )
EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut ) EVT_TIMER( ID_TIMOUT, WinEDA_MessageDialog::OnTimeOut )
END_EVENT_TABLE() END_EVENT_TABLE()
/**********************************************************************************/ /**********************************************************************************/
...@@ -80,12 +67,12 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime ) ...@@ -80,12 +67,12 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime )
wxMessageDialog* dialog; wxMessageDialog* dialog;
if( displaytime > 0 ) if( displaytime > 0 )
dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ), dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ),
wxOK | wxICON_INFORMATION, wxOK | wxICON_INFORMATION,
displaytime ); displaytime );
else else
dialog = new WinEDA_MessageDialog( parent, text, _( "Error" ), dialog = new WinEDA_MessageDialog( parent, text, _( "Error" ),
wxOK | wxICON_ERROR, 0 ); wxOK | wxICON_ERROR, 0 );
dialog->ShowModal(); dialog->ShowModal();
dialog->Destroy(); dialog->Destroy();
...@@ -116,7 +103,8 @@ bool IsOK( wxWindow* parent, const wxString& text ) ...@@ -116,7 +103,8 @@ bool IsOK( wxWindow* parent, const wxString& text )
{ {
int ii; int ii;
ii = wxMessageBox( text, _( "Confirmation" ), wxYES_NO | wxCENTRE | wxICON_HAND, parent ); ii = wxMessageBox( text, _( "Confirmation" ),
wxYES_NO | wxCENTRE | wxICON_HAND, parent );
if( ii == wxYES ) if( ii == wxYES )
return TRUE; return TRUE;
return FALSE; return FALSE;
...@@ -124,9 +112,9 @@ bool IsOK( wxWindow* parent, const wxString& text ) ...@@ -124,9 +112,9 @@ bool IsOK( wxWindow* parent, const wxString& text )
/***********************************************************************/ /***********************************************************************/
int Get_Message( const wxString& title, // The question int Get_Message( const wxString& title, // The question
const wxString& frame_caption, // The frame caption const wxString& frame_caption, // The frame caption
wxString& buffer, // String input/return buffer wxString& buffer, // String input/return buffer
wxWindow* frame ) wxWindow* frame )
/***********************************************************************/ /***********************************************************************/
......
...@@ -587,18 +587,18 @@ void WinEDA_DrawFrame::AdjustScrollBars() ...@@ -587,18 +587,18 @@ void WinEDA_DrawFrame::AdjustScrollBars()
screen->m_ScrollbarNumber.y, screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.x,
screen->m_ScrollbarPos.y, TRUE ); screen->m_ScrollbarPos.y, TRUE );
#else // #else
BASE_SCREEN* screen = GetBaseScreen(); // BASE_SCREEN* screen = GetBaseScreen();
wxSize drawingSize = screen->ReturnPageSize() * 2; // wxSize drawingSize = screen->ReturnPageSize() * 2;
wxCoord x, y; // wxCoord x, y;
wxClientDC DC( this ); // wxClientDC DC( this );
DrawPanel->PrepareGraphicContext( &DC ); // DrawPanel->PrepareGraphicContext( &DC );
x = DC.LogicalToDeviceXRel( drawingSize.GetWidth() ); // x = DC.LogicalToDeviceXRel( drawingSize.GetWidth() );
y = DC.LogicalToDeviceYRel( drawingSize.GetHeight() ); // y = DC.LogicalToDeviceYRel( drawingSize.GetHeight() );
DrawPanel->SetScrollbars( 1, 1, x, y, // DrawPanel->SetScrollbars( 1, 1, x, y,
DC.LogicalToDeviceX( screen->m_Curseur.x ), // DC.LogicalToDeviceX( screen->m_Curseur.x ),
DC.LogicalToDeviceY( screen->m_Curseur.y ), // DC.LogicalToDeviceY( screen->m_Curseur.y ),
true ); // true );
#endif #endif
} }
......
...@@ -73,8 +73,8 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id, ...@@ -73,8 +73,8 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id,
ForceCloseManageCurseur = NULL; ForceCloseManageCurseur = NULL;
if( wxGetApp().m_EDA_Config ) if( wxGetApp().m_EDA_Config )
m_AutoPAN_Enable = wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), wxGetApp().m_EDA_Config->Read( wxT( "AutoPAN" ), &m_AutoPAN_Enable,
true ); true );
m_AutoPAN_Request = FALSE; m_AutoPAN_Request = FALSE;
m_Block_Enable = FALSE; m_Block_Enable = FALSE;
...@@ -197,13 +197,25 @@ void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC ) ...@@ -197,13 +197,25 @@ void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC )
GRResetPenAndBrush( DC ); GRResetPenAndBrush( DC );
DC->SetBackgroundMode( wxTRANSPARENT ); DC->SetBackgroundMode( wxTRANSPARENT );
#ifdef WX_ZOOM #ifdef WX_ZOOM
int clientWidth, clientHeight;
GetClientSize( &clientWidth, &clientHeight );
wxSize drawingSize = GetScreen()->ReturnPageSize() * 2;
double scale = GetScreen()->GetScalingFactor(); double scale = GetScreen()->GetScalingFactor();
wxPoint origin = GetScreen()->m_DrawOrg; int dx = 0, dy = 0;
int ppuX, ppuY, startX, startY; int drawingWidth = wxRound( (double)drawingSize.GetWidth() * scale );
GetScrollPixelsPerUnit( & ppuX, & ppuY ); int drawingHeight = wxRound( (double)drawingSize.GetHeight() * scale );
GetViewStart( &startX, &startY );
DC->SetDeviceOrigin( origin.x - startX * ppuX, origin.y - startY * ppuY ); if( drawingWidth < clientWidth )
dx = ( clientWidth - drawingWidth ) / 2;
if( drawingHeight < clientHeight )
dy = ( clientHeight - drawingHeight ) / 2;
wxCoord x, y;
DC->GetDeviceOrigin( &x, &y );
DC->SetUserScale( scale, scale ); DC->SetUserScale( scale, scale );
DC->SetDeviceOrigin( x + dx, y + dy );
// wxSize size = GetScreen()->ReturnPageSize() * 2 * scale; // wxSize size = GetScreen()->ReturnPageSize() * 2 * scale;
// DC->SetLogicalOrigin( origin.x, origin.y ); // DC->SetLogicalOrigin( origin.x, origin.y );
#endif #endif
...@@ -418,8 +430,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse ) ...@@ -418,8 +430,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse )
CalcUnscrolledPosition( screenPos.x, screenPos.y, CalcUnscrolledPosition( screenPos.x, screenPos.y,
&drawingPos.x, &drawingPos.y ); &drawingPos.x, &drawingPos.y );
wxLogDebug( wxT( "MouseTo() initial screen position(%d, %d) " \ wxLogDebug( wxT( "MouseTo() initial screen position(%d, %d) " ) \
"rectangle(%d, %d, %d, %d) view(%d, %d)" ), wxT( "rectangle(%d, %d, %d, %d) view(%d, %d)" ),
screenPos.x, screenPos.y, clientRect.x, clientRect.y, screenPos.x, screenPos.y, clientRect.x, clientRect.y,
clientRect.width, clientRect.height, x, y ); clientRect.width, clientRect.height, x, y );
...@@ -436,8 +448,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse ) ...@@ -436,8 +448,8 @@ void WinEDA_DrawPanel::MouseTo( const wxPoint& Mouse )
CalcScrolledPosition( drawingPos.x, drawingPos.y, CalcScrolledPosition( drawingPos.x, drawingPos.y,
&screenPos.x, &screenPos.y ); &screenPos.x, &screenPos.y );
wxLogDebug( wxT( "MouseTo() scrolled screen position(%d, %d) " \ wxLogDebug( wxT( "MouseTo() scrolled screen position(%d, %d) " ) \
"view(%d, %d)" ), screenPos.x, screenPos.y, x, y ); wxT( "view(%d, %d)" ), screenPos.x, screenPos.y, x, y );
} }
WarpPointer( screenPos.x, screenPos.y ); WarpPointer( screenPos.x, screenPos.y );
...@@ -936,8 +948,8 @@ void WinEDA_DrawPanel::OnMouseWheel( wxMouseEvent& event ) ...@@ -936,8 +948,8 @@ void WinEDA_DrawPanel::OnMouseWheel( wxMouseEvent& event )
if( event.GetWheelRotation() == 0 || !GetParent()->IsEnabled() if( event.GetWheelRotation() == 0 || !GetParent()->IsEnabled()
|| !rect.Contains( event.GetPosition() ) ) || !rect.Contains( event.GetPosition() ) )
{ {
wxLogDebug( wxT( "OnMouseWheel() position(%d, %d) " \ wxLogDebug( wxT( "OnMouseWheel() position(%d, %d) " ) \
"rectangle(%d, %d, %d, %d)" ), wxT( "rectangle(%d, %d, %d, %d)" ),
event.GetPosition().x, event.GetPosition().y, event.GetPosition().x, event.GetPosition().y,
rect.x, rect.y, rect.width, rect.height ); rect.x, rect.y, rect.width, rect.height );
......
...@@ -80,7 +80,7 @@ static void DrawGraphicTextPline( ...@@ -80,7 +80,7 @@ static void DrawGraphicTextPline(
static int overbar_position( int size_v, int thickness ) static int overbar_position( int size_v, int thickness )
{ {
return size_v * 1.1 + thickness; return wxRound( (double)size_v * 1.1 + (double)thickness );
} }
......
...@@ -3,18 +3,6 @@ ...@@ -3,18 +3,6 @@
// Name: eda_dde.cpp // // Name: eda_dde.cpp //
/////////////////////// ///////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "fctsys.h" #include "fctsys.h"
#include "eda_dde.h" #include "eda_dde.h"
#include "wxstruct.h" #include "wxstruct.h"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#ifndef _MSC_VER #ifndef _MSC_VER
#include <dir.h> //#include <dir.h>
#endif #endif
#endif #endif
......
...@@ -49,15 +49,15 @@ void ClipAndDrawFilledPoly( EDA_Rect * ClipBox, wxDC * DC, wxPoint Points[], int ...@@ -49,15 +49,15 @@ void ClipAndDrawFilledPoly( EDA_Rect * ClipBox, wxDC * DC, wxPoint Points[], int
extern BASE_SCREEN* ActiveScreen; extern BASE_SCREEN* ActiveScreen;
/* Variables locales */ /* Variables locales */
static int GRLastMoveToX, GRLastMoveToY; static int GRLastMoveToX, GRLastMoveToY;
static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0) static int PenMinWidth = 1; /* largeur minimum de la plume (DOIT etre > 0)
* (utile pour trace sur imprimante) */ * (utile pour trace sur imprimante) */
static int ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace static bool ForceBlackPen; /* si != 0 : traces en noir (utilise pour trace
* sur imprimante */ * sur imprimante */
static int xcliplo = 0, static int xcliplo = 0,
ycliplo = 0, ycliplo = 0,
xcliphi = 2000, xcliphi = 2000,
ycliphi = 2000; /* coord de la surface de trace */ ycliphi = 2000; /* coord de la surface de trace */
static int lastcolor = -1; static int lastcolor = -1;
static int lastwidth = -1; static int lastwidth = -1;
static int s_Last_Pen_Style = -1; static int s_Last_Pen_Style = -1;
...@@ -1490,7 +1490,7 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPoints[], in ...@@ -1490,7 +1490,7 @@ void ClipAndDrawFilledPoly( EDA_Rect* aClipBox, wxDC* aDC, wxPoint aPoints[], in
for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit ) for( cpointIterator cit = outputPolygon.begin(); cit != outputPolygon.end(); ++cit )
{ {
clippedPolygon.push_back( wxPoint( (int)round( cit->X ), (int)round( cit->Y ) ) ); clippedPolygon.push_back( wxPoint( wxRound( cit->X ), wxRound( cit->Y ) ) );
} }
if ( clippedPolygon.size() ) if ( clippedPolygon.size() )
......
...@@ -96,7 +96,7 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] = ...@@ -96,7 +96,7 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] =
{ wxT( "*" ), '*' }, { wxT( "*" ), '*' },
{ wxT( "+" ), '+' }, { wxT( "+" ), '+' },
{ wxT( "-" ), '-' }, { wxT( "-" ), '-' },
{ wxT( "\%" ), '%' }, { wxT( "%%" ), '%' },
{ wxT( "A" ), 'A' }, { wxT( "A" ), 'A' },
{ wxT( "B" ), 'B' }, { wxT( "B" ), 'B' },
{ wxT( "C" ), 'C' }, { wxT( "C" ), 'C' },
...@@ -676,11 +676,11 @@ void AddHotkeyConfigMenu( wxMenu* menu ) ...@@ -676,11 +676,11 @@ void AddHotkeyConfigMenu( wxMenu* menu )
wxITEM_CHECK ); wxITEM_CHECK );
submenu_hkcfg->Append( item ); submenu_hkcfg->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( menu, submenu_hkcfg, -1, ADD_MENUITEM_WITH_HELP_AND_SUBMENU(
_( "Hotkey config location" ), menu, submenu_hkcfg, -1,
_( "Hotkey config file location " \ _( "Hotkey config location" ),
"selection (home directory or " \ _( "Select hotkey config file location (home directory or kicad tree)" ),
"kicad tree)" ), right_xpm ); right_xpm );
submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME, submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME,
g_ConfigFileLocationChoice == 0 ); g_ConfigFileLocationChoice == 0 );
submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD, submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD,
......
...@@ -82,8 +82,9 @@ wxString g_Shapes3DExtBuffer( wxT( "wrl" ) ); ...@@ -82,8 +82,9 @@ wxString g_Shapes3DExtBuffer( wxT( "wrl" ) );
const wxString ModuleFileExtension( wxT( "mod" ) ); const wxString ModuleFileExtension( wxT( "mod" ) );
/* PCB file name wild card definitions. */ /* PCB file name wild card definitions. */
const wxString ModuleFileWildcard( _( "Kicad footprint library files " \ const wxString ModuleFileWildcard(
"(*.mod)|*.mod") ); _( "Kicad footprint library files (*.mod)|*.mod" )
);
int g_CurrentVersionPCB = 1; int g_CurrentVersionPCB = 1;
......
...@@ -14,16 +14,14 @@ ...@@ -14,16 +14,14 @@
#include <wx/apptrait.h> #include <wx/apptrait.h>
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
#include <boost/foreach.hpp>
#define CONFIG_VERSION 1 #define CONFIG_VERSION 1
#define FORCE_LOCAL_CONFIG true #define FORCE_LOCAL_CONFIG true
#include <wx/arrimpl.cpp>
WX_DEFINE_OBJARRAY( PARAM_CFG_ARRAY );
/** /**
* Cree ou recree la configuration locale de kicad (filename.pro) * Cree ou recree la configuration locale de kicad (filename.pro)
* initialise: * initialise:
...@@ -51,8 +49,8 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName, ...@@ -51,8 +49,8 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
/* Check just in case the file name does not a kicad project extension. */ /* Check just in case the file name does not a kicad project extension. */
if( fn.GetExt() != ProjectFileExtension ) if( fn.GetExt() != ProjectFileExtension )
{ {
wxLogDebug( _( "ReCreatePrjConfig() called with project file <%s> " \ wxLogDebug( wxT( "ReCreatePrjConfig() called with project file <%s> \
"which does not have the correct file extension." ), which does not have the correct file extension." ),
fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
fn.SetExt( ProjectFileExtension ); fn.SetExt( ProjectFileExtension );
} }
...@@ -94,7 +92,7 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName, ...@@ -94,7 +92,7 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
return true; return true;
else else
{ {
delete m_ProjectConfig; // Version incorrecte delete m_ProjectConfig; // Version incorrect
} }
} }
...@@ -182,12 +180,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName, ...@@ -182,12 +180,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
void WinEDA_App::WriteProjectConfig( const wxString& fileName, void WinEDA_App::WriteProjectConfig( const wxString& fileName,
const wxString& GroupName, const wxString& GroupName,
const PARAM_CFG_ARRAY& params ) PARAM_CFG_ARRAY& params )
{ {
PARAM_CFG_BASE* param;
wxString msg;
size_t i;
ReCreatePrjConfig( fileName, GroupName, FORCE_LOCAL_CONFIG ); ReCreatePrjConfig( fileName, GroupName, FORCE_LOCAL_CONFIG );
/* Write date ( surtout pour eviter bug de wxFileConfig /* Write date ( surtout pour eviter bug de wxFileConfig
...@@ -195,11 +189,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName, ...@@ -195,11 +189,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
* (en fait si groupe vide) */ * (en fait si groupe vide) */
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR ); m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
msg = DateAndTime(); m_ProjectConfig->Write( wxT( "update" ), DateAndTime() );
m_ProjectConfig->Write( wxT( "update" ), msg ); m_ProjectConfig->Write( wxT( "last_client" ), GetAppName() );
msg = GetAppName();
m_ProjectConfig->Write( wxT( "last_client" ), msg );
/* Save parameters */ /* Save parameters */
m_ProjectConfig->DeleteGroup( GroupName ); // Erase all datas m_ProjectConfig->DeleteGroup( GroupName ); // Erase all datas
...@@ -209,24 +200,23 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName, ...@@ -209,24 +200,23 @@ void WinEDA_App::WriteProjectConfig( const wxString& fileName,
m_ProjectConfig->Write( wxT( "version" ), CONFIG_VERSION ); m_ProjectConfig->Write( wxT( "version" ), CONFIG_VERSION );
m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR ); m_ProjectConfig->SetPath( wxCONFIG_PATH_SEPARATOR );
for( i = 0; i < params.GetCount(); i++ ) BOOST_FOREACH( PARAM_CFG_BASE& param, params )
{ {
param = &params[i]; if( param.m_Group )
if( param->m_Group ) m_ProjectConfig->SetPath( param.m_Group );
m_ProjectConfig->SetPath( param->m_Group );
else else
m_ProjectConfig->SetPath( GroupName ); m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup ) if( param.m_Setup )
continue; continue;
if ( param->m_Type == PARAM_COMMAND_ERASE ) // Erase all data if ( param.m_Type == PARAM_COMMAND_ERASE ) // Erase all data
{ {
if( param->m_Ident ) if( param.m_Ident )
m_ProjectConfig->DeleteGroup( param->m_Ident ); m_ProjectConfig->DeleteGroup( param.m_Ident );
} }
else else
param->SaveParam( m_ProjectConfig ); param.SaveParam( m_ProjectConfig );
} }
m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP ); m_ProjectConfig->SetPath( UNIX_STRING_DIR_SEP );
...@@ -267,28 +257,23 @@ void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList ) ...@@ -267,28 +257,23 @@ void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
} }
void WinEDA_App::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List ) void WinEDA_App::SaveCurrentSetupValues( PARAM_CFG_ARRAY& List )
{ {
size_t i;
PARAM_CFG_BASE* pt_cfg;
if( m_EDA_Config == NULL ) if( m_EDA_Config == NULL )
return; return;
for( i = 0; i < List.GetCount(); i++ ) BOOST_FOREACH( PARAM_CFG_BASE& param, List )
{ {
pt_cfg = &List[i]; if( param.m_Setup == false )
if( pt_cfg->m_Setup == false )
continue; continue;
if ( pt_cfg->m_Type == PARAM_COMMAND_ERASE ) // Erase all data if ( param.m_Type == PARAM_COMMAND_ERASE ) // Erase all data
{ {
if( pt_cfg->m_Ident ) if( param.m_Ident )
m_EDA_Config->DeleteGroup( pt_cfg->m_Ident ); m_EDA_Config->DeleteGroup( param.m_Ident );
} }
else else
pt_cfg->SaveParam( m_EDA_Config ); param.SaveParam( m_EDA_Config );
} }
} }
...@@ -298,7 +283,7 @@ void WinEDA_App::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List ) ...@@ -298,7 +283,7 @@ void WinEDA_App::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List )
* Parameters are parameters that have the .m_Setup member set to false * Parameters are parameters that have the .m_Setup member set to false
* read file is the .pro file project * read file is the .pro file project
* *
* if Load_Only_if_New == true, this file is read only if it diders from * if Load_Only_if_New == true, this file is read only if it differs from
* the current config (different dates ) * the current config (different dates )
* *
* @return true if read. * @return true if read.
...@@ -358,13 +343,11 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, ...@@ -358,13 +343,11 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
} }
bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename, bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
const PARAM_CFG_ARRAY& params, PARAM_CFG_ARRAY& params,
bool Load_Only_if_New ) bool Load_Only_if_New )
{ {
size_t i;
PARAM_CFG_BASE* param;
wxString timestamp; wxString timestamp;
ReCreatePrjConfig( local_config_filename, GroupName, false ); ReCreatePrjConfig( local_config_filename, GroupName, false );
...@@ -390,19 +373,17 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename ...@@ -390,19 +373,17 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename
m_CurrentOptionFile = g_Prj_Config_LocalFilename; m_CurrentOptionFile = g_Prj_Config_LocalFilename;
} }
for( i = 0; i < params.GetCount(); i++ ) BOOST_FOREACH( PARAM_CFG_BASE& param, params )
{ {
param = &params[i]; if( param.m_Group )
m_ProjectConfig->SetPath( param.m_Group );
if( param->m_Group )
m_ProjectConfig->SetPath( param->m_Group );
else else
m_ProjectConfig->SetPath( GroupName ); m_ProjectConfig->SetPath( GroupName );
if( param->m_Setup ) if( param.m_Setup )
continue; continue;
param->ReadParam( m_ProjectConfig ); param.ReadParam( m_ProjectConfig );
} }
delete m_ProjectConfig; delete m_ProjectConfig;
...@@ -435,19 +416,14 @@ void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList ) ...@@ -435,19 +416,14 @@ void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_BASE** aList )
} }
void WinEDA_App::ReadCurrentSetupValues( const PARAM_CFG_ARRAY& List ) void WinEDA_App::ReadCurrentSetupValues( PARAM_CFG_ARRAY& List )
{ {
size_t i; BOOST_FOREACH( PARAM_CFG_BASE& param, List )
PARAM_CFG_BASE* pt_cfg;
for( i = 0; i < List.GetCount(); i++ )
{ {
pt_cfg = &List[i]; if( param.m_Setup == false )
if( pt_cfg->m_Setup == false )
continue; continue;
pt_cfg->ReadParam( m_EDA_Config ); param.ReadParam( m_EDA_Config );
} }
} }
......
#include "wx/wxprec.h" #include "fctsys.h"
#include <id.h> #include "common.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you #include <id.h>
// need because it includes almost all "standard" wxWindows headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/dir.h> #include <wx/dir.h>
#include <wx/utils.h>
#include <pyhandler.h> #include <pyhandler.h>
#include <iostream> #include <iostream>
#include "fctsys.h"
#include "common.h"
using namespace boost::python; using namespace boost::python;
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
/*********************************************/ /*********************************************/
#include "fctsys.h" #include "fctsys.h"
#include <time.h>
#include "macros.h" #include "macros.h"
#include "kicad_string.h" #include "kicad_string.h"
......
...@@ -399,7 +399,7 @@ void RotatePoint( double* pX, double* pY, int angle ) ...@@ -399,7 +399,7 @@ void RotatePoint( double* pX, double* pY, int angle )
} }
float fsinus[3600] = double fsinus[3600] =
{ {
0.0000000000, 0.0017453284, 0.0034906514, 0.0052359638, 0.0000000000, 0.0017453284, 0.0034906514, 0.0052359638,
0.0069812603, 0.0087265355, 0.0104717841, 0.0122170008, 0.0139621803, 0.0069812603, 0.0087265355, 0.0104717841, 0.0122170008, 0.0139621803,
...@@ -1124,7 +1124,7 @@ float fsinus[3600] = ...@@ -1124,7 +1124,7 @@ float fsinus[3600] =
-0.0017453284 -0.0017453284
}; };
float fcosinus[3600] = double fcosinus[3600] =
{ {
1.0000000000, 0.9999984769, 0.9999939077, 0.9999862922, 1.0000000000, 0.9999984769, 0.9999939077, 0.9999862922,
0.9999756307, 0.9999619231, 0.9999451694, 0.9999253697, 0.9999025240, 0.9999756307, 0.9999619231, 0.9999451694, 0.9999253697, 0.9999025240,
......
...@@ -107,8 +107,8 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event ) ...@@ -107,8 +107,8 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
{ {
if( DrawPanel == NULL ) if( DrawPanel == NULL )
{ {
wxLogDebug( wxT( "No DrawPanel object defined in " \ wxLogDebug( wxT( "%s, %d: DrawPanel object is undefined ." ),
"WinEDA_DrawFrame::OnZoom()." ) ); __TFILE__, __LINE__ );
return; return;
} }
...@@ -165,15 +165,10 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event ) ...@@ -165,15 +165,10 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
default: default:
i = id - ID_POPUP_ZOOM_LEVEL_START; i = id - ID_POPUP_ZOOM_LEVEL_START;
if( i < 0 ) if( ( i < 0 ) || ( (size_t) i >= screen->m_ZoomList.GetCount() ) )
{ {
wxLogDebug( wxT( "WinEDA_DrawFram::OnZoom() invalid ID %d" ), id ); wxLogDebug( _T( "%s %d: index %d is outside the bounds of the zoom list." ),
return; __TFILE__, __LINE__, i );
}
if( !( (size_t) i < screen->m_ZoomList.GetCount()) )
{
wxLogDebug( _T( "Requested index %d is outside the bounds of " \
"the zoom list." ), i );
return; return;
} }
if( screen->SetZoom( screen->m_ZoomList[i] ) ) if( screen->SetZoom( screen->m_ZoomList[i] ) )
...@@ -254,7 +249,8 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) ...@@ -254,7 +249,8 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
{ {
tmp = GetScreen()->m_GridList[i]; tmp = GetScreen()->m_GridList[i];
gridValue = To_User_Unit( g_UnitMetric, tmp.m_Size.x, gridValue = To_User_Unit( g_UnitMetric, tmp.m_Size.x,
( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits ); m_Parent->m_InternalUnits );
if( tmp.m_Id == ID_POPUP_GRID_USER ) if( tmp.m_Id == ID_POPUP_GRID_USER )
{ {
msg = _( "User Grid" ); msg = _( "User Grid" );
......
...@@ -90,8 +90,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event ) ...@@ -90,8 +90,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
if( !tmp ) if( !tmp )
{ {
msg.Printf( _( "Footprint alias library file <%s> could not be " \ msg.Printf( _( "Footprint alias library file <%s> could not be \
"found in the default search paths." ), found in the default search paths." ),
fn.GetFullName().c_str() ); fn.GetFullName().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
continue; continue;
...@@ -166,8 +166,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event ) ...@@ -166,8 +166,8 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
if( component.m_Module.IsEmpty() ) if( component.m_Module.IsEmpty() )
{ {
msg.Printf( _( "Component %s: footprint %s not found in " \ msg.Printf( _( "Component %s: footprint %s not found in \
"any of the project footprint libraries." ), any of the project footprint libraries." ),
component.m_Reference.c_str(), component.m_Reference.c_str(),
alias.m_FootprintName.c_str() ); alias.m_FootprintName.c_str() );
wxMessageBox( msg, _( "CVPcb Error" ), wxOK | wxICON_ERROR, wxMessageBox( msg, _( "CVPcb Error" ), wxOK | wxICON_ERROR,
......
...@@ -28,24 +28,24 @@ ...@@ -28,24 +28,24 @@
* to define local variables. The old method of statically building the array * to define local variables. The old method of statically building the array
* at compile time requiring global variable definitions. * at compile time requiring global variable definitions.
*/ */
const PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void ) PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void )
{ {
if( !m_projectFileParams.IsEmpty() ) if( !m_projectFileParams.empty() )
return m_projectFileParams; return m_projectFileParams;
m_projectFileParams.Add( new PARAM_CFG_BASE( GROUPLIB, m_projectFileParams.push_back( new PARAM_CFG_BASE( GROUPLIB,
PARAM_COMMAND_ERASE ) ); PARAM_COMMAND_ERASE ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ), m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
&m_ModuleLibNames, &m_ModuleLibNames,
GROUPLIB ) ); GROUPLIB ) );
m_projectFileParams.Add( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ), m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "EquName" ),
&m_AliasLibNames, &m_AliasLibNames,
GROUPEQU ) ); GROUPEQU ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetIExt" ),
&m_NetlistFileExtension ) ); &m_NetlistFileExtension ) );
m_projectFileParams.Add( new PARAM_CFG_WXSTRING( wxT( "LibDir" ), m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LibDir" ),
&m_UserLibraryPath, &m_UserLibraryPath,
GROUPLIB ) ); GROUPLIB ) );
return m_projectFileParams; return m_projectFileParams;
} }
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include "cvpcb.h" #include "cvpcb.h"
#include <wx/listimpl.cpp>
PIN::PIN() PIN::PIN()
{ {
......
...@@ -261,8 +261,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event ) ...@@ -261,8 +261,7 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
{ {
unsigned ii; unsigned ii;
wxMessageDialog dialog( this, wxMessageDialog dialog( this,
_( "Net and component list modified.\nSave " \ _( "Net and component list modified.\nSave before exit ?" ),
"before exit ?" ),
_( "Confirmation" ), _( "Confirmation" ),
wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT ); wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT );
......
...@@ -25,10 +25,8 @@ const wxString RetroFileExtension( wxT( "stf" ) ); ...@@ -25,10 +25,8 @@ const wxString RetroFileExtension( wxT( "stf" ) );
const wxString FootprintAliasFileExtension( wxT( "equ" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) );
// Wildcard for schematic retroannotation (import footprint names in schematic): // Wildcard for schematic retroannotation (import footprint names in schematic):
const wxString RetroFileWildcard( _( "Kicad retroannotation files " \ const wxString RetroFileWildcard( _( "Kicad retroannotation files (*.stf)|*.stf" ) );
"(*.stf)|*.stf" ) ); const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files (*.equ)|*.equ" ) );
const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files " \
"(*.equ)|*.equ" ) );
const wxString titleLibLoadError( _( "Library Load Error" ) ); const wxString titleLibLoadError( _( "Library Load Error" ) );
......
...@@ -16,7 +16,6 @@ class FootprintListBox; ...@@ -16,7 +16,6 @@ class FootprintListBox;
class ListBoxCmp; class ListBoxCmp;
class WinEDA_DisplayFrame; class WinEDA_DisplayFrame;
#define LIST_BOX_TYPE wxListView
/******************************************************/ /******************************************************/
/* classe derivee pour la Fenetre principale de cvpcb */ /* classe derivee pour la Fenetre principale de cvpcb */
...@@ -98,7 +97,7 @@ public: ...@@ -98,7 +97,7 @@ public:
virtual void LoadSettings(); virtual void LoadSettings();
virtual void SaveSettings(); virtual void SaveSettings();
const PARAM_CFG_ARRAY& GetProjectFileParameters( void ); PARAM_CFG_ARRAY& GetProjectFileParameters( void );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
...@@ -107,11 +106,8 @@ public: ...@@ -107,11 +106,8 @@ public:
/***********************************************/ /***********************************************/
/* ListBox derivee pour l'affichage des listes */ /* ListBox derivee pour l'affichage des listes */
/***********************************************/ /***********************************************/
class ListBoxBase : public LIST_BOX_TYPE class ListBoxBase : public wxListView
{ {
public:
WinEDA_CvpcbFrame* m_Parent;
public: public:
ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id, ListBoxBase( WinEDA_CvpcbFrame * parent, wxWindowID id,
...@@ -121,6 +117,9 @@ public: ...@@ -121,6 +117,9 @@ public:
int GetSelection(); int GetSelection();
void OnSize( wxSizeEvent& event ); void OnSize( wxSizeEvent& event );
virtual WinEDA_CvpcbFrame* GetParent();
}; };
/************************************************************/ /************************************************************/
...@@ -205,7 +204,6 @@ public: ...@@ -205,7 +204,6 @@ public:
~WinEDA_DisplayFrame(); ~WinEDA_DisplayFrame();
void OnCloseWindow( wxCloseEvent& Event ); void OnCloseWindow( wxCloseEvent& Event );
void Process_Special_Functions( wxCommandEvent& event );
void RedrawActiveWindow( wxDC* DC, bool EraseBg ); void RedrawActiveWindow( wxDC* DC, bool EraseBg );
void ReCreateHToolbar(); void ReCreateHToolbar();
void ReCreateVToolbar(); void ReCreateVToolbar();
......
...@@ -37,7 +37,8 @@ void WinEDA_DisplayFrame::InstallOptionsDisplay(wxCommandEvent& event) ...@@ -37,7 +37,8 @@ void WinEDA_DisplayFrame::InstallOptionsDisplay(wxCommandEvent& event)
/*********************************************************************/ /*********************************************************************/
/* Creation de la fenetre d'options de la fenetre de visu */ /* Creation de la fenetre d'options de la fenetre de visu */
{ {
WinEDA_FootprintDisplayOptionsFrame * OptionWindow = new WinEDA_FootprintDisplayOptionsFrame(this); WinEDA_FootprintDisplayOptionsFrame* OptionWindow =
new WinEDA_FootprintDisplayOptionsFrame(this);
OptionWindow->ShowModal(); OptionWindow->ShowModal();
OptionWindow->Destroy(); OptionWindow->Destroy();
} }
...@@ -179,7 +180,7 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls() ...@@ -179,7 +180,7 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls()
// Set validators // Set validators
m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) ); m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) );
m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) ); m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) );
m_IsShowPadFill->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadFill) ); m_IsShowPadFill->SetValidator( wxGenericValidator( & DisplayOpt.DisplayPadFill) );
m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) ); m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) );
////@end WinEDA_FootprintDisplayOptionsFrame content construction ////@end WinEDA_FootprintDisplayOptionsFrame content construction
......
...@@ -51,11 +51,11 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father, ...@@ -51,11 +51,11 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
m_FrameName = wxT( "CmpFrame" ); m_FrameName = wxT( "CmpFrame" );
// Give an icon // Give an icon
#ifdef __WINDOWS__ #ifdef __WINDOWS__
SetIcon( wxICON( a_icon_cvpcb ) ); SetIcon( wxICON( a_icon_cvpcb ) );
#else #else
SetIcon( wxICON( icon_cvpcb ) ); SetIcon( wxICON( icon_cvpcb ) );
#endif #endif
SetTitle( title ); SetTitle( title );
SetBoard( new BOARD( NULL, this ) ); SetBoard( new BOARD( NULL, this ) );
...@@ -292,30 +292,6 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -292,30 +292,6 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
} }
/*************************************************************************/
void WinEDA_DisplayFrame::Process_Special_Functions( wxCommandEvent& event )
/*************************************************************************/
/* Called when a tool is selected, or when a popup menu is clicked
* Currently : no action exists
*/
{
int id = event.GetId();
wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext( &dc );
switch( id )
{
default:
wxMessageBox( wxT( "WinEDA_DisplayFrame::Process_Special_Functions error" ) );
break;
}
SetToolbars();
}
/** /**
* Display 3D frame of current footprint selection. * Display 3D frame of current footprint selection.
*/ */
......
...@@ -84,8 +84,7 @@ bool WinEDA_CvpcbFrame::ReadNetList() ...@@ -84,8 +84,7 @@ bool WinEDA_CvpcbFrame::ReadNetList()
if( error_level < 0 ) if( error_level < 0 )
{ {
msg.Printf( _( "File <%s> does not appear to be a valid Kicad " \ msg.Printf( _( "File <%s> does not appear to be a valid Kicad net list file." ),
"net list file." ),
m_NetlistFileName.GetFullPath().c_str() ); m_NetlistFileName.GetFullPath().c_str() );
::wxMessageBox( msg, _( "File Error" ), wxOK | wxICON_ERROR, this ); ::wxMessageBox( msg, _( "File Error" ), wxOK | wxICON_ERROR, this );
return false; return false;
......
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, wxWindowID id, ListBoxBase::ListBoxBase( WinEDA_CvpcbFrame* parent, wxWindowID id,
const wxPoint& loc, const wxSize& size ) : const wxPoint& loc, const wxSize& size ) :
LIST_BOX_TYPE( parent, id, loc, size, wxListView( parent, id, loc, size,
wxSUNKEN_BORDER | wxLC_NO_HEADER | wxSUNKEN_BORDER | wxLC_NO_HEADER |
wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL ) wxLC_SINGLE_SEL | wxLC_REPORT | wxLC_VIRTUAL )
{ {
m_Parent = parent;
InsertColumn( 0, wxEmptyString ); InsertColumn( 0, wxEmptyString );
SetColumnWidth( 0, wxLIST_AUTOSIZE ); SetColumnWidth( 0, wxLIST_AUTOSIZE );
} }
...@@ -57,6 +56,12 @@ int ListBoxBase::GetSelection() ...@@ -57,6 +56,12 @@ int ListBoxBase::GetSelection()
} }
WinEDA_CvpcbFrame* ListBoxBase::GetParent()
{
return (WinEDA_CvpcbFrame*) wxListView::GetParent();
}
/***************************************/ /***************************************/
/* ListBox handling the footprint list */ /* ListBox handling the footprint list */
/***************************************/ /***************************************/
...@@ -67,6 +72,7 @@ FootprintListBox::FootprintListBox( WinEDA_CvpcbFrame* parent, ...@@ -67,6 +72,7 @@ FootprintListBox::FootprintListBox( WinEDA_CvpcbFrame* parent,
int nbitems, wxString choice[] ) : int nbitems, wxString choice[] ) :
ListBoxBase( parent, id, loc, size ) ListBoxBase( parent, id, loc, size )
{ {
m_UseFootprintFullList = true;
m_ActiveFootprintList = NULL; m_ActiveFootprintList = NULL;
SetActiveFootprintList( TRUE ); SetActiveFootprintList( TRUE );
} }
...@@ -106,7 +112,8 @@ wxString FootprintListBox::GetSelectedFootprint() ...@@ -106,7 +112,8 @@ wxString FootprintListBox::GetSelectedFootprint()
if( ii >= 0 ) if( ii >= 0 )
{ {
wxString msg = (*m_ActiveFootprintList)[ii]; wxString msg = (*m_ActiveFootprintList)[ii];
msg.Trim( TRUE ); msg.Trim( FALSE ); msg.Trim( TRUE );
msg.Trim( FALSE );
FootprintName = msg.AfterFirst( wxChar( ' ' ) ); FootprintName = msg.AfterFirst( wxChar( ' ' ) );
} }
...@@ -172,7 +179,7 @@ ListBoxCmp::~ListBoxCmp() ...@@ -172,7 +179,7 @@ ListBoxCmp::~ListBoxCmp()
/* Build the events table for the schematic components list box /* Build the events table for the schematic components list box
*/ */
BEGIN_EVENT_TABLE( ListBoxCmp, LIST_BOX_TYPE ) BEGIN_EVENT_TABLE( ListBoxCmp, ListBoxBase )
EVT_SIZE( ListBoxBase::OnSize ) EVT_SIZE( ListBoxBase::OnSize )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -418,8 +425,8 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) ...@@ -418,8 +425,8 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) ) if( !m_UseFootprintFullList || ( m_UseFootprintFullList != old_selection ) )
{ {
m_Parent->SetStatusText( wxEmptyString, 0 ); GetParent()->SetStatusText( wxEmptyString, 0 );
m_Parent->SetStatusText( wxEmptyString, 1 ); GetParent()->SetStatusText( wxEmptyString, 1 );
} }
wxString msg; wxString msg;
...@@ -429,7 +436,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) ...@@ -429,7 +436,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
else else
msg.Printf( _( "Footprints (filtered): %d" ), msg.Printf( _( "Footprints (filtered): %d" ),
m_ActiveFootprintList->GetCount() ); m_ActiveFootprintList->GetCount() );
m_Parent->SetStatusText( msg, 2 ); GetParent()->SetStatusText( msg, 2 );
} }
...@@ -437,7 +444,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw ) ...@@ -437,7 +444,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
/* Event table for the footprint list */ /* Event table for the footprint list */
/**************************************/ /**************************************/
BEGIN_EVENT_TABLE( FootprintListBox, LIST_BOX_TYPE ) BEGIN_EVENT_TABLE( FootprintListBox, ListBoxBase )
EVT_SIZE( ListBoxBase::OnSize ) EVT_SIZE( ListBoxBase::OnSize )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -449,21 +456,21 @@ void FootprintListBox::OnLeftClick( wxListEvent& event ) ...@@ -449,21 +456,21 @@ void FootprintListBox::OnLeftClick( wxListEvent& event )
FOOTPRINT* Module; FOOTPRINT* Module;
wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint();
Module = GetModuleDescrByName( FootprintName, m_Parent->m_footprints ); Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints );
if( m_Parent->DrawFrame ) if( GetParent()->DrawFrame )
{ {
m_Parent->CreateScreenCmp(); /* refresh general */ GetParent()->CreateScreenCmp(); /* refresh general */
} }
if( Module ) if( Module )
{ {
wxString msg; wxString msg;
msg = Module->m_Doc; msg = Module->m_Doc;
m_Parent->SetStatusText( msg, 0 ); GetParent()->SetStatusText( msg, 0 );
msg = wxT( "KeyW: " ); msg = wxT( "KeyW: " );
msg += Module->m_KeyWord; msg += Module->m_KeyWord;
m_Parent->SetStatusText( msg, 1 ); GetParent()->SetStatusText( msg, 1 );
} }
} }
...@@ -474,7 +481,7 @@ void FootprintListBox::OnLeftDClick( wxListEvent& event ) ...@@ -474,7 +481,7 @@ void FootprintListBox::OnLeftDClick( wxListEvent& event )
{ {
wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint();
m_Parent->SetNewPkg( FootprintName ); GetParent()->SetNewPkg( FootprintName );
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "protos.h"
/* routines locales : */ /* routines locales : */
static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list ); static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
...@@ -53,9 +54,8 @@ bool LoadFootprintFiles( const wxArrayString& libNames, ...@@ -53,9 +54,8 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if( libNames.GetCount() == 0 ) if( libNames.GetCount() == 0 )
{ {
wxMessageBox( _( "No PCB foot print libraries are listed in the " \ wxMessageBox( _( "No PCB foot print libraries are listed in the current project file." ),
"current project file." ), _( "Project File Error" ), _( "Project File Error" ), wxOK | wxICON_ERROR );
wxOK | wxICON_ERROR );
return false; return false;
} }
...@@ -70,8 +70,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames, ...@@ -70,8 +70,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if( !tmp ) if( !tmp )
{ {
msg.Printf( _( "PCB foot print library file <%s> could not be " \ msg.Printf( _( "PCB foot print library file <%s> could not be found in the default search paths." ),
"found in the default search paths." ),
fn.GetFullName().c_str() ); fn.GetFullName().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
continue; continue;
...@@ -124,8 +123,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames, ...@@ -124,8 +123,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if( !end ) if( !end )
{ {
msg.Printf( _( "Unexpected end of file occurred while " \ msg.Printf( _( "Unexpected end of file occurred while parsing PCB foot print library <%s>." ),
"parsing PCB foot print library <%s>." ),
tmp.c_str() ); tmp.c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
} }
...@@ -159,8 +157,8 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list ) ...@@ -159,8 +157,8 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list )
if( ( LibDoc = wxFopen( fn.GetFullPath(), wxT( "rt" ) ) ) == NULL ) if( ( LibDoc = wxFopen( fn.GetFullPath(), wxT( "rt" ) ) ) == NULL )
{ {
msg.Printf( _( "Could not open PCB foot print library document " \ msg.Printf( _( "Could not open PCB foot print library document file <%s>." ),
"file <%s>." ), fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
return; return;
} }
...@@ -168,8 +166,8 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list ) ...@@ -168,8 +166,8 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list )
GetLine( LibDoc, Line, NULL, sizeof(Line) - 1 ); GetLine( LibDoc, Line, NULL, sizeof(Line) - 1 );
if( strnicmp( Line, ENTETE_LIBDOC, L_ENTETE_LIB ) != 0 ) if( strnicmp( Line, ENTETE_LIBDOC, L_ENTETE_LIB ) != 0 )
{ {
msg.Printf( _( "<%s> is not a valid PCB foot print library " \ msg.Printf( _( "<%s> is not a valid PCB foot print library document file." ),
"document file." ), fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
return; return;
} }
......
...@@ -47,8 +47,7 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName ) ...@@ -47,8 +47,7 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
if( !tmp ) if( !tmp )
{ {
msg.Printf( _( "PCB foot print library file <%s> could not be " \ msg.Printf( _( "PCB foot print library file <%s> could not be found in the default search paths." ),
"found in the default search paths." ),
fn.GetFullName().c_str() ); fn.GetFullName().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR, this ); wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR, this );
continue; continue;
......
...@@ -24,11 +24,12 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar() ...@@ -24,11 +24,12 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
*/ */
{ {
wxMenuItem* item; wxMenuItem* item;
wxMenuBar* menuBar = GetMenuBar(); wxMenuBar* menuBar;
/* Destroy the existing menu bar so it can be rebuilt. This allows /* Destroy the existing menu bar so it can be rebuilt. This allows
* language changes of the menu text on the fly. */ * language changes of the menu text on the fly. */
if( menuBar ) // if( menuBar )
SetMenuBar( NULL ); // SetMenuBar( NULL );
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
...@@ -66,8 +67,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar() ...@@ -66,8 +67,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
_( "Keep Open On Save" ), _( "Keep Open On Save" ),
_( "Prevent CVPcb from exiting after saving " \ _( "Prevent CVPcb from exiting after saving netlist file" ),
"netlist file" ),
wxITEM_CHECK ); wxITEM_CHECK );
configmenu->Append( item ); configmenu->Append( item );
configmenu->AppendSeparator(); configmenu->AppendSeparator();
......
...@@ -135,7 +135,8 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() ...@@ -135,7 +135,8 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
wxString msg, Lineconv = CONV_FROM_UTF8( Line ); wxString msg, Lineconv = CONV_FROM_UTF8( Line );
msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() ); msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() );
DisplayError( this, msg ); DisplayError( this, msg );
fclose( source ); return -3; fclose( source );
return -3;
} }
SetStatusText( _( "Netlist Format: EESchema" ), 0 ); SetStatusText( _( "Netlist Format: EESchema" ), 0 );
......
...@@ -93,8 +93,8 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list ) ...@@ -93,8 +93,8 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
/* Identification du Type de fichier CmpMod */ /* Identification du Type de fichier CmpMod */
if( fgets( Line, 79, source ) == 0 ) if( fgets( Line, 79, source ) == 0 )
{ {
msg.Printf( _( " <%s> does not appear to be a valid Kicad component " \ msg.Printf( _( " <%s> does not appear to be a valid Kicad component library." ),
"library." ), fn.GetFullPath().c_str() ); fn.GetFullPath().c_str() );
wxMessageBox( msg, titleComponentLibErr, wxOK | wxICON_ERROR ); wxMessageBox( msg, titleComponentLibErr, wxOK | wxICON_ERROR );
fclose( source ); fclose( source );
return false; return false;
......
...@@ -26,28 +26,35 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() ...@@ -26,28 +26,35 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar ); SetToolBar( m_HToolBar );
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString, wxBitmap( open_xpm ), m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
wxBitmap( open_xpm ),
_( "Open a NetList file" ) ); _( "Open a NetList file" ) );
m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString, wxBitmap( save_xpm ), m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString,
wxBitmap( save_xpm ),
_( "Save NetList and Footprints List files" ) ); _( "Save NetList and Footprints List files" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString, wxBitmap( config_xpm ), m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
wxBitmap( config_xpm ),
_( "Configuration" ) ); _( "Configuration" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString, wxBitmap( module_xpm ), m_HToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
wxBitmap( module_xpm ),
_( "View selected footprint" ) ); _( "View selected footprint" ) );
m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString, wxBitmap( auto_associe_xpm ), m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
wxBitmap( auto_associe_xpm ),
_( "Automatic Association" ) ); _( "Automatic Association" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString, wxBitmap( left_xpm ), m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
wxBitmap( left_xpm ),
_( "Select previous free component" ) ); _( "Select previous free component" ) );
m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString, wxBitmap( right_xpm ), m_HToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
wxBitmap( right_xpm ),
_( "Select next free component" ) ); _( "Select next free component" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
...@@ -58,7 +65,8 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() ...@@ -58,7 +65,8 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString, m_HToolBar->AddTool( ID_CVPCB_CREATE_STUFF_FILE, wxEmptyString,
wxBitmap( save_cmpstuff_xpm ), wxBitmap( save_cmpstuff_xpm ),
_( "Create export file (component/footprint list, used by eeschema to fill the footprint field of components)" ) ); _( "Create export file (component/footprint list, \
used by eeschema to fill the footprint field of components)" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString, m_HToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
...@@ -89,4 +97,3 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar() ...@@ -89,4 +97,3 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
// the changes // the changes
m_HToolBar->Realize(); m_HToolBar->Realize();
} }
...@@ -248,8 +248,7 @@ void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event ) ...@@ -248,8 +248,7 @@ void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event )
else else
message += _( "on the current sheet?" ); message += _( "on the current sheet?" );
message += _( "\n\nThis operation will change the current annotation and " \ message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
"cannot be undone." );
response = wxMessageBox( message, wxT( "" ), response = wxMessageBox( message, wxT( "" ),
wxICON_EXCLAMATION | wxOK | wxCANCEL ); wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
...@@ -274,8 +273,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event ) ...@@ -274,8 +273,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event )
else else
message += _( "the current sheet?" ); message += _( "the current sheet?" );
message += _( "\n\nThis operation will clear the existing annotation " \ message += _( "\n\nThis operation will clear the existing annotation and cannot be undone." );
"and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), response = wxMessageBox( message, wxT( "" ),
wxICON_EXCLAMATION | wxOK | wxCANCEL ); wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if (response == wxCANCEL)
......
...@@ -121,8 +121,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) ...@@ -121,8 +121,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
{ {
wxString msg; wxString msg;
err = TRUE; err = TRUE;
msg.Printf( wxT( "HandleBlockPLace() : m_BlockDrawStruct = " \ msg.Printf( wxT( "HandleBlockPLace() : m_BlockDrawStruct = NULL (cmd %d, state %d)" ),
"NULL (cmd %d, state %d)" ),
block->m_Command, block->m_State ); block->m_Command, block->m_State );
DisplayError( this, msg ); DisplayError( this, msg );
} }
...@@ -202,11 +201,12 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) ...@@ -202,11 +201,12 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
if( block->m_BlockDrawStruct ) if( block->m_BlockDrawStruct )
{ {
DisplayError( this, DisplayError( this,
wxT( "HandleBlockPLace() error: DrawStruct != Null" ) ); wxT( "HandleBlockPLace() error: DrawStruct != Null" ) );
block->m_BlockDrawStruct = NULL; block->m_BlockDrawStruct = NULL;
} }
SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor, wxEmptyString ); SetToolID( m_ID_current_state, DrawPanel->m_PanelDefaultCursor,
wxEmptyString );
} }
......
...@@ -508,8 +508,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line, ...@@ -508,8 +508,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line,
break; break;
default: default:
errorMsg.Printf( wxT( "Undefined DRAW command in line %d\n" \ errorMsg.Printf( wxT( "Undefined DRAW command in line %d\n%s, aborted." ),
"%s, aborted." ), *lineNum, line ); *lineNum, line );
m_Drawings = headEntry; m_Drawings = headEntry;
return false; return false;
} }
...@@ -526,8 +526,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line, ...@@ -526,8 +526,8 @@ bool EDA_LibComponentStruct::LoadDrawEntries( FILE* f, char* line,
{ {
if( GetLine( f, line, lineNum, 1024 ) == NULL ) if( GetLine( f, line, lineNum, 1024 ) == NULL )
{ {
errorMsg = wxT( "File ended prematurely while attempting" \ errorMsg = wxT( "File ended prematurely while attempting \
"to flush to end of drawing section." ); to flush to end of drawing section." );
return false; return false;
} }
} while( strncmp( line, "ENDDRAW", 7 ) != 0 ); } while( strncmp( line, "ENDDRAW", 7 ) != 0 );
......
...@@ -130,8 +130,7 @@ bool LibDrawPin::Load( char* line, wxString& errorMsg ) ...@@ -130,8 +130,7 @@ bool LibDrawPin::Load( char* line, wxString& errorMsg )
if( i < 11 ) if( i < 11 )
{ {
errorMsg.Printf( wxT( "pin only had %d parameters of the " \ errorMsg.Printf( wxT( "pin only had %d parameters of the required 11 or 12" ), i );
"required 11 or 12" ), i );
return false; return false;
} }
......
...@@ -864,7 +864,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, c ...@@ -864,7 +864,7 @@ void SCH_GLOBALLABEL::CreateGraphicShape( std::vector <wxPoint>& aCorner_list, c
// Create outline shape : 6 points // Create outline shape : 6 points
int x = symb_len + width + 3; int x = symb_len + width + 3;
int y = HalfSize * 1.5 + width + 3; // 50% more for negation bar int y = wxRound( (double)HalfSize * 1.5 + (double)width + 3.0 ); // 50% more for negation bar
aCorner_list.push_back( wxPoint( 0, 0 ) ); // Starting point (anchor) aCorner_list.push_back( wxPoint( 0, 0 ) ); // Starting point (anchor)
aCorner_list.push_back( wxPoint( 0, -y ) ); // Up aCorner_list.push_back( wxPoint( 0, -y ) ); // Up
aCorner_list.push_back( wxPoint( -x, -y ) ); // left Up aCorner_list.push_back( wxPoint( -x, -y ) ); // left Up
......
...@@ -129,8 +129,8 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg ) ...@@ -129,8 +129,8 @@ bool LibDrawArc::Load( char* line, wxString& errorMsg )
&m_Width, tmp, &startx, &starty, &endx, &endy ); &m_Width, tmp, &startx, &starty, &endx, &endy );
if( cnt < 8 ) if( cnt < 8 )
{ {
errorMsg.Printf( wxT( "arc only had %d parameters of the " \ errorMsg.Printf( _( "arc only had %d parameters of the required 8" ),
"required 8" ), cnt ); cnt );
return false; return false;
} }
...@@ -268,8 +268,8 @@ EDA_Rect LibDrawArc::GetBoundingBox() ...@@ -268,8 +268,8 @@ EDA_Rect LibDrawArc::GetBoundingBox()
if( ( normStart == nullPoint ) || ( normEnd == nullPoint ) if( ( normStart == nullPoint ) || ( normEnd == nullPoint )
|| ( m_Rayon == 0 ) ) || ( m_Rayon == 0 ) )
{ {
wxLogDebug( wxT(" Invalid arc drawing definition, center(%d, %d) " \ wxLogDebug( wxT("Invalid arc drawing definition, center(%d, %d) \
"start(%d, %d), end(%d, %d), radius %d" ), start(%d, %d), end(%d, %d), radius %d" ),
m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x, m_Pos.x, m_Pos.y, m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x,
m_ArcEnd.y, m_Rayon ); m_ArcEnd.y, m_Rayon );
return rect; return rect;
...@@ -362,8 +362,8 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg ) ...@@ -362,8 +362,8 @@ bool LibDrawCircle::Load( char* line, wxString& errorMsg )
&m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp ); &m_Rayon, &m_Unit, &m_Convert, &m_Width, tmp );
if( cnt < 6 ) if( cnt < 6 )
{ {
errorMsg.Printf( wxT( "circle only had %d parameters of the " \ errorMsg.Printf( _( "circle only had %d parameters of the required 6" ),
"required 6" ), cnt ); cnt );
return false; return false;
} }
...@@ -501,8 +501,8 @@ bool LibDrawText::Load( char* line, wxString& errorMsg ) ...@@ -501,8 +501,8 @@ bool LibDrawText::Load( char* line, wxString& errorMsg )
if( cnt < 8 ) if( cnt < 8 )
{ {
errorMsg.Printf( wxT( "text only had %d parameters of the " \ errorMsg.Printf( _( "text only had %d parameters of the required 8" ),
"required 8" ), cnt ); cnt );
return false; return false;
} }
...@@ -609,8 +609,8 @@ bool LibDrawSquare::Load( char* line, wxString& errorMsg ) ...@@ -609,8 +609,8 @@ bool LibDrawSquare::Load( char* line, wxString& errorMsg )
if( cnt < 7 ) if( cnt < 7 )
{ {
errorMsg.Printf( wxT( "rectangle only had %d parameters of the " \ errorMsg.Printf( _( "rectangle only had %d parameters of the required 7" ),
"required 7" ), cnt ); cnt );
return false; return false;
} }
...@@ -814,13 +814,12 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg ) ...@@ -814,13 +814,12 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
if( i < 4 ) if( i < 4 )
{ {
errorMsg.Printf( wxT( "polyline only had %d parameters of the " \ errorMsg.Printf( _( "polyline only had %d parameters of the required 4" ), i );
"required 4" ), i );
return false; return false;
} }
if ( ccount <= 0 ) if ( ccount <= 0 )
{ {
errorMsg.Printf( wxT( "polyline count parameter %d is invalid" ), errorMsg.Printf( _( "polyline count parameter %d is invalid" ),
ccount ); ccount );
return false; return false;
} }
...@@ -836,14 +835,14 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg ) ...@@ -836,14 +835,14 @@ bool LibDrawPolyline::Load( char* line, wxString& errorMsg )
p = strtok( NULL, " \t\n" ); p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.x ) != 1 ) if( sscanf( p, "%d", &pt.x ) != 1 )
{ {
errorMsg.Printf( wxT( "polyline point %d X position not defined" ), errorMsg.Printf( _( "polyline point %d X position not defined" ),
i ); i );
return false; return false;
} }
p = strtok( NULL, " \t\n" ); p = strtok( NULL, " \t\n" );
if( sscanf( p, "%d", &pt.y ) != 1 ) if( sscanf( p, "%d", &pt.y ) != 1 )
{ {
errorMsg.Printf( wxT( "polyline point %d Y position not defined" ), errorMsg.Printf( _( "polyline point %d Y position not defined" ),
i ); i );
return false; return false;
} }
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define COMPONENT_CLASS_H #define COMPONENT_CLASS_H
#include "base_struct.h"
#include "class_sch_screen.h" #include "class_sch_screen.h"
#include <wx/arrstr.h> #include <wx/arrstr.h>
#include <wx/dynarray.h> #include <wx/dynarray.h>
......
#include <wx/checklst.h>
#include <wx/tooltip.h> #include <wx/tooltip.h>
#include <algorithm> #include <algorithm>
......
...@@ -15,17 +15,6 @@ ...@@ -15,17 +15,6 @@
#pragma implementation "dialog_erc.h" #pragma implementation "dialog_erc.h"
#endif #endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes ////@begin includes
////@end includes ////@end includes
#include "fctsys.h" #include "fctsys.h"
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
#include "wx/checklst.h"
#include "protos.h" #include "protos.h"
......
This diff is collapsed.
...@@ -539,12 +539,10 @@ EDA_LibComponentStruct* Read_Component_Definition( WinEDA_DrawFrame* frame, ...@@ -539,12 +539,10 @@ EDA_LibComponentStruct* Read_Component_Definition( WinEDA_DrawFrame* frame,
if( !Res ) if( !Res )
{ /* Something went wrong there. */ { /* Something went wrong there. */
if( errorMsg.IsEmpty() ) if( errorMsg.IsEmpty() )
Msg.Printf( wxT( "Error at line %d of library \n\"%s\",\n" \ Msg.Printf( wxT( "Error at line %d of library \n\"%s\",\nlibrary not loaded" ),
"library not loaded" ),
*LineNum, currentLibraryName.GetData() ); *LineNum, currentLibraryName.GetData() );
else else
Msg.Printf( wxT( "Error <%s> at line %d of library \n\"%s\"," \ Msg.Printf( wxT( "Error <%s> at line %d of library \n\"%s\",\nlibrary not loaded" ),
"\nlibrary not loaded" ),
errorMsg.c_str(), *LineNum, errorMsg.c_str(), *LineNum,
currentLibraryName.GetData() ); currentLibraryName.GetData() );
DisplayError( frame, Msg ); DisplayError( frame, Msg );
...@@ -621,18 +619,17 @@ static LibEDA_BaseStruct* GetDrawEntry (WinEDA_DrawFrame* frame, FILE* f, ...@@ -621,18 +619,17 @@ static LibEDA_BaseStruct* GetDrawEntry (WinEDA_DrawFrame* frame, FILE* f,
break; break;
default: default:
MsgLine.Printf( wxT( "Undefined DRAW command in line %d\n" \ MsgLine.Printf( wxT( "Undefined DRAW command in line %d\n%s, aborted." ),
"%s, aborted." ), *LineNum, Line ); *LineNum, Line );
DisplayError( frame, MsgLine ); DisplayError( frame, MsgLine );
return Head; return Head;
} }
if( !entryLoaded ) if( !entryLoaded )
{ {
MsgLine.Printf( wxT( "> in DRAW command %c in line %d" ), Line[0], MsgLine.Printf( wxT( "Error <%s %s> in DRAW command %c in line %d, aborted." ),
*LineNum ); errorMsg.c_str(), MsgLine.c_str(),
MsgLine = wxT( "Error <" ) + errorMsg + MsgLine + Line[0], *LineNum );
wxT( ", aborted." );
DisplayError( frame, MsgLine ); DisplayError( frame, MsgLine );
SAFE_DELETE( New ); SAFE_DELETE( New );
......
...@@ -81,8 +81,7 @@ wxString g_SymbolExtBuffer( wxT( "sym" ) ); ...@@ -81,8 +81,7 @@ wxString g_SymbolExtBuffer( wxT( "sym" ) );
const wxString CompLibFileExtension( wxT( "lib" ) ); const wxString CompLibFileExtension( wxT( "lib" ) );
const wxString CompLibFileWildcard( wxT( "Kicad component library file " \ const wxString CompLibFileWildcard( wxT( "Kicad component library file (*.lib)|*.lib" ) );
"(*.lib)|*.lib" ) );
wxString g_SimulatorCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..) wxString g_SimulatorCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..)
wxString g_NetListerCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..) wxString g_NetListerCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..)
......
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
#include "libcmp.h" #include "libcmp.h"
#include "general.h" #include "general.h"
//#include "protos.h"
#include "wx/image.h"
#include "wx/imaglist.h" #include "wx/imaglist.h"
#include "wx/treectrl.h" #include "wx/treectrl.h"
......
...@@ -144,9 +144,9 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) ...@@ -144,9 +144,9 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event )
if( createLib && success ) if( createLib && success )
{ {
msg = fn.GetFullPath() + _( " - OK" ); msg = fn.GetFullPath() + _( " - OK" );
DisplayInfoMessage( this, _( "Note: this new library will be available " \ DisplayInfoMessage( this,
"only if it is loaded by eeschema.\nModify " _( "Note: this new library will be available only \
"eeschema config if you want use it." ) ); if it is loaded by eeschema.\nModify eeschema config if you want use it." ) );
} }
else else
msg = _( "Error creating " ) + fn.GetFullName(); msg = _( "Error creating " ) + fn.GetFullName();
......
...@@ -19,9 +19,9 @@ extern int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, ...@@ -19,9 +19,9 @@ extern int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f,
wxString& aMsgDiag, int* aLineNum, wxString& aMsgDiag, int* aLineNum,
BASE_SCREEN* Window ); BASE_SCREEN* Window );
extern int ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, extern bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f,
wxString& aMsgDiag, int* aLineNum, wxString& aMsgDiag, int* aLineNum,
BASE_SCREEN* Window ); BASE_SCREEN* Window );
extern int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, extern int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
wxString& aMsgDiag, int* aLineNum, wxString& aMsgDiag, int* aLineNum,
...@@ -90,9 +90,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -90,9 +90,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
int ver = version - '0'; int ver = version - '0';
if( ver > EESCHEMA_VERSION ) if( ver > EESCHEMA_VERSION )
{ {
MsgDiag = FullFileName + _( " was created by a more recent " \ MsgDiag = FullFileName + _( " was created by a more recent \
"version of EESchema and may not load " \ version of EESchema and may not load correctly. Please consider updating!" );
"correctly. Please consider updating!" );
DisplayInfoMessage( this, MsgDiag ); DisplayInfoMessage( this, MsgDiag );
} }
...@@ -100,10 +99,10 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -100,10 +99,10 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
// Compile it if the new version is unreadable by previous eeschema versions // Compile it if the new version is unreadable by previous eeschema versions
else if( ver < EESCHEMA_VERSION ) else if( ver < EESCHEMA_VERSION )
{ {
MsgDiag = FullFileName + _( " was created by an older version of " \ MsgDiag = FullFileName + _( " was created by an older version of \
"EESchema. It will be stored in the new " \ EESchema. It will be stored in the new file format when you save this file \
"file format when you save this file " \ again." );
"again." );
DisplayInfoMessage( this, MsgDiag ); DisplayInfoMessage( this, MsgDiag );
} }
#endif #endif
...@@ -173,8 +172,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -173,8 +172,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'W': /* Its a Segment (WIRE or BUS) item. */ case 'W': /* Its a Segment (WIRE or BUS) item. */
if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 ) if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 )
{ {
MsgDiag.Printf( wxT( "EESchema file Segment struct error " \ MsgDiag.Printf( wxT( "EESchema file Segment struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
break; break;
...@@ -193,8 +192,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -193,8 +192,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
&SegmentStruct->m_Start.y, &SegmentStruct->m_End.x, &SegmentStruct->m_Start.y, &SegmentStruct->m_End.x,
&SegmentStruct->m_End.y ) != 4 ) &SegmentStruct->m_End.y ) != 4 )
{ {
MsgDiag.Printf( wxT( "EESchema file Segment struct error " \ MsgDiag.Printf( wxT( "EESchema file Segment struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
SAFE_DELETE( SegmentStruct ); SAFE_DELETE( SegmentStruct );
...@@ -212,8 +211,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -212,8 +211,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'E': /* Its a Raccord (WIRE or BUS) item. */ case 'E': /* Its a Raccord (WIRE or BUS) item. */
if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 ) if( sscanf( SLine, "%s %s", Name1, Name2 ) != 2 )
{ {
MsgDiag.Printf( wxT( "EESchema file record struct error at " \ MsgDiag.Printf( wxT( "EESchema file record struct error at line %d, aborted" ),
"line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
break; break;
...@@ -230,8 +229,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -230,8 +229,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
&RaccordStruct->m_Pos.y, &RaccordStruct->m_Size.x, &RaccordStruct->m_Pos.y, &RaccordStruct->m_Size.x,
&RaccordStruct->m_Size.y ) != 4 ) &RaccordStruct->m_Size.y ) != 4 )
{ {
MsgDiag.Printf( wxT( "EESchema file Bus Entry struct error " \ MsgDiag.Printf( wxT( "EESchema file Bus Entry struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
SAFE_DELETE( RaccordStruct ); SAFE_DELETE( RaccordStruct );
...@@ -250,8 +249,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -250,8 +249,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'P': /* Its a polyline item. */ case 'P': /* Its a polyline item. */
if( sscanf( SLine, "%s %s %d", Name1, Name2, &ii ) != 3 ) if( sscanf( SLine, "%s %s %d", Name1, Name2, &ii ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file polyline struct error " \ MsgDiag.Printf( wxT( "EESchema file polyline struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
break; break;
...@@ -270,8 +269,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -270,8 +269,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
if( fgets( Line, 256 - 1, f ) == NULL if( fgets( Line, 256 - 1, f ) == NULL
|| sscanf( Line, "%d %d", &point.x, &point.y ) != 2 ) || sscanf( Line, "%d %d", &point.x, &point.y ) != 2 )
{ {
MsgDiag.Printf( wxT( "EESchema file polyline struct " \ MsgDiag.Printf( wxT( "EESchema file polyline struct error \
"error at line %d, aborted" ), at line %d, aborted" ),
LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
...@@ -295,8 +294,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -295,8 +294,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
if( sscanf( SLine, "%s %d %d", Name1, &ConnectionStruct->m_Pos.x, if( sscanf( SLine, "%s %d %d", Name1, &ConnectionStruct->m_Pos.x,
&ConnectionStruct->m_Pos.y ) != 3 ) &ConnectionStruct->m_Pos.y ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file connection struct error " \ MsgDiag.Printf( wxT( "EESchema file connection struct error \
"at line %d, aborted" ), LineCount ); at line %d, aborted" ), LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
SAFE_DELETE( ConnectionStruct ); SAFE_DELETE( ConnectionStruct );
...@@ -311,8 +310,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -311,8 +310,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'N': /* It is a NoConnect item. */ case 'N': /* It is a NoConnect item. */
if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 ) if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file NoConnect struct error " \ MsgDiag.Printf( wxT( "EESchema file NoConnect struct error at line %d, aborted" ),
"at line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
} }
...@@ -327,8 +326,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -327,8 +326,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
case 'K': /* It is a Marker item. */ case 'K': /* It is a Marker item. */
if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 ) if( sscanf( SLine, "%s %d %d", Name1, &pos.x, &pos.y ) != 3 )
{ {
MsgDiag.Printf( wxT( "EESchema file marker struct error " \ MsgDiag.Printf( wxT( "EESchema file marker struct error line %d, aborted" ),
"line %d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
Failed = true; Failed = true;
} }
...@@ -372,8 +371,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, ...@@ -372,8 +371,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen,
default: default:
Failed = true; Failed = true;
MsgDiag.Printf( wxT( "EESchema file undefined object at line " \ MsgDiag.Printf( wxT( "EESchema file undefined object at line %d, aborted" ),
"%d, aborted" ), LineCount ); LineCount );
MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line ); MsgDiag << wxT( "\n" ) << CONV_FROM_UTF8( Line );
break; break;
} }
......
...@@ -733,7 +733,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen, ...@@ -733,7 +733,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
break; break;
dx = aRefPoint.x - Circle->m_Pos.x; dx = aRefPoint.x - Circle->m_Pos.x;
dy = aRefPoint.y + Circle->m_Pos.y; dy = aRefPoint.y + Circle->m_Pos.y;
int dist = (int) sqrt( dx * dx + dy * dy ); int dist = (int) sqrt( (double)( dx * dx + dy * dy ) );
if( abs( dist - Circle->m_Rayon ) <= seuil ) if( abs( dist - Circle->m_Rayon ) <= seuil )
return DrawItem; return DrawItem;
} }
......
...@@ -40,21 +40,6 @@ static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction, ...@@ -40,21 +40,6 @@ static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
WinEDA_SchematicFrame* frame ); WinEDA_SchematicFrame* frame );
/***********************************************************************/
void WinEDA_SchematicFrame::ToolOnRightClick( wxCommandEvent& event )
/***********************************************************************/
{
int id = event.GetId();
switch( id )
{
default:
DisplayError( this, wxT( "ToolOnRightClick() error" ) );
break;
}
}
/*****************************************************************/ /*****************************************************************/
bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu ) wxMenu* PopMenu )
...@@ -66,7 +51,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos, ...@@ -66,7 +51,7 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
*/ */
{ {
SCH_ITEM* DrawStruct = (SCH_ITEM*) GetScreen()->GetCurItem(); SCH_ITEM* DrawStruct = (SCH_ITEM*) GetScreen()->GetCurItem();
bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE); bool BlockActive = (GetScreen()->BlockLocate.m_Command != BLOCK_IDLE);
DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu DrawPanel->m_CanStartBlock = -1; // Ne pas engager un debut de bloc sur validation menu
......
...@@ -774,8 +774,9 @@ static void CreateImagePins( LibDrawPin* Pin ) ...@@ -774,8 +774,9 @@ static void CreateImagePins( LibDrawPin* Pin )
* creation d'une pin * creation d'une pin
*/ */
{ {
int ii, CreateConv = false; int ii;
LibDrawPin* NewPin; LibDrawPin* NewPin;
bool CreateConv = false;
if( g_EditPinByPinIsOn ) if( g_EditPinByPinIsOn )
return; return;
......
...@@ -681,7 +681,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FullFileName, ...@@ -681,7 +681,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FullFileName,
#undef STRUCT #undef STRUCT
#define STRUCT ( (DrawJunctionStruct*) DrawList ) #define STRUCT ( (DrawJunctionStruct*) DrawList )
x1 = STRUCT->m_Pos.x; y1 = STRUCT->m_Pos.y; x1 = STRUCT->m_Pos.x; y1 = STRUCT->m_Pos.y;
PlotCercle( wxPoint( x1, y1 ), true, DRAWJUNCTION_SIZE * 2 ); PlotCercle( wxPoint( x1, y1 ), DRAWJUNCTION_SIZE * 2, true );
break; break;
case TYPE_SCH_TEXT: case TYPE_SCH_TEXT:
......
...@@ -16,16 +16,6 @@ ...@@ -16,16 +16,6 @@
#pragma implementation "plotps.h" #pragma implementation "plotps.h"
#endif #endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -37,8 +27,6 @@ ...@@ -37,8 +27,6 @@
#include "plot_common.h" #include "plot_common.h"
#include "protos.h" #include "protos.h"
#include "wx/defs.h"
// coeff de conversion dim en 1 mil -> dim en unite PS: // coeff de conversion dim en 1 mil -> dim en unite PS:
const double SCALE_PS = 0.001; const double SCALE_PS = 0.001;
......
# 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 @@ ...@@ -4,17 +4,18 @@
/* read the generic netlist created by eeschema and convert it to a pads-pcb form /* read the generic netlist created by eeschema and convert it to a pads-pcb form
*/ */
#include "config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h>
#include <ctype.h>
#ifdef __UNIX__ #if defined( HAVE_STRINGS_H )
#define stricmp strcasecmp #include <strings.h>
#define strnicmp strncasecmp
#endif #endif
#include <ctype.h>
/* Pads-pcb sample: /* Pads-pcb sample:
*PADS-PCB* *PADS-PCB*
*PART* *PART*
......
...@@ -132,20 +132,23 @@ SCH_ITEM* ReadTextDescr( FILE* aFile, ...@@ -132,20 +132,23 @@ SCH_ITEM* ReadTextDescr( FILE* aFile,
} }
else else
{ {
wxString val= CONV_FROM_UTF8( text ); wxString val = CONV_FROM_UTF8( text );
for (;;)
{ for( ;; )
int i=val.find(wxT("\\n")); {
if (i==wxNOT_FOUND) int i=val.find( wxT( "\\n" ) );
break;
if( i == wxNOT_FOUND )
val.erase(i,2); break;
val.insert(i,wxT("\n")); val.erase( i, 2 );
} val.insert( i, wxT( "\n" ) );
}
SCH_TEXT* TextStruct = new SCH_TEXT( pos, val ); SCH_TEXT* TextStruct = new SCH_TEXT( pos, val );
TextStruct->m_Size.x = TextStruct->m_Size.y = size; TextStruct->m_Size.x = TextStruct->m_Size.y = size;
TextStruct->SetSchematicTextOrientation( orient ); TextStruct->SetSchematicTextOrientation( orient );
if( isdigit( Name3[0] ) ) if( isdigit( Name3[0] ) )
{ {
thickness = atol( Name3 ); thickness = atol( Name3 );
...@@ -265,8 +268,9 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, ...@@ -265,8 +268,9 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
{ {
if( sscanf( ptcar, "%d", &size ) != 1 ) if( sscanf( ptcar, "%d", &size ) != 1 )
{ {
aMsgDiag.Printf( wxT( "EESchema file sheet Label Caract " \ aMsgDiag.Printf( wxT( "EESchema file sheet Label Caract \
"error line %d, aborted\n" ), *aLineNum ); error line %d, aborted\n" ),
*aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
DisplayError( frame, aMsgDiag ); DisplayError( frame, aMsgDiag );
} }
...@@ -304,8 +308,9 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, ...@@ -304,8 +308,9 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
&SheetLabelStruct->m_Pos.x, &SheetLabelStruct->m_Pos.y, &SheetLabelStruct->m_Pos.x, &SheetLabelStruct->m_Pos.y,
&size ) != 5 ) &size ) != 5 )
{ {
aMsgDiag.Printf( wxT( "EESchema file Sheet Label Caract " \ aMsgDiag.Printf( wxT( "EESchema file Sheet Label Caract \
"error line %d, aborted\n" ), *aLineNum ); error line %d, aborted\n" ),
*aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
DisplayError( frame, aMsgDiag ); DisplayError( frame, aMsgDiag );
continue; continue;
...@@ -341,8 +346,8 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, ...@@ -341,8 +346,8 @@ int ReadSheetDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
if( strnicmp( "$End", Line, 4 ) != 0 ) if( strnicmp( "$End", Line, 4 ) != 0 )
{ {
aMsgDiag.Printf( wxT( "**EESchema file end_sheet struct error at " \ aMsgDiag.Printf( wxT( "**EESchema file end_sheet struct error at line %d, aborted\n" ),
"line %d, aborted\n" ), *aLineNum ); *aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
Failed = TRUE; Failed = TRUE;
} }
...@@ -394,8 +399,8 @@ bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag, ...@@ -394,8 +399,8 @@ bool ReadSchemaDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
if( SheetFormatList[ii] == NULL ) if( SheetFormatList[ii] == NULL )
{ {
/* Erreur ici: descr non trouvee */ /* Erreur ici: descr non trouvee */
aMsgDiag.Printf( wxT( "EESchema file Dims Caract error line %d, " \ aMsgDiag.Printf( wxT( "EESchema file Dims Caract error line %d, \aborted\n" ),
"aborted\n" ), *aLineNum ); *aLineNum );
aMsgDiag << CONV_FROM_UTF8( Line ); aMsgDiag << CONV_FROM_UTF8( Line );
DisplayError( frame, aMsgDiag ); DisplayError( frame, aMsgDiag );
} }
......
...@@ -102,11 +102,6 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) ...@@ -102,11 +102,6 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
ID_SCHEMATIC_VERTICAL_TOOLBAR_END, ID_SCHEMATIC_VERTICAL_TOOLBAR_END,
WinEDA_SchematicFrame::Process_Special_Functions ) WinEDA_SchematicFrame::Process_Special_Functions )
EVT_TOOL_RCLICKED( ID_LABEL_BUTT, WinEDA_SchematicFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_GLABEL_BUTT, WinEDA_SchematicFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_HIERLABEL_BUTT,
WinEDA_SchematicFrame::ToolOnRightClick )
EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE, EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
WinEDA_SchematicFrame::Process_Special_Functions ) WinEDA_SchematicFrame::Process_Special_Functions )
......
...@@ -266,10 +266,8 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event ) ...@@ -266,10 +266,8 @@ void WinEDA_SheetPropertiesFrame::SheetPropertiesAccept( wxCommandEvent& event )
if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() ) if( ( fn.GetFullPath() != m_CurrentSheet->GetFileName() )
|| ( m_CurrentSheet->m_AssociatedScreen == NULL) ) || ( m_CurrentSheet->m_AssociatedScreen == NULL) )
{ {
msg = _( "Changing a Filename can change all the schematic " \ msg = _( "Changing a Filename can change all the schematic \
"structures and cannot be undone." ); structures and cannot be undone.\nOk to continue renaming?" );
msg << wxT( "\n" );
msg << _( "Ok to continue renaming?" );
if( m_CurrentSheet->m_AssociatedScreen == NULL || IsOK( NULL, msg ) ) if( m_CurrentSheet->m_AssociatedScreen == NULL || IsOK( NULL, msg ) )
{ //do not prompt on a new sheet. in fact, we should not allow a sheet to be created { //do not prompt on a new sheet. in fact, we should not allow a sheet to be created
......
...@@ -17,28 +17,28 @@ ...@@ -17,28 +17,28 @@
/* class WinEDA_ViewlibFrame */ /* class WinEDA_ViewlibFrame */
/*****************************/ /*****************************/
BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame ) BEGIN_EVENT_TABLE( WinEDA_ViewlibFrame, WinEDA_DrawFrame )
/* Window events */ /* Window events */
EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow ) EVT_CLOSE( WinEDA_ViewlibFrame::OnCloseWindow )
EVT_SIZE( WinEDA_ViewlibFrame::OnSize ) EVT_SIZE( WinEDA_ViewlibFrame::OnSize )
EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate ) EVT_ACTIVATE( WinEDA_DrawFrame::OnActivate )
/* Sash drag events */ /* Sash drag events */
EVT_SASH_DRAGGED( ID_LIBVIEW_LIBWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) EVT_SASH_DRAGGED( ID_LIBVIEW_LIBWINDOW, WinEDA_ViewlibFrame::OnSashDrag )
EVT_SASH_DRAGGED( ID_LIBVIEW_CMPWINDOW, WinEDA_ViewlibFrame::OnSashDrag ) EVT_SASH_DRAGGED( ID_LIBVIEW_CMPWINDOW, WinEDA_ViewlibFrame::OnSashDrag )
/* Toolbar events */ /* Toolbar events */
EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL, EVT_TOOL_RANGE( ID_LIBVIEW_START_H_TOOL, ID_LIBVIEW_END_H_TOOL,
WinEDA_ViewlibFrame::Process_Special_Functions ) WinEDA_ViewlibFrame::Process_Special_Functions )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom ) EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_ViewlibFrame::OnZoom )
EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
WinEDA_ViewlibFrame::ExportToSchematicLibraryPart ) WinEDA_ViewlibFrame::ExportToSchematicLibraryPart )
EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER, EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER,
WinEDA_ViewlibFrame::Process_Special_Functions ) WinEDA_ViewlibFrame::Process_Special_Functions )
/* listbox events */ /* listbox events */
EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList ) EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, WinEDA_ViewlibFrame::ClickOnLibList )
EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList ) EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, WinEDA_ViewlibFrame::ClickOnCmpList )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -58,13 +58,13 @@ static wxAcceleratorEntry accels[] = ...@@ -58,13 +58,13 @@ static wxAcceleratorEntry accels[] =
#define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) ) #define ACCEL_TABLE_CNT ( sizeof( accels ) / sizeof( wxAcceleratorEntry ) )
#define EXTRA_BORDER_SIZE 2 #define EXTRA_BORDER_SIZE 2
/******************************************************************************/
WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
LibraryStruct* Library, LibraryStruct* Library,
wxSemaphore* semaphore ) : wxSemaphore* semaphore ) :
WinEDA_DrawFrame( father, VIEWER_FRAME, _( "Library browser" ), WinEDA_DrawFrame( father, VIEWER_FRAME, _( "Library browser" ),
wxDefaultPosition, wxDefaultSize ) wxDefaultPosition, wxDefaultSize )
/******************************************************************************/
{ {
wxAcceleratorTable table( ACCEL_TABLE_CNT, accels ); wxAcceleratorTable table( ACCEL_TABLE_CNT, accels );
...@@ -101,16 +101,18 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, ...@@ -101,16 +101,18 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
{ {
// Creates the libraries window display // Creates the libraries window display
m_LibListWindow = m_LibListWindow =
new wxSashLayoutWindow( this, ID_LIBVIEW_LIBWINDOW, win_pos, m_LibListSize, new wxSashLayoutWindow( this, ID_LIBVIEW_LIBWINDOW, win_pos,
wxCLIP_CHILDREN | wxSW_3D, wxT( m_LibListSize, wxCLIP_CHILDREN | wxSW_3D,
"LibWindow" ) ); wxT( "LibWindow" ) );
m_LibListWindow->SetOrientation( wxLAYOUT_VERTICAL ); m_LibListWindow->SetOrientation( wxLAYOUT_VERTICAL );
m_LibListWindow->SetAlignment( wxLAYOUT_LEFT ); m_LibListWindow->SetAlignment( wxLAYOUT_LEFT );
m_LibListWindow->SetSashVisible( wxSASH_RIGHT, TRUE ); m_LibListWindow->SetSashVisible( wxSASH_RIGHT, TRUE );
m_LibListWindow->SetExtraBorderSize( EXTRA_BORDER_SIZE ); m_LibListWindow->SetExtraBorderSize( EXTRA_BORDER_SIZE );
m_LibList = new wxListBox( m_LibListWindow, ID_LIBVIEW_LIB_LIST, wxPoint( 0, 0 ), m_LibList =
m_LibListWindow->GetClientSize() - wxSize(EXTRA_BORDER_SIZE*2,0), new wxListBox( m_LibListWindow, ID_LIBVIEW_LIB_LIST,
0, NULL, wxLB_HSCROLL ); wxPoint( 0, 0 ),
m_LibListWindow->GetClientSize() - wxSize(EXTRA_BORDER_SIZE*2,0),
0, NULL, wxLB_HSCROLL );
} }
else else
{ {
...@@ -123,8 +125,9 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, ...@@ -123,8 +125,9 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
win_pos.x = m_LibListSize.x; win_pos.x = m_LibListSize.x;
win_pos.y = 0; win_pos.y = 0;
m_CmpListWindow = new wxSashLayoutWindow( this, ID_LIBVIEW_CMPWINDOW, m_CmpListWindow = new wxSashLayoutWindow( this, ID_LIBVIEW_CMPWINDOW,
win_pos, m_CmpListSize, win_pos, m_CmpListSize,
wxCLIP_CHILDREN | wxSW_3D, wxT( "CmpWindow" ) ); wxCLIP_CHILDREN | wxSW_3D,
wxT( "CmpWindow" ) );
m_CmpListWindow->SetOrientation( wxLAYOUT_VERTICAL ); m_CmpListWindow->SetOrientation( wxLAYOUT_VERTICAL );
// m_CmpListWindow->SetAlignment( wxLAYOUT_LEFT ); // m_CmpListWindow->SetAlignment( wxLAYOUT_LEFT );
...@@ -467,4 +470,3 @@ void WinEDA_ViewlibFrame::SaveSettings() ...@@ -467,4 +470,3 @@ void WinEDA_ViewlibFrame::SaveSettings()
cfg->Write( LIBLIST_WIDTH_KEY, m_LibListSize.x ); cfg->Write( LIBLIST_WIDTH_KEY, m_LibListSize.x );
cfg->Write( CMPLIST_WIDTH_KEY, m_CmpListSize.x ); cfg->Write( CMPLIST_WIDTH_KEY, m_CmpListSize.x );
} }
...@@ -13,9 +13,6 @@ ...@@ -13,9 +13,6 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
static void Process_Move_Item( WinEDA_GerberFrame* frame,
EDA_BaseStruct* DrawStruct, wxDC* DC );
/************************************************************************/ /************************************************************************/
void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/************************************************************************/ /************************************************************************/
...@@ -31,15 +28,10 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -31,15 +28,10 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
if( DrawStruct && DrawStruct->m_Flags ) // Commande "POPUP" en cours if( DrawStruct && DrawStruct->m_Flags ) // Commande "POPUP" en cours
{ {
switch( DrawStruct->Type() ) msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ),
{ (unsigned) DrawStruct->Type(),
default: (unsigned) DrawStruct->m_Flags );
msg.Printf( DisplayError( this, msg );
wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ),
(unsigned) DrawStruct->Type(),
(unsigned) DrawStruct->m_Flags );
DisplayError( this, msg );
}
} }
else else
{ {
...@@ -221,11 +213,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -221,11 +213,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) ); SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) );
break; break;
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
DrawPanel->MouseToCursorSchema();
Process_Move_Item( this, GetScreen()->GetCurItem(), &dc );
break;
case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER:
((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice(); ((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_SelLayerBox->GetChoice();
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
...@@ -308,29 +295,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -308,29 +295,6 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
} }
/****************************************************************/
static void Process_Move_Item( WinEDA_GerberFrame* frame,
EDA_BaseStruct* DrawStruct, wxDC* DC )
/****************************************************************/
{
if( DrawStruct == NULL )
return;
frame->DrawPanel->MouseToCursorSchema();
switch( DrawStruct->Type() )
{
default:
wxString msg;
msg.Printf(
wxT( "WinEDA_LibeditFrame::Move_Item Error: Bad DrawType %d" ),
DrawStruct->Type() );
DisplayError( frame, msg );
break;
}
}
/**************************************************************************/ /**************************************************************************/
void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/**************************************************************************/ /**************************************************************************/
...@@ -355,16 +319,6 @@ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -355,16 +319,6 @@ void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
} }
if( (DrawStruct == NULL) || (DrawStruct->m_Flags != 0) )
break;
// Element localis�
switch( DrawStruct->Type() )
{
default:
break;
}
break; // end case 0 break; // end case 0
case ID_BUS_BUTT: case ID_BUS_BUTT:
......
...@@ -130,8 +130,8 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName, ...@@ -130,8 +130,8 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
if( !fn.IsOk() ) if( !fn.IsOk() )
{ {
wildcard.Printf( _( "Gerber files (.%s .gbr .gbx .lgr .ger .pho)|" \ wildcard.Printf( _( "Gerber files (.%s .gbr .gbx .lgr .ger .pho)| \
"*.%s;*.gbr;*.gbx;*.lgr;*.ger;*.pho|" ), *.%s;*.gbr;*.gbx;*.lgr;*.ger;*.pho|" ),
g_PenFilenameExt.c_str(), g_PenFilenameExt.c_str()); g_PenFilenameExt.c_str(), g_PenFilenameExt.c_str());
wildcard += AllFilesWildcard; wildcard += AllFilesWildcard;
......
...@@ -105,7 +105,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -105,7 +105,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
// Annulation de commande en cours // Annulation de commande en cours
EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, EVT_MENU_RANGE( ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_PcbFrame::Process_Special_Functions ) WinEDA_GerberFrame::Process_Special_Functions )
// Pop up menu // Pop up menu
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
...@@ -133,16 +133,15 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, ...@@ -133,16 +133,15 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
m_Draw_Axis = true; // true to show X and Y axis on screen m_Draw_Axis = true; // true to show X and Y axis on screen
m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin� m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin�
m_Ident = GERBER_FRAME;
if( DrawPanel ) if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE; DrawPanel->m_Block_Enable = TRUE;
// Give an icon // Give an icon
#ifdef __WINDOWS__ #ifdef __WINDOWS__
SetIcon( wxICON( a_icon_gerbview ) ); SetIcon( wxICON( a_icon_gerbview ) );
#else #else
SetIcon( wxICON( icon_gerbview ) ); SetIcon( wxICON( icon_gerbview ) );
#endif #endif
SetBaseScreen( ScreenPcb ); SetBaseScreen( ScreenPcb );
ActiveScreen = ScreenPcb; ActiveScreen = ScreenPcb;
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
const wxString GerbviewProjectFileExt( wxT( "cnf" ) ); const wxString GerbviewProjectFileExt( wxT( "cnf" ) );
const wxString GerbviewProjectFileWildcard( _( "GerbView project files " \ const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) );
"(.cnf)|*.cnf" ) );
/*************************************************************/ /*************************************************************/
......
This diff is collapsed.
...@@ -64,13 +64,11 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -64,13 +64,11 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_PADS_SKETCH: case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
if( m_OptionsToolBar->GetToolState( id ) ) if( m_OptionsToolBar->GetToolState( id ) )
{ {
m_DisplayPadFill = FALSE; DisplayOpt.DisplayPadFill = m_DisplayPadFill = false;
DisplayOpt.DisplayPadFill = FALSE;
} }
else else
{ {
m_DisplayPadFill = TRUE; DisplayOpt.DisplayPadFill = m_DisplayPadFill = true;
DisplayOpt.DisplayPadFill = TRUE;
} }
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
...@@ -364,9 +362,9 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event ) ...@@ -364,9 +362,9 @@ void WinEDA_LookFrame::OnOkClick( wxCommandEvent& event )
DisplayOpt.DisplayPcbTrackFill = FALSE; DisplayOpt.DisplayPcbTrackFill = FALSE;
if( m_OptDisplayFlashes->GetSelection() == 1 ) if( m_OptDisplayFlashes->GetSelection() == 1 )
DisplayOpt.DisplayPadFill = TRUE; DisplayOpt.DisplayPadFill = true;
else else
DisplayOpt.DisplayPadFill = FALSE; DisplayOpt.DisplayPadFill = false;
if( m_OptDisplayPolygons->GetSelection() == 0 ) if( m_OptDisplayPolygons->GetSelection() == 0 )
g_DisplayPolygonsModeSketch = 1; g_DisplayPolygonsModeSketch = 1;
......
...@@ -984,8 +984,8 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -984,8 +984,8 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
break; break;
default: default:
msg.Printf( wxT( "Execute_DCODE_Command: interpol error " \ msg.Printf( wxT( "Execute_DCODE_Command: interpol error (type %X)" ),
"(type %X)" ), m_Iterpolation ); m_Iterpolation );
DisplayError( frame, msg ); DisplayError( frame, msg );
break; break;
} }
...@@ -1193,7 +1193,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -1193,7 +1193,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
m_GerbMetric ); m_GerbMetric );
int gap = scale( p->params[4].GetValue( tool ), int gap = scale( p->params[4].GetValue( tool ),
m_GerbMetric ); m_GerbMetric );
int numCircles = p->params[5].GetValue( tool ); int numCircles = (int)p->params[5].GetValue( tool );
int crossHairThickness = int crossHairThickness =
scale( p->params[6].GetValue( tool ), m_GerbMetric ); scale( p->params[6].GetValue( tool ), m_GerbMetric );
int crossHairLength = int crossHairLength =
......
...@@ -34,9 +34,9 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl ...@@ -34,9 +34,9 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
save_opt = DisplayOpt; save_opt = DisplayOpt;
if( printmasklayer & ALL_CU_LAYERS ) if( printmasklayer & ALL_CU_LAYERS )
DisplayOpt.DisplayPadFill = FILLED; DisplayOpt.DisplayPadFill = true;
else else
DisplayOpt.DisplayPadFill = SKETCH; DisplayOpt.DisplayPadFill = false;
DisplayOpt.DisplayPadNum = 0; DisplayOpt.DisplayPadNum = 0;
DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadNoConn = 0;
DisplayOpt.DisplayPadIsol = 0; DisplayOpt.DisplayPadIsol = 0;
......
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
PARAM_CFG_BASE** List ); PARAM_CFG_BASE** List );
void WriteProjectConfig( const wxString& fileName, void WriteProjectConfig( const wxString& fileName,
const wxString& GroupName, const wxString& GroupName,
const PARAM_CFG_ARRAY& params ); PARAM_CFG_ARRAY& params );
/** Function SaveCurrentSetupValues() /** Function SaveCurrentSetupValues()
* Save the current setup values in m_EDA_Config * Save the current setup values in m_EDA_Config
...@@ -131,7 +131,7 @@ public: ...@@ -131,7 +131,7 @@ public:
* @param aList = array of PARAM_CFG_BASE pointers * @param aList = array of PARAM_CFG_BASE pointers
*/ */
void SaveCurrentSetupValues( PARAM_CFG_BASE** aList ); void SaveCurrentSetupValues( PARAM_CFG_BASE** aList );
void SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List ); void SaveCurrentSetupValues( PARAM_CFG_ARRAY& List );
/** Function ReadCurrentSetupValues() /** Function ReadCurrentSetupValues()
* Raed the current setup values previously saved, from m_EDA_Config * Raed the current setup values previously saved, from m_EDA_Config
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
* @param aList = array of PARAM_CFG_BASE pointers * @param aList = array of PARAM_CFG_BASE pointers
*/ */
void ReadCurrentSetupValues( PARAM_CFG_BASE** aList ); void ReadCurrentSetupValues( PARAM_CFG_BASE** aList );
void ReadCurrentSetupValues( const PARAM_CFG_ARRAY& List ); void ReadCurrentSetupValues( PARAM_CFG_ARRAY& List );
bool ReadProjectConfig( const wxString& local_config_filename, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
...@@ -147,7 +147,7 @@ public: ...@@ -147,7 +147,7 @@ public:
bool Load_Only_if_New ); bool Load_Only_if_New );
bool ReadProjectConfig( const wxString& local_config_filename, bool ReadProjectConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
const PARAM_CFG_ARRAY& List, PARAM_CFG_ARRAY& List,
bool Load_Only_if_New ); bool Load_Only_if_New );
bool ReCreatePrjConfig( const wxString& local_config_filename, bool ReCreatePrjConfig( const wxString& local_config_filename,
const wxString& GroupName, const wxString& GroupName,
......
...@@ -472,13 +472,13 @@ enum GRTextVertJustifyType { ...@@ -472,13 +472,13 @@ enum GRTextVertJustifyType {
/* Options to show solid segments (segments, texts...) */ /* Options to show solid segments (segments, texts...) */
enum GRFillMode { enum GRFillMode {
FILAIRE = 0, // segments are drawn as lines FILAIRE = 0, // segments are drawn as lines
FILLED, // normal mode: segments have thickness FILLED, // normal mode: segments have thickness
SKETCH // skect mode: segments have thickness, but are not filled SKETCH // skect mode: segments have thickness, but are not filled
}; };
#define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */ #define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */
/** /**
* Class EDA_TextStruct * Class EDA_TextStruct
......
...@@ -17,19 +17,10 @@ ...@@ -17,19 +17,10 @@
#include <wx/wx.h> #include <wx/wx.h>
#endif #endif
#include <stdio.h> /*
#ifdef __FreeBSD__ * FIXME: This appears to already be included in the OSX build of wxWidgets.
#include <stdlib.h> * Will someone with OSX please remove this and see if it compiles.
#else */
#ifndef __DARWIN__
#include <malloc.h> // MacOSX (DARWIN): malloc() and free() are in stdlib.h
#endif
#endif
#include <time.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#ifdef __WXMAC__ #ifdef __WXMAC__
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#endif #endif
...@@ -41,11 +32,6 @@ ...@@ -41,11 +32,6 @@
#define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch #define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch
#define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch #define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch
#ifdef __UNIX__
#define stricmp strcasecmp
#define strnicmp strncasecmp
#endif
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#define DIR_SEP '\\' #define DIR_SEP '\\'
#define STRING_DIR_SEP wxT( "\\" ) #define STRING_DIR_SEP wxT( "\\" )
...@@ -60,7 +46,6 @@ ...@@ -60,7 +46,6 @@
#define D(x) // nothing #define D(x) // nothing
#endif #endif
#define UNIX_STRING_DIR_SEP wxT( "/" ) #define UNIX_STRING_DIR_SEP wxT( "/" )
#define WIN_STRING_DIR_SEP wxT( "\\" ) #define WIN_STRING_DIR_SEP wxT( "\\" )
...@@ -76,4 +61,6 @@ ...@@ -76,4 +61,6 @@
#define MAYBE_RESIZE_BORDER 0 // no resizeable border #define MAYBE_RESIZE_BORDER 0 // no resizeable border
#endif #endif
#include "config.h"
#endif /* FCTSYS_H */ #endif /* FCTSYS_H */
...@@ -74,11 +74,15 @@ static inline const wxChar* GetChars( wxString s ) ...@@ -74,11 +74,15 @@ static inline const wxChar* GetChars( wxString s )
/* macro to exchange 2 items */ /* macro to exchange 2 items */
/*****************************/ /*****************************/
/* this macro uses the typeof keyword /*
* for compilers that do not know typeof (MSVC ) * The EXCHG macro uses BOOST_TYPEOF for compilers that do not have native
* the boost libs have a workaround for the typeof problem * typeof support (MSVC). Please do not attempt to qualify these macros
* within #ifdef compiler definitions pragmas. BOOST_TYPEOF is smart enough
* to check for native typeof support and use it instead of it's own
* implementation. These macros effectively compile to nothing on platforms
* with native typeof support.
*/ */
#ifdef __MSVC__ // MSCV does not know typeof. Others def can be added here
#include "boost/typeof/typeof.hpp" #include "boost/typeof/typeof.hpp"
// we have to register the types used with the typeof keyword with boost // we have to register the types used with the typeof keyword with boost
...@@ -93,13 +97,11 @@ class D_PAD; ...@@ -93,13 +97,11 @@ class D_PAD;
BOOST_TYPEOF_REGISTER_TYPE( D_PAD* ); BOOST_TYPEOF_REGISTER_TYPE( D_PAD* );
BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* ); BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* );
class BOARD_ITEM; class BOARD_ITEM;
BOOST_TYPEOF_REGISTER_TYPE( BOARD_ ITEM* ); BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* );
#define typeof (expr)BOOST_TYPEOF( expr )
#endif // #ifdef __MSVC__
// here is the macro: #define EXCHG( a, b ) { BOOST_TYPEOF(a) __temp__ = (a); \
#define EXCHG( a, b ) { typeof(a)__temp__ = (a); (a) = (b); (b) = __temp__; } (a) = (b); \
(b) = __temp__; }
/*****************************************************/ /*****************************************************/
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "wx/confbase.h" #include "wx/confbase.h"
#include "wx/fileconf.h" #include "wx/fileconf.h"
#include <wx/dynarray.h> #include <boost/ptr_container/ptr_vector.hpp>
/* definifition des types de parametre des files de configuration */ /* definifition des types de parametre des files de configuration */
...@@ -207,6 +207,6 @@ public: ...@@ -207,6 +207,6 @@ public:
virtual void SaveParam( wxConfigBase* aConfig ); virtual void SaveParam( wxConfigBase* aConfig );
}; };
WX_DECLARE_OBJARRAY( PARAM_CFG_BASE, PARAM_CFG_ARRAY ); typedef boost::ptr_vector< PARAM_CFG_BASE > PARAM_CFG_ARRAY;
#endif /* __PARAM_CONFIG_H__ */ #endif /* __PARAM_CONFIG_H__ */
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
/* Forward declaration */ /* Forward declaration */
class EQUIPOT; class EQUIPOT;
class MARKER; class MARKER;
struct CHEVELU; class CHEVELU;
//class Ki_PageDescr; //class Ki_PageDescr;
//class DrawBlockStruct; //class DrawBlockStruct;
...@@ -289,7 +289,7 @@ public: ...@@ -289,7 +289,7 @@ public:
* 1 show netnames on pads * 1 show netnames on pads
* 2 show netnames on tracks * 2 show netnames on tracks
* 3 show netnames on tracks and pads * 3 show netnames on tracks and pads
*/ */
bool Show_Modules_Cmp; bool Show_Modules_Cmp;
bool Show_Modules_Cu; bool Show_Modules_Cu;
......
...@@ -46,7 +46,7 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY ); ...@@ -46,7 +46,7 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
} while( 0 ); } while( 0 );
extern float fsinus[]; extern double fsinus[];
extern float fcosinus[]; extern double fcosinus[];
#endif #endif
...@@ -90,11 +90,11 @@ public: ...@@ -90,11 +90,11 @@ public:
void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ); void GeneralControle( wxDC* DC, wxPoint MousePositionInPixels );
const PARAM_CFG_ARRAY& GetProjectFileParameters( void ); PARAM_CFG_ARRAY& GetProjectFileParameters( void );
void SaveProjectFile( wxWindow* displayframe ); void SaveProjectFile( wxWindow* displayframe );
bool LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig ); bool LoadProjectFile( const wxString& CfgFileName, bool ForceRereadConfig );
const PARAM_CFG_ARRAY& GetConfigurationSettings( void ); PARAM_CFG_ARRAY& GetConfigurationSettings( void );
void LoadSettings(); void LoadSettings();
void SaveSettings(); void SaveSettings();
...@@ -131,7 +131,6 @@ public: ...@@ -131,7 +131,6 @@ public:
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event );
int BestZoom(); // Retourne le meilleur zoom int BestZoom(); // Retourne le meilleur zoom
SCH_ITEM* SchematicGeneralLocateAndDisplay( bool IncludePin = TRUE ); SCH_ITEM* SchematicGeneralLocateAndDisplay( bool IncludePin = TRUE );
......
...@@ -92,8 +92,7 @@ public: ...@@ -92,8 +92,7 @@ public:
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { }
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
...@@ -112,8 +111,6 @@ public: ...@@ -112,8 +111,6 @@ public:
virtual void Show3D_Frame( wxCommandEvent& event ); virtual void Show3D_Frame( wxCommandEvent& event );
// Undo and redo functions
public:
virtual void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy, virtual void SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
int flag_type_command = 0 ); int flag_type_command = 0 );
...@@ -983,6 +980,7 @@ public: ...@@ -983,6 +980,7 @@ public:
void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event );
void GeneralControle( wxDC* DC, wxPoint Mouse ); void GeneralControle( wxDC* DC, wxPoint Mouse );
virtual void OnSelectGrid( wxCommandEvent& event ); virtual void OnSelectGrid( wxCommandEvent& event );
void LoadModuleFromBoard( wxCommandEvent& event );
/* handlers for block commands */ /* handlers for block commands */
int ReturnBlockCommand( int key ); int ReturnBlockCommand( int key );
......
...@@ -218,11 +218,10 @@ public: ...@@ -218,11 +218,10 @@ public:
virtual void OnSelectGrid( wxCommandEvent& event ); virtual void OnSelectGrid( wxCommandEvent& event );
virtual void OnSelectZoom( wxCommandEvent& event ); virtual void OnSelectZoom( wxCommandEvent& event );
virtual void GeneralControle( wxDC* DC, wxPoint Mouse ) { /* dummy */ } virtual void GeneralControle( wxDC* DC, wxPoint Mouse ) { /* dummy */ }
virtual void OnSize( wxSizeEvent& event ); virtual void OnSize( wxSizeEvent& event );
void OnEraseBackground( wxEraseEvent& SizeEvent ); void OnEraseBackground( wxEraseEvent& SizeEvent );
// void OnChar(wxKeyEvent& event);
void SetToolbarBgColor( int color_num ); void SetToolbarBgColor( int color_num );
virtual void OnZoom( wxCommandEvent& event ); virtual void OnZoom( wxCommandEvent& event );
void OnGrid( int grid_type ); void OnGrid( int grid_type );
...@@ -259,8 +258,7 @@ public: ...@@ -259,8 +258,7 @@ public:
void Process_Zoom( wxCommandEvent& event ); void Process_Zoom( wxCommandEvent& event );
void Process_Grid( wxCommandEvent& event ); void Process_Grid( wxCommandEvent& event );
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0; virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event ); virtual void ToolOnRightClick( wxCommandEvent& event );
......
...@@ -257,29 +257,34 @@ void WinEDA_MainFrame::RecreateBaseHToolbar() ...@@ -257,29 +257,34 @@ void WinEDA_MainFrame::RecreateBaseHToolbar()
SetToolBar( m_HToolBar ); SetToolBar( m_HToolBar );
// Set up toolbar // Set up toolbar
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_project_xpm ), m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
wxBitmap( new_project_xpm ),
_( "Start a new project" ) ); _( "Start a new project" ) );
// Load project // Load project
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString, wxBitmap( open_project_xpm ), m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
wxBitmap( open_project_xpm ),
_( "Load existing project" ) ); _( "Load existing project" ) );
// Save project // Save project
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString, wxBitmap( save_project_xpm ), m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
wxBitmap( save_project_xpm ),
_( "Save current project" ) ); _( "Save current project" ) );
// Separator // Separator
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
// Save and archive files // Save and archive files
m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString, wxBitmap( zip_xpm ), m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
wxBitmap( zip_xpm ),
_( "Archive all project files" ) ); // Tooltip _( "Archive all project files" ) ); // Tooltip
// Separator // Separator
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
// Refresh project tree // Refresh project tree
m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString, wxBitmap( reload_xpm ), m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
wxBitmap( reload_xpm ),
_( "Refresh project tree" ) ); _( "Refresh project tree" ) );
m_HToolBar->Realize(); // Create m_HToolBar m_HToolBar->Realize(); // Create m_HToolBar
......
...@@ -278,7 +278,7 @@ public: ...@@ -278,7 +278,7 @@ public:
WinEDA_PrjFrame( WinEDA_MainFrame* parent, WinEDA_PrjFrame( WinEDA_MainFrame* parent,
const wxPoint& pos, const wxSize& size ); const wxPoint& pos, const wxSize& size );
~WinEDA_PrjFrame() { } ~WinEDA_PrjFrame();
void OnSelect( wxTreeEvent& Event ); void OnSelect( wxTreeEvent& Event );
void OnRenameAsk( wxTreeEvent& Event ); void OnRenameAsk( wxTreeEvent& Event );
void OnRename( wxTreeEvent& Event ); void OnRename( wxTreeEvent& Event );
......
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 ) ...@@ -42,11 +42,10 @@ void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
{ {
bool select = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME; bool select = event.GetId() == ID_SELECT_PREFERED_PDF_BROWSER_NAME;
if( !wxGetApp().m_PdfBrowser || select ) if( !wxGetApp().m_PdfBrowser && !select )
{ {
if( !select ) DisplayError( this,
DisplayError( this, _( "You must choose a PDF viewer before use " \ _( "You must choose a PDF viewer before using this option." ) );
"this option" ) );
} }
wxString wildcard( wxT( "*" ) ); wxString wildcard( wxT( "*" ) );
......
...@@ -57,6 +57,13 @@ WinEDA_TreePrj::WinEDA_TreePrj( WinEDA_PrjFrame* parent ) : ...@@ -57,6 +57,13 @@ WinEDA_TreePrj::WinEDA_TreePrj( WinEDA_PrjFrame* parent ) :
} }
WinEDA_TreePrj::~WinEDA_TreePrj()
{
if( m_ImageList )
delete m_ImageList;
}
/***************************************************************************************/ /***************************************************************************************/
int WinEDA_TreePrj::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 ) int WinEDA_TreePrj::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 )
/***************************************************************************************/ /***************************************************************************************/
...@@ -215,8 +222,8 @@ void TreePrjItemData::Move( TreePrjItemData* dest ) ...@@ -215,8 +222,8 @@ void TreePrjItemData::Move( TreePrjItemData* dest )
if( !wxRenameFile( GetFileName(), destName, false ) ) if( !wxRenameFile( GetFileName(), destName, false ) )
#endif #endif
{ {
wxMessageDialog( m_Parent, _( "Unable to move file ... " ), _( wxMessageDialog( m_Parent, _( "Unable to move file ... " ),
"Permission error ?" ), wxICON_ERROR | wxOK ); _( "Permission error ?" ), wxICON_ERROR | wxOK );
return; return;
} }
...@@ -390,8 +397,8 @@ void TreePrjItemData::Activate( WinEDA_PrjFrame* prjframe ) ...@@ -390,8 +397,8 @@ void TreePrjItemData::Activate( WinEDA_PrjFrame* prjframe )
it in treeprj_frame.cpp in the line looking like this: it in treeprj_frame.cpp in the line looking like this:
m_Filters.push_back( wxT( "^no kicad files found" ) ); m_Filters.push_back( wxT( "^no kicad files found" ) );
*/ */
prjframe->AddFile( wxString( _( "no kicad files found in " \ prjframe->AddFile(
"this directory" ) ), id ); _( "no kicad files found in this directory" ), id );
} }
/* Sort filenames by alphabetic order */ /* Sort filenames by alphabetic order */
......
...@@ -100,7 +100,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, ...@@ -100,7 +100,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
m_Filters.push_back( wxT( "^no kicad files found" ) ); m_Filters.push_back( wxT( "^no kicad files found" ) );
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
m_Filters.push_back( wxT( "^.*\\.py$" ) ); m_Filters.push_back( wxT( "^.*\\.py$" ) );
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RunScript" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RunScript" ) );
...@@ -112,7 +112,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, ...@@ -112,7 +112,7 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::DeleteFile" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::DeleteFile" ) );
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) );
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) ); PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) );
#endif /* KICAD_PYTHON */ #endif /* KICAD_PYTHON */
for( int i = 0; i < TREE_MAX; i++ ) for( int i = 0; i < TREE_MAX; i++ )
...@@ -121,13 +121,13 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, ...@@ -121,13 +121,13 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
wxMenu* menu = m_ContextMenus[TREE_PY]; wxMenu* menu = m_ContextMenus[TREE_PY];
// Python script context menu // Python script context menu
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
item = new wxMenuItem( menu, ID_PROJECT_RUNPY, item = new wxMenuItem( menu, ID_PROJECT_RUNPY,
_( "&Run" ), _( "&Run" ),
_( "Run the Python Script" ) ); _( "Run the Python Script" ) );
item->SetBitmap( icon_python_small_xpm ); item->SetBitmap( icon_python_small_xpm );
menu->Append( item ); menu->Append( item );
#endif /* KICAD_PYTHON */ #endif /* KICAD_PYTHON */
// ID_PROJECT_TXTEDIT // ID_PROJECT_TXTEDIT
...@@ -228,6 +228,21 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent, ...@@ -228,6 +228,21 @@ WinEDA_PrjFrame::WinEDA_PrjFrame( WinEDA_MainFrame* parent,
ReCreateTreePrj(); ReCreateTreePrj();
} }
WinEDA_PrjFrame::~WinEDA_PrjFrame()
{
size_t i;
wxMenu* menu;
for( i = 0; i < m_ContextMenus.size(); i++ )
{
menu = m_ContextMenus[i];
delete menu;
}
if( m_PopupMenu )
delete m_PopupMenu;
}
/*****************************************************************************/ /*****************************************************************************/
BEGIN_EVENT_TABLE( WinEDA_PrjFrame, wxSashLayoutWindow ) BEGIN_EVENT_TABLE( WinEDA_PrjFrame, wxSashLayoutWindow )
...@@ -258,13 +273,6 @@ END_EVENT_TABLE() ...@@ -258,13 +273,6 @@ END_EVENT_TABLE()
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/
WinEDA_TreePrj::~WinEDA_TreePrj()
/*****************************************************************************/
{
}
/** /**
* @brief Allowing drag & drop of file other than the currently opened project * @brief Allowing drag & drop of file other than the currently opened project
*/ */
......
#
# 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