Commit 84c496e1 authored by Maciej Suminski's avatar Maciej Suminski

Upstream merge

parents d613da8b de65a7a1
......@@ -47,8 +47,6 @@ option( KICAD_SCRIPTING_WXPYTHON
# 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 )
......
......@@ -77,6 +77,7 @@ macro(perform_feature_checks)
check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
check_symbol_exists(strncasecmp "string.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.
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
# 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_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
......
......@@ -7,6 +7,8 @@
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_STRTOKR // spelled odly to differ from wx's similar test
// Handle platform differences in math.h
#cmakedefine HAVE_MATH_H
......@@ -56,9 +58,6 @@
/// The legacy file format revision of the *.brd file created by this build
#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.
#define DEFAULT_INSTALL_PATH "@CMAKE_INSTALL_PREFIX"
......
......@@ -74,10 +74,12 @@ Dialogs:
size should the user have selected a font size of 13 points.
Quoting:
Filenames and paths should be emphasized with <> angle brackets. Anything
else should be emphasized with single quotes ''. e.g.:
<filename.kicad_pcb>
<longpath/subdir>
Filenames, paths or other text should be with single quotes ''. e.g.:
'filename.kicad_pcb'
'longpath/subdir'
'FOOTPRINTNAME'
'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.
......@@ -141,6 +141,7 @@ set(COMMON_SRCS
selcolor.cpp
string.cpp
trigo.cpp
utf8.cpp
wildcards_and_files_ext.cpp
worksheet.cpp
wxwineda.cpp
......@@ -148,6 +149,10 @@ set(COMMON_SRCS
zoom.cpp
)
if( NOT HAVE_STRTOKR )
set( COMMON_SRCS ${COMMON_SRCS} strtok_r.c )
endif()
enable_language(C CXX ASM)
set_source_files_properties(system/fcontext.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
......
......@@ -56,6 +56,10 @@ const wxChar* traceAutoSave = wxT( "KicadAutoSave" );
/// Configuration file entry name for auto save interval.
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,
ID_DRAWFRAME_TYPE aFrameType,
......@@ -213,6 +217,11 @@ void EDA_BASE_FRAME::LoadSettings()
if( maximized )
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;
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" );
#endif
tmp << wxT( " USE_FP_LIB_TABLE=" );
#ifdef USE_FP_LIB_TABLE
tmp << wxT( "ON\n" );
#else
tmp << wxT( "OFF\n" );
#endif
tmp << wxT( " USE_FP_LIB_TABLE=HARD_CODED_ON\n" );
tmp << wxT( " BUILD_GITHUB_PLUGIN=" );
#ifdef BUILD_GITHUB_PLUGIN
......
......@@ -30,7 +30,9 @@ PLOTTER::PLOTTER( )
defaultPenWidth = 0;
currentPenWidth = -1; // To-be-set marker
penState = 'Z'; // End-of-path idle
plotMirror = false; // Mirror flag
m_plotMirror = false; // Mirror flag
m_mirrorIsHorizontal = true;
m_yaxisReversed = false;
outputFile = 0;
colorMode = false; // Starts as a BW plot
negativeMode = false;
......@@ -74,16 +76,27 @@ bool PLOTTER::OpenFile( const wxString& aFullFilename )
* scale factor, and offsets trace. Also convert from a wxPoint to DPOINT,
* 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;
double y;
wxPoint pos = aCoordinate - plotOffset;
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 );
}
......
......@@ -44,7 +44,7 @@ void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
iuPerDeviceUnit *= 0.00254; // ... now in mm
SetDefaultLineWidth( 0 ); // No line width on DXF
plotMirror = false; // No mirroring on DXF
m_plotMirror = false; // No mirroring on DXF
m_currentColor = BLACK;
}
......
......@@ -21,7 +21,7 @@ void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
{
wxASSERT( !outputFile );
wxASSERT( aMirror == false );
plotMirror = false;
m_plotMirror = false;
plotOffset = aOffset;
wxASSERT( aScale == 1 );
plotScale = 1;
......
......@@ -196,7 +196,7 @@ void HPGL_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
paperSize.x *= 10.0 * aIusPerDecimil;
paperSize.y *= 10.0 * aIusPerDecimil;
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 );
if( plotMirror )
if( m_plotMirror )
angle = StAngle - EndAngle;
else
angle = EndAngle - StAngle;
NORMALIZE_ANGLE_180( angle );
angle /= 10;
// Calculate start point,
// Calculate arc start point:
wxPoint cmap;
cmap.x = centre.x + KiROUND( cosdecideg( 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,
"PU;PA %.0f,%.0f;PD;AA %.0f,%.0f,",
cmap_dev.x,
cmap_dev.y,
centre_dev.x,
centre_dev.y );
cmap_dev.x, cmap_dev.y,
centre_dev.x, centre_dev.y );
fprintf( outputFile, "%.0f", angle );
fprintf( outputFile, ";PU;\n" );
PenFinish();
......@@ -431,7 +430,7 @@ void HPGL_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double
*/
if( size.x > size.y )
{
EXCHG( size.x, size.y );
EXCHG( size.x, size.y );
orient = AddAngles( orient, 900 );
}
......
......@@ -71,7 +71,7 @@ void PDF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !workFile );
plotMirror = aMirror;
m_plotMirror = aMirror;
plotOffset = aOffset;
plotScale = aScale;
m_IUsPerDecimil = aIusPerDecimil;
......
......@@ -306,7 +306,7 @@ void PS_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
wxASSERT( !outputFile );
plotMirror = aMirror;
m_plotMirror = aMirror;
plotOffset = aOffset;
plotScale = aScale;
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 )
{
wxASSERT( outputFile );
......@@ -486,14 +486,24 @@ void PS_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle,
// Calculate start point.
DPOINT centre_dev = userToDeviceCoordinates( centre );
double radius_dev = userToDeviceSize( radius );
if( plotMirror )
fprintf( outputFile, "%g %g %g %g %g arc%d\n", centre_dev.x, centre_dev.y,
radius_dev, -EndAngle / 10.0, -StAngle / 10.0,
fill );
else
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 );
if( m_plotMirror )
{
if( m_mirrorIsHorizontal )
{
StAngle = 1800.0 -StAngle;
EndAngle = 1800.0 -EndAngle;
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 );
}
......
......@@ -172,7 +172,8 @@ void SVG_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
double aScale, bool aMirror )
{
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;
plotScale = aScale;
m_IUsPerDecimil = aIusPerDecimil;
......@@ -345,13 +346,28 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
DPOINT centre_dev = userToDeviceCoordinates( centre );
double radius_dev = userToDeviceSize( radius );
if( !plotMirror )
if( m_yaxisReversed ) // Should be always the case
{
double tmp = StAngle;
StAngle = -EndAngle;
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;
start.x = radius_dev;
RotatePoint( &start.x, &start.y, StAngle );
......
......@@ -81,7 +81,6 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
EDA_COLOR_T plotColor = plotter->GetColorMode() ? RED : BLACK;
plotter->SetColor( plotColor );
plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH );
WS_DRAW_ITEM_LIST drawList;
// 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;
item = drawList.GetNext() )
{
plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH );
switch( item->GetType() )
{
case WS_DRAW_ITEM_BASE::wsg_line:
{
WS_DRAW_ITEM_LINE* line = (WS_DRAW_ITEM_LINE*) item;
plotter->SetCurrentLineWidth( line->GetPenWidth() );
plotter->MoveTo( line->GetStart() );
plotter->FinishTo( line->GetEnd() );
}
......@@ -116,7 +118,11 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
case WS_DRAW_ITEM_BASE::wsg_rect:
{
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;
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;
plotter->PlotPoly( poly->m_Corners,
poly->IsFilled() ? FILLED_SHAPE : NO_FILL );
poly->IsFilled() ? FILLED_SHAPE : NO_FILL,
poly->GetPenWidth() );
}
break;
......
......@@ -102,10 +102,10 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& text, int displaytime
void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title,
const wxString& text, const wxSize& size )
{
HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX(parent,title, wxDefaultPosition, size );
dlg->AddHTML_Text( text );
dlg->ShowModal();
dlg->Destroy();
HTML_MESSAGE_BOX dlg( parent, title, wxDefaultPosition, size );
dlg.AddHTML_Text( text );
dlg.ShowModal();
}
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/
//
// 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->SetDefault();
bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxALL, 10 );
this->SetSizer( bMainSizer );
......
......@@ -20,8 +20,10 @@
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_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_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
......@@ -42,7 +44,7 @@
<property name="minimum_size">400,120</property>
<property name="name">DIALOG_DISPLAY_HTML_TEXT_BASE</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="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title"></property>
......@@ -176,8 +178,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="border">10</property>
<property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -45,7 +45,7 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
public:
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();
};
......
......@@ -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 )
{
// Protect from refreshing during backend switch
......
This diff is collapsed.
......@@ -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.
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() );
}
......@@ -631,13 +637,34 @@ 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 )
{
// We reserve the right to do this another way, by providing our own member
// function.
return wxExpandEnvVars( aString );
}
#endif
bool FP_LIB_TABLE::IsEmpty( bool aIncludeFallback )
{
......
This diff is collapsed.
......@@ -25,7 +25,6 @@
#include <geometry/shape_line_chain.h>
#include <geometry/shape_circle.h>
using namespace std;
using boost::optional;
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;
for( int s = 0; s < SegmentCount(); s++ )
d = min( d, CSegment( s ).Distance( aP ) );
d = std::min( d, CSegment( s ).Distance( aP ) );
return d;
}
......@@ -437,7 +436,7 @@ const optional<SHAPE_LINE_CHAIN::INTERSECTION> SHAPE_LINE_CHAIN::SelfIntersectin
SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify()
{
vector<VECTOR2I> pts_unique;
std::vector<VECTOR2I> pts_unique;
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 ) << " ";
......
......@@ -1358,8 +1358,8 @@ void ClipAndDrawPoly( EDA_RECT* aClipBox, wxDC* aDC, wxPoint aPoints[], int n )
}
// A clip box exists: clip and draw the polygon.
static vector<wxPoint> clippedPolygon;
static pointVector inputPolygon, outputPolygon;
static std::vector<wxPoint> clippedPolygon;
static pointVector inputPolygon, outputPolygon;
inputPolygon.clear();
outputPolygon.clear();
......
#include <fctsys.h>
#include <html_messagebox.h>
#include <macros.h>
#include <common.h>
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle,
wxPoint aPos, wxSize aSize)
: DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize )
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle,
wxPoint aPos, wxSize aSize) :
DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize )
{
ListClear();
Center();
}
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)
void HTML_MESSAGE_BOX::ListSet( const wxString& aList )
{
wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
// wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
wxArrayString* strings_list = wxStringSplit( aList, wxChar( '\n' ) );
wxArrayString* strings_list = wxStringSplit( aList, wxChar('\n') );
wxString msg = wxT("<ul>");
for ( unsigned ii = 0; ii < strings_list->GetCount(); ii ++ )
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( "<li>" );
msg += strings_list->Item( ii ) + wxT( "</li>" );
}
msg += wxT("</ul>");
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg );
delete strings_list;
}
/**
* Function ListSet
* Add a list of items.
* @param aList = a wxArrayString containing items
*/
void HTML_MESSAGE_BOX::ListSet(const wxArrayString &aList)
void HTML_MESSAGE_BOX::ListSet( const wxArrayString& aList )
{
wxString msg = wxT("<ul>");
for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
wxString msg = wxT( "<ul>" );
for( unsigned ii = 0; ii < aList.GetCount(); ii++ )
{
msg += wxT("<li>");
msg += aList.Item(ii) + wxT("</li>");
msg += wxT( "<li>" );
msg += aList.Item( ii ) + wxT( "</li>" );
}
msg += wxT("</ul>");
msg += wxT( "</ul>" );
m_htmlWindow->AppendToPage( msg );
}
/**
* Function MessageSet
* Add a message (in bold) to message list.
* @param message = the message
*/
void HTML_MESSAGE_BOX::MessageSet(const wxString &message)
void HTML_MESSAGE_BOX::MessageSet( const wxString& message )
{
wxString message_value;
message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) );
wxString message_value = wxString::Format(
wxT( "<b>%s</b><br>" ), GetChars( message ) );
m_htmlWindow->AppendToPage( message_value );
}
/**
* Function AddHTML_Text
* Add a text to message list.
* @param message = the text to add
*/
void HTML_MESSAGE_BOX::AddHTML_Text(const wxString &message)
void HTML_MESSAGE_BOX::AddHTML_Text( const wxString& message )
{
m_htmlWindow->AppendToPage( message );
}
......
......@@ -55,9 +55,6 @@ LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
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_ModuleTextCMPColor = LIGHTGRAY;
int g_ModuleTextCUColor = MAGENTA;
......
......@@ -477,3 +477,18 @@ bool ReplaceIllegalFileNameChars( std::string* aName )
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;
}
/*
* 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;
}
......@@ -31,8 +31,6 @@
#include <boost/foreach.hpp>
using namespace std;
struct FlagString
{
int flag;
......@@ -154,7 +152,7 @@ const std::string TOOL_EVENT::Format() const
const std::string TOOL_EVENT_LIST::Format() const
{
string s;
std::string s;
BOOST_FOREACH( TOOL_EVENT e, m_events )
s += e.Format() + " ";
......
......@@ -47,7 +47,6 @@
#include <class_drawpanel_gal.h>
using boost::optional;
using namespace std;
/// Struct describing the current execution state of a TOOL
struct TOOL_MANAGER::TOOL_STATE
......
/*
* 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
......@@ -159,10 +159,12 @@ struct queryVisitor
{
}
void operator()( VIEW_ITEM* aItem )
bool operator()( VIEW_ITEM* aItem )
{
if( aItem->ViewIsVisible() )
m_cont.push_back( VIEW::LAYER_ITEM_PAIR( aItem, m_layer ) );
return true;
}
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
const COLOR4D color = painter->GetSettings()->GetColor( aItem, layer );
......@@ -401,6 +403,8 @@ struct VIEW::updateItemsColor
if( group >= 0 )
gal->ChangeGroupColor( group, color );
return true;
}
int layer;
......@@ -453,12 +457,14 @@ struct VIEW::changeItemsDepth
{
}
void operator()( VIEW_ITEM* aItem )
bool operator()( VIEW_ITEM* aItem )
{
int group = aItem->getGroup( layer );
if( group >= 0 )
gal->ChangeGroupDepth( group, depth );
return true;
}
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
bool drawCondition = aItem->ViewIsVisible() &&
aItem->ViewGetLOD( currentLayer->id ) < view->m_scale;
if( !drawCondition )
return;
return true;
view->draw( aItem, currentLayer->id );
return true;
}
const VIEW_LAYER* currentLayer;
......@@ -682,9 +690,11 @@ bool VIEW::IsDirty() const
struct VIEW::unlinkItem
{
void operator()( VIEW_ITEM* aItem )
bool operator()( VIEW_ITEM* aItem )
{
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
int prevGroup = aItem->getGroup( layer );
......@@ -718,6 +728,8 @@ struct VIEW::recacheItem
{
aItem->setGroup( layer, -1 );
}
return true;
}
VIEW* view;
......@@ -798,12 +810,14 @@ struct VIEW::clearLayerCache
{
}
void operator()( VIEW_ITEM* aItem )
bool operator()( VIEW_ITEM* aItem )
{
if( aItem->storesGroups() )
{
aItem->deleteGroups();
}
return true;
}
VIEW* view;
......
......@@ -191,7 +191,7 @@ void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_TEXT* aItem, GAL* aGal ) const
aGal->SetStrokeColor( COLOR4D( aItem->GetColor() ) );
aGal->SetLineWidth( aItem->GetThickness() );
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 );
}
......
......@@ -112,13 +112,13 @@ target_link_libraries( cvpcb
# Only for win32 cross compilation using MXE
if( WIN32 AND MSYS AND CMAKE_CROSSCOMPILING )
target_link_libraries(cvpcb
opengl32
glu32
pixman-1
fontconfig
freetype
bz2
)
opengl32
glu32
pixman-1
fontconfig
freetype
bz2
)
endif()
......@@ -126,6 +126,9 @@ if( BUILD_GITHUB_PLUGIN )
target_link_libraries( cvpcb github_plugin )
endif()
# Must follow github_plugin
target_link_libraries( cvpcb ${Boost_LIBRARIES} )
###
# Add cvpcb as install target
......
......@@ -176,7 +176,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
/* filter alias so one can use multiple aliases (for polar and nonpolar caps for
* example) */
FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( alias.m_FootprintName );
const FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( alias.m_FootprintName );
if( module )
{
......@@ -185,7 +185,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
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
......@@ -210,7 +210,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
{
/* we do not need to analyse wildcards: single footprint do not contain them */
/* 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 )
{
......
......@@ -89,7 +89,6 @@ void CVPCB_MAINFRAME::LoadProjectFile( const wxString& aFileName )
// User library path takes precedent over default library search paths.
wxGetApp().InsertLibraryPath( m_UserLibraryPath, 1 );
#if defined( USE_FP_LIB_TABLE )
delete m_footprintLibTable;
// 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 );
}
#endif
}
......
......@@ -479,7 +479,6 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
try
{
#if defined( USE_FP_LIB_TABLE )
FPID fpid;
if( fpid.Parse( aFootprintName ) >= 0 )
......@@ -496,35 +495,6 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
fpname.c_str(), nickname.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 )
{
......@@ -558,9 +528,9 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) );
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 )
libname = GetChars( module_info->GetNickname() );
......
......@@ -135,14 +135,9 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
{
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,
GetChars( aList.GetItem( ii ).GetNickname() ),
GetChars( aList.GetItem( ii ).m_Module ) );
#endif
GetChars( aList.GetItem( ii ).GetFootprintName() ) );
newList.Add( msg );
continue;
}
......@@ -151,22 +146,17 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
&& !aList.GetItem( ii ).InLibrary( aLibName ) )
continue;
if( (aFilterType & BY_COMPONENT) && (aComponent != NULL)
&& !aComponent->MatchesFootprintFilters( aList.GetItem( ii ).m_Module ) )
if( (aFilterType & BY_COMPONENT) && aComponent
&& !aComponent->MatchesFootprintFilters( aList.GetItem( ii ).GetFootprintName() ) )
continue;
if( (aFilterType & BY_PIN_COUNT) && (aComponent!= NULL)
&& (aComponent->GetNetCount() != aList.GetItem( ii ).m_padCount) )
if( (aFilterType & BY_PIN_COUNT) && aComponent
&& aComponent->GetNetCount() != aList.GetItem( ii ).GetPadCount() )
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,
GetChars( aList.GetItem( ii ).GetNickname() ),
GetChars( aList.GetItem( ii ).m_Module ) );
#endif
GetChars( aList.GetItem( ii ).GetFootprintName() ) );
newList.Add( msg );
}
......
......@@ -73,9 +73,7 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
EVT_MENU( ID_SAVE_PROJECT_AS, CVPCB_MAINFRAME::SaveProjectFile )
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 )
#endif
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_skipComponentSelect = false;
#if defined( USE_FP_LIB_TABLE )
m_globalFootprintTable = NULL;
m_footprintLibTable = NULL;
#endif
/* Name of the document footprint list
* usually located in share/modules/footprints_doc
......@@ -199,7 +195,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
m_auimgr.Update();
#if defined( USE_FP_LIB_TABLE )
if( m_globalFootprintTable == NULL )
{
try
......@@ -229,8 +224,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
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 )
{
bool tableChanged = false;
......@@ -556,9 +548,11 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
}
if( tableChanged )
{
BuildLIBRARY_LISTBOX();
m_footprints.ReadFootprintFiles( m_footprintLibTable );
}
}
#endif
void CVPCB_MAINFRAME::OnKeepOpenOnSave( wxCommandEvent& event )
......@@ -703,20 +697,20 @@ void CVPCB_MAINFRAME::DisplayStatus()
}
else
{
wxString footprintName = m_FootprintList->GetSelectedFootprint();
wxString footprintName = m_FootprintList->GetSelectedFootprint();
FOOTPRINT_INFO* module = m_footprints.GetModuleInfo( footprintName );
if( module ) // can be NULL if no netlist loaded
{
msg = _( "Description: " ) + module->m_Doc;
msg = _( "Description: " ) + module->GetDoc();
SetStatusText( msg, 0 );
msg = _( "Key words: " ) + module->m_KeyWord;
msg = _( "Key words: " ) + module->GetKeywords();
SetStatusText( msg, 1 );
}
}
msg.Empty();
if( m_FootprintList )
......@@ -762,33 +756,12 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles()
return false;
}
#if !defined( USE_FP_LIB_TABLE )
m_footprints.ReadFootprintFiles( m_ModuleLibNames );
#else
if( m_footprintLibTable != NULL )
m_footprints.ReadFootprintFiles( m_footprintLibTable );
#endif
// Display error messages, if any.
if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() )
if( m_footprints.GetErrorCount() )
{
HTML_MESSAGE_BOX dialog( this, _( "Load Error" ) );
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();
m_footprints.DisplayErrors( this );
}
return true;
......@@ -953,9 +926,7 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
wxSize( 600, 400 ),
KICAD_DEFAULT_DRAWFRAME_STYLE );
#if defined( USE_FP_LIB_TABLE )
m_DisplayFootprintFrame->SetFootprintLibTable( m_footprintLibTable );
#endif
m_DisplayFootprintFrame->Show( true );
}
......@@ -1052,7 +1023,6 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
wxFONTWEIGHT_NORMAL ) );
}
#if defined( USE_FP_LIB_TABLE )
if( m_footprintLibTable )
{
wxArrayString libNames;
......@@ -1064,9 +1034,6 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
m_LibraryList->SetLibraryList( libNames );
}
#else
m_LibraryList->SetLibraryList( m_ModuleLibNames );
#endif
}
......
......@@ -99,9 +99,7 @@ bool EDA_APP::OnInit()
InitEDA_Appl( wxT( "CvPcb" ), APP_CVPCB_T );
#if defined( USE_FP_LIB_TABLE )
SetFootprintLibTablePath();
#endif
if( m_Checker && m_Checker->IsAnotherRunning() )
{
......
......@@ -55,7 +55,6 @@ class CVPCB_MAINFRAME : public EDA_BASE_FRAME
{
wxArrayString m_footprintListEntries;
#if defined( USE_FP_LIB_TABLE )
/// The global footprint library table.
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
/// use when finding a #MODULE.
FP_LIB_TABLE* m_footprintLibTable;
#endif
public:
bool m_KeepCvpcbOpen;
......@@ -148,9 +146,7 @@ public:
* Function OnEditLibraryTable
* envokes the footpirnt library table edit dialog.
*/
#if defined( USE_FP_LIB_TABLE )
void OnEditFootprintLibraryTable( wxCommandEvent& aEvent );
#endif
void OnKeepOpenOnSave( wxCommandEvent& event );
void DisplayModule( wxCommandEvent& event );
......
......@@ -110,17 +110,9 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Menu Preferences:
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,
_( "Li&brary Tables" ), _( "Setup footprint libraries" ),
KiBitmap( library_table_xpm ) );
#endif
// Language submenu
wxGetApp().AddMenuLanguageList( preferencesMenu );
......
......@@ -159,8 +159,6 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
isLegacy = false; // None of the components have footprints assigned.
}
#if defined( USE_FP_LIB_TABLE )
wxString missingLibs;
// 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++ )
{
......@@ -272,7 +269,6 @@ int CVPCB_MAINFRAME::SaveCmpLinkFile( const wxString& aFullFileName )
if( !fn.HasExt() )
fn.SetExt( ComponentFileExtension );
#if defined( USE_FP_LIB_TABLE )
// Save the project specific footprint library table.
if( !m_footprintLibTable->IsEmpty( false ) )
{
......@@ -298,8 +294,6 @@ int CVPCB_MAINFRAME::SaveCmpLinkFile( const wxString& aFullFileName )
}
}
}
#endif
}
if( !IsWritable( fn.GetFullPath() ) )
......
......@@ -26,8 +26,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <algorithm> // to use sort vector
#include <vector>
#include <algorithm>
#include <fctsys.h>
#include <class_drawpanel.h>
......
......@@ -30,7 +30,7 @@
#include <wx/regex.h>
#include <algorithm> // to use sort vector
#include <algorithm>
#include <vector>
#include <fctsys.h>
......
/*
* 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
* 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:
if( choiceCount <= 1 )
{
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()
& ~( 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
// the component has more than one shape)
if( m_Cmp->GetConvert() > 1 )
{
convertCheckBox->SetValue( true );
}
if( m_LibEntry == NULL || !m_LibEntry->HasConversion() )
{
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.
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() ) );
}
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/
//
// 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 );
optionsSizer->Add( unitChoice, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* orientationSizer;
orientationSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerUnitsInterchangeable;
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") };
int orientationRadioBoxNChoices = sizeof( orientationRadioBoxChoices ) / sizeof( wxString );
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") );
orientationSizer->Add( orientationRadioBox, 1, wxALL|wxEXPAND, 8 );
optionsSizer->Add( orientationSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 0 );
wxBoxSizer* mirrorSizer;
mirrorSizer = new wxBoxSizer( wxHORIZONTAL );
optionsSizer->Add( orientationRadioBox, 0, wxEXPAND|wxALL, 5 );
wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") };
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->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") );
mirrorSizer->Add( mirrorRadioBox, 1, wxALL, 8 );
optionsSizer->Add( mirrorSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 0 );
optionsSizer->Add( mirrorRadioBox, 0, wxALL|wxEXPAND, 5 );
m_staticTextChipname = new wxStaticText( this, wxID_ANY, _("Chip Name"), wxDefaultPosition, wxDefaultSize, 0 );
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->SetToolTip( _("Use the alternate shape of this component.\nFor gates, this is the \"De Morgan\" conversion") );
optionsSizer->Add( convertCheckBox, 0, wxALL, 8 );
partsAreLockedLabel = new wxStaticText( this, wxID_ANY, _("Parts are locked"), wxDefaultPosition, wxDefaultSize, 0 );
partsAreLockedLabel->Wrap( -1 );
optionsSizer->Add( partsAreLockedLabel, 0, wxALL|wxEXPAND, 8 );
optionsSizer->Add( convertCheckBox, 0, wxALL, 5 );
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.") );
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 );
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|wxALL|wxEXPAND, 5 );
upperSizer->Add( optionsSizer, 0, wxALIGN_TOP|wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* fieldsSizer;
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->Realize();
mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 8 );
mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( mainSizer );
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -21,8 +21,8 @@ class DIALOG_SHIM;
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/radiobox.h>
#include <wx/sizer.h>
#include <wx/radiobox.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/button.h>
......@@ -43,13 +43,16 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
protected:
wxStaticText* m_staticTextUnit;
wxChoice* unitChoice;
wxStaticText* unitsInterchageableText;
wxStaticText* unitsInterchageableLabel;
wxRadioBox* orientationRadioBox;
wxRadioBox* mirrorRadioBox;
wxStaticText* m_staticTextChipname;
wxTextCtrl* chipnameTextCtrl;
wxCheckBox* convertCheckBox;
wxStaticText* partsAreLockedLabel;
wxButton* defaultsButton;
wxStaticText* m_staticTextTimeStamp;
wxTextCtrl* m_textCtrlTimeStamp;
wxListCtrl* fieldListCtrl;
wxButton* addFieldButton;
wxButton* deleteFieldButton;
......
......@@ -3,7 +3,9 @@
DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT( wxWindow* parent ) :
DIALOG_LIB_NEW_COMPONENT_BASE( parent )
{
/* Required to make escape key work correctly in wxGTK. */
m_sdbSizerOK->SetFocus();
// initial focus should be on first editable field.
m_textName->SetFocus();
// What happens when user presses "Enter"? OK button! OK?
m_sdbSizerOK->SetDefault();
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -21,8 +21,8 @@ class DIALOG_SHIM;
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
......@@ -37,20 +37,19 @@ class DIALOG_LIB_NEW_COMPONENT_BASE : public DIALOG_SHIM
private:
protected:
wxStaticText* m_staticText6;
wxStaticText* m_staticText8;
wxStaticText* m_staticText2;
wxTextCtrl* m_textName;
wxStaticText* m_staticText3;
wxStaticText* m_staticText9;
wxTextCtrl* m_textReference;
wxStaticText* m_staticText4;
wxStaticText* m_staticText10;
wxSpinCtrl* m_spinPartCount;
wxCheckBox* m_checkHasConversion;
wxCheckBox* m_checkIsPowerSymbol;
wxCheckBox* m_checkLockItems;
wxStaticText* m_staticText7;
wxStaticText* m_staticText41;
wxStaticText* m_staticText11;
wxStaticText* m_staticText12;
wxSpinCtrl* m_spinPinTextPosition;
wxStaticText* m_staticText5;
wxCheckBox* m_checkShowPinNumber;
wxCheckBox* m_checkShowPinName;
wxCheckBox* m_checkShowPinNameInside;
......
This diff is collapsed.
......@@ -45,6 +45,12 @@ public:
{
m_staticSheetNameSizeUnits->SetLabel( aUnits );
}
void SetSheetTimeStamp(const wxString& aTimeStamp)
{
m_textCtrlTimeStamp->SetValue( aTimeStamp );
}
};
#endif // __dialog_sch_sheet_props__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/
//
// 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;
mainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 2, 6, 0, 0 );
fgSizer1 = new wxFlexGridSizer( 0, 6, 0, 0 );
fgSizer1->AddGrowableCol( 1 );
fgSizer1->SetFlexibleDirection( wxBOTH );
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 );
m_textFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textFileName->SetMaxLength( 0 );
m_textFileName->SetMinSize( wxSize( 200,-1 ) );
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 );
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 );
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 );
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 );
......@@ -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 );
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 );
m_staticSheetNameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticSheetNameSizeUnits->Wrap( -1 );
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 );
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( fgSizer1, 1, wxALL|wxEXPAND, 12 );
mainSizer->Add( bupperSizer, 0, wxEXPAND, 5 );
mainSizer->Add( 0, 0, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -11,6 +11,8 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
......@@ -19,8 +21,8 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
......@@ -44,6 +46,10 @@ class DIALOG_SCH_SHEET_PROPS_BASE : public DIALOG_SHIM
wxStaticText* m_staticText5;
wxTextCtrl* m_textSheetNameSize;
wxStaticText* m_staticSheetNameSizeUnits;
wxStaticLine* m_staticline2;
wxStaticLine* m_staticline3;
wxStaticText* m_staticTextTimeStamp;
wxTextCtrl* m_textCtrlTimeStamp;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
......@@ -51,7 +57,7 @@ class DIALOG_SCH_SHEET_PROPS_BASE : public DIALOG_SHIM
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();
};
......
......@@ -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
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.
m_TreeSize.y = m_nbsheets * itemrect.GetHeight();
......
......@@ -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_End() );
......
......@@ -96,7 +96,7 @@ public:
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; }
......
......@@ -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_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
{
vector< wxPoint > pts;
std::vector< wxPoint > pts;
GetConnectionPoints( pts );
......
......@@ -357,7 +357,7 @@ public:
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 );
......@@ -372,7 +372,7 @@ public:
*/
bool IsInNetlist() const;
void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
void GetConnectionPoints( std::vector<wxPoint>& aPoints ) const;
SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] );
......
......@@ -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 );
}
......
......@@ -81,7 +81,7 @@ public:
bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const { return wxString( _( "Junction" ) ); }
......
......@@ -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_end );
......
......@@ -113,9 +113,9 @@ public:
*/
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; }
......@@ -123,7 +123,7 @@ public:
bool IsConnectable() const;
void GetConnectionPoints( vector< wxPoint >& aPoints ) const;
void GetConnectionPoints(std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const;
......
......@@ -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 );
}
......
......@@ -81,7 +81,7 @@ public:
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" ) ); }
......
......@@ -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++ )
aPoints.push_back( GetPins()[i].GetPosition() );
......
......@@ -533,7 +533,7 @@ public:
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,
const KICAD_T scanTypes[] );
......
......@@ -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.
if( Type() == SCH_TEXT_T )
......
......@@ -189,7 +189,7 @@ public:
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; }
......
......@@ -27,13 +27,13 @@
*/
#include <fctsys.h>
#include <gr_basic.h>
//#include <gr_basic.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <wxEeschemaStruct.h>
#include <base_units.h>
#include <general.h>
//#include <general.h>
#include <sch_sheet.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.SetSheetNameTextSize( ReturnStringFromValue( g_UserUnit, aSheet->GetSheetNameSize() ) );
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
* versions for the flex grid sizer in wxGTK that prevents the last
......
......@@ -111,6 +111,12 @@ public:
m_eventDispatcher = aEventDispatcher;
}
/**
* Function StopDrawing()
* Prevents the GAL canvas from further drawing till it is recreated.
*/
void StopDrawing();
protected:
void onPaint( wxPaintEvent& WXUNUSED( aEvent ) );
void onSize( wxSizeEvent& aEvent );
......
This diff is collapsed.
......@@ -640,26 +640,4 @@ protected:
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_
......@@ -277,7 +277,7 @@ public:
* @param aPosition is the text position in world coordinates.
* @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 )
{
strokeFont.Draw( aText, aPosition, aRotationAngle );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#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_
This diff is collapsed.
......@@ -25,8 +25,6 @@ extern DISPLAY_OPTIONS DisplayOpt;
extern int g_CurrentVersionPCB;
extern int g_RotationAngle;
/// List of segments of the trace currently being drawn.
extern DLIST<TRACK> g_CurrentTrackList;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,8 +3,6 @@
#include <tool/coroutine.h>
using namespace std;
typedef COROUTINE<int, int> MyCoroutine;
class MyClass
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment