Upstream merge

This commit is contained in:
Maciej Suminski 2013-12-19 11:15:27 +01:00
commit 84c496e138
153 changed files with 4447 additions and 5282 deletions

View File

@ -47,8 +47,6 @@ option( KICAD_SCRIPTING_WXPYTHON
# python binary file should be is exec path. # python binary file should be is exec path.
option( USE_FP_LIB_TABLE "Use the new footprint library table implementation. ( default OFF)" )
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF ) option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )

View File

@ -77,6 +77,7 @@ macro(perform_feature_checks)
check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP) check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
check_symbol_exists(strncasecmp "string.h" HAVE_STRNCASECMP) check_symbol_exists(strncasecmp "string.h" HAVE_STRNCASECMP)
check_symbol_exists(strncasecmp "strings.h" HAVE_STRNCASECMP) check_symbol_exists(strncasecmp "strings.h" HAVE_STRNCASECMP)
check_symbol_exists( strtok_r "string.h" HAVE_STRTOKR )
# Some platforms define malloc and free in malloc.h instead of stdlib.h. # Some platforms define malloc and free in malloc.h instead of stdlib.h.
check_symbol_exists(malloc "stdlib.h" MALLOC_IN_STDLIB_H) check_symbol_exists(malloc "stdlib.h" MALLOC_IN_STDLIB_H)
@ -92,7 +93,7 @@ macro(perform_feature_checks)
# CMakes check_cxx_symbol_exists() doesn't work for templates so we must create a # CMakes check_cxx_symbol_exists() doesn't work for templates so we must create a
# small program to verify isinf() exists in cmath. # small program to verify isinf() exists in cmath.
check_cxx_source_compiles( "#include <cmath>\nusing namespace std;\nint main(int argc, char** argv)\n{\n (void)argv;\n isinf(1.0); (void)argc;\n return 0;\n}\n" HAVE_CMATH_ISINF ) check_cxx_source_compiles( "#include <cmath>\nint main(int argc, char** argv)\n{\n (void)argv;\n std::isinf(1.0); (void)argc;\n return 0;\n}\n" HAVE_CMATH_ISINF )
#check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) non-standard library, does not work #check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) non-standard library, does not work
check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME) check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)

View File

@ -7,6 +7,8 @@
#cmakedefine HAVE_STRNCASECMP #cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_STRTOKR // spelled odly to differ from wx's similar test
// Handle platform differences in math.h // Handle platform differences in math.h
#cmakedefine HAVE_MATH_H #cmakedefine HAVE_MATH_H
@ -56,9 +58,6 @@
/// The legacy file format revision of the *.brd file created by this build /// The legacy file format revision of the *.brd file created by this build
#define LEGACY_BOARD_FILE_VERSION 2 #define LEGACY_BOARD_FILE_VERSION 2
/// Definition to compile with Pcbnew footprint library table implementation.
#cmakedefine USE_FP_LIB_TABLE
/// The install prefix defined in CMAKE_INSTALL_PREFIX. /// The install prefix defined in CMAKE_INSTALL_PREFIX.
#define DEFAULT_INSTALL_PATH "@CMAKE_INSTALL_PREFIX" #define DEFAULT_INSTALL_PATH "@CMAKE_INSTALL_PREFIX"

View File

@ -74,10 +74,12 @@ Dialogs:
size should the user have selected a font size of 13 points. size should the user have selected a font size of 13 points.
Quoting: Quoting:
Filenames and paths should be emphasized with <> angle brackets. Anything Filenames, paths or other text should be with single quotes ''. e.g.:
else should be emphasized with single quotes ''. e.g.: 'filename.kicad_pcb'
<filename.kicad_pcb> 'longpath/subdir'
<longpath/subdir>
'FOOTPRINTNAME' 'FOOTPRINTNAME'
'anything else' 'anything else'
Often text strings like this end up in panels which use HTML rendering, and this
can happen in the future. Previously used angle brackets only cause grief there.

View File

@ -141,6 +141,7 @@ set(COMMON_SRCS
selcolor.cpp selcolor.cpp
string.cpp string.cpp
trigo.cpp trigo.cpp
utf8.cpp
wildcards_and_files_ext.cpp wildcards_and_files_ext.cpp
worksheet.cpp worksheet.cpp
wxwineda.cpp wxwineda.cpp
@ -148,6 +149,10 @@ set(COMMON_SRCS
zoom.cpp zoom.cpp
) )
if( NOT HAVE_STRTOKR )
set( COMMON_SRCS ${COMMON_SRCS} strtok_r.c )
endif()
enable_language(C CXX ASM) enable_language(C CXX ASM)
set_source_files_properties(system/fcontext.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp") set_source_files_properties(system/fcontext.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")

View File

@ -56,6 +56,10 @@ const wxChar* traceAutoSave = wxT( "KicadAutoSave" );
/// Configuration file entry name for auto save interval. /// Configuration file entry name for auto save interval.
static const wxChar* entryAutoSaveInterval = wxT( "AutoSaveInterval" ); static const wxChar* entryAutoSaveInterval = wxT( "AutoSaveInterval" );
/// Configuration file entry for wxAuiManger perspective.
static const wxChar* entryPerspective = wxT( "Perspective" );
EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent,
ID_DRAWFRAME_TYPE aFrameType, ID_DRAWFRAME_TYPE aFrameType,
@ -213,6 +217,11 @@ void EDA_BASE_FRAME::LoadSettings()
if( maximized ) if( maximized )
Maximize(); Maximize();
// Once this is fully implemented, wxAuiManager will be used to maintain the persistance of
// the main frame and all it's managed windows and all of the legacy frame persistence
// position code can be removed.
config->Read( m_FrameName + entryPerspective, &m_perspective );
} }
@ -247,6 +256,11 @@ void EDA_BASE_FRAME::SaveSettings()
text = m_FrameName + entryAutoSaveInterval; text = m_FrameName + entryAutoSaveInterval;
config->Write( text, m_autoSaveInterval ); config->Write( text, m_autoSaveInterval );
} }
// Once this is fully implemented, wxAuiManager will be used to maintain the persistance of
// the main frame and all it's managed windows and all of the legacy frame persistence
// position code can be removed.
config->Write( m_FrameName + entryPerspective, m_auimgr.SavePerspective() );
} }
@ -552,12 +566,7 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
tmp << wxT( "OFF\n" ); tmp << wxT( "OFF\n" );
#endif #endif
tmp << wxT( " USE_FP_LIB_TABLE=" ); tmp << wxT( " USE_FP_LIB_TABLE=HARD_CODED_ON\n" );
#ifdef USE_FP_LIB_TABLE
tmp << wxT( "ON\n" );
#else
tmp << wxT( "OFF\n" );
#endif
tmp << wxT( " BUILD_GITHUB_PLUGIN=" ); tmp << wxT( " BUILD_GITHUB_PLUGIN=" );
#ifdef BUILD_GITHUB_PLUGIN #ifdef BUILD_GITHUB_PLUGIN

View File

@ -30,7 +30,9 @@ PLOTTER::PLOTTER( )
defaultPenWidth = 0; defaultPenWidth = 0;
currentPenWidth = -1; // To-be-set marker currentPenWidth = -1; // To-be-set marker
penState = 'Z'; // End-of-path idle penState = 'Z'; // End-of-path idle
plotMirror = false; // Mirror flag m_plotMirror = false; // Mirror flag
m_mirrorIsHorizontal = true;
m_yaxisReversed = false;
outputFile = 0; outputFile = 0;
colorMode = false; // Starts as a BW plot colorMode = false; // Starts as a BW plot
negativeMode = false; negativeMode = false;
@ -74,16 +76,27 @@ bool PLOTTER::OpenFile( const wxString& aFullFilename )
* scale factor, and offsets trace. Also convert from a wxPoint to DPOINT, * scale factor, and offsets trace. Also convert from a wxPoint to DPOINT,
* since some output engines needs floating point coordinates. * since some output engines needs floating point coordinates.
*/ */
DPOINT PLOTTER::userToDeviceCoordinates( const wxPoint& pos ) DPOINT PLOTTER::userToDeviceCoordinates( const wxPoint& aCoordinate )
{ {
double x = (pos.x - plotOffset.x) * plotScale * iuPerDeviceUnit; wxPoint pos = aCoordinate - plotOffset;
double y;
double x = pos.x * plotScale;
double y = ( paperSize.y - pos.y * plotScale );
if( m_plotMirror )
{
if( m_mirrorIsHorizontal )
x = ( paperSize.x - pos.x * plotScale );
else
y = pos.y * plotScale;
}
if( m_yaxisReversed )
y = paperSize.y - y;
x *= iuPerDeviceUnit;
y *= iuPerDeviceUnit;
if( plotMirror )
y = ( pos.y - plotOffset.y ) * plotScale * iuPerDeviceUnit ;
else
y = ( paperSize.y - ( pos.y - plotOffset.y )
* plotScale ) * iuPerDeviceUnit ;
return DPOINT( x, y ); return DPOINT( x, y );
} }

View File

@ -44,7 +44,7 @@ void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
iuPerDeviceUnit *= 0.00254; // ... now in mm iuPerDeviceUnit *= 0.00254; // ... now in mm
SetDefaultLineWidth( 0 ); // No line width on DXF SetDefaultLineWidth( 0 ); // No line width on DXF
plotMirror = false; // No mirroring on DXF m_plotMirror = false; // No mirroring on DXF
m_currentColor = BLACK; m_currentColor = BLACK;
} }

View File

@ -21,7 +21,7 @@ void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
{ {
wxASSERT( !outputFile ); wxASSERT( !outputFile );
wxASSERT( aMirror == false ); wxASSERT( aMirror == false );
plotMirror = false; m_plotMirror = false;
plotOffset = aOffset; plotOffset = aOffset;
wxASSERT( aScale == 1 ); wxASSERT( aScale == 1 );
plotScale = 1; plotScale = 1;

View File

@ -196,7 +196,7 @@ void HPGL_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
paperSize.x *= 10.0 * aIusPerDecimil; paperSize.x *= 10.0 * aIusPerDecimil;
paperSize.y *= 10.0 * aIusPerDecimil; paperSize.y *= 10.0 * aIusPerDecimil;
SetDefaultLineWidth( 0 ); // HPGL has pen sizes instead SetDefaultLineWidth( 0 ); // HPGL has pen sizes instead
plotMirror = aMirror; m_plotMirror = aMirror;
} }
@ -392,14 +392,15 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle,
DPOINT centre_dev = userToDeviceCoordinates( centre ); DPOINT centre_dev = userToDeviceCoordinates( centre );
if( plotMirror ) if( m_plotMirror )
angle = StAngle - EndAngle; angle = StAngle - EndAngle;
else else
angle = EndAngle - StAngle; angle = EndAngle - StAngle;
NORMALIZE_ANGLE_180( angle ); NORMALIZE_ANGLE_180( angle );
angle /= 10; angle /= 10;
// Calculate start point, // Calculate arc start point:
wxPoint cmap; wxPoint cmap;
cmap.x = centre.x + KiROUND( cosdecideg( radius, StAngle ) ); cmap.x = centre.x + KiROUND( cosdecideg( radius, StAngle ) );
cmap.y = centre.y - KiROUND( sindecideg( radius, StAngle ) ); cmap.y = centre.y - KiROUND( sindecideg( radius, StAngle ) );
@ -407,10 +408,8 @@ void HPGL_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle,
fprintf( outputFile, fprintf( outputFile,
"PU;PA %.0f,%.0f;PD;AA %.0f,%.0f,", "PU;PA %.0f,%.0f;PD;AA %.0f,%.0f,",
cmap_dev.x, cmap_dev.x, cmap_dev.y,
cmap_dev.y, centre_dev.x, centre_dev.y );
centre_dev.x,
centre_dev.y );
fprintf( outputFile, "%.0f", angle ); fprintf( outputFile, "%.0f", angle );
fprintf( outputFile, ";PU;\n" ); fprintf( outputFile, ";PU;\n" );
PenFinish(); PenFinish();
@ -431,7 +430,7 @@ void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double
*/ */
if( size.x > size.y ) if( size.x > size.y )
{ {
EXCHG( size.x, size.y ); EXCHG( size.x, size.y );
orient = AddAngles( orient, 900 ); orient = AddAngles( orient, 900 );
} }

View File

@ -71,7 +71,7 @@ void PDF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror ) double aScale, bool aMirror )
{ {
wxASSERT( !workFile ); wxASSERT( !workFile );
plotMirror = aMirror; m_plotMirror = aMirror;
plotOffset = aOffset; plotOffset = aOffset;
plotScale = aScale; plotScale = aScale;
m_IUsPerDecimil = aIusPerDecimil; m_IUsPerDecimil = aIusPerDecimil;

View File

@ -306,7 +306,7 @@ void PS_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror ) double aScale, bool aMirror )
{ {
wxASSERT( !outputFile ); wxASSERT( !outputFile );
plotMirror = aMirror; m_plotMirror = aMirror;
plotOffset = aOffset; plotOffset = aOffset;
plotScale = aScale; plotScale = aScale;
m_IUsPerDecimil = aIusPerDecimil; m_IUsPerDecimil = aIusPerDecimil;
@ -471,7 +471,7 @@ void PS_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int widt
} }
void PS_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, void PS_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle,
int radius, FILL_T fill, int width ) int radius, FILL_T fill, int width )
{ {
wxASSERT( outputFile ); wxASSERT( outputFile );
@ -486,14 +486,24 @@ void PS_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle,
// Calculate start point. // Calculate start point.
DPOINT centre_dev = userToDeviceCoordinates( centre ); DPOINT centre_dev = userToDeviceCoordinates( centre );
double radius_dev = userToDeviceSize( radius ); double radius_dev = userToDeviceSize( radius );
if( plotMirror )
fprintf( outputFile, "%g %g %g %g %g arc%d\n", centre_dev.x, centre_dev.y, if( m_plotMirror )
radius_dev, -EndAngle / 10.0, -StAngle / 10.0, {
fill ); if( m_mirrorIsHorizontal )
else {
fprintf( outputFile, "%g %g %g %g %g arc%d\n", centre_dev.x, centre_dev.y, StAngle = 1800.0 -StAngle;
radius_dev, StAngle / 10.0, EndAngle / 10.0, EndAngle = 1800.0 -EndAngle;
fill ); EXCHG( StAngle, EndAngle );
}
else
{
StAngle = -StAngle;
EndAngle = -EndAngle;
}
}
fprintf( outputFile, "%g %g %g %g %g arc%d\n", centre_dev.x, centre_dev.y,
radius_dev, StAngle / 10.0, EndAngle / 10.0, fill );
} }

View File

@ -172,7 +172,8 @@ void SVG_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror ) double aScale, bool aMirror )
{ {
wxASSERT( !outputFile ); wxASSERT( !outputFile );
plotMirror = not aMirror; // unlike other plotters, SVG has Y axis reversed m_plotMirror = aMirror;
m_yaxisReversed = true; // unlike other plotters, SVG has Y axis reversed
plotOffset = aOffset; plotOffset = aOffset;
plotScale = aScale; plotScale = aScale;
m_IUsPerDecimil = aIusPerDecimil; m_IUsPerDecimil = aIusPerDecimil;
@ -345,13 +346,28 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
DPOINT centre_dev = userToDeviceCoordinates( centre ); DPOINT centre_dev = userToDeviceCoordinates( centre );
double radius_dev = userToDeviceSize( radius ); double radius_dev = userToDeviceSize( radius );
if( !plotMirror ) if( m_yaxisReversed ) // Should be always the case
{ {
double tmp = StAngle; double tmp = StAngle;
StAngle = -EndAngle; StAngle = -EndAngle;
EndAngle = -tmp; EndAngle = -tmp;
} }
if( m_plotMirror )
{
if( m_mirrorIsHorizontal )
{
StAngle = 1800.0 -StAngle;
EndAngle = 1800.0 -EndAngle;
EXCHG( StAngle, EndAngle );
}
else
{
StAngle = -StAngle;
EndAngle = -EndAngle;
}
}
DPOINT start; DPOINT start;
start.x = radius_dev; start.x = radius_dev;
RotatePoint( &start.x, &start.y, StAngle ); RotatePoint( &start.x, &start.y, StAngle );

View File

@ -81,7 +81,6 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
EDA_COLOR_T plotColor = plotter->GetColorMode() ? RED : BLACK; EDA_COLOR_T plotColor = plotter->GetColorMode() ? RED : BLACK;
plotter->SetColor( plotColor ); plotter->SetColor( plotColor );
plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH );
WS_DRAW_ITEM_LIST drawList; WS_DRAW_ITEM_LIST drawList;
// Print only a short filename, if aFilename is the full filename // Print only a short filename, if aFilename is the full filename
@ -103,11 +102,14 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item;
item = drawList.GetNext() ) item = drawList.GetNext() )
{ {
plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH );
switch( item->GetType() ) switch( item->GetType() )
{ {
case WS_DRAW_ITEM_BASE::wsg_line: case WS_DRAW_ITEM_BASE::wsg_line:
{ {
WS_DRAW_ITEM_LINE* line = (WS_DRAW_ITEM_LINE*) item; WS_DRAW_ITEM_LINE* line = (WS_DRAW_ITEM_LINE*) item;
plotter->SetCurrentLineWidth( line->GetPenWidth() );
plotter->MoveTo( line->GetStart() ); plotter->MoveTo( line->GetStart() );
plotter->FinishTo( line->GetEnd() ); plotter->FinishTo( line->GetEnd() );
} }
@ -116,7 +118,11 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
case WS_DRAW_ITEM_BASE::wsg_rect: case WS_DRAW_ITEM_BASE::wsg_rect:
{ {
WS_DRAW_ITEM_RECT* rect = (WS_DRAW_ITEM_RECT*) item; WS_DRAW_ITEM_RECT* rect = (WS_DRAW_ITEM_RECT*) item;
plotter->Rect( rect->GetStart(), rect->GetEnd(), NO_FILL ); } plotter->Rect( rect->GetStart(),
rect->GetEnd(),
NO_FILL,
rect->GetPenWidth() );
}
break; break;
case WS_DRAW_ITEM_BASE::wsg_text: case WS_DRAW_ITEM_BASE::wsg_text:
@ -135,7 +141,8 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
{ {
WS_DRAW_ITEM_POLYGON* poly = (WS_DRAW_ITEM_POLYGON*) item; WS_DRAW_ITEM_POLYGON* poly = (WS_DRAW_ITEM_POLYGON*) item;
plotter->PlotPoly( poly->m_Corners, plotter->PlotPoly( poly->m_Corners,
poly->IsFilled() ? FILLED_SHAPE : NO_FILL ); poly->IsFilled() ? FILLED_SHAPE : NO_FILL,
poly->GetPenWidth() );
} }
break; break;

View File

@ -102,10 +102,10 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& text, int displaytime
void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title, void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title,
const wxString& text, const wxSize& size ) const wxString& text, const wxSize& size )
{ {
HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX(parent,title, wxDefaultPosition, size ); HTML_MESSAGE_BOX dlg( parent, title, wxDefaultPosition, size );
dlg->AddHTML_Text( text );
dlg->ShowModal(); dlg.AddHTML_Text( text );
dlg->Destroy(); dlg.ShowModal();
} }

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -21,7 +21,7 @@ DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent,
m_buttonClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); m_buttonClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
m_buttonClose->SetDefault(); m_buttonClose->SetDefault();
bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxALL, 10 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );

View File

@ -20,8 +20,10 @@
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header"></property>
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property> <property name="skip_php_events">1</property>
<property name="skip_python_events">1</property> <property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property> <property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
@ -42,7 +44,7 @@
<property name="minimum_size">400,120</property> <property name="minimum_size">400,120</property>
<property name="name">DIALOG_DISPLAY_HTML_TEXT_BASE</property> <property name="name">DIALOG_DISPLAY_HTML_TEXT_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">431,120</property> <property name="size">465,202</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property> <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title"></property> <property name="title"></property>
@ -176,8 +178,8 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">10</property>
<property name="flag">wxALIGN_RIGHT|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -45,7 +45,7 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
public: public:
wxHtmlWindow* m_htmlWindow; wxHtmlWindow* m_htmlWindow;
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 431,120 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 465,202 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DISPLAY_HTML_TEXT_BASE(); ~DIALOG_DISPLAY_HTML_TEXT_BASE();
}; };

View File

