Commit fe5c5953 authored by Maciej Suminski's avatar Maciej Suminski

Upstream merge.

parents 6d0a3532 dd3da842
......@@ -228,8 +228,6 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event )
{
wxSize size( GetClientSize() );
if( event.ShiftDown() )
{
if( event.GetWheelRotation() < 0 )
......
......@@ -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 )
......@@ -459,11 +457,6 @@ add_custom_target( uninstall
# Installation
#================================================
add_custom_target( install_user_configuration_files
"${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/template/fp-lib-table" ${KICAD_USER_CONFIG_DIR}/
COMMENT "Install template fp-lib-table into your home directory."
)
install( FILES INSTALL.txt
DESTINATION ${KICAD_DOCS}
COMPONENT resources )
......@@ -534,10 +527,6 @@ if( UNIX AND NOT APPLE )
#set( CPACK_PACKAGE_CONTACT Firstname Lastname <email@company.com> )
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "KiCad built by CMake build system." )
# Tell debian CPack about all files which are configuration files
add_conffiles() # clear file
add_conffiles( ${KICAD_USER_CONFIG_DIR}/fp-lib-table ) # append to it
include( CPack )
endif()
......@@ -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.
......@@ -62,10 +62,6 @@ PCBNew
Dick's Final TODO List:
======================
*) Rewrite
PCB_BASE_FRAME::Save_Module_In_Library
PCB_EDIT_FRAME::ArchiveModulesOnBoard
to use FP_LIB_TABLE mechanisms.
*) Apply Fabrizio and Alexander's linux desktop patches after unifying them.
*) Get licensing cleaned up.
*) Re-arrange the repo architecture.
......
......@@ -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;
}
......@@ -386,7 +386,7 @@ void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int
}
}
/** Plot an arc in DXF format
/* Plot an arc in DXF format
* Filling is not supported
*/
void DXF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius,
......@@ -397,6 +397,14 @@ void DXF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
if( radius <= 0 )
return;
// In DXF, arcs are drawn CCW.
// In Kicad, arcs are CW or CCW
// If StAngle > EndAngle, it is CW. So transform it to CCW
if( StAngle > EndAngle )
{
EXCHG( StAngle, EndAngle );
}
DPOINT centre_dev = userToDeviceCoordinates( centre );
double radius_dev = userToDeviceSize( radius );
......@@ -425,6 +433,7 @@ void DXF_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, double
EXCHG( size.x, size.y );
orient = AddAngles( orient, 900 );
}
sketchOval( pos, size, orient, -1 );
}
......
......@@ -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();
};
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
* 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
......@@ -56,15 +57,39 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
InsertItems( aItemList, 0 );
for( unsigned i = 0; i < aItemHeaders.Count(); i++ )
m_listBox->SetColumnWidth( i, wxLIST_AUTOSIZE );
if( m_callBackFct == NULL )
{
m_messages->Show( false );
m_staticTextMsg->Show( false );
}
for( unsigned col = 0; col < aItemHeaders.Count(); ++col )
{
m_listBox->SetColumnWidth( col, wxLIST_AUTOSIZE );
#if !wxCHECK_VERSION( 2, 9, 0 )
// include the column header in the width decision, wx 2.8 forgets this:
wxListItem col_info;
m_listBox->GetColumn( col, col_info );
wxString header = col_info.GetText();
int headerz = GetTextSize( header, m_listBox ).x;
// A reasonable column header has about 14 pixels of whitespace
// in addition to the width of the text itself.
headerz += 14;
if( headerz > col_info.GetWidth() )
{
col_info.SetWidth( headerz );
m_listBox->SetColumn( col, col_info );
}
#endif
}
#if !wxCHECK_VERSION( 2, 9, 0 )
// wx 2.8.x has bug in wxListCtrl WRT honoring the omission of wxHSCROLL, at least
// on gtk2. Fix by setting minimum width so horizontal wxListCtrl scrolling is
......@@ -77,8 +102,6 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
width += m_listBox->GetColumnWidth( col ) + 2;
}
//width += 40; // vert scroll bar.
wxSize sz = m_listBox->GetSize();
sz.SetWidth( width );
......@@ -112,11 +135,6 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
}
EDA_LIST_DIALOG::~EDA_LIST_DIALOG()
{
}
void EDA_LIST_DIALOG::textChangeInFilterBox( wxCommandEvent& event )
{
wxString filter;
......@@ -143,22 +161,24 @@ void EDA_LIST_DIALOG::textChangeInFilterBox( wxCommandEvent& event )
wxString EDA_LIST_DIALOG::GetTextSelection( int aColumn )
{
wxCHECK_MSG( aColumn < m_listBox->GetColumnCount(), wxEmptyString,
wxCHECK_MSG( unsigned( aColumn ) < unsigned( m_listBox->GetColumnCount() ), wxEmptyString,
wxT( "Invalid list control column." ) );
wxListItem info;
wxString text;
long item = -1;
item = m_listBox->GetNextItem( item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
long item = m_listBox->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = item;
info.m_col = aColumn;
if( item >= 0 ) // if something is selected.
{
wxListItem info;
info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = item;
info.m_col = aColumn;
if( !m_listBox->GetItem( info ) )
return wxEmptyString;
if( m_listBox->GetItem( info ) )
return info.m_text;
}
return info.m_text;
return wxEmptyString;
}
......@@ -182,9 +202,9 @@ void EDA_LIST_DIALOG::InsertItems( const std::vector< wxArrayString >& itemList,
{
wxASSERT( (int) itemList[row].GetCount() == m_listBox->GetColumnCount() );
long itemIndex = 0;
for( unsigned col = 0; col < itemList[row].GetCount(); col++ )
{
long itemIndex;
if( col == 0 )
{
......
......@@ -906,11 +906,22 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
bool offCenterReq = event.ControlDown() && event.ShiftDown();
offCenterReq = offCenterReq || m_enableZoomNoCenter;
#if wxMAJOR_VERSION >= 2 && wxMINOR_VERSION >= 9
int axis = event.GetWheelAxis();
#else
const int axis = 0;
#endif
// This is a zoom in or out command
if( event.GetWheelRotation() > 0 )
{
if( event.ShiftDown() && !event.ControlDown() )
cmd.SetId( ID_PAN_UP );
{
if( axis == 0 )
cmd.SetId( ID_PAN_UP );
else
cmd.SetId( ID_PAN_RIGHT );
}
else if( event.ControlDown() && !event.ShiftDown() )
cmd.SetId( ID_PAN_LEFT );
else if( offCenterReq )
......@@ -921,7 +932,12 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
else if( event.GetWheelRotation() < 0 )
{
if( event.ShiftDown() && !event.ControlDown() )
cmd.SetId( ID_PAN_DOWN );
{
if( axis == 0 )
cmd.SetId( ID_PAN_DOWN );
else
cmd.SetId( ID_PAN_LEFT );
}
else if( event.ControlDown() && !event.ShiftDown() )
cmd.SetId( ID_PAN_RIGHT );
else if( offCenterReq )
......
......@@ -184,6 +184,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
......
......@@ -265,47 +265,17 @@ void EDA_TEXT::Draw( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
{
if( m_MultilineAllowed )
{
std::vector<wxPoint> positions;
wxArrayString* list = wxStringSplit( m_Text, '\n' );
positions.reserve( list->Count() );
wxPoint pos = m_Pos; // Position of first line of the
// multiline text according to
// the center of the multiline text block
GetPositionsOfLinesOfMultilineText(positions, list->Count() );
wxPoint offset; // Offset to next line.
offset.y = GetInterline();
#ifdef FIX_MULTILINE_VERT_JUSTIF
if( list->Count() > 1 )
for( unsigned ii = 0; ii < list->Count(); ii++ )
{
switch( m_VJustify )
{
case GR_TEXT_VJUSTIFY_TOP:
break;
case GR_TEXT_VJUSTIFY_CENTER:
pos.y -= ( list->Count() - 1 ) * offset.y / 2;
break;
case GR_TEXT_VJUSTIFY_BOTTOM:
pos.y -= ( list->Count() - 1 ) * offset.y;
break;
}
}
// Rotate the position of the first line
// around the center of the multiline text block
RotatePoint( &pos, m_Pos, m_Orient );
#endif
// Rotate the offset lines to increase happened in the right direction
RotatePoint( &offset, m_Orient );
for( unsigned i = 0; i<list->Count(); i++ )
{
wxString txt = list->Item( i );
wxString& txt = list->Item( ii );
drawOneLineOfText( aClipBox, aDC, aOffset, aColor,
aDrawMode, aFillMode, txt, pos );
pos += offset;
aDrawMode, aFillMode, txt, positions[ii] );
}
delete (list);
......@@ -324,6 +294,49 @@ void EDA_TEXT::Draw( EDA_RECT* aClipBox, wxDC* aDC, const wxPoint& aOffset,
}
void EDA_TEXT::GetPositionsOfLinesOfMultilineText(
std::vector<wxPoint>& aPositions, int aLineCount )
{
wxPoint pos = m_Pos; // Position of first line of the
// multiline text according to
// the center of the multiline text block
wxPoint offset; // Offset to next line.
offset.y = GetInterline();
#ifdef FIX_MULTILINE_VERT_JUSTIF
if( aLineCount > 1 )
{
switch( m_VJustify )
{
case GR_TEXT_VJUSTIFY_TOP:
break;
case GR_TEXT_VJUSTIFY_CENTER:
pos.y -= ( aLineCount - 1 ) * offset.y / 2;
break;
case GR_TEXT_VJUSTIFY_BOTTOM:
pos.y -= ( aLineCount - 1 ) * offset.y;
break;
}
}
// Rotate the position of the first line
// around the center of the multiline text block
RotatePoint( &pos, m_Pos, m_Orient );
#endif
// Rotate the offset lines to increase happened in the right direction
RotatePoint( &offset, m_Orient );
for( int ii = 0; ii < aLineCount; ii++ )
{
aPositions.push_back( pos );
pos += offset;
}
}
void EDA_TEXT::drawOneLineOfText( EDA_RECT* aClipBox, wxDC* aDC,
const wxPoint& aOffset, EDA_COLOR_T aColor,
GR_DRAWMODE aDrawMode, EDA_DRAW_MODE_T aFillMode,
......
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() );
}
......@@ -179,11 +185,27 @@ MODULE* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname, const wxString&
}
void FP_LIB_TABLE::FootprintSave( const wxString& aNickname, const MODULE* aFootprint )
FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave( const wxString& aNickname, const MODULE* aFootprint, bool aOverwrite )
{
const ROW* row = FindRow( aNickname );
wxASSERT( (PLUGIN*) row->plugin );
return row->plugin->FootprintSave( row->GetFullURI( true ), aFootprint, row->GetProperties() );
if( !aOverwrite )
{
// Try loading the footprint to see if it already exists, caller wants overwrite
// protection, which is atypical, not the default.
wxString fpname = FROM_UTF8( aFootprint->GetFPID().GetFootprintName().c_str() );
std::auto_ptr<MODULE> m( row->plugin->FootprintLoad( row->GetFullURI( true ), fpname, row->GetProperties() ) );
if( m.get() )
return SAVE_SKIPPED;
}
row->plugin->FootprintSave( row->GetFullURI( true ), aFootprint, row->GetProperties() );
return SAVE_OK;
}
......@@ -203,6 +225,22 @@ bool FP_LIB_TABLE::IsFootprintLibWritable( const wxString& aNickname )
}
void FP_LIB_TABLE::FootprintLibDelete( const wxString& aNickname )
{
const ROW* row = FindRow( aNickname );
wxASSERT( (PLUGIN*) row->plugin );
row->plugin->FootprintLibDelete( row->GetFullURI( true ), row->GetProperties() );
}
void FP_LIB_TABLE::FootprintLibCreate( const wxString& aNickname )
{
const ROW* row = FindRow( aNickname );
wxASSERT( (PLUGIN*) row->plugin );
row->plugin->FootprintLibCreate( row->GetFullURI( true ), row->GetProperties() );
}
const wxString FP_LIB_TABLE::GetDescription( const wxString& aNickname )
{
// use "no exception" form of find row:
......@@ -599,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 )
{
......
......@@ -189,7 +189,7 @@ void GPU_CACHED_MANAGER::uploadToGpu()
{
#ifdef __WXDEBUG__
prof_counter totalTime;
prof_start( &totalTime, false );
prof_start( &totalTime );
#endif /* __WXDEBUG__ */
if( !m_buffersInitialized )
......@@ -214,8 +214,7 @@ void GPU_CACHED_MANAGER::uploadToGpu()
#ifdef __WXDEBUG__
prof_end( &totalTime );
wxLogDebug( wxT( "Uploading %d vertices to GPU / %.1f ms" ),
bufferSize, (double) totalTime.value / 1000.0 );
wxLogDebug( wxT( "Uploading %d vertices to GPU / %.1f ms" ), bufferSize, totalTime.msecs() );
#endif /* __WXDEBUG__ */
}
......
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 );
}
......
......@@ -68,7 +68,7 @@ int64_t rescale( int64_t aNumerator, int64_t aValue, int64_t aDenominator )
a0 = a0 * b0 + t1a;
a1 = a1 * b1 + ( t1 >> 32 ) + ( a0 < t1a );
a0 += r;
a1 += ( (uint64_t) a0 ) < r;
a1 += a0 < (uint64_t)r;
for( i = 63; i >= 0; i-- )
{
......
......@@ -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;
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* 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
*/
/**
* @file profile.h:
* @brief Simple profiling functions for measuring code execution time.
*/
#ifndef __TPROFILE_H
#define __TPROFILE_H
#include <sys/time.h>
#include <stdint.h>
/**
* Function rdtsc
* Returns processor's time-stamp counter. Main purpose is precise time measuring of code
* execution time.
* @return unsigned long long - Value of time-stamp counter.
*/
#if defined(__i386__)
static __inline__ unsigned long long rdtsc()
{
unsigned long long int x;
__asm__ volatile ( ".byte 0x0f, 0x31" : "=A" ( x ) );
return x;
}
#elif defined(__x86_64__)
static __inline__ unsigned long long rdtsc()
{
unsigned hi, lo;
__asm__ __volatile__ ( "rdtsc" : "=a" ( lo ), "=d" ( hi ) );
return ( (unsigned long long) lo ) | ( ( (unsigned long long) hi ) << 32 );
}
#elif defined(__powerpc__)
static __inline__ unsigned long long rdtsc()
{
unsigned long long int result = 0;
unsigned long int upper, lower, tmp;
__asm__ volatile (
"0: \n"
"\tmftbu %0 \n"
"\tmftb %1 \n"
"\tmftbu %2 \n"
"\tcmpw %2,%0 \n"
"\tbne 0b \n"
: "=r" ( upper ), "=r" ( lower ), "=r" ( tmp )
);
result = upper;
result = result << 32;
result = result | lower;
return result;
}
#endif /* __powerpc__ */
// Fixme: OS X version
/**
* Function get_tics
* Returns the number of microseconds that have elapsed since the system was started.
* @return uint64_t Number of microseconds.
*/
static inline uint64_t get_tics()
{
struct timeval tv;
gettimeofday( &tv, NULL );
return (uint64_t) tv.tv_sec * 1000000ULL + (uint64_t) tv.tv_usec;
}
/**
* Structure for storing data related to profiling counters.
*/
struct prof_counter
{
uint64_t value; /// Stored timer value
bool use_rdtsc; /// Method of time measuring (rdtsc or tics)
};
/**
* Function prof_start
* Begins code execution time counting for a given profiling counter.
* @param cnt is the counter which should be started.
* @param use_rdtsc tells if processor's time-stamp counter should be used for time counting.
* Otherwise is system tics method will be used. IMPORTANT: time-stamp counter should not
* be used on multicore machines executing threaded code.
*/
static inline void prof_start( prof_counter* cnt, bool use_rdtsc )
{
cnt->use_rdtsc = use_rdtsc;
if( use_rdtsc )
{
cnt->value = rdtsc();
}
else
{
cnt->value = get_tics();
}
}
/**
* Function prof_stop
* Ends code execution time counting for a given profiling counter.
* @param cnt is the counter which should be stopped.
*/
static inline void prof_end( prof_counter* cnt )
{
if( cnt->use_rdtsc )
cnt->value = rdtsc() - cnt->value;
else
cnt->value = get_tics() - cnt->value;
}
#endif
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 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
* 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
*/
/**
* @file string.cpp
* @brief Some useful functions to handle strings.
......@@ -5,9 +28,18 @@
#include <fctsys.h>
#include <macros.h>
#include <richio.h> // StrPrintf
#include <kicad_string.h>
/**
* Illegal file name characters used to insure file names will be valid on all supported
* platforms. This is the list of illegal file name characters for Windows which includes
* the illegal file name characters for Linux and OSX.
*/
static const char illegalFileNameChars[] = "\\/:\"<>|";
int ReadDelimitedText( wxString* aDest, const char* aSource )
{
std::string utf8; // utf8 but without escapes and quotes.
......@@ -414,3 +446,49 @@ int SplitString( wxString strToSplit,
return 0;
}
wxString GetIllegalFileNameWxChars()
{
return FROM_UTF8( illegalFileNameChars );
}
bool ReplaceIllegalFileNameChars( std::string* aName )
{
bool changed = false;
std::string result;
for( std::string::iterator it = aName->begin(); it != aName->end(); ++it )
{
if( strchr( illegalFileNameChars, *it ) )
{
StrPrintf( &result, "%%%02x", *it );
changed = true;
}
else
{
result += *it;
}
}
if( changed )
*aName = result;
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;
}
......@@ -33,6 +33,10 @@
#include "jump_x86_64_sysv_elf_gas.S"
#include "make_x86_64_sysv_elf_gas.S"
#elif __arm__
#include "jump_arm_aapcs_elf_gas.S"
#include "make_arm_aapcs_elf_gas.S"
#else
#error "Missing make_fcontext & jump_fcontext routines for this architecture"
#endif
......
/*
Copyright Oliver Kowalke 2009.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
/*******************************************************************
* *
* ------------------------------------------------------------- *
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *
* ------------------------------------------------------------- *
* | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| 0x20| 0x24| *
* ------------------------------------------------------------- *
* | v1 | v2 | v3 | v4 | v5 | v6 | v7 | v8 | sp | lr | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 10 | | *
* ------------------------------------------------------------- *
* | 0x28| | *
* ------------------------------------------------------------- *
* | pc | | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 11 | 12 | | *
* ------------------------------------------------------------- *
* | 0x2c| 0x30| | *
* ------------------------------------------------------------- *
* | sp | size| | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | *
* ------------------------------------------------------------- *
* | 0x34| 0x38|0x3c| 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58 | *
* ------------------------------------------------------------- *
* | s16 | s17 | s18 | s19 | s20 | s21 | s22 | s23 | s24 | s25 | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 23 | 24 | 25 | 26 | 27 | 28 | | *
* ------------------------------------------------------------- *
* | 0x5c| 0x60| 0x64| 0x68| 0x6c| 0x70| | *
* ------------------------------------------------------------- *
* | s26 | s27 | s28 | s29 | s30 | s31 | | *
* ------------------------------------------------------------- *
* *
* *****************************************************************/
.text
.globl jump_fcontext
.align 2
.type jump_fcontext,%function
jump_fcontext:
stmia a1, {v1-v8,sp-lr} @ save V1-V8,SP-LR
str lr, [a1,#40] @ save LR as PC
#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
cmp a4, #0 @ test if fpu env should be preserved
beq 1f
mov a4, a1
add a4, #52
vstmia a4, {d8-d15} @ save S16-S31
mov a4, a2
add a4, #52
vldmia a4, {d8-d15} @ restore S16-S31
1:
#endif
mov a1, a3 @ use third arg as return value after jump
@ and as first arg in context function
ldmia a2, {v1-v8,sp-pc} @ restore v1-V8,SP-PC
.size jump_fcontext,.-jump_fcontext
/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits
/*
Copyright Oliver Kowalke 2009.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
/*******************************************************************
* *
* ------------------------------------------------------------- *
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *
* ------------------------------------------------------------- *
* | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| 0x20| 0x24| *
* ------------------------------------------------------------- *
* | v1 | v2 | v3 | v4 | v5 | v6 | v7 | v8 | sp | lr | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 10 | | *
* ------------------------------------------------------------- *
* | 0x28| | *
* ------------------------------------------------------------- *
* | pc | | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 11 | 12 | | *
* ------------------------------------------------------------- *
* | 0x2c| 0x30| | *
* ------------------------------------------------------------- *
* | sp | size| | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | *
* ------------------------------------------------------------- *
* | 0x34| 0x38|0x3c| 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58 | *
* ------------------------------------------------------------- *
* | s16 | s17 | s18 | s19 | s20 | s21 | s22 | s23 | s24 | s25 | *
* ------------------------------------------------------------- *
* ------------------------------------------------------------- *
* | 23 | 24 | 25 | 26 | 27 | 28 | | *
* ------------------------------------------------------------- *
* | 0x5c| 0x60| 0x64| 0x68| 0x6c| 0x70| | *
* ------------------------------------------------------------- *
* | s26 | s27 | s28 | s29 | s30 | s31 | | *
* ------------------------------------------------------------- *
* *
* *****************************************************************/
.text
.globl make_fcontext
.align 2
.type make_fcontext,%function
make_fcontext:
mov a4, a1 @ save address of context stack (base) A4
sub a1, a1, #116 @ reserve space for fcontext_t at top of context stack
@ shift address in A1 to lower 16 byte boundary
@ == pointer to fcontext_t and address of context stack
bic a1, a1, #15
str a4, [a1,#44] @ save address of context stack (base) in fcontext_t
str a2, [a1,#48] @ save context stack size in fcontext_t
str a3, [a1,#40] @ save address of context function in fcontext_t
str a1, [a1,#32] @ save address in A4 as stack pointer for context function
adr a2, finish @ compute abs address of label finish
str a2, [a1,#36] @ save address of finish as return address for context function
@ entered after context function returns
bx lr
finish:
@ SP points to same addras SP on entry of context function
mov a1, #0 @ exit code is zero
bl _exit@PLT @ exit application
.size make_fcontext,.-make_fcontext
/* Mark that we don't need executable stack. */
.section .note.GNU-stack,"",%progbits
......@@ -31,8 +31,6 @@
#include <boost/foreach.hpp>
using namespace std;
struct FlagString
{
int flag;
......@@ -153,7 +151,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
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
* 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
* 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
*/
/**
* @file validators.cpp
* @brief Custom text control validator implementations.
*/
#include <kicad_string.h>
#include <validators.h>
FOOTPRINT_NAME_VALIDATOR::FOOTPRINT_NAME_VALIDATOR( wxString* aValue ) :
wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, aValue )
{
// The Windows (DOS) file system forbidden characters already include the forbidden
// file name characters for both Posix and OSX systems. The characters \/*?|"<> are
// illegal and filtered by the validator.
wxString illegalChars = GetIllegalFileNameWxChars();
wxTextValidator nameValidator( wxFILTER_EXCLUDE_CHAR_LIST );
wxArrayString illegalCharList;
for( unsigned i = 0; i < illegalChars.size(); i++ )
illegalCharList.Add( wxString( illegalChars[i] ) );
SetExcludes( illegalCharList );
}
......@@ -153,10 +153,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;
......@@ -387,7 +389,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 );
......@@ -395,6 +397,8 @@ struct VIEW::updateItemsColor
if( group >= 0 )
gal->ChangeGroupColor( group, color );
return true;
}
int layer;
......@@ -447,12 +451,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;
......@@ -571,15 +577,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;
......@@ -676,9 +684,11 @@ bool VIEW::IsDirty() const
struct VIEW::unlinkItem
{
void operator()( VIEW_ITEM* aItem )
bool operator()( VIEW_ITEM* aItem )
{
aItem->m_view = NULL;
return true;
}
};
......@@ -690,7 +700,7 @@ struct VIEW::recacheItem
{
}
void operator()( VIEW_ITEM* aItem )
bool operator()( VIEW_ITEM* aItem )
{
// Remove previously cached group
int prevGroup = aItem->getGroup( layer );
......@@ -712,6 +722,8 @@ struct VIEW::recacheItem
{
aItem->setGroup( layer, -1 );
}
return true;
}
VIEW* view;
......@@ -792,12 +804,14 @@ struct VIEW::clearLayerCache
{
}
void operator()( VIEW_ITEM* aItem )
bool operator()( VIEW_ITEM* aItem )
{
if( aItem->storesGroups() )
{
aItem->deleteGroups();
}
return true;
}
VIEW* view;
......@@ -971,7 +985,7 @@ void VIEW::RecacheAllItems( bool aImmediately )
#ifdef __WXDEBUG__
prof_counter totalRealTime;
prof_start( &totalRealTime, false );
prof_start( &totalRealTime );
#endif /* __WXDEBUG__ */
for( LAYER_MAP_ITER i = m_layers.begin(); i != m_layers.end(); ++i )
......@@ -992,7 +1006,7 @@ void VIEW::RecacheAllItems( bool aImmediately )
prof_end( &totalRealTime );
wxLogDebug( wxT( "RecacheAllItems::immediately: %u %.1f ms" ),
aImmediately, (double) totalRealTime.value / 1000.0 );
aImmediately, totalRealTime.msecs() );
#endif /* __WXDEBUG__ */
}
......
......@@ -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;
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -43,7 +43,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE
bSizerFiledsList->Add( moveUpButton, 0, wxALL|wxEXPAND, 5 );
bSizerFieldsSetup->Add( bSizerFiledsList, 1, wxEXPAND, 5 );
bSizerFieldsSetup->Add( bSizerFiledsList, 3, wxEXPAND, 5 );
wxBoxSizer* fieldEditBoxSizer;
fieldEditBoxSizer = new wxBoxSizer( wxVERTICAL );
......@@ -179,7 +179,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE
fieldEditBoxSizer->Add( fgSizerPosSize, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
bSizerFieldsSetup->Add( fieldEditBoxSizer, 0, wxEXPAND, 5 );
bSizerFieldsSetup->Add( fieldEditBoxSizer, 2, wxEXPAND, 5 );
mainSizer->Add( bSizerFieldsSetup, 1, wxEXPAND, 5 );
......
......@@ -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">
......@@ -45,7 +47,7 @@
<property name="size">-1,-1</property>
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
<property name="subclass"></property>
<property name="title">Fields Properties</property>
<property name="title">Field Properties</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
......@@ -103,17 +105,17 @@
<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="proportion">3</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizerFiledsList</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">8</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxListCtrl" expanded="1">
<object class="wxListCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
......@@ -214,11 +216,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
......@@ -302,11 +304,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
......@@ -390,11 +392,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
......@@ -483,7 +485,7 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<property name="proportion">2</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">fieldEditBoxSizer</property>
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -80,7 +80,7 @@ class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE : public wxDialog
public:
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Fields Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Field Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE();
};
......
......@@ -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; }
......
......@@ -1229,7 +1229,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
int multi = atoi( name1 );
if( multi < 0 || multi > 25 )
if( multi < 0 || multi > 26 )
multi = 1;
AddHierarchicalReference( path, ref, multi );
......@@ -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 )
......@@ -673,20 +673,17 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
if( m_MultilineAllowed )
{
wxPoint pos = textpos;
std::vector<wxPoint> positions;
wxArrayString* list = wxStringSplit( m_Text, '\n' );
wxPoint offset;
positions.reserve( list->Count() );
offset.y = GetInterline();
GetPositionsOfLinesOfMultilineText(positions, list->Count() );
RotatePoint( &offset, m_Orient );
for( unsigned i = 0; i<list->Count(); i++ )
for( unsigned ii = 0; ii < list->Count(); ii++ )
{
wxString txt = list->Item( i );
aPlotter->Text( pos, color, txt, m_Orient, m_Size, m_HJustify,
wxString& txt = list->Item( ii );
aPlotter->Text( positions[ii], color, txt, m_Orient, m_Size, m_HJustify,
m_VJustify, thickness, m_Italic, m_Bold );
pos += offset;
}
delete (list);
......
......@@ -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.
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.
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