@ -187,6 +187,13 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool eraseBackground, const wxRect* rect )
} }
void EDA_DRAW_PANEL_GAL::StopDrawing()
{
Disconnect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this );
m_refreshTimer.Stop();
}
void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType ) void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
{ {
// Protect from refreshing during backend switch // Protect from refreshing during backend switch

View File

@ -2,7 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2011 Jean-Pierre Charras, <jp.charras@wanadoo.fr> * Copyright (C) 2011 Jean-Pierre Charras, <jp.charras@wanadoo.fr>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -27,10 +28,13 @@
*/ */
#define USE_WORKER_THREADS 1 // 1:yes, 0:no. use worker thread to load libraries
/* /*
* Functions to read footprint libraries and fill m_footprints by available footprints names * Functions to read footprint libraries and fill m_footprints by available footprints names
* and their documentation (comments and keywords) * and their documentation (comments and keywords)
*/ */
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
#include <macros.h> #include <macros.h>
@ -40,206 +44,289 @@
#include <io_mgr.h> #include <io_mgr.h>
#include <fp_lib_table.h> #include <fp_lib_table.h>
#include <fpid.h> #include <fpid.h>
#include <class_module.h> #include <class_module.h>
#include <boost/thread.hpp>
#if !defined( USE_FP_LIB_TABLE )
bool FOOTPRINT_LIST::ReadFootprintFiles( wxArrayString& aFootprintLibNames ) /*
static wxString ToHTMLFragment( const IO_ERROR* aDerivative )
{ {
bool retv = true; @todo
// Clear data before reading files 1) change up IO_ERROR so it keeps linenumbers, source file name and
m_filesNotFound.Empty(); error message in separate strings.
m_filesInvalid.Empty();
m_List.clear();
// try 2) Add a summarizing virtual member like
virtual wxString What()
to combine all portions of an IO_ERROR's text into a single wxString.
3) Do same for PARSE_ERROR.
4) Add a "reason or error category" to IO_ERROR and thereby also PARSE_ERROR?
msg += "
for( int i=0; i<aCount; ++i )
{ {
PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::LEGACY ) );
// Parse Libraries Listed
for( unsigned ii = 0; ii < aFootprintLibNames.GetCount(); ii++ ) wxArrayString* sl = wxStringSplit( aList, wxChar( '\n' ) );
delete sl;
}
wxString msg = wxT( "<ul>" );
for ( unsigned ii = 0; ii < strings_list->GetCount(); ii++ )
{
msg += wxT( "<li>" );
msg += strings_list->Item( ii ) + wxT( "</li>" );
}
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg );
delete strings_list;
}
*/
void FOOTPRINT_INFO::load()
{
FP_LIB_TABLE* fptable = m_owner->GetTable();
wxASSERT( fptable );
std::auto_ptr<MODULE> m( fptable->FootprintLoad( m_nickname, m_fpname ) );
m_pad_count = m->GetPadCount( MODULE::DO_NOT_INCLUDE_NPTH );
m_keywords = m->GetKeywords();
m_doc = m->GetDescription();
// tell ensure_loaded() I'm loaded.
m_loaded = true;
}
#define JOBZ 6 // no. libraries per worker thread. It takes about
// a second to load a GITHUB library, so assigning
// this no. libraries to each thread should give a little
// over this no. seconds total time if the original delay
// were caused by latencies alone.
// (If https://github.com does not mind.)
#define NTOLERABLE_ERRORS 4 // max errors before aborting, although threads
// in progress will still pile on for a bit. e.g. if 9 threads
// expect 9 greater than this.
void FOOTPRINT_LIST::loader_job( const wxString* aNicknameList, int aJobZ )
{
//DBG(printf( "%s: first:'%s' count:%d\n", __func__, (char*) TO_UTF8( *aNicknameList ), aJobZ );)
for( int i=0; i<aJobZ; ++i )
{
if( m_error_count >= NTOLERABLE_ERRORS )
break;
const wxString& nickname = aNicknameList[i];
try
{ {
// Footprint library file names can be fully qualified or file name only. wxArrayString fpnames = m_lib_table->FootprintEnumerate( nickname );
wxFileName filename = aFootprintLibNames[ii];
if( !filename.FileExists() ) for( unsigned ni=0; ni<fpnames.GetCount(); ++ni )
{ {
filename = wxGetApp().FindLibraryPath( filename.GetFullName() ); FOOTPRINT_INFO* fpinfo = new FOOTPRINT_INFO( this, nickname, fpnames[ni] );
if( !filename.FileExists() ) addItem( fpinfo );
{
filename = wxFileName( wxEmptyString, aFootprintLibNames[ii],
LegacyFootprintLibPathExtension );
filename = wxGetApp().FindLibraryPath( filename.GetFullName() );
}
} }
}
catch( const PARSE_ERROR& pe )
{
// m_errors.push_back is not thread safe, lock its MUTEX.
MUTLOCK lock( m_errors_lock );
wxLogDebug( wxT( "Path <%s> -> <%s>." ), GetChars( aFootprintLibNames[ii] ), ++m_error_count; // modify only under lock
GetChars( filename.GetFullPath() ) ); m_errors.push_back( new IO_ERROR( pe ) );
}
catch( const IO_ERROR& ioe )
{
MUTLOCK lock( m_errors_lock );
if( !filename.IsOk() || !filename.FileExists() ) ++m_error_count;
{ m_errors.push_back( new IO_ERROR( ioe ) );
m_filesNotFound << aFootprintLibNames[ii] << wxT( "\n" ); }
retv = false;
continue;
}
// Catch anything unexpected and map it into the expected.
// Likely even more important since this function runs on GUI-less
// worker threads.
catch( const std::exception& se )
{
// This is a round about way to do this, but who knows what THROW_IO_ERROR()
// may be tricked out to do someday, keep it in the game.
try try
{ {
wxArrayString fpnames = pi->FootprintEnumerate( filename.GetFullPath() ); THROW_IO_ERROR( se.what() );
for( unsigned i=0; i<fpnames.GetCount(); ++i )
{
std::auto_ptr<MODULE> m( pi->FootprintLoad( filename.GetFullPath(),
fpnames[i] ) );
// we're loading what we enumerated, all must be there.
wxASSERT( m.get() );
FOOTPRINT_INFO* fpinfo = new FOOTPRINT_INFO();
fpinfo->SetNickname( filename.GetName() );
fpinfo->SetLibPath( filename.GetFullPath() );
fpinfo->m_Module = fpnames[i];
fpinfo->m_padCount = m->GetPadCount( MODULE::DO_NOT_INCLUDE_NPTH );
fpinfo->m_KeyWord = m->GetKeywords();
fpinfo->m_Doc = m->GetDescription();
AddItem( fpinfo );
}
} }
catch( IO_ERROR ioe ) catch( const IO_ERROR& ioe )
{ {
m_filesInvalid << ioe.errorText << wxT( "\n" ); MUTLOCK lock( m_errors_lock );
retv = false;
++m_error_count;
m_errors.push_back( new IO_ERROR( ioe ) );
} }
} }
} }
/* caller should catch this, UI seems not wanted here.
catch( IO_ERROR ioe )
{
DisplayError( NULL, ioe.errorText );
return false;
}
*/
m_List.sort();
return retv;
} }
#else
bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname ) bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname )
{ {
bool retv = true; bool retv = true;
m_lib_table = aTable;
// Clear data before reading files // Clear data before reading files
m_filesNotFound.Empty(); m_error_count = 0;
m_filesInvalid.Empty(); m_errors.clear();
m_List.clear(); m_list.clear();
std::vector< wxString > nicknames; if( aNickname )
// single footprint
loader_job( aNickname, 1 );
else
{
std::vector< wxString > nicknames;
if( !aNickname )
// do all of them // do all of them
nicknames = aTable->GetLogicalLibs(); nicknames = aTable->GetLogicalLibs();
else
nicknames.push_back( *aNickname );
for( unsigned ii = 0; ii < nicknames.size(); ii++ ) #if USE_WORKER_THREADS
{
const wxString& nickname = nicknames[ii];
try // Something which will not invoke a thread copy constructor, one of many ways obviously:
typedef boost::ptr_vector< boost::thread > MYTHREADS;
MYTHREADS threads;
// Give each thread JOBZ nicknames to process. The last portion of, or if the entire
// size() is small, I'll do myself.
for( unsigned i=0; i<nicknames.size(); )
{ {
wxArrayString fpnames = aTable->FootprintEnumerate( nickname ); if( m_error_count >= NTOLERABLE_ERRORS )
for( unsigned i=0; i<fpnames.GetCount(); ++i )
{ {
std::auto_ptr<MODULE> m( aTable->FootprintLoad( nickname, fpnames[i] ) ); // abort the remaining nicknames.
retv = false;
// we're loading what we enumerated, all must be there. break;
wxASSERT( m.get() );
FOOTPRINT_INFO* fpinfo = new FOOTPRINT_INFO();
fpinfo->SetNickname( nickname );
fpinfo->m_Module = fpnames[i];
fpinfo->m_padCount = m->GetPadCount( MODULE::DO_NOT_INCLUDE_NPTH );
fpinfo->m_KeyWord = m->GetKeywords();
fpinfo->m_Doc = m->GetDescription();
AddItem( fpinfo );
} }
int jobz = JOBZ;
if( i + jobz >= nicknames.size() )
{
jobz = nicknames.size() - i;
// Only a little bit to do, I'll do it myself, on current thread.
loader_job( &nicknames[i], jobz );
}
else
{
// Delegate the job to a worker thread created here.
threads.push_back( new boost::thread( &FOOTPRINT_LIST::loader_job,
this, &nicknames[i], jobz ) );
}
i += jobz;
} }
catch( IO_ERROR ioe )
// Wait for all the worker threads to complete, it does not matter in what order
// we wait for them as long as a full sweep is made. Think of the great race,
// everyone must finish.
for( unsigned i=0; i<threads.size(); ++i )
{ {
m_filesInvalid << ioe.errorText << wxT( "\n" ); threads[i].join();
retv = false;
} }
#else
loader_job( &nicknames[0], nicknames.size() );
#endif
m_list.sort();
} }
m_List.sort(); // The result of this function can be a blend of successes and failures, whose
// mix is given by the Count()s of the two lists. The return value indicates whether
// an abort occurred, even true does not necessarily mean full success, although
// false definitely means failure.
return retv; return retv;
} }
#endif // USE_FP_LIB_TABLE
FOOTPRINT_INFO* FOOTPRINT_LIST::GetModuleInfo( const wxString& aFootprintName ) FOOTPRINT_INFO* FOOTPRINT_LIST::GetModuleInfo( const wxString& aFootprintName )
{ {
BOOST_FOREACH( FOOTPRINT_INFO& footprint, m_List ) BOOST_FOREACH( FOOTPRINT_INFO& fp, m_list )
{ {
#if defined( USE_FP_LIB_TABLE )
FPID fpid; FPID fpid;
wxCHECK_MSG( fpid.Parse( aFootprintName ) < 0, NULL, wxCHECK_MSG( fpid.Parse( aFootprintName ) < 0, NULL,
wxString::Format( wxT( "'%s' is not a valid FPID." ), wxString::Format( wxT( "'%s' is not a valid FPID." ),
GetChars( aFootprintName ) ) ); GetChars( aFootprintName ) ) );
wxString libNickname = FROM_UTF8( fpid.GetLibNickname().c_str() ); wxString libNickname = FROM_UTF8( fpid.GetLibNickname().c_str() );
wxString footprintName = FROM_UTF8( fpid.GetFootprintName().c_str() ); wxString footprintName = FROM_UTF8( fpid.GetFootprintName().c_str() );
if( libNickname == footprint.m_nickname && footprintName == footprint.m_Module ) if( libNickname == fp.GetNickname() && footprintName == fp.GetFootprintName() )
return &footprint; return &fp;
#else
if( aFootprintName.CmpNoCase( footprint.m_Module ) == 0 )
return &footprint;
#endif
} }
return NULL; return NULL;
} }
bool FOOTPRINT_INFO::InLibrary( const wxString& aLibrary ) const bool FOOTPRINT_INFO::InLibrary( const wxString& aLibrary ) const
{ {
#if defined( USE_FP_LIB_TABLE )
return aLibrary == m_nickname; return aLibrary == m_nickname;
#else }
if( aLibrary.IsEmpty() )
return false;
if( aLibrary == m_nickname || aLibrary == m_lib_path ) #include <confirm.h> // until scaffolding goes.
return true;
wxFileName filename = aLibrary; void FOOTPRINT_LIST::DisplayErrors( wxTopLevelWindow* aWindow )
{
#if 1
// scaffolding until a better one is written, hopefully below.
if( filename.GetExt().IsEmpty() ) DBG(printf( "m_error_count:%d\n", m_error_count );)
filename.SetExt( LegacyFootprintLibPathExtension );
if( filename.GetFullPath() == m_lib_path ) wxString msg = _( "Errors were encountered loading footprints" );
return true;
if( filename.GetPath().IsEmpty() ) msg += wxT( '\n' );
filename = wxGetApp().FindLibraryPath( filename.GetFullName() );
for( unsigned i = 0; i<m_errors.size(); ++i )
{
msg += m_errors[i].errorText;
msg += wxT( '\n' );
}
DisplayError( aWindow, msg );
#else // real evolving deal:
// @todo: go to a more HTML !<table>! ? centric output, possibly with
// recommendations for remedy of errors. Add numeric error codes
// to PARSE_ERROR, and switch on them for remedies, etc. Full
// access is provided to everything in every exception!
HTML_MESSAGE_BOX dlg( aWindow, _( "Load Error" ) );
dlg.MessageSet( _( "Errors were encountered loading footprints" ) );
wxString msg = my html wizardry.
dlg.AddHTML_Text( msg );
dlg.ShowModal();
return filename.GetFullPath() == m_lib_path;
#endif #endif
} }

View File

@ -172,6 +172,12 @@ MODULE* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString&
// having to copy the FPID and its two strings, twice each. // having to copy the FPID and its two strings, twice each.
FPID& fpid = (FPID&) ret->GetFPID(); FPID& fpid = (FPID&) ret->GetFPID();
// Catch any misbehaving plugin, which should be setting internal footprint name properly:
wxASSERT( aFootprintName == FROM_UTF8( fpid.GetFootprintName().c_str() ) );
// and clearing nickname
wxASSERT( !fpid.GetLibNickname().size() );
fpid.SetLibNickname( row->GetNickName() ); fpid.SetLibNickname( row->GetNickName() );
} }
@ -631,6 +637,26 @@ const FP_LIB_TABLE::ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname )
} }
// wxGetenv( wchar_t* ) is not re-entrant on linux.
// Put a lock on multithreaded use of wxGetenv( wchar_t* ), called from wxEpandEnvVars(),
// needed by bool ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname = NULL );
#if 1
#include <ki_mutex.h>
const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
{
static MUTEX getenv_mutex;
MUTLOCK lock( getenv_mutex );
// We reserve the right to do this another way, by providing our own member
// function.
return wxExpandEnvVars( aString );
}
#else
const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString ) const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
{ {
// We reserve the right to do this another way, by providing our own member // We reserve the right to do this another way, by providing our own member
@ -638,6 +664,7 @@ const wxString FP_LIB_TABLE::ExpandSubstitutions( const wxString& aString )
return wxExpandEnvVars( aString ); return wxExpandEnvVars( aString );
} }
#endif
bool FP_LIB_TABLE::IsEmpty( bool aIncludeFallback ) bool FP_LIB_TABLE::IsEmpty( bool aIncludeFallback )
{ {

View File

@ -3,6 +3,8 @@
* *
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors. * Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2013 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
* *
* Stroke font class * Stroke font class
* *
@ -26,12 +28,13 @@
#include <gal/stroke_font.h> #include <gal/stroke_font.h>
#include <gal/graphics_abstraction_layer.h> #include <gal/graphics_abstraction_layer.h>
#include <wx/string.h>
using namespace KIGFX; using namespace KIGFX;
const double STROKE_FONT::OVERBAR_HEIGHT = 0.45;
const double STROKE_FONT::LINE_HEIGHT_RATIO = 1.6; const double STROKE_FONT::BOLD_FACTOR = 1.3;
const double STROKE_FONT::HERSHEY_SCALE = 1.0 / 21.0;
STROKE_FONT::STROKE_FONT( GAL* aGal ) : STROKE_FONT::STROKE_FONT( GAL* aGal ) :
m_gal( aGal ), m_gal( aGal ),
@ -40,22 +43,18 @@ STROKE_FONT::STROKE_FONT( GAL* aGal ) :
m_mirrored( false ) m_mirrored( false )
{ {
// Default values // Default values
m_scaleFactor = 1.0 / 21.0;
m_glyphSize = VECTOR2D( 10.0, 10.0 ); m_glyphSize = VECTOR2D( 10.0, 10.0 );
m_verticalJustify = GR_TEXT_VJUSTIFY_BOTTOM; m_verticalJustify = GR_TEXT_VJUSTIFY_BOTTOM;
m_horizontalJustify = GR_TEXT_HJUSTIFY_LEFT; m_horizontalJustify = GR_TEXT_HJUSTIFY_LEFT;
} }
STROKE_FONT::~STROKE_FONT()
{
}
bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNewStrokeFontSize ) bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNewStrokeFontSize )
{ {
m_glyphs.clear(); m_glyphs.clear();
m_glyphBoundingBoxes.clear(); m_glyphBoundingBoxes.clear();
m_glyphs.resize( aNewStrokeFontSize );
m_glyphBoundingBoxes.resize( aNewStrokeFontSize );
for( int j = 0; j < aNewStrokeFontSize; j++ ) for( int j = 0; j < aNewStrokeFontSize; j++ )
{ {
@ -81,8 +80,8 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
if( i < 2 ) if( i < 2 )
{ {
// The first two values contain the width of the char // The first two values contain the width of the char
glyphStartX = coordinate[0] - 'R'; glyphStartX = ( coordinate[0] - 'R' ) * HERSHEY_SCALE;
glyphEndX = coordinate[1] - 'R'; glyphEndX = ( coordinate[1] - 'R' ) * HERSHEY_SCALE;
glyphBoundingX = VECTOR2D( 0, glyphEndX - glyphStartX ); glyphBoundingX = VECTOR2D( 0, glyphEndX - glyphStartX );
} }
else if( ( coordinate[0] == ' ' ) && ( coordinate[1] == 'R' ) ) else if( ( coordinate[0] == ' ' ) && ( coordinate[1] == 'R' ) )
@ -97,8 +96,8 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
{ {
// Every coordinate description of the Hershey format has an offset, // Every coordinate description of the Hershey format has an offset,
// it has to be subtracted // it has to be subtracted
point.x = (double) ( coordinate[0] - 'R' ) - glyphStartX; point.x = (double) ( coordinate[0] - 'R' ) * HERSHEY_SCALE - glyphStartX;
point.y = (double) ( coordinate[1] - 'R' ) - 11.0; point.y = (double) ( coordinate[1] - 'R' ) * HERSHEY_SCALE;
pointList.push_back( point ); pointList.push_back( point );
} }
@ -108,16 +107,22 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
if( pointList.size() > 0 ) if( pointList.size() > 0 )
glyph.push_back( pointList ); glyph.push_back( pointList );
m_glyphs.push_back( glyph ); m_glyphs[j] = glyph;
// Compute the bounding box of the glyph // Compute the bounding box of the glyph
m_glyphBoundingBoxes.push_back( computeBoundingBox( glyph, glyphBoundingX ) ); m_glyphBoundingBoxes[j] = computeBoundingBox( glyph, glyphBoundingX );
} }
return true; return true;
} }
int STROKE_FONT::getInterline() const
{
return ( m_glyphSize.y * 14 ) / 10 + m_gal->GetLineWidth();
}
BOX2D STROKE_FONT::computeBoundingBox( const GLYPH& aGLYPH, const VECTOR2D& aGLYPHBoundingX ) const BOX2D STROKE_FONT::computeBoundingBox( const GLYPH& aGLYPH, const VECTOR2D& aGLYPHBoundingX ) const
{ {
BOX2D boundingBox; BOX2D boundingBox;
@ -142,133 +147,162 @@ BOX2D STROKE_FONT::computeBoundingBox( const GLYPH& aGLYPH, const VECTOR2D& aGLY
} }
void STROKE_FONT::Draw( std::string aText, const VECTOR2D& aPosition, double aRotationAngle ) void STROKE_FONT::Draw( const wxString& aText, const VECTOR2D& aPosition, double aRotationAngle )
{ {
// By default overbar is turned off
m_overbar = false;
// Context needs to be saved before any transformations // Context needs to be saved before any transformations
m_gal->Save(); m_gal->Save();
m_gal->Translate( aPosition ); m_gal->Translate( aPosition );
m_gal->Rotate( -aRotationAngle );
// Split multiline strings into separate ones and draw them line by line // Single line height
size_t newlinePos = aText.find( '\n' ); int lineHeight = getInterline();
if( newlinePos != std::string::npos ) // The overall height of all lines of text
{ double textBlockHeight = lineHeight * ( linesCount( aText ) - 1 );
VECTOR2D nextlinePosition = VECTOR2D( 0.0, m_glyphSize.y * LINE_HEIGHT_RATIO );
Draw( aText.substr( newlinePos + 1 ), nextlinePosition, 0.0 );
aText = aText.substr( 0, newlinePos );
}
// Compute the text size
VECTOR2D textsize = computeTextSize( aText );
// Adjust the text position to the given alignment
switch( m_horizontalJustify )
{
case GR_TEXT_HJUSTIFY_CENTER:
m_gal->Translate( VECTOR2D( -textsize.x / 2.0, 0 ) );
break;
case GR_TEXT_HJUSTIFY_RIGHT:
if( !m_mirrored )
m_gal->Translate( VECTOR2D( -textsize.x, 0 ) );
break;
case GR_TEXT_HJUSTIFY_LEFT:
if( m_mirrored )
m_gal->Translate( VECTOR2D( -textsize.x, 0 ) );
break;
default:
break;
}
switch( m_verticalJustify ) switch( m_verticalJustify )
{ {
case GR_TEXT_VJUSTIFY_CENTER: case GR_TEXT_VJUSTIFY_CENTER:
m_gal->Translate( VECTOR2D( 0, textsize.y / 2.0 ) ); m_gal->Translate( VECTOR2D( 0, -textBlockHeight / 2.0 ) );
break;
case GR_TEXT_VJUSTIFY_TOP:
m_gal->Translate( VECTOR2D( 0, textsize.y ) );
break; break;
case GR_TEXT_VJUSTIFY_BOTTOM: case GR_TEXT_VJUSTIFY_BOTTOM:
m_gal->Translate( VECTOR2D( 0, -textBlockHeight ) );
break;
case GR_TEXT_VJUSTIFY_TOP:
break; break;
default: default:
break; break;
} }
double xOffset, glyphSizeX; m_gal->Rotate( -aRotationAngle );
if( m_mirrored )
{
// In case of mirrored text invert the X scale of points and their X direction
// (m_glyphSize.x) and start drawing from the position where text normally should end
// (textsize.x)
xOffset = textsize.x;
glyphSizeX = -m_glyphSize.x;
}
else
{
xOffset = 0.0;
glyphSizeX = m_glyphSize.x;
}
double scaleY = m_scaleFactor * m_glyphSize.y;
double scaleX = m_scaleFactor * glyphSizeX;
m_gal->SetIsStroke( true ); m_gal->SetIsStroke( true );
m_gal->SetIsFill( false ); m_gal->SetIsFill( false );
if( m_bold ) if( m_bold )
m_gal->SetLineWidth( m_gal->GetLineWidth() * BOLD_FACTOR );
// Split multiline strings into separate ones and draw them line by line
size_t begin = 0;
size_t newlinePos = aText.find( '\n' );
while( newlinePos != aText.npos )
{ {
m_gal->SetLineWidth( m_gal->GetLineWidth() * 1.3 ); size_t length = newlinePos - begin;
drawSingleLineText( aText.Mid( begin, length ) );
m_gal->Translate( VECTOR2D( 0.0, lineHeight ) );
begin = newlinePos + 1;
newlinePos = aText.find( '\n', begin );
} }
for( std::string::const_iterator chIt = aText.begin(); chIt != aText.end(); chIt++ ) // Draw the last (or the only one) line
if( !aText.IsEmpty() )
drawSingleLineText( aText.Mid( begin ) );
m_gal->Restore();
}
void STROKE_FONT::drawSingleLineText( const wxString& aText )
{
// By default the overbar is turned off
m_overbar = false;
double xOffset;
VECTOR2D glyphSize( m_glyphSize );
// Compute the text size
VECTOR2D textSize = computeTextSize( aText );
m_gal->Save();
// Adjust the text position to the given alignment
switch( m_horizontalJustify )
{ {
case GR_TEXT_HJUSTIFY_CENTER:
m_gal->Translate( VECTOR2D( -textSize.x / 2.0, 0 ) );
break;
case GR_TEXT_HJUSTIFY_RIGHT:
if( !m_mirrored )
m_gal->Translate( VECTOR2D( -textSize.x, 0 ) );
break;
case GR_TEXT_HJUSTIFY_LEFT:
if( m_mirrored )
m_gal->Translate( VECTOR2D( -textSize.x, 0 ) );
break;
default:
break;
}
if( m_mirrored )
{
// In case of mirrored text invert the X scale of points and their X direction
// (m_glyphSize.x) and start drawing from the position where text normally should end
// (textSize.x)
xOffset = textSize.x;
glyphSize.x = -m_glyphSize.x;
}
else
{
xOffset = 0.0;
}
for( wxString::const_iterator chIt = aText.begin(); chIt != aText.end(); ++chIt )
{
// Toggle overbar
if( *chIt == '~' ) if( *chIt == '~' )
{ {
m_overbar = !m_overbar; if( ++chIt == aText.end() )
continue; break;
if( *chIt != '~' ) // It was a single tilda, it toggles overbar
m_overbar = !m_overbar;
// If it is a double tilda, just process the second one
} }
GLYPH_LIST::iterator glyphIt = m_glyphs.begin(); unsigned dd = *chIt - ' ';
std::deque<BOX2D>::iterator bbIt = m_glyphBoundingBoxes.begin();
unsigned dd = (unsigned) ((unsigned char) *chIt ) - (unsigned) ' '; if( dd >= m_glyphBoundingBoxes.size() || dd < 0 )
if( dd >= m_glyphBoundingBoxes.size() )
dd = '?' - ' '; dd = '?' - ' ';
advance( glyphIt, dd ); GLYPH& glyph = m_glyphs[dd];
advance( bbIt, dd ); BOX2D& bbox = m_glyphBoundingBoxes[dd];
GLYPH glyph = *glyphIt; if( m_overbar )
{
VECTOR2D startOverbar( xOffset, -getInterline() * OVERBAR_HEIGHT );
VECTOR2D endOverbar( xOffset + glyphSize.x * bbox.GetEnd().x,
-getInterline() * OVERBAR_HEIGHT );
m_gal->DrawLine( startOverbar, endOverbar );
}
for( GLYPH::iterator pointListIt = glyph.begin(); pointListIt != glyph.end(); for( GLYPH::iterator pointListIt = glyph.begin(); pointListIt != glyph.end();
pointListIt++ ) ++pointListIt )
{ {
std::deque<VECTOR2D> pointListScaled; std::deque<VECTOR2D> pointListScaled;
for( std::deque<VECTOR2D>::iterator pointIt = pointListIt->begin(); for( std::deque<VECTOR2D>::iterator pointIt = pointListIt->begin();
pointIt != pointListIt->end(); pointIt++ ) pointIt != pointListIt->end(); ++pointIt )
{ {
VECTOR2D pointPos( pointIt->x * scaleX + xOffset, pointIt->y * scaleY ); VECTOR2D pointPos( pointIt->x * glyphSize.x + xOffset, pointIt->y * glyphSize.y );
if( m_italic ) if( m_italic )
{ {
// FIXME should be done other way - referring to the lowest Y value of point // FIXME should be done other way - referring to the lowest Y value of point
// because now italic fonts are translated a bit // because now italic fonts are translated a bit
pointPos.x += pointPos.y * 0.1; if( m_mirrored )
pointPos.x += pointPos.y * 0.1;
else
pointPos.x -= pointPos.y * 0.1;
} }
pointListScaled.push_back( pointPos ); pointListScaled.push_back( pointPos );
@ -277,39 +311,37 @@ void STROKE_FONT::Draw( std::string aText, const VECTOR2D& aPosition, double aRo
m_gal->DrawPolyline( pointListScaled ); m_gal->DrawPolyline( pointListScaled );
} }
if( m_overbar ) xOffset += glyphSize.x * bbox.GetEnd().x;
{
VECTOR2D startOverbar( xOffset, -textsize.y * 1.2 );
VECTOR2D endOverbar( xOffset + m_scaleFactor * glyphSizeX * bbIt->GetEnd().x,
-textsize.y * 1.2 );
m_gal->DrawLine( startOverbar, endOverbar );
}
xOffset += m_scaleFactor * glyphSizeX * bbIt->GetEnd().x;
} }
m_gal->Restore(); m_gal->Restore();
} }
VECTOR2D STROKE_FONT::computeTextSize( const std::string& aText ) const VECTOR2D STROKE_FONT::computeTextSize( const wxString& aText ) const
{ {
VECTOR2D result = VECTOR2D( 0.0, m_glyphSize.y ); VECTOR2D result = VECTOR2D( 0.0, m_glyphSize.y );
for( std::string::const_iterator chIt = aText.begin(); chIt != aText.end(); chIt++ ) for( wxString::const_iterator chIt = aText.begin(); chIt != aText.end(); ++chIt )
{ {
wxASSERT_MSG( *chIt != '\n',
wxT( "This function is intended to work with single line strings" ) );
// If it is double tilda, then it is displayed as a single tilda
// If it is single tilda, then it is toggling overbar, so we need to skip it
if( *chIt == '~' ) if( *chIt == '~' )
continue; {
if( ++chIt == aText.end() )
break;
}
std::deque<BOX2D>::const_iterator bbIt = m_glyphBoundingBoxes.begin(); // Index in the bounding boxes table
unsigned dd = (unsigned) ((unsigned char)*chIt) - (unsigned) ' '; unsigned dd = *chIt - ' ';
if( dd >= m_glyphBoundingBoxes.size() ) if( dd >= m_glyphBoundingBoxes.size() || dd < 0 )
dd = '?' - ' '; dd = '?' - ' ';
advance( bbIt, dd ); result.x += m_glyphSize.x * m_glyphBoundingBoxes[dd].GetEnd().x;
result.x += m_scaleFactor * m_glyphSize.x * bbIt->GetEnd().x;
} }
return result; return result;

View File

@ -25,7 +25,6 @@
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include <geometry/shape_circle.h> #include <geometry/shape_circle.h>
using namespace std;
using boost::optional; using boost::optional;
bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const
@ -137,7 +136,7 @@ int SHAPE_LINE_CHAIN::Distance( const VECTOR2I& aP ) const
int d = INT_MAX; int d = INT_MAX;
for( int s = 0; s < SegmentCount(); s++ ) for( int s = 0; s < SegmentCount(); s++ )
d = min( d, CSegment( s ).Distance( aP ) ); d = std::min( d, CSegment( s ).Distance( aP ) );
return d; return d;
} }
@ -437,7 +436,7 @@ const optional<SHAPE_LINE_CHAIN::INTERSECTION> SHAPE_LINE_CHAIN::SelfIntersectin
SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify() SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify()
{ {
vector<VECTOR2I> pts_unique; std::vector<VECTOR2I> pts_unique;
if( PointCount() < 2 ) if( PointCount() < 2 )
{ {
@ -524,9 +523,9 @@ const VECTOR2I SHAPE_LINE_CHAIN::NearestPoint( const VECTOR2I& aP ) const
} }
const string SHAPE_LINE_CHAIN::Format() const const std::string SHAPE_LINE_CHAIN::Format() const
{ {
stringstream ss; std::stringstream ss;
ss << m_points.size() << " " << ( m_closed ? 1 : 0 ) << " "; ss << m_points.size() << " " << ( m_closed ? 1 : 0 ) << " ";

View File

@ -1358,8 +1358,8 @@ void ClipAndDrawPoly( EDA_RECT* aClipBox, wxDC* aDC, wxPoint aPoints[], int n )
} }
// A clip box exists: clip and draw the polygon. // A clip box exists: clip and draw the polygon.
static vector<wxPoint> clippedPolygon; static std::vector<wxPoint> clippedPolygon;
static pointVector inputPolygon, outputPolygon; static pointVector inputPolygon, outputPolygon;
inputPolygon.clear(); inputPolygon.clear();
outputPolygon.clear(); outputPolygon.clear();

View File

@ -1,83 +1,78 @@
#include <fctsys.h> #include <fctsys.h>
#include <html_messagebox.h> #include <html_messagebox.h>
#include <macros.h> #include <macros.h>
#include <common.h>
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle,
wxPoint aPos, wxSize aSize) HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle,
: DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize ) wxPoint aPos, wxSize aSize) :
DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize )
{ {
ListClear(); ListClear();
Center(); Center();
} }
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event ) void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
{ {
EndModal(0); EndModal( 0 );
} }
void HTML_MESSAGE_BOX::ListClear(void) void HTML_MESSAGE_BOX::ListClear()
{ {
m_htmlWindow->SetPage(wxEmptyString); m_htmlWindow->SetPage( wxEmptyString );
} }
/**
* Function ListSet
* Add a list of items.
* @param aList = a string containing items. Items are separated by '\n'
*/
void HTML_MESSAGE_BOX::ListSet(const wxString &aList)
{
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
wxArrayString* strings_list = wxStringSplit( aList, wxChar('\n') ); void HTML_MESSAGE_BOX::ListSet( const wxString& aList )
wxString msg = wxT("<ul>"); {
for ( unsigned ii = 0; ii < strings_list->GetCount(); ii ++ ) // wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
wxArrayString* strings_list = wxStringSplit( aList, wxChar( '\n' ) );
wxString msg = wxT( "<ul>" );
for ( unsigned ii = 0; ii < strings_list->GetCount(); ii++ )
{ {
msg += wxT("<li>"); msg += wxT( "<li>" );
msg += strings_list->Item(ii) + wxT("</li>"); msg += strings_list->Item( ii ) + wxT( "</li>" );
} }
msg += wxT("</ul>");
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg ); m_htmlWindow->AppendToPage( msg );
delete strings_list; delete strings_list;
} }
/**
* Function ListSet void HTML_MESSAGE_BOX::ListSet( const wxArrayString& aList )
* Add a list of items.
* @param aList = a wxArrayString containing items
*/
void HTML_MESSAGE_BOX::ListSet(const wxArrayString &aList)
{ {
wxString msg = wxT("<ul>"); wxString msg = wxT( "<ul>" );
for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
for( unsigned ii = 0; ii < aList.GetCount(); ii++ )
{ {
msg += wxT("<li>"); msg += wxT( "<li>" );
msg += aList.Item(ii) + wxT("</li>"); msg += aList.Item( ii ) + wxT( "</li>" );
} }
msg += wxT("</ul>");
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg ); m_htmlWindow->AppendToPage( msg );
} }
/**
* Function MessageSet void HTML_MESSAGE_BOX::MessageSet( const wxString& message )
* Add a message (in bold) to message list.
* @param message = the message
*/
void HTML_MESSAGE_BOX::MessageSet(const wxString &message)
{ {
wxString message_value; wxString message_value = wxString::Format(
message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) ); wxT( "<b>%s</b><br>" ), GetChars( message ) );
m_htmlWindow->AppendToPage( message_value ); m_htmlWindow->AppendToPage( message_value );
} }
/**
* Function AddHTML_Text void HTML_MESSAGE_BOX::AddHTML_Text( const wxString& message )
* Add a text to message list.
* @param message = the text to add
*/
void HTML_MESSAGE_BOX::AddHTML_Text(const wxString &message)
{ {
m_htmlWindow->AppendToPage( message ); m_htmlWindow->AppendToPage( message );
} }

View File

@ -55,9 +55,6 @@ LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
DISPLAY_OPTIONS DisplayOpt; // Display options for board items DISPLAY_OPTIONS DisplayOpt; // Display options for board items
// This will be always be 450 or 900 (by UI design) at the moment
int g_RotationAngle;
int g_AnchorColor = BLUE; int g_AnchorColor = BLUE;
int g_ModuleTextCMPColor = LIGHTGRAY; int g_ModuleTextCMPColor = LIGHTGRAY;
int g_ModuleTextCUColor = MAGENTA; int g_ModuleTextCUColor = MAGENTA;

View File

@ -477,3 +477,18 @@ bool ReplaceIllegalFileNameChars( std::string* aName )
return changed; return changed;
} }
wxString RemoveTrailingZeros( const wxString& aString )
{
wxString retv = aString;
int i = retv.Length();
while( --i > 0 && retv[i] == wxChar( '0' ) )
retv.RemoveLast();
if( retv[i] == wxChar( '.' ) )
retv.RemoveLast();
return retv;
}

35
common/strtok_r.c Normal file
View File

@ -0,0 +1,35 @@
/*
* public domain strtok_r()
*/
#include <string.h>
char* strtok_r( char* str, const char* delim, char** nextp )
{
char* ret;
if( str == NULL )
{
str = *nextp;
}
str += strspn( str, delim );
if( *str == '\0' )
{
return NULL;
}
ret = str;
str += strcspn( str, delim );
if( *str )
{
*str++ = '\0';
}
*nextp = str;
return ret;
}

View File

@ -31,8 +31,6 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
using namespace std;
struct FlagString struct FlagString
{ {
int flag; int flag;
@ -154,7 +152,7 @@ const std::string TOOL_EVENT::Format() const
const std::string TOOL_EVENT_LIST::Format() const const std::string TOOL_EVENT_LIST::Format() const
{ {
string s; std::string s;
BOOST_FOREACH( TOOL_EVENT e, m_events ) BOOST_FOREACH( TOOL_EVENT e, m_events )
s += e.Format() + " "; s += e.Format() + " ";

View File

@ -47,7 +47,6 @@
#include <class_drawpanel_gal.h> #include <class_drawpanel_gal.h>
using boost::optional; using boost::optional;
using namespace std;
/// Struct describing the current execution state of a TOOL /// Struct describing the current execution state of a TOOL
struct TOOL_MANAGER::TOOL_STATE struct TOOL_MANAGER::TOOL_STATE

260
common/utf8.cpp Normal file
View File

@ -0,0 +1,260 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <utf8.h>
/* THROW_IO_ERROR needs this, but it will soon be including this file, so until some
factoring of THROW_IO_ERROR into a separate header, defer and use the asserts.
#include <richio.h>
*/
#include <assert.h>
/*
These are not inlined so that code space is saved by encapsulating the
creation of intermediate objects and referencing wxConvUTF8.
*/
UTF8::UTF8( const wxString& o ) :
std::string( (const char*) o.utf8_str() )
{
}
UTF8::operator wxString () const
{
return wxString( c_str(), wxConvUTF8 );
}
UTF8& UTF8::operator=( const wxString& o )
{
std::string::operator=( (const char*) o.utf8_str() );
return *this;
}
#ifndef THROW_IO_ERROR
#define THROW_IO_ERROR(x) // nothing
#endif
// There is no wxWidgets function that does this, because wchar_t is 16 bits
// on windows and wx wants to encode the output in UTF16 for such.
int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult )
{
unsigned ch = *aSequence;
if( ch < 0x80 )
{
if( aResult )
*aResult = ch;
return 1;
}
const unsigned char* s = aSequence;
static const unsigned char utf8_len[] = {
// Map encoded prefix byte to sequence length. Zero means
// illegal prefix. See RFC 3629 for details
/*
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 00-0F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 70-7F
*/
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80-8F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B0-BF
0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0-C1 + C2-CF
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // D0-DF
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // E0-EF
4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F0-F4 + F5-FF
};
int len = utf8_len[ *s - 0x80 /* top half of table is missing */ ];
switch( len )
{
default:
case 0:
THROW_IO_ERROR( "invalid start byte" );
break;
case 2:
if( ( s[1] & 0xc0 ) != 0x80 )
{
THROW_IO_ERROR( "invalid continuation byte" );
}
ch = ((s[0] & 0x1f) << 6) +
((s[1] & 0x3f) << 0);
assert( ch > 0x007F && ch <= 0x07FF );
break;
case 3:
if( (s[1] & 0xc0) != 0x80 ||
(s[2] & 0xc0) != 0x80 ||
(s[0] == 0xE0 && s[1] < 0xA0)
// || (s[0] == 0xED && s[1] > 0x9F)
)
{
THROW_IO_ERROR( "invalid continuation byte" );
}
ch = ((s[0] & 0x0f) << 12) +
((s[1] & 0x3f) << 6 ) +
((s[2] & 0x3f) << 0 );
assert( ch > 0x07FF && ch <= 0xFFFF );
break;
case 4:
if( (s[1] & 0xc0) != 0x80 ||
(s[2] & 0xc0) != 0x80 ||
(s[3] & 0xc0) != 0x80 ||
(s[0] == 0xF0 && s[1] < 0x90) ||
(s[0] == 0xF4 && s[1] > 0x8F) )
{
THROW_IO_ERROR( "invalid continuation byte" );
}
ch = ((s[0] & 0x7) << 18) +
((s[1] & 0x3f) << 12) +
((s[2] & 0x3f) << 6 ) +
((s[3] & 0x3f) << 0 );
assert( ch > 0xFFFF && ch <= 0x10ffff );
break;
}
if( aResult )
{
*aResult = ch;
}
return len;
}
UTF8::UTF8( const wchar_t* txt ) :
// size initial string safely large enough, then shrink to known size later.
std::string( wcslen( txt ) * 4, 0 )
{
/*
"this" string was sized to hold the worst case UTF8 encoded byte
sequence, and was initialized with all nul bytes. Overwrite some of
those nuls, then resize, shrinking down to actual size.
Use the wx 2.8 function, not new FromWChar(). It knows about wchar_t
possibly being 16 bits wide on Windows and holding UTF16 input.
*/
int sz = wxConvUTF8.WC2MB( (char*) data(), txt, size() );
resize( sz );
}
#if 0 // some unit tests:
#include <stdio.h>
wxString wxFunctionTaking_wxString( const wxString& wx )
{
printf( "%s:'%s'\n", __func__, (char*) UTF8( wx ) );
printf( "%s:'%s'\n", __func__, (const char*) UTF8( wx ) );
printf( "%s:'%s'\n", __func__, UTF8( wx ).c_str() );
return wx;
}
int main()
{
std::string str = "input";
UTF8 u0 = L"wide string";
UTF8 u1 = "initial";
wxString wx = wxT( "input2" );
printf( "u0:'%s'\n", u0.c_str() );
printf( "u1:'%s'\n", u1.c_str() );
u1 = str;
wxString wx2 = u1;
// force a std::string into a UTF8, then into a wxString, then copy construct:
wxString wx3 = (UTF8&) u1;
UTF8 u2 = wx2;
u2 += 'X';
printf( "u2:'%s'\n", u2.c_str() );
// key accomplishments here:
// 1) passing a UTF8 to a function which normally takes a wxString.
// 2) return a wxString back into a UTF8.
UTF8 result = wxFunctionTaking_wxString( u2 );
printf( "result:'%s'\n", result.c_str() );
// test the unicode iterator:
for( UTF8::uni_iter it = u2.ubegin(); it < u2.uend(); )
{
// test post-increment:
printf( " _%c_", *it++ );
// after UTF8::uni_forward() is implemented, %c is no longer useable.
// printf( " _%02x_", *it++ );
}
printf( "\n" );
UTF8::uni_iter it = u2.ubegin();
UTF8::uni_iter it2 = it++;
printf( "post_inc:'%c' should be 'i'\n", *it2 );
it2 = ++it;
printf( "pre_inc:'%c' should be 'p'\n", *it2 );
printf( "u[1]:'%c' should be 'n'\n", u2[1] );
return 0;
}
#endif

View File

@ -159,10 +159,12 @@ struct queryVisitor
{ {
} }
void operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{ {
if( aItem->ViewIsVisible() ) if( aItem->ViewIsVisible() )
m_cont.push_back( VIEW::LAYER_ITEM_PAIR( aItem, m_layer ) ); m_cont.push_back( VIEW::LAYER_ITEM_PAIR( aItem, m_layer ) );
return true;
} }
Container& m_cont; Container& m_cont;
@ -393,7 +395,7 @@ struct VIEW::updateItemsColor
{ {
} }
void operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{ {
// Obtain the color that should be used for coloring the item // Obtain the color that should be used for coloring the item
const COLOR4D color = painter->GetSettings()->GetColor( aItem, layer ); const COLOR4D color = painter->GetSettings()->GetColor( aItem, layer );
@ -401,6 +403,8 @@ struct VIEW::updateItemsColor
if( group >= 0 ) if( group >= 0 )
gal->ChangeGroupColor( group, color ); gal->ChangeGroupColor( group, color );
return true;
} }
int layer; int layer;
@ -453,12 +457,14 @@ struct VIEW::changeItemsDepth
{ {
} }
void operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{ {
int group = aItem->getGroup( layer ); int group = aItem->getGroup( layer );
if( group >= 0 ) if( group >= 0 )
gal->ChangeGroupDepth( group, depth ); gal->ChangeGroupDepth( group, depth );
return true;
} }
int layer, depth; int layer, depth;
@ -577,15 +583,17 @@ struct VIEW::drawItem
{ {
} }
void operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{ {
// Conditions that have te be fulfilled for an item to be drawn // Conditions that have te be fulfilled for an item to be drawn
bool drawCondition = aItem->ViewIsVisible() && bool drawCondition = aItem->ViewIsVisible() &&
aItem->ViewGetLOD( currentLayer->id ) < view->m_scale; aItem->ViewGetLOD( currentLayer->id ) < view->m_scale;
if( !drawCondition ) if( !drawCondition )
return; return true;
view->draw( aItem, currentLayer->id ); view->draw( aItem, currentLayer->id );
return true;
} }
const VIEW_LAYER* currentLayer; const VIEW_LAYER* currentLayer;
@ -682,9 +690,11 @@ bool VIEW::IsDirty() const
struct VIEW::unlinkItem struct VIEW::unlinkItem
{ {
void operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{ {
aItem->m_view = NULL; aItem->m_view = NULL;
return true;
} }
}; };
@ -696,7 +706,7 @@ struct VIEW::recacheItem
{ {
} }
void operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{ {
// Remove previously cached group // Remove previously cached group
int prevGroup = aItem->getGroup( layer ); int prevGroup = aItem->getGroup( layer );
@ -718,6 +728,8 @@ struct VIEW::recacheItem
{ {
aItem->setGroup( layer, -1 ); aItem->setGroup( layer, -1 );
} }
return true;
} }
VIEW* view; VIEW* view;
@ -798,12 +810,14 @@ struct VIEW::clearLayerCache
{ {
} }
void operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{ {
if( aItem->storesGroups() ) if( aItem->storesGroups() )
{ {
aItem->deleteGroups(); aItem->deleteGroups();
} }
return true;
} }
VIEW* view; VIEW* view;

View File

@ -191,7 +191,7 @@ void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_TEXT* aItem, GAL* aGal ) const
aGal->SetStrokeColor( COLOR4D( aItem->GetColor() ) ); aGal->SetStrokeColor( COLOR4D( aItem->GetColor() ) );
aGal->SetLineWidth( aItem->GetThickness() ); aGal->SetLineWidth( aItem->GetThickness() );
aGal->SetTextAttributes( aItem ); aGal->SetTextAttributes( aItem );
aGal->StrokeText( std::string( aItem->GetText().mb_str() ), position, 0.0 ); aGal->StrokeText( std::wstring( aItem->GetText().wc_str() ), position, 0.0 );
} }

View File

@ -112,13 +112,13 @@ target_link_libraries( cvpcb
# Only for win32 cross compilation using MXE # Only for win32 cross compilation using MXE
if( WIN32 AND MSYS AND CMAKE_CROSSCOMPILING ) if( WIN32 AND MSYS AND CMAKE_CROSSCOMPILING )
target_link_libraries(cvpcb target_link_libraries(cvpcb
opengl32 opengl32
glu32 glu32
pixman-1 pixman-1
fontconfig fontconfig
freetype freetype
bz2 bz2
) )
endif() endif()
@ -126,6 +126,9 @@ if( BUILD_GITHUB_PLUGIN )
target_link_libraries( cvpcb github_plugin ) target_link_libraries( cvpcb github_plugin )
endif() endif()
# Must follow github_plugin
target_link_libraries( cvpcb ${Boost_LIBRARIES} )
### ###
# Add cvpcb as install target # Add cvpcb as install target

View File

@ -176,7 +176,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
/* filter alias so one can use multiple aliases (for polar and nonpolar caps for /* filter alias so one can use multiple aliases (for polar and nonpolar caps for
* example) */ * example) */
FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( alias.m_FootprintName ); const FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( alias.m_FootprintName );
if( module ) if( module )
{ {
@ -185,7 +185,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
for( size_t jj = 0; jj < filtercount && !found; jj++ ) for( size_t jj = 0; jj < filtercount && !found; jj++ )
{ {
found = module->m_Module.Matches( component->GetFootprintFilters()[jj] ); found = module->GetFootprintName().Matches( component->GetFootprintFilters()[jj] );
} }
} }
else else
@ -210,7 +210,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
{ {
/* we do not need to analyse wildcards: single footprint do not contain them */ /* we do not need to analyse wildcards: single footprint do not contain them */
/* and if there are wildcards it just will not match any */ /* and if there are wildcards it just will not match any */
FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( component->GetFootprintFilters()[0] ); const FOOTPRINT_INFO* module = m_footprints.GetModuleInfo( component->GetFootprintFilters()[0] );
if( module ) if( module )
{ {

View File

@ -89,7 +89,6 @@ void CVPCB_MAINFRAME::LoadProjectFile( const wxString& aFileName )
// User library path takes precedent over default library search paths. // User library path takes precedent over default library search paths.
wxGetApp().InsertLibraryPath( m_UserLibraryPath, 1 ); wxGetApp().InsertLibraryPath( m_UserLibraryPath, 1 );
#if defined( USE_FP_LIB_TABLE )
delete m_footprintLibTable; delete m_footprintLibTable;
// Attempt to load the project footprint library table if it exists. // Attempt to load the project footprint library table if it exists.
@ -111,7 +110,6 @@ void CVPCB_MAINFRAME::LoadProjectFile( const wxString& aFileName )
{ {
DisplayError( this, ioe.errorText ); DisplayError( this, ioe.errorText );
} }
#endif
} }

View File

@ -479,7 +479,6 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
try try
{ {
#if defined( USE_FP_LIB_TABLE )
FPID fpid; FPID fpid;
if( fpid.Parse( aFootprintName ) >= 0 ) if( fpid.Parse( aFootprintName ) >= 0 )
@ -496,35 +495,6 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
fpname.c_str(), nickname.c_str() ); fpname.c_str(), nickname.c_str() );
footprint = m_footprintLibTable->FootprintLoad( FROM_UTF8( nickname.c_str() ), FROM_UTF8( fpname.c_str() ) ); footprint = m_footprintLibTable->FootprintLoad( FROM_UTF8( nickname.c_str() ), FROM_UTF8( fpname.c_str() ) );
#else
CVPCB_MAINFRAME* parent = ( CVPCB_MAINFRAME* ) GetParent();
PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::LEGACY ) );
for( unsigned i = 0; i < parent->m_ModuleLibNames.GetCount(); ++i )
{
wxFileName fn( wxEmptyString, parent->m_ModuleLibNames[i],
LegacyFootprintLibPathExtension );
wxString libPath = wxGetApp().FindLibraryPath( fn );
if( !libPath )
{
wxString msg = wxString::Format( _( "PCB footprint library file <%s> could not "
"be found in the default search paths." ),
fn.GetFullName().GetData() );
// @todo we should not be using wxMessageBox directly.
wxMessageBox( msg, wxEmptyString, wxOK | wxICON_ERROR, this );
continue;
}
footprint = pi->FootprintLoad( libPath, aFootprintName );
if( footprint != NULL )
break;
}
#endif
} }
catch( IO_ERROR ioe ) catch( IO_ERROR ioe )
{ {
@ -558,9 +528,9 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) ); msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) );
SetTitle( msg ); SetTitle( msg );
FOOTPRINT_INFO* module_info = parentframe->m_footprints.GetModuleInfo( footprintName ); const FOOTPRINT_INFO* module_info = parentframe->m_footprints.GetModuleInfo( footprintName );
const wxChar *libname; const wxChar* libname;
if( module_info ) if( module_info )
libname = GetChars( module_info->GetNickname() ); libname = GetChars( module_info->GetNickname() );

View File

@ -135,14 +135,9 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
{ {
if( aFilterType == UNFILTERED ) if( aFilterType == UNFILTERED )
{ {
#if !defined( USE_FP_LIB_TABLE )
msg.Printf( wxT( "%3zu %s" ), newList.GetCount() + 1,
GetChars( aList.GetItem( ii ).m_Module ) );
#else
msg.Printf( wxT( "%3zu %s:%s" ), newList.GetCount() + 1, msg.Printf( wxT( "%3zu %s:%s" ), newList.GetCount() + 1,
GetChars( aList.GetItem( ii ).GetNickname() ), GetChars( aList.GetItem( ii ).GetNickname() ),
GetChars( aList.GetItem( ii ).m_Module ) ); GetChars( aList.GetItem( ii ).GetFootprintName() ) );
#endif
newList.Add( msg ); newList.Add( msg );
continue; continue;
} }
@ -151,22 +146,17 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
&& !aList.GetItem( ii ).InLibrary( aLibName ) ) && !aList.GetItem( ii ).InLibrary( aLibName ) )
continue; continue;
if( (aFilterType & BY_COMPONENT) && (aComponent != NULL) if( (aFilterType & BY_COMPONENT) && aComponent
&& !aComponent->MatchesFootprintFilters( aList.GetItem( ii ).m_Module ) ) && !aComponent->MatchesFootprintFilters( aList.GetItem( ii ).GetFootprintName() ) )
continue; continue;
if( (aFilterType & BY_PIN_COUNT) && (aComponent!= NULL) if( (aFilterType & BY_PIN_COUNT) && aComponent
&& (aComponent->GetNetCount() != aList.GetItem( ii ).m_padCount) ) && aComponent->GetNetCount() != aList.GetItem( ii ).GetPadCount() )
continue; continue;
#if !defined( USE_FP_LIB_TABLE )
msg.Printf( wxT( "%3zu %s" ), newList.GetCount() + 1,
aList.GetItem( ii ).m_Module.GetData() );
#else
msg.Printf( wxT( "%3zu %s:%s" ), newList.GetCount() + 1, msg.Printf( wxT( "%3zu %s:%s" ), newList.GetCount() + 1,
GetChars( aList.GetItem( ii ).GetNickname() ), GetChars( aList.GetItem( ii ).GetNickname() ),
GetChars( aList.GetItem( ii ).m_Module ) ); GetChars( aList.GetItem( ii ).GetFootprintName() ) );
#endif
newList.Add( msg ); newList.Add( msg );
} }

View File

@ -73,9 +73,7 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
EVT_MENU( ID_SAVE_PROJECT_AS, CVPCB_MAINFRAME::SaveProjectFile ) EVT_MENU( ID_SAVE_PROJECT_AS, CVPCB_MAINFRAME::SaveProjectFile )
EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave ) EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )
#if defined( USE_FP_LIB_TABLE )
EVT_MENU( ID_CVPCB_LIB_TABLE_EDIT, CVPCB_MAINFRAME::OnEditFootprintLibraryTable ) EVT_MENU( ID_CVPCB_LIB_TABLE_EDIT, CVPCB_MAINFRAME::OnEditFootprintLibraryTable )
#endif
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, CVPCB_MAINFRAME::SetLanguage ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, CVPCB_MAINFRAME::SetLanguage )
@ -122,10 +120,8 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
m_undefinedComponentCnt = 0; m_undefinedComponentCnt = 0;
m_skipComponentSelect = false; m_skipComponentSelect = false;
#if defined( USE_FP_LIB_TABLE )
m_globalFootprintTable = NULL; m_globalFootprintTable = NULL;
m_footprintLibTable = NULL; m_footprintLibTable = NULL;
#endif
/* Name of the document footprint list /* Name of the document footprint list
* usually located in share/modules/footprints_doc * usually located in share/modules/footprints_doc
@ -199,7 +195,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
m_auimgr.Update(); m_auimgr.Update();
#if defined( USE_FP_LIB_TABLE )
if( m_globalFootprintTable == NULL ) if( m_globalFootprintTable == NULL )
{ {
try try
@ -229,8 +224,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
m_footprintLibTable = new FP_LIB_TABLE( m_globalFootprintTable ); m_footprintLibTable = new FP_LIB_TABLE( m_globalFootprintTable );
} }
#endif
} }
@ -511,7 +504,6 @@ void CVPCB_MAINFRAME::ConfigCvpcb( wxCommandEvent& event )
} }
#if defined( USE_FP_LIB_TABLE )
void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent ) void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
{ {
bool tableChanged = false; bool tableChanged = false;
@ -556,9 +548,11 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
} }
if( tableChanged ) if( tableChanged )
{
BuildLIBRARY_LISTBOX(); BuildLIBRARY_LISTBOX();
m_footprints.ReadFootprintFiles( m_footprintLibTable );
}
} }
#endif
void CVPCB_MAINFRAME::OnKeepOpenOnSave( wxCommandEvent& event ) void CVPCB_MAINFRAME::OnKeepOpenOnSave( wxCommandEvent& event )
@ -703,20 +697,20 @@ void CVPCB_MAINFRAME::DisplayStatus()
} }
else else
{ {
wxString footprintName = m_FootprintList->GetSelectedFootprint(); wxString footprintName = m_FootprintList->GetSelectedFootprint();
FOOTPRINT_INFO* module = m_footprints.GetModuleInfo( footprintName ); FOOTPRINT_INFO* module = m_footprints.GetModuleInfo( footprintName );
if( module ) // can be NULL if no netlist loaded if( module ) // can be NULL if no netlist loaded
{ {
msg = _( "Description: " ) + module->m_Doc; msg = _( "Description: " ) + module->GetDoc();
SetStatusText( msg, 0 ); SetStatusText( msg, 0 );
msg = _( "Key words: " ) + module->m_KeyWord; msg = _( "Key words: " ) + module->GetKeywords();
SetStatusText( msg, 1 ); SetStatusText( msg, 1 );
} }
} }
msg.Empty(); msg.Empty();
if( m_FootprintList ) if( m_FootprintList )
@ -762,33 +756,12 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles()
return false; return false;
} }
#if !defined( USE_FP_LIB_TABLE )
m_footprints.ReadFootprintFiles( m_ModuleLibNames );
#else
if( m_footprintLibTable != NULL ) if( m_footprintLibTable != NULL )
m_footprints.ReadFootprintFiles( m_footprintLibTable ); m_footprints.ReadFootprintFiles( m_footprintLibTable );
#endif
// Display error messages, if any. if( m_footprints.GetErrorCount() )
if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() )
{ {
HTML_MESSAGE_BOX dialog( this, _( "Load Error" ) ); m_footprints.DisplayErrors( this );
if( !m_footprints.m_filesNotFound.IsEmpty() )
{
wxString message = _( "Some files could not be found!" );
dialog.MessageSet( message );
dialog.ListSet( m_footprints.m_filesNotFound );
}
// Display if there are invalid files.
if( !m_footprints.m_filesInvalid.IsEmpty() )
{
dialog.MessageSet( _( "Some files are invalid!" ) );
dialog.ListSet( m_footprints.m_filesInvalid );
}
dialog.ShowModal();
} }
return true; return true;
@ -953,9 +926,7 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
wxSize( 600, 400 ), wxSize( 600, 400 ),
KICAD_DEFAULT_DRAWFRAME_STYLE ); KICAD_DEFAULT_DRAWFRAME_STYLE );
#if defined( USE_FP_LIB_TABLE )
m_DisplayFootprintFrame->SetFootprintLibTable( m_footprintLibTable ); m_DisplayFootprintFrame->SetFootprintLibTable( m_footprintLibTable );
#endif
m_DisplayFootprintFrame->Show( true ); m_DisplayFootprintFrame->Show( true );
} }
@ -1052,7 +1023,6 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
wxFONTWEIGHT_NORMAL ) ); wxFONTWEIGHT_NORMAL ) );
} }
#if defined( USE_FP_LIB_TABLE )
if( m_footprintLibTable ) if( m_footprintLibTable )
{ {
wxArrayString libNames; wxArrayString libNames;
@ -1064,9 +1034,6 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
m_LibraryList->SetLibraryList( libNames ); m_LibraryList->SetLibraryList( libNames );
} }
#else
m_LibraryList->SetLibraryList( m_ModuleLibNames );
#endif
} }

View File

@ -99,9 +99,7 @@ bool EDA_APP::OnInit()
InitEDA_Appl( wxT( "CvPcb" ), APP_CVPCB_T ); InitEDA_Appl( wxT( "CvPcb" ), APP_CVPCB_T );
#if defined( USE_FP_LIB_TABLE )
SetFootprintLibTablePath(); SetFootprintLibTablePath();
#endif
if( m_Checker && m_Checker->IsAnotherRunning() ) if( m_Checker && m_Checker->IsAnotherRunning() )
{ {

View File

@ -55,7 +55,6 @@ class CVPCB_MAINFRAME : public EDA_BASE_FRAME
{ {
wxArrayString m_footprintListEntries; wxArrayString m_footprintListEntries;
#if defined( USE_FP_LIB_TABLE )
/// The global footprint library table. /// The global footprint library table.
FP_LIB_TABLE* m_globalFootprintTable; FP_LIB_TABLE* m_globalFootprintTable;
@ -63,7 +62,6 @@ class CVPCB_MAINFRAME : public EDA_BASE_FRAME
/// footprint library table and the global footprint table. This is the one to /// footprint library table and the global footprint table. This is the one to
/// use when finding a #MODULE. /// use when finding a #MODULE.
FP_LIB_TABLE* m_footprintLibTable; FP_LIB_TABLE* m_footprintLibTable;
#endif
public: public:
bool m_KeepCvpcbOpen; bool m_KeepCvpcbOpen;
@ -148,9 +146,7 @@ public:
* Function OnEditLibraryTable * Function OnEditLibraryTable
* envokes the footpirnt library table edit dialog. * envokes the footpirnt library table edit dialog.
*/ */
#if defined( USE_FP_LIB_TABLE )
void OnEditFootprintLibraryTable( wxCommandEvent& aEvent ); void OnEditFootprintLibraryTable( wxCommandEvent& aEvent );
#endif
void OnKeepOpenOnSave( wxCommandEvent& event ); void OnKeepOpenOnSave( wxCommandEvent& event );
void DisplayModule( wxCommandEvent& event ); void DisplayModule( wxCommandEvent& event );

View File

@ -110,17 +110,9 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
#if !defined( USE_FP_LIB_TABLE )
// Libraries to load
AddMenuItem( preferencesMenu, wxID_PREFERENCES,
_( "&Libraries" ),
_( "Set footprint libraries to load and library search paths" ),
KiBitmap( config_xpm ) );
#else
AddMenuItem( preferencesMenu, ID_CVPCB_LIB_TABLE_EDIT, AddMenuItem( preferencesMenu, ID_CVPCB_LIB_TABLE_EDIT,
_( "Li&brary Tables" ), _( "Setup footprint libraries" ), _( "Li&brary Tables" ), _( "Setup footprint libraries" ),
KiBitmap( library_table_xpm ) ); KiBitmap( library_table_xpm ) );
#endif
// Language submenu // Language submenu
wxGetApp().AddMenuLanguageList( preferencesMenu ); wxGetApp().AddMenuLanguageList( preferencesMenu );

View File

@ -159,8 +159,6 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
isLegacy = false; // None of the components have footprints assigned. isLegacy = false; // None of the components have footprints assigned.
} }
#if defined( USE_FP_LIB_TABLE )
wxString missingLibs; wxString missingLibs;
// Check if footprint links were generated before the footprint library table was implemented. // Check if footprint links were generated before the footprint library table was implemented.
@ -217,7 +215,6 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
} }
} }
} }
#endif
for( unsigned i = 0; i < m_netlist.GetCount(); i++ ) for( unsigned i = 0; i < m_netlist.GetCount(); i++ )
{ {
@ -272,7 +269,6 @@ int CVPCB_MAINFRAME::SaveCmpLinkFile( const wxString& aFullFileName )
if( !fn.HasExt() ) if( !fn.HasExt() )
fn.SetExt( ComponentFileExtension ); fn.SetExt( ComponentFileExtension );
#if defined( USE_FP_LIB_TABLE )
// Save the project specific footprint library table. // Save the project specific footprint library table.
if( !m_footprintLibTable->IsEmpty( false ) ) if( !m_footprintLibTable->IsEmpty( false ) )
{ {
@ -298,8 +294,6 @@ int CVPCB_MAINFRAME::SaveCmpLinkFile( const wxString& aFullFileName )
} }
} }
} }
#endif
} }
if( !IsWritable( fn.GetFullPath() ) ) if( !IsWritable( fn.GetFullPath() ) )

View File

@ -26,8 +26,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <algorithm> // to use sort vector #include <algorithm>
#include <vector>
#include <fctsys.h> #include <fctsys.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>

View File

@ -30,7 +30,7 @@
#include <wx/regex.h> #include <wx/regex.h>
#include <algorithm> // to use sort vector #include <algorithm>
#include <vector> #include <vector>
#include <fctsys.h> #include <fctsys.h>

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -863,7 +863,19 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
// Disable unit selection if only one unit exists: // Disable unit selection if only one unit exists:
if( choiceCount <= 1 ) if( choiceCount <= 1 )
{
unitChoice->Enable( false ); unitChoice->Enable( false );
unitsInterchageableLabel->Show( false );
unitsInterchageableText->Show( false );
}
else
{
// Show the "Units are not interchangeable" message option?
if( !m_LibEntry || !m_LibEntry->UnitsLocked() )
unitsInterchageableLabel->SetLabel( _("Yes") );
else
unitsInterchageableLabel->SetLabel( _("No") );
}
int orientation = m_Cmp->GetOrientation() int orientation = m_Cmp->GetOrientation()
& ~( CMP_MIRROR_X | CMP_MIRROR_Y ); & ~( CMP_MIRROR_X | CMP_MIRROR_Y );
@ -895,24 +907,17 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
// Activate/Desactivate the normal/convert option ? (activated only if // Activate/Desactivate the normal/convert option ? (activated only if
// the component has more than one shape) // the component has more than one shape)
if( m_Cmp->GetConvert() > 1 ) if( m_Cmp->GetConvert() > 1 )
{
convertCheckBox->SetValue( true ); convertCheckBox->SetValue( true );
}
if( m_LibEntry == NULL || !m_LibEntry->HasConversion() ) if( m_LibEntry == NULL || !m_LibEntry->HasConversion() )
{
convertCheckBox->Enable( false ); convertCheckBox->Enable( false );
}
// Show the "Parts Locked" option?
if( !m_LibEntry || !m_LibEntry->UnitsLocked() )
{
DBG( printf( "partsAreLocked->false\n" ); )
partsAreLockedLabel->Show( false );
}
// Set the component's library name. // Set the component's library name.
chipnameTextCtrl->SetValue( m_Cmp->m_ChipName ); chipnameTextCtrl->SetValue( m_Cmp->m_ChipName );
// Set the component's unique ID time stamp.
m_textCtrlTimeStamp->SetValue( wxString::Format( wxT("%8.8lX"),
(unsigned long) m_Cmp->GetTimeStamp() ) );
} }

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013) // C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -32,22 +32,27 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
unitChoice->SetSelection( 0 ); unitChoice->SetSelection( 0 );
optionsSizer->Add( unitChoice, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); optionsSizer->Add( unitChoice, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* orientationSizer; wxBoxSizer* bSizerUnitsInterchangeable;
orientationSizer = new wxBoxSizer( wxHORIZONTAL ); bSizerUnitsInterchangeable = new wxBoxSizer( wxHORIZONTAL );
unitsInterchageableText = new wxStaticText( this, wxID_ANY, _("Units are interchangeable:"), wxDefaultPosition, wxDefaultSize, 0 );
unitsInterchageableText->Wrap( -1 );
bSizerUnitsInterchangeable->Add( unitsInterchageableText, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
unitsInterchageableLabel = new wxStaticText( this, wxID_ANY, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 );
unitsInterchageableLabel->Wrap( -1 );
bSizerUnitsInterchangeable->Add( unitsInterchageableLabel, 0, wxALL, 5 );
optionsSizer->Add( bSizerUnitsInterchangeable, 1, wxEXPAND, 5 );
wxString orientationRadioBoxChoices[] = { _("0"), _("+90"), _("180"), _("-90") }; wxString orientationRadioBoxChoices[] = { _("0"), _("+90"), _("180"), _("-90") };
int orientationRadioBoxNChoices = sizeof( orientationRadioBoxChoices ) / sizeof( wxString ); int orientationRadioBoxNChoices = sizeof( orientationRadioBoxChoices ) / sizeof( wxString );
orientationRadioBox = new wxRadioBox( this, wxID_ANY, _("Orientation (Degrees)"), wxDefaultPosition, wxDefaultSize, orientationRadioBoxNChoices, orientationRadioBoxChoices, 1, wxRA_SPECIFY_COLS ); orientationRadioBox = new wxRadioBox( this, wxID_ANY, _("Orientation (Degrees)"), wxDefaultPosition, wxDefaultSize, orientationRadioBoxNChoices, orientationRadioBoxChoices, 1, wxRA_SPECIFY_COLS );
orientationRadioBox->SetSelection( 0 ); orientationRadioBox->SetSelection( 1 );
orientationRadioBox->SetToolTip( _("Select if the component is to be rotated when drawn") ); orientationRadioBox->SetToolTip( _("Select if the component is to be rotated when drawn") );
orientationSizer->Add( orientationRadioBox, 1, wxALL|wxEXPAND, 8 ); optionsSizer->Add( orientationRadioBox, 0, wxEXPAND|wxALL, 5 );
optionsSizer->Add( orientationSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 0 );
wxBoxSizer* mirrorSizer;
mirrorSizer = new wxBoxSizer( wxHORIZONTAL );
wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") }; wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") };
int mirrorRadioBoxNChoices = sizeof( mirrorRadioBoxChoices ) / sizeof( wxString ); int mirrorRadioBoxNChoices = sizeof( mirrorRadioBoxChoices ) / sizeof( wxString );
@ -55,10 +60,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
mirrorRadioBox->SetSelection( 0 ); mirrorRadioBox->SetSelection( 0 );
mirrorRadioBox->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") ); mirrorRadioBox->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") );
mirrorSizer->Add( mirrorRadioBox, 1, wxALL, 8 ); optionsSizer->Add( mirrorRadioBox, 0, wxALL|wxEXPAND, 5 );
optionsSizer->Add( mirrorSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 0 );
m_staticTextChipname = new wxStaticText( this, wxID_ANY, _("Chip Name"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextChipname = new wxStaticText( this, wxID_ANY, _("Chip Name"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextChipname->Wrap( -1 ); m_staticTextChipname->Wrap( -1 );
@ -73,19 +75,24 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
convertCheckBox = new wxCheckBox( this, wxID_ANY, _("Convert"), wxDefaultPosition, wxDefaultSize, 0 ); convertCheckBox = new wxCheckBox( this, wxID_ANY, _("Convert"), wxDefaultPosition, wxDefaultSize, 0 );
convertCheckBox->SetToolTip( _("Use the alternate shape of this component.\nFor gates, this is the \"De Morgan\" conversion") ); convertCheckBox->SetToolTip( _("Use the alternate shape of this component.\nFor gates, this is the \"De Morgan\" conversion") );
optionsSizer->Add( convertCheckBox, 0, wxALL, 8 ); optionsSizer->Add( convertCheckBox, 0, wxALL, 5 );
partsAreLockedLabel = new wxStaticText( this, wxID_ANY, _("Parts are locked"), wxDefaultPosition, wxDefaultSize, 0 );
partsAreLockedLabel->Wrap( -1 );
optionsSizer->Add( partsAreLockedLabel, 0, wxALL|wxEXPAND, 8 );
defaultsButton = new wxButton( this, wxID_ANY, _("Reset to Library Defaults"), wxDefaultPosition, wxDefaultSize, 0 ); defaultsButton = new wxButton( this, wxID_ANY, _("Reset to Library Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
defaultsButton->SetToolTip( _("Set position and style of fields and component orientation to default lib value.\nFields texts are not modified.") ); defaultsButton->SetToolTip( _("Set position and style of fields and component orientation to default lib value.\nFields texts are not modified.") );
optionsSizer->Add( defaultsButton, 0, wxALL|wxEXPAND, 5 ); optionsSizer->Add( defaultsButton, 0, wxALL|wxEXPAND, 5 );
m_staticTextTimeStamp = new wxStaticText( this, wxID_ANY, _("Timestamp"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextTimeStamp->Wrap( -1 );
optionsSizer->Add( m_staticTextTimeStamp, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
upperSizer->Add( optionsSizer, 0, wxALIGN_TOP|wxALL|wxEXPAND, 5 ); m_textCtrlTimeStamp = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
m_textCtrlTimeStamp->SetToolTip( _("An unique ID (a time stamp) to identify the component.\nThis is an alternate identifier to the reference.") );
optionsSizer->Add( m_textCtrlTimeStamp, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
upperSizer->Add( optionsSizer, 0, wxALIGN_TOP|wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* fieldsSizer; wxStaticBoxSizer* fieldsSizer;
fieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxHORIZONTAL ); fieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxHORIZONTAL );
@ -265,7 +272,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
stdDialogButtonSizer->AddButton( stdDialogButtonSizerCancel ); stdDialogButtonSizer->AddButton( stdDialogButtonSizerCancel );
stdDialogButtonSizer->Realize(); stdDialogButtonSizer->Realize();
mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 8 ); mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( mainSizer ); this->SetSizer( mainSizer );

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013) // C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -21,8 +21,8 @@ class DIALOG_SHIM;
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/radiobox.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
@ -43,13 +43,16 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
protected: protected:
wxStaticText* m_staticTextUnit; wxStaticText* m_staticTextUnit;
wxChoice* unitChoice; wxChoice* unitChoice;
wxStaticText* unitsInterchageableText;
wxStaticText* unitsInterchageableLabel;
wxRadioBox* orientationRadioBox; wxRadioBox* orientationRadioBox;
wxRadioBox* mirrorRadioBox; wxRadioBox* mirrorRadioBox;
wxStaticText* m_staticTextChipname; wxStaticText* m_staticTextChipname;
wxTextCtrl* chipnameTextCtrl; wxTextCtrl* chipnameTextCtrl;
wxCheckBox* convertCheckBox; wxCheckBox* convertCheckBox;
wxStaticText* partsAreLockedLabel;
wxButton* defaultsButton; wxButton* defaultsButton;
wxStaticText* m_staticTextTimeStamp;
wxTextCtrl* m_textCtrlTimeStamp;
wxListCtrl* fieldListCtrl; wxListCtrl* fieldListCtrl;
wxButton* addFieldButton; wxButton* addFieldButton;
wxButton* deleteFieldButton; wxButton* deleteFieldButton;

View File

@ -3,7 +3,9 @@
DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) : DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) :
DIALOG_LIB_NEW_COMPONENT_BASE( parent ) DIALOG_LIB_NEW_COMPONENT_BASE( parent )
{ {
/* Required to make escape key work correctly in wxGTK. */ // initial focus should be on first editable field.
m_sdbSizerOK->SetFocus(); m_textName->SetFocus();
// What happens when user presses "Enter"? OK button! OK?
m_sdbSizerOK->SetDefault(); m_sdbSizerOK->SetDefault();
} }

View File

@ -20,8 +20,10 @@
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header"></property>
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property> <property name="skip_php_events">1</property>
<property name="skip_python_events">1</property> <property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">1</property> <property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
@ -88,23 +90,23 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">mainSizer</property> <property name="name">bSizer7</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">12</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer5</property> <property name="name">bSizer16</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxALIGN_LEFT</property> <property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -140,7 +142,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_staticText6</property> <property name="name">m_staticText8</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
@ -183,30 +185,27 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">0</property> <property name="border">20</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxFlexGridSizer" expanded="0">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer2</property> <property name="name">fgSizer31</property>
<property name="orient">wxHORIZONTAL</property> <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <property name="rows">0</property>
<property name="border">3</property> <property name="vgap">0</property>
<property name="flag">wxEXPAND</property> <object class="sizeritem" expanded="0">
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -285,21 +284,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">3</property> <property name="border">3</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="spacer" expanded="1"> <object class="wxTextCtrl" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -386,42 +375,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="spacer" expanded="1"> <object class="wxStaticText" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">30</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">0</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -449,7 +407,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Default &amp;reference designator:</property> <property name="label">Default reference designator:</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -457,7 +415,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_staticText3</property> <property name="name">m_staticText9</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
@ -470,7 +428,7 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">This is the reference used in schematic for annotation.&#x0A;Do not use digits in reference.</property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -500,21 +458,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -545,7 +493,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -559,7 +507,7 @@
<property name="pos"></property> <property name="pos"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size">100,-1</property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
@ -601,42 +549,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="spacer" expanded="1"> <object class="wxStaticText" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">30</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">0</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -664,7 +581,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Number of units per &amp;package:</property> <property name="label">Number of units per package:</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -672,7 +589,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_staticText4</property> <property name="name">m_staticText10</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
@ -685,7 +602,7 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">This is the number of parts in this component package.&#x0A;A 74LS00 gate has 4 parts per packages.</property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -715,21 +632,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxSpinCtrl" expanded="1"> <object class="wxSpinCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -776,7 +683,7 @@
<property name="pos"></property> <property name="pos"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size">100,-1</property> <property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property> <property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
@ -812,42 +719,22 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">30</property>
</object>
</object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">0</property> <property name="border">15</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer7</property> <property name="name">bSizer17</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="spacer" expanded="1"> <object class="wxCheckBox" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -876,7 +763,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Create component with &amp;alternate body style (DeMorgan)</property> <property name="label">Create component with alternate body style (DeMorgan)</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -897,7 +784,7 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">Check this option for components that have a De Morgan representation.&#x0A;This is usual for gates.</property> <property name="tooltip"></property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
@ -931,32 +818,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> <object class="sizeritem" expanded="0">
</object> <property name="border">5</property>
<object class="sizeritem" expanded="1"> <property name="flag">wxALL</property>
<property name="border">0</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer8</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="spacer" expanded="1"> <object class="wxCheckBox" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -985,7 +851,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Create component as power &amp;symbol</property> <property name="label">Create component as power symbol</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1006,7 +872,7 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">Check this option for power symbols.&#x0A;Power symbols have specific properties for Eeschema:&#x0A;- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol&#x0A;- Reference is updated automatically when a netlist is created (no need to run Annotate)</property> <property name="tooltip"></property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
@ -1040,32 +906,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> <object class="sizeritem" expanded="0">
</object> <property name="border">5</property>
<object class="sizeritem" expanded="1"> <property name="flag">wxALL</property>
<property name="border">0</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer9</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="spacer" expanded="1"> <object class="wxCheckBox" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -1094,7 +939,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Units are not &amp;interchangeable</property> <property name="label">Units are not interchangeable</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1115,7 +960,7 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">Check this option if Eeschema cannot change parts selections inside a given package&#x0A;This happens when parts are different in this package.&#x0A;When this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count</property> <property name="tooltip"></property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
@ -1151,19 +996,30 @@
</object> </object>
</object> </object>
</object> </object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer18</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">10</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="spacer" expanded="1"> <object class="spacer" expanded="1">
<property name="height">0</property> <property name="height">10</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="width">0</property> <property name="width">0</property>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxALIGN_LEFT|wxBOTTOM</property> <property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1193,7 +1049,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Global Pin Settings</property> <property name="label">General Pin Settings</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1201,7 +1057,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_staticText7</property> <property name="name">m_staticText11</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
@ -1245,27 +1101,24 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">0</property> <property name="border">20</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxLEFT|wxRIGHT</property>
<property name="proportion">1</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
<property name="growablerows"></property>
<property name="hgap">55</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer6</property> <property name="name">fgSizer4</property>
<property name="orient">wxHORIZONTAL</property> <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property> <property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1295,7 +1148,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Pin text position &amp;offset:</property> <property name="label">Pin text position offset:</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1303,7 +1156,7 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_staticText41</property> <property name="name">m_staticText12</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
@ -1316,7 +1169,7 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">Margin (in 0.001 inches) between a pin name position and the component body.&#x0A;A value from 10 to 40 is usually good.</property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
@ -1347,18 +1200,8 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxSpinCtrl" expanded="1"> <object class="wxSpinCtrl" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1407,7 +1250,7 @@
<property name="pos"></property> <property name="pos"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size">100,-1</property> <property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property> <property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
@ -1443,113 +1286,20 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">mils</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText5</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size">30,-1</property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">0</property> <property name="border">15</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizer10</property> <property name="name">bSizer19</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="1"> <object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1580,7 +1330,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Show pin n&amp;umber text</property> <property name="label">Show pin number text</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1635,30 +1385,9 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">0</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer12</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="1"> <object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1689,7 +1418,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Show pin name te&amp;xt</property> <property name="label">Show pin name text</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1744,30 +1473,9 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer121</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">3</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">12</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="1"> <object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1798,7 +1506,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Pin name &amp;inside</property> <property name="label">Pin name inside</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -1855,42 +1563,32 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> </object>
<property name="border">10</property> </object>
<property name="flag">wxALL|wxEXPAND</property> <object class="sizeritem" expanded="1">
<property name="proportion">0</property> <property name="border">10</property>
<object class="spacer" expanded="1"> <property name="flag">wxALL|wxEXPAND</property>
<property name="height">5</property> <property name="proportion">0</property>
<property name="permission">protected</property> <object class="wxStdDialogButtonSizer" expanded="1">
<property name="width">0</property> <property name="Apply">0</property>
</object> <property name="Cancel">1</property>
</object> <property name="ContextHelp">0</property>
<object class="sizeritem" expanded="1"> <property name="Help">0</property>
<property name="border">0</property> <property name="No">0</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="OK">1</property>
<property name="proportion">0</property> <property name="Save">0</property>
<object class="wxStdDialogButtonSizer" expanded="1"> <property name="Yes">0</property>
<property name="Apply">0</property> <property name="minimum_size"></property>
<property name="Cancel">1</property> <property name="name">m_sdbSizer</property>
<property name="ContextHelp">0</property> <property name="permission">protected</property>
<property name="Help">0</property> <event name="OnApplyButtonClick"></event>
<property name="No">0</property> <event name="OnCancelButtonClick"></event>
<property name="OK">1</property> <event name="OnContextHelpButtonClick"></event>
<property name="Save">0</property> <event name="OnHelpButtonClick"></event>
<property name="Yes">0</property> <event name="OnNoButtonClick"></event>
<property name="minimum_size"></property> <event name="OnOKButtonClick"></event>
<property name="name">m_sdbSizer</property> <event name="OnSaveButtonClick"></event>
<property name="permission">protected</property> <event name="OnYesButtonClick"></event>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object> </object>
</object> </object>
</object> </object>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -13,209 +13,116 @@ DIALOG_LIB_NEW_COMPONENT_BASE::DIALOG_LIB_NEW_COMPONENT_BASE( wxWindow* parent,
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* mainSizer; wxBoxSizer* bSizer7;
mainSizer = new wxBoxSizer( wxHORIZONTAL ); bSizer7 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer5; wxBoxSizer* bSizer16;
bSizer5 = new wxBoxSizer( wxVERTICAL ); bSizer16 = new wxBoxSizer( wxVERTICAL );
m_staticText6 = new wxStaticText( this, wxID_ANY, _("General Settings"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText8 = new wxStaticText( this, wxID_ANY, _("General Settings"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 ); m_staticText8->Wrap( -1 );
m_staticText6->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); m_staticText8->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizer5->Add( m_staticText6, 0, wxALIGN_LEFT, 3 ); bSizer16->Add( m_staticText8, 0, wxALL, 5 );
wxBoxSizer* bSizer2; wxFlexGridSizer* fgSizer31;
bSizer2 = new wxBoxSizer( wxHORIZONTAL ); fgSizer31 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer31->AddGrowableCol( 1 );
fgSizer31->SetFlexibleDirection( wxBOTH );
bSizer2->Add( 12, 0, 0, wxEXPAND, 3 ); fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Component &name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2 = new wxStaticText( this, wxID_ANY, _("Component &name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 ); m_staticText2->Wrap( -1 );
m_staticText2->SetToolTip( _("This is the component name in library,\nand also the default component value when loaded in the schematic.") ); m_staticText2->SetToolTip( _("This is the component name in library,\nand also the default component value when loaded in the schematic.") );
bSizer2->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); fgSizer31->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
bSizer2->Add( 0, 0, 1, wxEXPAND, 3 );
m_textName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 100,-1 ), 0 ); m_textName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 100,-1 ), 0 );
m_textName->SetMaxLength( 0 ); m_textName->SetMaxLength( 0 );
bSizer2->Add( m_textName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); fgSizer31->Add( m_textName, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
m_staticText9 = new wxStaticText( this, wxID_ANY, _("Default reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizer31->Add( m_staticText9, 0, wxALL, 5 );
bSizer2->Add( 30, 0, 0, wxEXPAND, 3 ); m_textReference = new wxTextCtrl( this, wxID_ANY, _("U"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer31->Add( m_textReference, 0, wxALL|wxEXPAND, 5 );
m_staticText10 = new wxStaticText( this, wxID_ANY, _("Number of units per package:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText10->Wrap( -1 );
fgSizer31->Add( m_staticText10, 0, wxALL, 5 );
bSizer5->Add( bSizer2, 0, wxALL|wxEXPAND, 0 ); m_spinPartCount = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 26, 0 );
fgSizer31->Add( m_spinPartCount, 0, wxALL, 5 );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
bSizer16->Add( fgSizer31, 1, wxEXPAND|wxLEFT|wxRIGHT, 20 );
bSizer3->Add( 12, 0, 0, wxEXPAND, 3 ); wxBoxSizer* bSizer17;
bSizer17 = new wxBoxSizer( wxVERTICAL );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Default &reference designator:"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkHasConversion = new wxCheckBox( this, wxID_ANY, _("Create component with alternate body style (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 ); bSizer17->Add( m_checkHasConversion, 0, wxALL, 5 );
m_staticText3->SetToolTip( _("This is the reference used in schematic for annotation.\nDo not use digits in reference.") );
bSizer3->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); m_checkIsPowerSymbol = new wxCheckBox( this, wxID_ANY, _("Create component as power symbol"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer17->Add( m_checkIsPowerSymbol, 0, wxALL, 5 );
m_checkLockItems = new wxCheckBox( this, wxID_ANY, _("Units are not interchangeable"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer17->Add( m_checkLockItems, 0, wxALL, 5 );
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
m_textReference = new wxTextCtrl( this, wxID_ANY, _("U"), wxDefaultPosition, wxSize( 100,-1 ), 0 ); bSizer16->Add( bSizer17, 1, wxEXPAND|wxLEFT|wxRIGHT, 15 );
m_textReference->SetMaxLength( 0 );
bSizer3->Add( m_textReference, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
bSizer3->Add( 30, 0, 0, wxEXPAND, 5 ); bSizer7->Add( bSizer16, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer18;
bSizer18 = new wxBoxSizer( wxVERTICAL );
bSizer5->Add( bSizer3, 0, wxALL|wxEXPAND, 0 );
wxBoxSizer* bSizer4; bSizer18->Add( 0, 10, 0, wxEXPAND, 5 );
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
m_staticText11 = new wxStaticText( this, wxID_ANY, _("General Pin Settings"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
m_staticText11->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizer4->Add( 12, 0, 0, wxEXPAND, 3 ); bSizer18->Add( m_staticText11, 0, wxALL, 5 );
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Number of units per &package:"), wxDefaultPosition, wxDefaultSize, 0 ); wxFlexGridSizer* fgSizer4;
m_staticText4->Wrap( -1 ); fgSizer4 = new wxFlexGridSizer( 0, 2, 0, 55 );
m_staticText4->SetToolTip( _("This is the number of parts in this component package.\nA 74LS00 gate has 4 parts per packages.") ); fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
bSizer4->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); m_staticText12 = new wxStaticText( this, wxID_ANY, _("Pin text position offset:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
fgSizer4->Add( m_staticText12, 0, wxALL, 5 );
m_spinPinTextPosition = new wxSpinCtrl( this, wxID_ANY, wxT("40"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 100, 40 );
fgSizer4->Add( m_spinPinTextPosition, 0, wxALL, 5 );
bSizer4->Add( 0, 0, 1, wxEXPAND, 3 );
m_spinPartCount = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxSize( 100,-1 ), wxSP_ARROW_KEYS, 1, 26, 0 ); bSizer18->Add( fgSizer4, 0, wxLEFT|wxRIGHT, 20 );
bSizer4->Add( m_spinPartCount, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
wxBoxSizer* bSizer19;
bSizer19 = new wxBoxSizer( wxVERTICAL );
bSizer4->Add( 30, 0, 0, wxEXPAND, 3 ); m_checkShowPinNumber = new wxCheckBox( this, wxID_ANY, _("Show pin number text"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer5->Add( bSizer4, 0, wxALL|wxEXPAND, 0 );
wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
bSizer7->Add( 12, 0, 0, wxEXPAND, 3 );
m_checkHasConversion = new wxCheckBox( this, wxID_ANY, _("Create component with &alternate body style (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkHasConversion->SetToolTip( _("Check this option for components that have a De Morgan representation.\nThis is usual for gates.") );
bSizer7->Add( m_checkHasConversion, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
bSizer5->Add( bSizer7, 0, wxALL|wxEXPAND, 0 );
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxHORIZONTAL );
bSizer8->Add( 12, 0, 0, wxEXPAND, 3 );
m_checkIsPowerSymbol = new wxCheckBox( this, wxID_ANY, _("Create component as power &symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkIsPowerSymbol->SetToolTip( _("Check this option for power symbols.\nPower symbols have specific properties for Eeschema:\n- Value cannot be edited (to avoid mistakes) because this is the pin name that is important for a power symbol\n- Reference is updated automatically when a netlist is created (no need to run Annotate)") );
bSizer8->Add( m_checkIsPowerSymbol, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
bSizer5->Add( bSizer8, 0, wxALL|wxEXPAND, 0 );
wxBoxSizer* bSizer9;
bSizer9 = new wxBoxSizer( wxHORIZONTAL );
bSizer9->Add( 12, 0, 0, wxEXPAND, 3 );
m_checkLockItems = new wxCheckBox( this, wxID_ANY, _("Units are not &interchangeable"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkLockItems->SetToolTip( _("Check this option if Eeschema cannot change parts selections inside a given package\nThis happens when parts are different in this package.\nWhen this option is not checked, Eeschema automatically choose the parts in packages to minimize packages count") );
bSizer9->Add( m_checkLockItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
bSizer5->Add( bSizer9, 0, wxALL|wxEXPAND, 0 );
bSizer5->Add( 0, 0, 0, wxALL|wxEXPAND, 10 );
m_staticText7 = new wxStaticText( this, wxID_ANY, _("Global Pin Settings"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
m_staticText7->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizer5->Add( m_staticText7, 0, wxALIGN_LEFT|wxBOTTOM, 3 );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
bSizer6->Add( 12, 0, 0, wxEXPAND, 3 );
m_staticText41 = new wxStaticText( this, wxID_ANY, _("Pin text position &offset:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText41->Wrap( -1 );
m_staticText41->SetToolTip( _("Margin (in 0.001 inches) between a pin name position and the component body.\nA value from 10 to 40 is usually good.") );
bSizer6->Add( m_staticText41, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
bSizer6->Add( 0, 0, 1, wxEXPAND, 3 );
m_spinPinTextPosition = new wxSpinCtrl( this, wxID_ANY, wxT("40"), wxDefaultPosition, wxSize( 100,-1 ), wxSP_ARROW_KEYS, 1, 100, 40 );
bSizer6->Add( m_spinPinTextPosition, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_staticText5 = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxSize( 30,-1 ), 0 );
m_staticText5->Wrap( -1 );
bSizer6->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL, 3 );
bSizer5->Add( bSizer6, 1, wxALL|wxEXPAND, 0 );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxHORIZONTAL );
bSizer10->Add( 12, 0, 0, wxEXPAND, 3 );
m_checkShowPinNumber = new wxCheckBox( this, wxID_ANY, _("Show pin n&umber text"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkShowPinNumber->SetValue(true); m_checkShowPinNumber->SetValue(true);
bSizer10->Add( m_checkShowPinNumber, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); bSizer19->Add( m_checkShowPinNumber, 0, wxALL, 5 );
m_checkShowPinName = new wxCheckBox( this, wxID_ANY, _("Show pin name text"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer5->Add( bSizer10, 0, wxALL|wxEXPAND, 0 );
wxBoxSizer* bSizer12;
bSizer12 = new wxBoxSizer( wxHORIZONTAL );
bSizer12->Add( 12, 0, 0, wxEXPAND, 3 );
m_checkShowPinName = new wxCheckBox( this, wxID_ANY, _("Show pin name te&xt"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkShowPinName->SetValue(true); m_checkShowPinName->SetValue(true);
bSizer12->Add( m_checkShowPinName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); bSizer19->Add( m_checkShowPinName, 0, wxALL, 5 );
m_checkShowPinNameInside = new wxCheckBox( this, wxID_ANY, _("Pin name inside"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer5->Add( bSizer12, 0, wxALL|wxEXPAND, 0 );
wxBoxSizer* bSizer121;
bSizer121 = new wxBoxSizer( wxHORIZONTAL );
bSizer121->Add( 12, 0, 0, wxEXPAND, 3 );
m_checkShowPinNameInside = new wxCheckBox( this, wxID_ANY, _("Pin name &inside"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkShowPinNameInside->SetValue(true); m_checkShowPinNameInside->SetValue(true);
bSizer121->Add( m_checkShowPinNameInside, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); bSizer19->Add( m_checkShowPinNameInside, 0, wxALL, 5 );
bSizer5->Add( bSizer121, 1, wxEXPAND, 5 ); bSizer18->Add( bSizer19, 0, wxEXPAND|wxLEFT|wxRIGHT, 15 );
bSizer5->Add( 0, 5, 0, wxALL|wxEXPAND, 10 ); bSizer7->Add( bSizer18, 1, wxALL|wxEXPAND, 5 );
m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizerOK = new wxButton( this, wxID_OK );
@ -224,15 +131,12 @@ DIALOG_LIB_NEW_COMPONENT_BASE::DIALOG_LIB_NEW_COMPONENT_BASE( wxWindow* parent,
m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize(); m_sdbSizer->Realize();
bSizer5->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 0 ); bSizer7->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 10 );
mainSizer->Add( bSizer5, 1, wxALL|wxEXPAND, 12 ); this->SetSizer( bSizer7 );
this->SetSizer( mainSizer );
this->Layout(); this->Layout();
mainSizer->Fit( this ); bSizer7->Fit( this );
this->Centre( wxBOTH ); this->Centre( wxBOTH );
} }

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -21,8 +21,8 @@ class DIALOG_SHIM;
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h> #include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
@ -37,20 +37,19 @@ class DIALOG_LIB_NEW_COMPONENT_BASE : public DIALOG_SHIM
private: private:
protected: protected:
wxStaticText* m_staticText6; wxStaticText* m_staticText8;
wxStaticText* m_staticText2; wxStaticText* m_staticText2;
wxTextCtrl* m_textName; wxTextCtrl* m_textName;
wxStaticText* m_staticText3; wxStaticText* m_staticText9;
wxTextCtrl* m_textReference; wxTextCtrl* m_textReference;
wxStaticText* m_staticText4; wxStaticText* m_staticText10;
wxSpinCtrl* m_spinPartCount; wxSpinCtrl* m_spinPartCount;
wxCheckBox* m_checkHasConversion; wxCheckBox* m_checkHasConversion;
wxCheckBox* m_checkIsPowerSymbol; wxCheckBox* m_checkIsPowerSymbol;
wxCheckBox* m_checkLockItems; wxCheckBox* m_checkLockItems;
wxStaticText* m_staticText7; wxStaticText* m_staticText11;
wxStaticText* m_staticText41; wxStaticText* m_staticText12;
wxSpinCtrl* m_spinPinTextPosition; wxSpinCtrl* m_spinPinTextPosition;
wxStaticText* m_staticText5;
wxCheckBox* m_checkShowPinNumber; wxCheckBox* m_checkShowPinNumber;
wxCheckBox* m_checkShowPinName; wxCheckBox* m_checkShowPinName;
wxCheckBox* m_checkShowPinNameInside; wxCheckBox* m_checkShowPinNameInside;

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,12 @@ public:
{ {
m_staticSheetNameSizeUnits->SetLabel( aUnits ); m_staticSheetNameSizeUnits->SetLabel( aUnits );
} }
void SetSheetTimeStamp(const wxString& aTimeStamp)
{
m_textCtrlTimeStamp->SetValue( aTimeStamp );
}
}; };
#endif // __dialog_sch_sheet_props__ #endif // __dialog_sch_sheet_props__

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012) // C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -16,8 +16,11 @@ DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWi
wxBoxSizer* mainSizer; wxBoxSizer* mainSizer;
mainSizer = new wxBoxSizer( wxVERTICAL ); mainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer1; wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 2, 6, 0, 0 ); fgSizer1 = new wxFlexGridSizer( 0, 6, 0, 0 );
fgSizer1->AddGrowableCol( 1 ); fgSizer1->AddGrowableCol( 1 );
fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
@ -27,6 +30,7 @@ DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWi
fgSizer1->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); fgSizer1->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textFileName->SetMaxLength( 0 );
m_textFileName->SetMinSize( wxSize( 200,-1 ) ); m_textFileName->SetMinSize( wxSize( 200,-1 ) );
fgSizer1->Add( m_textFileName, 5, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 3 ); fgSizer1->Add( m_textFileName, 5, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 3 );
@ -39,6 +43,7 @@ DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWi
fgSizer1->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); fgSizer1->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textFileNameSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textFileNameSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textFileNameSize->SetMaxLength( 0 );
fgSizer1->Add( m_textFileNameSize, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 3 ); fgSizer1->Add( m_textFileNameSize, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 3 );
m_staticFileNameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticFileNameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
@ -50,6 +55,7 @@ DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWi
fgSizer1->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); fgSizer1->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textSheetName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textSheetName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textSheetName->SetMaxLength( 0 );
fgSizer1->Add( m_textSheetName, 5, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 3 ); fgSizer1->Add( m_textSheetName, 5, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 3 );
@ -60,14 +66,43 @@ DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWi
fgSizer1->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); fgSizer1->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textSheetNameSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textSheetNameSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textSheetNameSize->SetMaxLength( 0 );
fgSizer1->Add( m_textSheetNameSize, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 3 ); fgSizer1->Add( m_textSheetNameSize, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 3 );
m_staticSheetNameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticSheetNameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticSheetNameSizeUnits->Wrap( -1 ); m_staticSheetNameSizeUnits->Wrap( -1 );
fgSizer1->Add( m_staticSheetNameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); fgSizer1->Add( m_staticSheetNameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizer1->Add( m_staticline2, 0, wxEXPAND|wxALL, 5 );
mainSizer->Add( fgSizer1, 1, wxALL|wxEXPAND, 12 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizer1->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticTextTimeStamp = new wxStaticText( this, wxID_ANY, _("Unique timestamp:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextTimeStamp->Wrap( -1 );
fgSizer1->Add( m_staticTextTimeStamp, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_textCtrlTimeStamp = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
fgSizer1->Add( m_textCtrlTimeStamp, 0, wxEXPAND|wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
bupperSizer->Add( fgSizer1, 1, wxALL|wxEXPAND, 12 );
mainSizer->Add( bupperSizer, 0, wxEXPAND, 5 );
mainSizer->Add( 0, 0, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); mainSizer->Add( 0, 0, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012) // C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -11,6 +11,8 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
@ -19,8 +21,8 @@
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/sizer.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
@ -44,6 +46,10 @@ class DIALOG_SCH_SHEET_PROPS_BASE : public DIALOG_SHIM
wxStaticText* m_staticText5; wxStaticText* m_staticText5;
wxTextCtrl* m_textSheetNameSize; wxTextCtrl* m_textSheetNameSize;
wxStaticText* m_staticSheetNameSizeUnits; wxStaticText* m_staticSheetNameSizeUnits;
wxStaticLine* m_staticline2;
wxStaticLine* m_staticline3;
wxStaticText* m_staticTextTimeStamp;
wxTextCtrl* m_textCtrlTimeStamp;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1; wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1OK;
@ -51,7 +57,7 @@ class DIALOG_SCH_SHEET_PROPS_BASE : public DIALOG_SHIM
public: public:
DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Sheet Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 453,170 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Sheet Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 519,198 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_SCH_SHEET_PROPS_BASE(); ~DIALOG_SCH_SHEET_PROPS_BASE();
}; };

View File

@ -169,7 +169,7 @@ HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* parent, wxDC* DC, cons
// Set dialog window size to be large enough // Set dialog window size to be large enough
m_TreeSize.x = itemrect.GetWidth() + 20; m_TreeSize.x = itemrect.GetWidth() + 20;
m_TreeSize.x = max( m_TreeSize.x, 250 ); m_TreeSize.x = std::max( m_TreeSize.x, 250 );
// Readjust the size of the frame to an optimal value. // Readjust the size of the frame to an optimal value.
m_TreeSize.y = m_nbsheets * itemrect.GetHeight(); m_TreeSize.y = m_nbsheets * itemrect.GetHeight();

View File

@ -246,7 +246,7 @@ bool SCH_BUS_ENTRY_BASE::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_BUS_ENTRY_BASE::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_BUS_ENTRY_BASE::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_pos ); aPoints.push_back( m_pos );
aPoints.push_back( m_End() ); aPoints.push_back( m_End() );

View File

@ -96,7 +96,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
BITMAP_DEF GetMenuImage() const { return add_entry_xpm; } BITMAP_DEF GetMenuImage() const { return add_entry_xpm; }

View File

@ -1605,7 +1605,7 @@ bool SCH_COMPONENT::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_COMPONENT::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_COMPONENT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
LIB_PIN* pin; LIB_PIN* pin;
LIB_COMPONENT* component = CMP_LIBRARY::FindLibraryComponent( m_ChipName ); LIB_COMPONENT* component = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
@ -1876,7 +1876,7 @@ bool SCH_COMPONENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccura
bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const
{ {
vector< wxPoint > pts; std::vector< wxPoint > pts;
GetConnectionPoints( pts ); GetConnectionPoints( pts );

View File

@ -357,7 +357,7 @@ public:
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ); bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ); void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList );
wxPoint GetPinPhysicalPosition( LIB_PIN* Pin ); wxPoint GetPinPhysicalPosition( LIB_PIN* Pin );
@ -372,7 +372,7 @@ public:
*/ */
bool IsInNetlist() const; bool IsInNetlist() const;
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector<wxPoint>& aPoints ) const;
SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );

View File

@ -168,7 +168,7 @@ bool SCH_JUNCTION::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_JUNCTION::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_JUNCTION::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_pos ); aPoints.push_back( m_pos );
} }

View File

@ -81,7 +81,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const { return wxString( _( "Junction" ) ); } wxString GetSelectMenuText() const { return wxString( _( "Junction" ) ); }

View File

@ -461,7 +461,7 @@ bool SCH_LINE::IsConnectable() const
} }
void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_LINE::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_start ); aPoints.push_back( m_start );
aPoints.push_back( m_end ); aPoints.push_back( m_end );

View File

@ -113,9 +113,9 @@ public:
*/ */
bool MergeOverlap( SCH_LINE* aLine ); bool MergeOverlap( SCH_LINE* aLine );
void GetEndPoints( vector <DANGLING_END_ITEM>& aItemList ); void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList );
bool IsDanglingStateChanged( vector< DANGLING_END_ITEM >& aItemList ); bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList );
bool IsDangling() const { return m_startIsDangling || m_endIsDangling; } bool IsDangling() const { return m_startIsDangling || m_endIsDangling; }
@ -123,7 +123,7 @@ public:
bool IsConnectable() const; bool IsConnectable() const;
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints(std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const; wxString GetSelectMenuText() const;

View File

@ -182,7 +182,7 @@ bool SCH_NO_CONNECT::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_NO_CONNECT::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_NO_CONNECT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_pos ); aPoints.push_back( m_pos );
} }

View File

@ -81,7 +81,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const { return wxString( _( "No Connect" ) ); } wxString GetSelectMenuText() const { return wxString( _( "No Connect" ) ); }

View File

@ -1000,7 +1000,7 @@ bool SCH_SHEET::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_SHEET::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_SHEET::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
for( size_t i = 0; i < GetPins().size(); i++ ) for( size_t i = 0; i < GetPins().size(); i++ )
aPoints.push_back( GetPins()[i].GetPosition() ); aPoints.push_back( GetPins()[i].GetPosition() );

View File

@ -533,7 +533,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );

View File

@ -564,7 +564,7 @@ bool SCH_TEXT::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_TEXT::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_TEXT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
// Normal text labels do not have connection points. All others do. // Normal text labels do not have connection points. All others do.
if( Type() == SCH_TEXT_T ) if( Type() == SCH_TEXT_T )

View File

@ -189,7 +189,7 @@ public:
virtual bool IsSelectStateChanged( const wxRect& aRect ); virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const; virtual void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
virtual bool CanIncrementLabel() const { return true; } virtual bool CanIncrementLabel() const { return true; }

View File

@ -27,13 +27,13 @@
*/ */
#include <fctsys.h> #include <fctsys.h>
#include <gr_basic.h> //#include <gr_basic.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
#include <confirm.h> #include <confirm.h>
#include <wxEeschemaStruct.h> #include <wxEeschemaStruct.h>
#include <base_units.h> #include <base_units.h>
#include <general.h> //#include <general.h>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <dialogs/dialog_sch_sheet_props.h> #include <dialogs/dialog_sch_sheet_props.h>
@ -55,6 +55,8 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
dlg.SetSheetName( aSheet->GetName() ); dlg.SetSheetName( aSheet->GetName() );
dlg.SetSheetNameTextSize( ReturnStringFromValue( g_UserUnit, aSheet->GetSheetNameSize() ) ); dlg.SetSheetNameTextSize( ReturnStringFromValue( g_UserUnit, aSheet->GetSheetNameSize() ) );
dlg.SetSheetNameTextSizeUnits( units ); dlg.SetSheetNameTextSizeUnits( units );
dlg.SetSheetTimeStamp( wxString::Format( wxT("%8.8lX"),
(unsigned long) aSheet->GetTimeStamp() ) );
/* This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier /* This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier
* versions for the flex grid sizer in wxGTK that prevents the last * versions for the flex grid sizer in wxGTK that prevents the last

View File

@ -111,6 +111,12 @@ public:
m_eventDispatcher = aEventDispatcher; m_eventDispatcher = aEventDispatcher;
} }
/**
* Function StopDrawing()
* Prevents the GAL canvas from further drawing till it is recreated.
*/
void StopDrawing();
protected: protected:
void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ); void onPaint( wxPaintEvent& WXUNUSED( aEvent ) );
void onSize( wxSizeEvent& aEvent ); void onSize( wxSizeEvent& aEvent );

View File

@ -33,10 +33,16 @@
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <ki_mutex.h>
#include <kicad_string.h> #include <kicad_string.h>
#define USE_FPI_LAZY 0 // 1:yes lazy, 0:no early
class FP_LIB_TABLE; class FP_LIB_TABLE;
class FOOTPRINT_LIST;
class wxTopLevelWindow;
/* /*
@ -46,38 +52,52 @@ class FP_LIB_TABLE;
*/ */
class FOOTPRINT_INFO class FOOTPRINT_INFO
{ {
friend bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 );
public: public:
// friend bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 ); // These two accessors do not have to call ensure_loaded(), because constructor
// fills in these fields:
wxString m_nickname; ///< the library nickname, eventually const wxString& GetFootprintName() const { return m_fpname; }
#if !defined(USE_FP_LIB_TABLE)
wxString m_lib_path;
#endif
wxString m_Module; ///< Module name.
int m_Num; ///< Order number in the display list.
wxString m_Doc; ///< Footprint description.
wxString m_KeyWord; ///< Footprint key words.
unsigned m_padCount; ///< Number of pads
FOOTPRINT_INFO()
{
m_Num = 0;
m_padCount = 0;
}
const wxString& GetFootprintName() const { return m_Module; }
void SetNickname( const wxString& aLibNickname ) { m_nickname = aLibNickname; }
const wxString& GetNickname() const { return m_nickname; } const wxString& GetNickname() const { return m_nickname; }
#if !defined(USE_FP_LIB_TABLE) FOOTPRINT_INFO( FOOTPRINT_LIST* aOwner, const wxString& aNickname, const wxString& aFootprintName ) :
void SetLibPath( const wxString& aLibPath ) { m_lib_path = aLibPath; } m_owner( aOwner ),
const wxString& GetLibPath() const { return m_lib_path; } m_loaded( false ),
m_nickname( aNickname ),
m_fpname( aFootprintName ),
m_num( 0 ),
m_pad_count( 0 )
{
#if !USE_FPI_LAZY
load();
#endif #endif
}
const wxString& GetDoc()
{
ensure_loaded();
return m_doc;
}
const wxString& GetKeywords()
{
ensure_loaded();
return m_keywords;
}
unsigned GetPadCount()
{
ensure_loaded();
return m_pad_count;
}
int GetOrderNum()
{
ensure_loaded();
return m_num;
}
/** /**
* Function InLibrary * Function InLibrary
@ -89,81 +109,140 @@ public:
* false. * false.
*/ */
bool InLibrary( const wxString& aLibrary ) const; bool InLibrary( const wxString& aLibrary ) const;
private:
void ensure_loaded()
{
if( !m_loaded )
load();
}
/// lazily load stuff not filled in by constructor. This may throw IO_ERRORS.
void load();
FOOTPRINT_LIST* m_owner; ///< provides access to FP_LIB_TABLE
bool m_loaded;
wxString m_nickname; ///< library as known in FP_LIB_TABLE
wxString m_fpname; ///< Module name.
int m_num; ///< Order number in the display list.
int m_pad_count; ///< Number of pads
wxString m_doc; ///< Footprint description.
wxString m_keywords; ///< Footprint keywords.
}; };
/// FOOTPRINT object list sort function. /// FOOTPRINT object list sort function.
inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 ) inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 )
{ {
#if defined( USE_FP_LIB_TABLE )
int retv = StrNumCmp( item1.m_nickname, item2.m_nickname, INT_MAX, true ); int retv = StrNumCmp( item1.m_nickname, item2.m_nickname, INT_MAX, true );
if( retv != 0 ) if( retv != 0 )
return retv < 0; return retv < 0;
#endif
return StrNumCmp( item1.m_Module, item2.m_Module, INT_MAX, true ) < 0; return StrNumCmp( item1.m_fpname, item2.m_fpname, INT_MAX, true ) < 0;
} }
/**
* Class FOOTPRINT_LIST
* holds a list of FOOTPRINT_INFO objects, along with a list of IO_ERRORs or
* PARSE_ERRORs that were thrown acquiring the FOOTPRINT_INFOs.
*/
class FOOTPRINT_LIST class FOOTPRINT_LIST
{ {
public: FP_LIB_TABLE* m_lib_table; ///< no ownership
boost::ptr_vector< FOOTPRINT_INFO > m_List; volatile int m_error_count; ///< thread safe to read.
wxString m_filesNotFound;
wxString m_filesInvalid; typedef boost::ptr_vector< FOOTPRINT_INFO > FPILIST;
typedef boost::ptr_vector< IO_ERROR > ERRLIST;
FPILIST m_list;
ERRLIST m_errors; ///< some can be PARSE_ERRORs also
MUTEX m_errors_lock;
MUTEX m_list_lock;
/**
* Function loader_job
* loads footprints from @a aNicknameList and calls AddItem() on to help fill
* m_list.
*
* @param aNicknameList is a wxString[] holding libraries to load all footprints from.
* @param aJobZ is the size of the job, i.e. the count of nicknames.
*/
void loader_job( const wxString* aNicknameList, int aJobZ );
void addItem( FOOTPRINT_INFO* aItem )
{
// m_list is not thread safe, and this function is called from
// worker threads, lock m_list.
MUTLOCK lock( m_list_lock );
m_list.push_back( aItem );
}
public: public:
FOOTPRINT_LIST() :
m_lib_table( 0 ),
m_error_count( 0 )
{
}
/** /**
* Function GetCount * Function GetCount
* @return the number of items stored in list * @return the number of items stored in list
*/ */
unsigned GetCount() const { return m_List.size(); } unsigned GetCount() const { return m_list.size(); }
/// Was forced to add this by modview_frame.cpp
const FPILIST& GetList() const { return m_list; }
/** /**
* Function GetModuleInfo * Function GetModuleInfo
* @return the item stored in list if found * @param aFootprintName = the footprint name inside the FOOTPRINT_INFO of interest.
* @param aFootprintName = the name of item * @return FOOTPRINT_INF* - the item stored in list if found
*/ */
FOOTPRINT_INFO* GetModuleInfo( const wxString & aFootprintName ); FOOTPRINT_INFO* GetModuleInfo( const wxString& aFootprintName );
/** /**
* Function GetItem * Function GetItem
* @return the aIdx item in list
* @param aIdx = index of the given item * @param aIdx = index of the given item
* @return the aIdx item in list
*/ */
FOOTPRINT_INFO & GetItem( unsigned aIdx ) FOOTPRINT_INFO& GetItem( unsigned aIdx ) { return m_list[aIdx]; }
{
return m_List[aIdx];
}
/** /**
* Function AddItem * Function AddItem
* add aItem in list * add aItem in list
* @param aItem = item to add * @param aItem = item to add
*/ */
void AddItem( FOOTPRINT_INFO* aItem ) void AddItem( FOOTPRINT_INFO* aItem );
{
m_List.push_back( aItem );
}
/** unsigned GetErrorCount() const { return m_errors.size(); }
* Function ReadFootprintFiles
* const IO_ERROR* GetError( unsigned aIdx ) const { return &m_errors[aIdx]; }
* @param aFootprintsLibNames = an array string giving the list of libraries to load
*/
bool ReadFootprintFiles( wxArrayString& aFootprintsLibNames );
/** /**
* Function ReadFootprintFiles * Function ReadFootprintFiles
* reads all the footprints provided by the combination of aTable and aNickname. * reads all the footprints provided by the combination of aTable and aNickname.
*
* @param aTable defines all the libraries. * @param aTable defines all the libraries.
* @param aNickname is the library to read from, or if NULL means read all * @param aNickname is the library to read from, or if NULL means read all
* footprints from all known libraries. * footprints from all known libraries in aTable.
* @return bool - true if it ran to completion, else false if it aborted after
* some number of errors. If true, it does not mean there were no errors, check
* GetErrorCount() for that, should be zero to indicate success.
*/ */
bool ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname = NULL ); bool ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname = NULL );
void DisplayErrors( wxTopLevelWindow* aCaller = NULL );
FP_LIB_TABLE* GetTable() const { return m_lib_table; }
}; };
#endif // FOOTPRINT_INFO_H_ #endif // FOOTPRINT_INFO_H_

View File

@ -640,26 +640,4 @@ protected:
FP_LIB_TABLE* fallBack; FP_LIB_TABLE* fallBack;
}; };
#if 0 // I don't think this is going to be needed.
/**
* Function LookupPart
* finds and loads a MODULE, and parses it. As long as the part is
* accessible in any LIB_SOURCE, opened or not opened, this function
* will find it and load it into its containing LIB, even if that means
* having to open a LIB in this table that was not previously opened.
*
* @param aFootprintId The fully qualified name of the footprint to look up.
*
* @return MODULE* - this will never be NULL, and no ownership is transferred because
* all MODULEs live in LIBs. You only get to point to them in some LIB. If the MODULE
* cannot be found, then an exception is thrown.
*
* @throw IO_ERROR if any problem occurs or if the footprint cannot be found.
*/
MODULE* LookupFootprint( const FP_LIB_ID& aFootprintId ) throw( IO_ERROR );
#endif
#endif // FP_LIB_TABLE_H_ #endif // FP_LIB_TABLE_H_

View File

@ -277,7 +277,7 @@ public:
* @param aPosition is the text position in world coordinates. * @param aPosition is the text position in world coordinates.
* @param aRotationAngle is the text rotation angle. * @param aRotationAngle is the text rotation angle.
*/ */
inline virtual void StrokeText( const std::string& aText, const VECTOR2D& aPosition, inline virtual void StrokeText( const wxString& aText, const VECTOR2D& aPosition,
double aRotationAngle ) double aRotationAngle )
{ {
strokeFont.Draw( aText, aPosition, aRotationAngle ); strokeFont.Draw( aText, aPosition, aRotationAngle );

View File

@ -3,6 +3,8 @@
* *
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors. * Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2013 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
* *
* Stroke font class * Stroke font class
* *
@ -39,7 +41,7 @@ namespace KIGFX
class GAL; class GAL;
typedef std::deque< std::deque<VECTOR2D> > GLYPH; typedef std::deque< std::deque<VECTOR2D> > GLYPH;
typedef std::deque<GLYPH> GLYPH_LIST; typedef std::vector<GLYPH> GLYPH_LIST;
/** /**
* @brief Class STROKE_FONT implements stroke font drawing. * @brief Class STROKE_FONT implements stroke font drawing.
@ -52,11 +54,6 @@ public:
/// Constructor /// Constructor
STROKE_FONT( GAL* aGal ); STROKE_FONT( GAL* aGal );
/// Destructor
~STROKE_FONT();
// TODO Load font from a text file
/** /**
* @brief Load the new stroke font. * @brief Load the new stroke font.
* *
@ -73,17 +70,7 @@ public:
* @param aPosition is the text position in world coordinates. * @param aPosition is the text position in world coordinates.
* @param aRotationAngle is the text rotation angle. * @param aRotationAngle is the text rotation angle.
*/ */
void Draw( std::string aText, const VECTOR2D& aPosition, double aRotationAngle ); void Draw( const wxString& aText, const VECTOR2D& aPosition, double aRotationAngle );
/**
* @brief Set the scale factor of the font for the glyph size.
*
* @param aScaleFactor is the scale factor of the font.
*/
inline void SetScaleFactor( const double aScaleFactor )
{
m_scaleFactor = aScaleFactor;
}
/** /**
* @brief Set the glyph size. * @brief Set the glyph size.
@ -158,13 +145,19 @@ public:
private: private:
GAL* m_gal; ///< Pointer to the GAL GAL* m_gal; ///< Pointer to the GAL
GLYPH_LIST m_glyphs; ///< Glyph list GLYPH_LIST m_glyphs; ///< Glyph list
std::deque<BOX2D> m_glyphBoundingBoxes; ///< Bounding boxes of the glyphs std::vector<BOX2D> m_glyphBoundingBoxes; ///< Bounding boxes of the glyphs
double m_scaleFactor; ///< Scale factor for the glyph
VECTOR2D m_glyphSize; ///< Size of the glyphs VECTOR2D m_glyphSize; ///< Size of the glyphs
EDA_TEXT_HJUSTIFY_T m_horizontalJustify; ///< Horizontal justification EDA_TEXT_HJUSTIFY_T m_horizontalJustify; ///< Horizontal justification
EDA_TEXT_VJUSTIFY_T m_verticalJustify; ///< Vertical justification EDA_TEXT_VJUSTIFY_T m_verticalJustify; ///< Vertical justification
bool m_bold, m_italic, m_mirrored, m_overbar; ///< Properties of text bool m_bold, m_italic, m_mirrored, m_overbar; ///< Properties of text
/**
* @brief Returns a single line height using current settings.
*
* @return The line height.
*/
int getInterline() const;
/** /**
* @brief Compute the bounding box of a given glyph. * @brief Compute the bounding box of a given glyph.
* *
@ -174,15 +167,50 @@ private:
*/ */
BOX2D computeBoundingBox( const GLYPH& aGlyph, const VECTOR2D& aGlyphBoundingX ) const; BOX2D computeBoundingBox( const GLYPH& aGlyph, const VECTOR2D& aGlyphBoundingX ) const;
/**
* @brief Draws a single line of text. Multiline texts should be split before using the
* function.
*
* @param aText is the text to be drawn.
*/
void drawSingleLineText( const wxString& aText );
/** /**
* @brief Compute the size of a given text. * @brief Compute the size of a given text.
* *
* @param aText is the text string. * @param aText is the text string.
* @return is the text size. * @return is the text size.
*/ */
VECTOR2D computeTextSize( const std::string& aText ) const; VECTOR2D computeTextSize( const wxString& aText ) const;
static const double LINE_HEIGHT_RATIO; /**
* @brief Returns number of lines for a given text.
*
* @param aText is the text to be checked.
* @return Number of lines of aText.
*/
unsigned int linesCount( const wxString& aText ) const
{
wxString::const_iterator it, itEnd;
unsigned int lines = 1;
for( it = aText.begin(), itEnd = aText.end(); it != itEnd; ++it )
{
if( *it == '\n' )
++lines;
}
return lines;
}
///> Factor that determines relative height of overbar.
static const double OVERBAR_HEIGHT;
///> Factor that determines relative line width for bold text.
static const double BOLD_FACTOR;
///> Scale factor for the glyph
static const double HERSHEY_SCALE;
}; };
} // namespace KIGFX } // namespace KIGFX

View File

@ -163,7 +163,7 @@ public:
/// Calculate Statistics /// Calculate Statistics
Statistics CalcStats( ); Statistics CalcStats();
/// Remove all entries from tree /// Remove all entries from tree
void RemoveAll(); void RemoveAll();
@ -396,7 +396,7 @@ protected:
bool IsInternalNode() { return m_level > 0; } // Not a leaf, but a internal node bool IsInternalNode() { return m_level > 0; } // Not a leaf, but a internal node
bool IsLeaf() { return m_level == 0; } // A leaf, contains data bool IsLeaf() { return m_level == 0; } // A leaf, contains data
int m_count; ///< Count int m_count; ///< Count
int m_level; ///< Leaf is zero, others positive int m_level; ///< Leaf is zero, others positive
Branch m_branch[MAXNODES]; ///< Branch Branch m_branch[MAXNODES]; ///< Branch
}; };
@ -830,18 +830,18 @@ RTREE_TEMPLATE
bool RTREE_QUAL::Load( RTFileStream& a_stream ) bool RTREE_QUAL::Load( RTFileStream& a_stream )
{ {
// Write some kind of header // Write some kind of header
int _dataFileId = ('R' << 0) | ('T' << 8) | ('R' << 16) | ('E' << 24); int _dataFileId = ('R' << 0) | ('T' << 8) | ('R' << 16) | ('E' << 24);
int _dataSize = sizeof(DATATYPE); int _dataSize = sizeof(DATATYPE);
int _dataNumDims = NUMDIMS; int _dataNumDims = NUMDIMS;
int _dataElemSize = sizeof(ELEMTYPE); int _dataElemSize = sizeof(ELEMTYPE);
int _dataElemRealSize = sizeof(ELEMTYPEREAL); int _dataElemRealSize = sizeof(ELEMTYPEREAL);
int _dataMaxNodes = TMAXNODES; int _dataMaxNodes = TMAXNODES;
int _dataMinNodes = TMINNODES; int _dataMinNodes = TMINNODES;
int dataFileId = 0; int dataFileId = 0;
int dataSize = 0; int dataSize = 0;
int dataNumDims = 0; int dataNumDims = 0;
int dataElemSize = 0; int dataElemSize = 0;
int dataElemRealSize = 0; int dataElemRealSize = 0;
int dataMaxNodes = 0; int dataMaxNodes = 0;
int dataMinNodes = 0; int dataMinNodes = 0;
@ -932,10 +932,10 @@ RTREE_TEMPLATE
bool RTREE_QUAL::Save( RTFileStream& a_stream ) bool RTREE_QUAL::Save( RTFileStream& a_stream )
{ {
// Write some kind of header // Write some kind of header
int dataFileId = ('R' << 0) | ('T' << 8) | ('R' << 16) | ('E' << 24); int dataFileId = ('R' << 0) | ('T' << 8) | ('R' << 16) | ('E' << 24);
int dataSize = sizeof(DATATYPE); int dataSize = sizeof(DATATYPE);
int dataNumDims = NUMDIMS; int dataNumDims = NUMDIMS;
int dataElemSize = sizeof(ELEMTYPE); int dataElemSize = sizeof(ELEMTYPE);
int dataElemRealSize = sizeof(ELEMTYPEREAL); int dataElemRealSize = sizeof(ELEMTYPEREAL);
int dataMaxNodes = TMAXNODES; int dataMaxNodes = TMAXNODES;
int dataMinNodes = TMINNODES; int dataMinNodes = TMINNODES;
@ -1286,27 +1286,27 @@ int RTREE_QUAL::PickBranch( Rect* a_rect, Node* a_node )
ELEMTYPEREAL increase; ELEMTYPEREAL increase;
ELEMTYPEREAL bestIncr = (ELEMTYPEREAL) -1; ELEMTYPEREAL bestIncr = (ELEMTYPEREAL) -1;
ELEMTYPEREAL area; ELEMTYPEREAL area;
ELEMTYPEREAL bestArea; ELEMTYPEREAL bestArea = 0;
int best = 0; int best = 0;
Rect tempRect; Rect tempRect;
for( int index = 0; index < a_node->m_count; ++index ) for( int index = 0; index < a_node->m_count; ++index )
{ {
Rect* curRect = &a_node->m_branch[index].m_rect; Rect* curRect = &a_node->m_branch[index].m_rect;
area = CalcRectVolume( curRect ); area = CalcRectVolume( curRect );
tempRect = CombineRect( a_rect, curRect ); tempRect = CombineRect( a_rect, curRect );
increase = CalcRectVolume( &tempRect ) - area; increase = CalcRectVolume( &tempRect ) - area;
if( (increase < bestIncr) || firstTime ) if( (increase < bestIncr) || firstTime )
{ {
best = index; best = index;
bestArea = area; bestArea = area;
bestIncr = increase; bestIncr = increase;
firstTime = false; firstTime = false;
} }
else if( (increase == bestIncr) && (area < bestArea) ) else if( (increase == bestIncr) && (area < bestArea) )
{ {
best = index; best = index;
bestArea = area; bestArea = area;
bestIncr = increase; bestIncr = increase;
} }
@ -1594,8 +1594,8 @@ void RTREE_QUAL::InitParVars( PartitionVars* a_parVars, int a_maxRects, int a_mi
for( int index = 0; index < a_maxRects; ++index ) for( int index = 0; index < a_maxRects; ++index )
{ {
a_parVars->m_taken[index] = false; a_parVars->m_taken[index] = false;
a_parVars->m_partition[index] = -1; a_parVars->m_partition[index] = -1;
} }
} }
@ -1622,7 +1622,7 @@ void RTREE_QUAL::PickSeeds( PartitionVars* a_parVars )
&a_parVars->m_branchBuf[indexB].m_rect ); &a_parVars->m_branchBuf[indexB].m_rect );
waste = CalcRectVolume( &oneRect ) - area[indexA] - area[indexB]; waste = CalcRectVolume( &oneRect ) - area[indexA] - area[indexB];
if( waste > worst ) if( waste >= worst )
{ {
worst = waste; worst = waste;
seed0 = indexA; seed0 = indexA;
@ -1856,8 +1856,6 @@ bool RTREE_QUAL::Search( Node* a_node, Rect* a_rect, int& a_foundCount, bool a_r
} }
//calculate the minimum distance between a point and a rectangle as defined by Manolopoulos et al. //calculate the minimum distance between a point and a rectangle as defined by Manolopoulos et al.
//it uses the square distance to avoid the use of ELEMTYPEREAL values, which are slower. //it uses the square distance to avoid the use of ELEMTYPEREAL values, which are slower.
RTREE_TEMPLATE RTREE_TEMPLATE

View File

@ -1,6 +1,7 @@
#ifndef _html_messagebox_ #ifndef _html_messagebox_
#define _html_messagebox_ #define _html_messagebox_
/** /**
@file @file
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder. Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
@ -8,7 +9,10 @@ Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
#include <../common/dialogs/dialog_display_info_HTML_base.h> #include <../common/dialogs/dialog_display_info_HTML_base.h>
/** Implementing HTML_MESSAGE_BOX */
/**
* Class HTML_MESSAGE_BOX
*/
class HTML_MESSAGE_BOX : public DIALOG_DISPLAY_HTML_TEXT_BASE class HTML_MESSAGE_BOX : public DIALOG_DISPLAY_HTML_TEXT_BASE
{ {
protected: protected:
@ -16,8 +20,10 @@ protected:
void OnCloseButtonClick( wxCommandEvent& event ); void OnCloseButtonClick( wxCommandEvent& event );
public: public:
/** Constructor */ /**
HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle, * Constructor
*/
HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle,
wxPoint aPos = wxDefaultPosition, wxPoint aPos = wxDefaultPosition,
wxSize aSize = wxSize( 450,250 ) ); wxSize aSize = wxSize( 450,250 ) );
@ -26,28 +32,30 @@ public:
* Add a list of items. * Add a list of items.
* @param aList = a string containing items. Items are separated by '\n' * @param aList = a string containing items. Items are separated by '\n'
*/ */
void ListSet(const wxString &aList); void ListSet( const wxString& aList );
/** /**
* Function ListSet * Function ListSet
* Add a list of items. * Add a list of items.
* @param aList = a wxArrayString containing items. * @param aList = a wxArrayString containing items.
*/ */
void ListSet(const wxArrayString &aList); void ListSet( const wxArrayString& aList );
void ListClear(); void ListClear();
/** /**
* Function MessageSet * Function MessageSet
* Add a message (in bold) to message list. * adds a message (in bold) to message list.
* @param message = the message * @param message = the message
*/ */
void MessageSet(const wxString &message); void MessageSet( const wxString& message );
/** /**
* Function AddHTML_Text * Function AddHTML_Text
* Add a html text (without any change) to message list. * adds html text (without any change) to message list.
* @param message = the text to add * @param message = the text to add
*/ */
void AddHTML_Text(const wxString &message); void AddHTML_Text( const wxString& message );
}; };
#endif // _html_messagebox_ #endif // _html_messagebox_

33
include/ki_mutex.h Normal file
View File

@ -0,0 +1,33 @@
#ifndef KI_MUTEX_H_
#define KI_MUTEX_H_
/// Establish KiCad MUTEX choices here in this file:
/// typedef MUTEX and typedef MUTLOCK.
///
/// Using an unnamed resource is easier, providing a textual name for a
/// constructor is cumbersome, so we make choice on that criteria mostly:
#if 1
// This is a fine choice between the two, but requires linking to ${Boost_LIBRARIES}
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
typedef boost::interprocess::interprocess_mutex MUTEX;
typedef boost::interprocess::scoped_lock<MUTEX> MUTLOCK;
#else
// This choice also works.
#include <wx/thread.h>
typedef wxMutex MUTEX;
typedef wxMutexLocker MUTLOCK;
#endif
#endif // KI_MUTEX_H_

View File

@ -164,4 +164,21 @@ wxString GetIllegalFileNameWxChars();
*/ */
bool ReplaceIllegalFileNameChars( std::string* aName ); bool ReplaceIllegalFileNameChars( std::string* aName );
/**
* Function RemoveTrailingZeros
* removes the trailing zeros from \a aString.
*
* All trailing zeros and the '.' character from floating point numbers are removed from
* \a aString.
*
* @param aString is a wxString object to remove the trailing zeros from.
* @return a wxString with the trailing zeros removed.
*/
wxString RemoveTrailingZeros( const wxString& aString );
#ifndef HAVE_STRTOKR
// common/strtok_r.c optionally:
extern "C" char* strtok_r( char* str, const char* delim, char** nextp );
#endif
#endif // KICAD_STRING_H_ #endif // KICAD_STRING_H_

View File

@ -25,8 +25,6 @@ extern DISPLAY_OPTIONS DisplayOpt;
extern int g_CurrentVersionPCB; extern int g_CurrentVersionPCB;
extern int g_RotationAngle;
/// List of segments of the trace currently being drawn. /// List of segments of the trace currently being drawn.
extern DLIST<TRACK> g_CurrentTrackList; extern DLIST<TRACK> g_CurrentTrackList;

View File

@ -153,7 +153,7 @@ public:
int width = DEFAULT_LINE_WIDTH ) = 0; int width = DEFAULT_LINE_WIDTH ) = 0;
virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
int width = DEFAULT_LINE_WIDTH ) = 0; int width = DEFAULT_LINE_WIDTH ) = 0;
virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
int rayon, FILL_T fill, int width = DEFAULT_LINE_WIDTH ); int rayon, FILL_T fill, int width = DEFAULT_LINE_WIDTH );
/** /**
@ -214,7 +214,7 @@ public:
// Higher level primitives -- can be drawn as line, sketch or 'filled' // Higher level primitives -- can be drawn as line, sketch or 'filled'
virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width, virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
EDA_DRAW_MODE_T tracemode ); EDA_DRAW_MODE_T tracemode );
virtual void ThickArc( const wxPoint& centre, double StAngle, double EndAngle, virtual void ThickArc( const wxPoint& centre, double StAngle, double EndAngle,
int rayon, int width, EDA_DRAW_MODE_T tracemode ); int rayon, int width, EDA_DRAW_MODE_T tracemode );
virtual void ThickRect( const wxPoint& p1, const wxPoint& p2, int width, virtual void ThickRect( const wxPoint& p1, const wxPoint& p2, int width,
EDA_DRAW_MODE_T tracemode ); EDA_DRAW_MODE_T tracemode );
@ -301,7 +301,7 @@ protected:
int width ); int width );
// Coordinate and scaling conversion functions // Coordinate and scaling conversion functions
virtual DPOINT userToDeviceCoordinates( const wxPoint& pos ); virtual DPOINT userToDeviceCoordinates( const wxPoint& aCoordinate );
virtual DPOINT userToDeviceSize( const wxSize& size ); virtual DPOINT userToDeviceSize( const wxSize& size );
virtual double userToDeviceSize( double size ); virtual double userToDeviceSize( double size );
@ -320,6 +320,12 @@ protected:
/// Plot offset (in IUs) /// Plot offset (in IUs)
wxPoint plotOffset; wxPoint plotOffset;
/// X axis orientation (SVG)
/// and plot mirrored (only for PS, PDF HPGL and SVG)
bool m_plotMirror;
bool m_mirrorIsHorizontal; /// true to mirror horizontally (else vertically)
bool m_yaxisReversed; /// true if the Y axis is top to bottom (SVG)
/// Output file /// Output file
FILE* outputFile; FILE* outputFile;
@ -332,7 +338,6 @@ protected:
char penState; char penState;
/// Last pen positions; set to -1,-1 when the pen is at rest /// Last pen positions; set to -1,-1 when the pen is at rest
wxPoint penLastpos; wxPoint penLastpos;
bool plotMirror;
wxString creator; wxString creator;
wxString filename; wxString filename;
PAGE_INFO pageInfo; PAGE_INFO pageInfo;
@ -402,7 +407,7 @@ public:
virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width, virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
EDA_DRAW_MODE_T tracemode ); EDA_DRAW_MODE_T tracemode );
virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
int rayon, FILL_T fill, int width = DEFAULT_LINE_WIDTH ); int rayon, FILL_T fill, int width = DEFAULT_LINE_WIDTH );
virtual void PenTo( const wxPoint& pos, char plume ); virtual void PenTo( const wxPoint& pos, char plume );
virtual void FlashPadCircle( const wxPoint& pos, int diametre, virtual void FlashPadCircle( const wxPoint& pos, int diametre,
@ -786,7 +791,7 @@ public:
int width = DEFAULT_LINE_WIDTH ); int width = DEFAULT_LINE_WIDTH );
virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill,
int width = DEFAULT_LINE_WIDTH ); int width = DEFAULT_LINE_WIDTH );
virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle, virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle,
int aRadius, FILL_T aFill, int aWidth = DEFAULT_LINE_WIDTH ); int aRadius, FILL_T aFill, int aWidth = DEFAULT_LINE_WIDTH );
virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, virtual void PlotPoly( const std::vector< wxPoint >& aCornerList,
FILL_T aFill, int aWidth = DEFAULT_LINE_WIDTH ); FILL_T aFill, int aWidth = DEFAULT_LINE_WIDTH );
@ -877,7 +882,7 @@ public:
FILL_T aFill, int aWidth = DEFAULT_LINE_WIDTH ); FILL_T aFill, int aWidth = DEFAULT_LINE_WIDTH );
virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width, virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width,
EDA_DRAW_MODE_T tracemode ); EDA_DRAW_MODE_T tracemode );
virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle,
int rayon, FILL_T fill, int width = DEFAULT_LINE_WIDTH ); int rayon, FILL_T fill, int width = DEFAULT_LINE_WIDTH );
virtual void PenTo( const wxPoint& pos, char plume ); virtual void PenTo( const wxPoint& pos, char plume );
virtual void FlashPadCircle( const wxPoint& pos, int diametre, virtual void FlashPadCircle( const wxPoint& pos, int diametre,

View File

@ -93,7 +93,7 @@ std::string
/** /**
* Struct IO_ERROR * Struct IO_ERROR
* is a class used to hold an error message and may be used to throw exceptions * is a class used to hold an error message and may be used when throwing exceptions
* containing meaningful error messages. * containing meaningful error messages.
* @author Dick Hollenbeck * @author Dick Hollenbeck
*/ */
@ -148,7 +148,9 @@ struct IO_ERROR // : std::exception
IO_ERROR() {} IO_ERROR() {}
~IO_ERROR() throw ( /*none*/ ){} // Destructor is virtual because PARSE_ERROR is derived from it and
// boost::ptr_vector lists consisting of both will need a virtual destructor.
virtual ~IO_ERROR() throw ( /*none*/ ){}
}; };

File diff suppressed because it is too large Load Diff

View File

@ -34,9 +34,6 @@
#include <class_base_screen.h> #include <class_base_screen.h>
#include <general.h> #include <general.h>
using namespace std;
class SCH_ITEM; class SCH_ITEM;
class SCH_SHEET_PATH; class SCH_SHEET_PATH;
class LINE_READER; class LINE_READER;
@ -49,7 +46,7 @@ class NETLIST_OBJECT_LIST;
typedef boost::ptr_vector< SCH_ITEM > SCH_ITEMS; typedef boost::ptr_vector< SCH_ITEM > SCH_ITEMS;
typedef SCH_ITEMS::iterator SCH_ITEMS_ITR; typedef SCH_ITEMS::iterator SCH_ITEMS_ITR;
typedef vector< SCH_ITEMS_ITR > SCH_ITEMS_ITRS; typedef std::vector< SCH_ITEMS_ITR > SCH_ITEMS_ITRS;
#define FMT_IU SCH_ITEM::FormatInternalUnits #define FMT_IU SCH_ITEM::FormatInternalUnits
@ -228,7 +225,7 @@ public:
* *
* @param aItemList - List of DANGLING_END_ITEMS to add to. * @param aItemList - List of DANGLING_END_ITEMS to add to.
*/ */
virtual void GetEndPoints( vector< DANGLING_END_ITEM >& aItemList ) {} virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
/** /**
* Function IsDanglingStateChanged * Function IsDanglingStateChanged
@ -243,7 +240,7 @@ public:
* @param aItemList - List of items to test item against. * @param aItemList - List of items to test item against.
* @return True if the dangling state has changed from it's current setting. * @return True if the dangling state has changed from it's current setting.
*/ */
virtual bool IsDanglingStateChanged( vector< DANGLING_END_ITEM >& aItemList ) { return false; } virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList ) { return false; }
virtual bool IsDangling() const { return false; } virtual bool IsDangling() const { return false; }
@ -273,7 +270,7 @@ public:
* *
* @param aPoints List of connection points to add to. * @param aPoints List of connection points to add to.
*/ */
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const { } virtual void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const { }
/** /**
* Function ClearConnections * Function ClearConnections

View File

@ -3,8 +3,6 @@
#include <tool/coroutine.h> #include <tool/coroutine.h>
using namespace std;
typedef COROUTINE<int, int> MyCoroutine; typedef COROUTINE<int, int> MyCoroutine;
class MyClass class MyClass

View File

@ -3,8 +3,6 @@
#include <tool/delegate.h> #include <tool/delegate.h>
using namespace std;
class MyClass class MyClass
{ {
public: public:

203
include/utf8.h Normal file
View File

@ -0,0 +1,203 @@
#ifndef UTF8_H_
#define UTF8_H_
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <string>
#include <wx/string.h>
/**
* Class UTF8
* is an 8 bit std::string that is assuredly encoded in UTF8, and supplies special
* conversion support to and from wxString, and has iteration over unicode characters.
*
* <p>I've been careful to supply only conversion facilities and not try
* and duplicate wxString() with many member functions. In the end it is
* to be a std::string. There are multiple ways to create text into a std::string
* without the need of too many member functions:
*
* <ul>
* <li>richio.h's StrPrintf()</li>
* <li>std::ostringstream.</li>
* </ul>
*
* <p>Because this class used no virtuals, it should be possible to cast any
* std::string into a UTF8 using this kind of cast: (UTF8 &) without construction
* or copying being the effect of the cast. Be sure the source std::string holds
* UTF8 encoded text before you do that.
*
* @author Dick Hollenbeck
*/
class UTF8 : public std::string
{
public:
UTF8( const wxString& o );
/// This is the only constructor for which you could end up with
/// non-UTF8 encoding, but that would be your fault.
UTF8( const char* txt ) :
std::string( txt )
{
}
/// For use with _() function on wx 2.8:
UTF8( const wchar_t* txt );
explicit UTF8( const std::string& o ) :
std::string( o )
{
}
UTF8() :
std::string()
{
}
UTF8& operator=( const wxString& o );
UTF8& operator=( const std::string& o )
{
std::string::operator=( o );
return *this;
}
operator wxString () const;
/// This one is not in std::string, and one wonders why... might be a solid
/// enough reason to remove it still.
operator char* () const
{
return (char*) c_str();
}
/**
* Function uni_forward
* advances over a single UTF8 encoded multibyte character, capturing the
* unicode character as it goes, and returning the number of bytes consumed.
*
* @param aSequence is the UTF8 byte sequence, must be aligned on start of character.
* @param aResult is where to put the unicode character, and may be NULL if no interest.
* @return int - the count of bytes consumed.
*/
static int uni_forward( const unsigned char* aSequence, unsigned* aResult = NULL );
/**
* class uni_iter
* is a non-muting iterator that walks through unicode code points in the UTF8 encoded
* string. The normal ++(), ++(int), ->(), and *() operators are all supported
* for read only access and they return an unsigned holding the unicode character
* appropriate for the respective operator.
*/
class uni_iter
{
friend class UTF8;
const unsigned char* it;
// private constructor.
uni_iter( const char* start ) :
it( (const unsigned char*) start )
{
// for the human: assert( sizeof(unsigned) >= 4 );
}
public:
uni_iter( const uni_iter& o )
{
it = o.it;
}
/// pre-increment and return uni_iter at new position
const uni_iter& operator++()
{
it += uni_forward( it );
return *this;
}
/// post-increment and return uni_iter at initial position
uni_iter operator++( int )
{
uni_iter ret = *this;
it += uni_forward( it );
return ret;
}
/*
/// return unicode at current position
unsigned operator->() const
{
unsigned result;
// grab the result, do not advance
uni_forward( it, &result );
return result;
}
*/
/// return unicode at current position
unsigned operator*() const
{
unsigned result;
// grab the result, do not advance
uni_forward( it, &result );
return result;
}
bool operator==( const uni_iter& other ) const { return it == other.it; }
bool operator!=( const uni_iter& other ) const { return it != other.it; }
/// Since the ++ operators advance more than one byte, this is your best
/// loop termination test, < end(), not == end().
bool operator< ( const uni_iter& other ) const { return it < other.it; }
bool operator<=( const uni_iter& other ) const { return it <= other.it; }
bool operator> ( const uni_iter& other ) const { return it > other.it; }
bool operator>=( const uni_iter& other ) const { return it >= other.it; }
};
/**
* Function ubegin
* returns a @a uni_iter initialized to the start of "this" UTF8 byte sequence.
*/
uni_iter ubegin() const
{
return uni_iter( data() );
}
/**
* Function uend
* returns a @a uni_iter initialized to the end of "this" UTF8 byte sequence.
*/
uni_iter uend() const
{
return uni_iter( data() + size() );
}
};
#endif // UTF8_H__

View File

@ -27,7 +27,7 @@
#include <math/box2.h> #include <math/box2.h>
#include <rtree.h> #include <geometry/rtree.h>
namespace KIGFX namespace KIGFX
{ {
@ -76,7 +76,6 @@ public:
* Executes a function object aVisitor for each item whose bounding box intersects * Executes a function object aVisitor for each item whose bounding box intersects
* with aBounds. * with aBounds.
*/ */
template <class Visitor> template <class Visitor>
void Query( const BOX2I& aBounds, Visitor& aVisitor ) // const void Query( const BOX2I& aBounds, Visitor& aVisitor ) // const
{ {

View File

@ -87,6 +87,9 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME
/// The global footprint library table. /// The global footprint library table.
FP_LIB_TABLE* m_globalFootprintTable; FP_LIB_TABLE* m_globalFootprintTable;
/// User defined rotation angle (in tenths of a degree).
int m_rotationAngle;
/** /**
* Function loadFootprints * Function loadFootprints
* loads the footprints for each #COMPONENT in \a aNetlist from the list of libraries. * loads the footprints for each #COMPONENT in \a aNetlist from the list of libraries.
@ -330,6 +333,9 @@ public:
*/ */
virtual void SetGridColor(EDA_COLOR_T aColor); virtual void SetGridColor(EDA_COLOR_T aColor);
int GetRotationAngle() const { return m_rotationAngle; }
void SetRotationAngle( int aRotationAngle );
// Configurations: // Configurations:
void InstallConfigFrame(); void InstallConfigFrame();
void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event );

View File

@ -136,6 +136,8 @@ protected:
/// The timer used to implement the auto save feature; /// The timer used to implement the auto save feature;
wxTimer* m_autoSaveTimer; wxTimer* m_autoSaveTimer;
wxString m_perspective; ///< wxAuiManager perspective.
/** /**
* Function onAutoSaveTimer * Function onAutoSaveTimer
* handles the auto save timer event. * handles the auto save timer event.

View File

@ -79,7 +79,7 @@ public:
class DIALOG_TEMPLATE_SELECTOR : public DIALOG_TEMPLATE_SELECTOR_BASE class DIALOG_TEMPLATE_SELECTOR : public DIALOG_TEMPLATE_SELECTOR_BASE
{ {
protected: protected:
vector<TEMPLATE_SELECTION_PANEL*> m_panels; std::vector<TEMPLATE_SELECTION_PANEL*> m_panels;
void AddTemplate( int aPage, PROJECT_TEMPLATE* aTemplate ); void AddTemplate( int aPage, PROJECT_TEMPLATE* aTemplate );
TEMPLATE_WIDGET* m_selectedWidget; TEMPLATE_WIDGET* m_selectedWidget;

View File

@ -33,8 +33,6 @@
#include <wx/txtstrm.h> #include <wx/txtstrm.h>
#include <wx/wfstream.h> #include <wx/wfstream.h>
using namespace std;
#define SEP() wxFileName::GetPathSeparator() #define SEP() wxFileName::GetPathSeparator()
@ -71,9 +69,9 @@ PROJECT_TEMPLATE::PROJECT_TEMPLATE( const wxString& aPath )
metaIcon = new wxBitmap( templateMetaIconFile.GetFullPath(), wxBITMAP_TYPE_PNG ); metaIcon = new wxBitmap( templateMetaIconFile.GetFullPath(), wxBITMAP_TYPE_PNG );
} }
vector<wxFileName> PROJECT_TEMPLATE::GetFileList() std::vector<wxFileName> PROJECT_TEMPLATE::GetFileList()
{ {
vector<wxFileName> files; std::vector<wxFileName> files;
wxString f = templateBasePath.GetPath(); wxString f = templateBasePath.GetPath();
wxArrayString allfiles; wxArrayString allfiles;
wxFileName p; wxFileName p;
@ -122,8 +120,8 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath )
{ {
bool result = true; bool result = true;
vector<wxFileName> srcFiles = GetFileList(); std::vector<wxFileName> srcFiles = GetFileList();
vector<wxFileName> dstFiles; std::vector<wxFileName> dstFiles;
for( size_t i=0; i < srcFiles.size(); i++ ) for( size_t i=0; i < srcFiles.size(); i++ )
{ {

View File

@ -110,9 +110,6 @@
#include <wx/image.h> #include <wx/image.h>
#include <wx/filename.h> #include <wx/filename.h>
using namespace std;
/** /**
* @brief A directory which contains information about the project template and does not get * @brief A directory which contains information about the project template and does not get
* copied. This define is the default filename for this directory * copied. This define is the default filename for this directory
@ -200,7 +197,7 @@ public:
* @brief Get a vector list of filenames for the template. The files are the source files, * @brief Get a vector list of filenames for the template. The files are the source files,
* and have not yet been through any renaming * and have not yet been through any renaming
*/ */
vector<wxFileName> GetFileList(); std::vector<wxFileName> GetFileList();
}; };
#endif #endif

View File

@ -52,9 +52,6 @@
#include <errno.h> #include <errno.h>
#include <assert.h> #include <assert.h>
#include <vector>
using namespace std;
#include <sch_dir_lib_source.h> #include <sch_dir_lib_source.h>
using namespace SCH; using namespace SCH;

View File

@ -31,7 +31,6 @@
#include <sch_dir_lib_source.h> #include <sch_dir_lib_source.h>
//using namespace std; // screws up Doxygen
using namespace SCH; using namespace SCH;
using namespace LT; // tokens, enum T for LIB_TABLE using namespace LT; // tokens, enum T for LIB_TABLE

View File

@ -28,20 +28,20 @@ double UNIT_SELECTOR_LEN::GetUnitScale()
{ {
switch( GetCurrentSelection() ) switch( GetCurrentSelection() )
{ {
case 0: return UNIT_MM; break; case 0: return UNIT_MM; break;
case 1: return UNIT_MICRON; break; case 1: return UNIT_MICRON; break;
case 2: return UNIT_CM; break; case 2: return UNIT_CM; break;
case 3: return UNIT_MIL; break; case 3: return UNIT_MIL; break;
case 4: return UNIT_INCH; break; case 4: return UNIT_INCH; break;
} }
return 1.0; return 1.0;
} }
UNIT_SELECTOR_FREQUENCY::UNIT_SELECTOR_FREQUENCY(wxWindow *parent, wxWindowID id, UNIT_SELECTOR_FREQUENCY::UNIT_SELECTOR_FREQUENCY( wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
const wxArrayString& choices, long style ) const wxArrayString& choices, long style ):
: UNIT_SELECTOR( parent, id, pos, size, choices, style ) UNIT_SELECTOR( parent, id, pos, size, choices, style )
{ {
Append( _("GHz") ); Append( _("GHz") );
Append( _("MHz") ); Append( _("MHz") );
@ -58,19 +58,19 @@ double UNIT_SELECTOR_FREQUENCY::GetUnitScale()
{ {
switch( GetCurrentSelection() ) switch( GetCurrentSelection() )
{ {
case 0: return UNIT_GHZ; break; case 0: return UNIT_GHZ;
case 1: return UNIT_MHZ; break; case 1: return UNIT_MHZ;
case 2: return UNIT_KHZ; break; case 2: return UNIT_KHZ;
case 3: return 1.0; break; case 3: return 1.0;
} }
return 1.0; return 1.0;
} }
UNIT_SELECTOR_ANGLE::UNIT_SELECTOR_ANGLE(wxWindow *parent, wxWindowID id, UNIT_SELECTOR_ANGLE::UNIT_SELECTOR_ANGLE( wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
const wxArrayString& choices, long style ) const wxArrayString& choices, long style ) :
: UNIT_SELECTOR( parent, id, pos, size, choices, style ) UNIT_SELECTOR( parent, id, pos, size, choices, style )
{ {
Append( _("Radian") ); Append( _("Radian") );
Append( _("Degree") ); Append( _("Degree") );
@ -85,8 +85,8 @@ double UNIT_SELECTOR_ANGLE::GetUnitScale()
{ {
switch( GetCurrentSelection() ) switch( GetCurrentSelection() )
{ {
case 0: return UNIT_RADIAN; break; case 0: return UNIT_RADIAN; break;
case 1: return UNIT_DEGREE; break; case 1: return UNIT_DEGREE; break;
} }
return 1.0; return 1.0;
} }
@ -111,8 +111,8 @@ double UNIT_SELECTOR_RESISTOR::GetUnitScale()
{ {
switch( GetCurrentSelection() ) switch( GetCurrentSelection() )
{ {
case 0: return UNIT_OHM; break; case 0: return UNIT_OHM; break;
case 1: return UNIT_KOHM; break; case 1: return UNIT_KOHM; break;
} }
return 1.0; return 1.0;
} }

View File

@ -372,13 +372,14 @@ if( KICAD_SCRIPTING_MODULES )
polygon polygon
bitmaps bitmaps
gal gal
${GLEW_LIBRARIES} ${GLEW_LIBRARIES}
${CAIRO_LIBRARIES} ${CAIRO_LIBRARIES}
${wxWidgets_LIBRARIES} ${wxWidgets_LIBRARIES}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GDI_PLUS_LIBRARIES} ${GDI_PLUS_LIBRARIES}
${PYTHON_LIBRARIES} ${PYTHON_LIBRARIES}
${PCBNEW_EXTRA_LIBS} ${PCBNEW_EXTRA_LIBS}
${Boost_LIBRARIES} # must follow GITHUB
) )
# create .i files from XML doxygen parsing, docstrings.i will include all of them # create .i files from XML doxygen parsing, docstrings.i will include all of them
@ -548,20 +549,21 @@ target_link_libraries( pcbnew
${GDI_PLUS_LIBRARIES} ${GDI_PLUS_LIBRARIES}
${PYTHON_LIBRARIES} ${PYTHON_LIBRARIES}
${PCBNEW_EXTRA_LIBS} ${PCBNEW_EXTRA_LIBS}
${GLEW_LIBRARIES} ${GLEW_LIBRARIES}
${CAIRO_LIBRARIES} ${CAIRO_LIBRARIES}
${Boost_LIBRARIES} # must follow GITHUB
) )
# Only for win32 cross compilation using MXE # Only for win32 cross compilation using MXE
if( WIN32 AND MSYS AND CMAKE_CROSSCOMPILING ) if( WIN32 AND MSYS AND CMAKE_CROSSCOMPILING )
target_link_libraries(pcbnew target_link_libraries( pcbnew
opengl32 opengl32
glu32 glu32
pixman-1 pixman-1
fontconfig fontconfig
freetype freetype
bz2 bz2
) )
endif() endif()
if( MAKE_LINK_MAPS ) if( MAKE_LINK_MAPS )

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