+ resync with main branch r6409

+ work in progress: new VRML2 3D plugin
This commit is contained in:
Cirilo Bernardo 2015-12-31 09:28:39 +11:00
commit 548b54d75d
65 changed files with 5331 additions and 5282 deletions

View File

@ -1,56 +1,27 @@
Contribute to KiCad (under Linux)
--------------------
1) make sure you have all the dependencies of KiCad:
sudo apt-get install debhelper dpatch libx11-dev libglm-dev
sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev mesa-common-dev
sudo apt-get install libwxbase2.8-dev libwxgtk2.8-dev libboost-dev fakeroot
sudo apt-get install cmake bzr
sudo apt-get install cmake bzr bzrtools
1) make sure you have all the dependencies of KiCad and installed a copy
of kicad sources:
see <kicad>/Documentation/development/compiling.md
2) initialize Bazaar:
bzr whoami "John Doe <john.doe@gmail.com>"
3) get latest KiCad source tree:
cd ~/
bzr branch lp:kicad kicad.bzr
this should leave you with the folder kicad.bzr
4) Read coding_style_policy.pdf, in kicad.bzr/Documentation,
2) Read coding_style_policy.pdf, in <kicad>/Documentation,
and other docs.
5) create a local (branch) copy of the KiCad project
bzr branch ./kicad.bzr ./kicad.my_contrib
3) Modify/add source code in kicad sources
6) Modify/add source code in
cd kicad.my_contrib
gedit .......
if you need to create and add the file foo.cpp do so and:
bzr add foo.cpp
if you need to delete files:
bzr rm foo.cpp
4) Compile:
see compiling.md
7) Compile:
cd kicad.my_contrib
mkdir build; cd build
cmake ../ -DCMAKE_BUILD_TYPE=Debug
to build a debug version
or
cmake ../ -DCMAKE_BUILD_TYPE=Release
to build a release version
make -j8
8) Repeat step 6 and 7 until satisfied.
5) Repeat step 3 and 4 until satisfied.
9) Create a patch file:
cd kicad.my_contrib
if you added the file foo.cpp do so:
bzr add foo.cpp
Create the patch
bzr diff > my_changes.patch
9) Send the patch file "my_changes.patch" to the KiCad developers mailing list.
in the subject of the e-mail include the keyword "[PATCH]".
in the body of the e-mail clearly explain what you have done.
for more info see INSTALL.txt.

View File

@ -78,14 +78,6 @@ specific patches required to build a working Boost library. These patches can b
[patches folder][] in the KiCad source. These patches are named by the platform name they should
be applied against.
## OpenSSL Secure Socket Layer Library ## {#openssl}
The [OpenSSL][] library is only required when the KiCad build is configured with the Github plugin
enabled. See the [KiCad Build Configuration Options](#build_opts)` section for more information.
Please note that KiCad will download and build version 1.0.1e of OpenSSL by default. You should
probably use the version of OpenSSL installed on your system as it will most likely be more up to
date and contain the latest security fixes.
## GLEW OpenGL Extension Wrangler Library ## {#glew}
The [OpenGL Extension Wrangler][GLEW] is an OpenGL helper library used by the KiCad graphics
@ -197,7 +189,7 @@ following command:
If you are contributing directly to the KiCad project on Launchpad, you can create a local
branch on your machine by using the following command:
bzr branch lp:repo_to_branch
bzr branch https://code.launchpad.net/~kicad-product-committers/kicad/product kicad_source
If you prefer to use [GIT][] as you version control system, you can clone the KiCad mirror on
Github using the following command:
@ -206,7 +198,7 @@ Github using the following command:
Here is a list of source links:
Stable release archive: https://launchpad.net/kicad/4.0/4.0.0-rc1/+download/kicad-4.0.0-rc1.tar.xz
Stable release archive: https://launchpad.net/kicad/4.0/4.0.1/+download/kicad-4.0.1.tar.xz
Development branch: https://code.launchpad.net/~kicad-product-committers/kicad/product
@ -216,7 +208,7 @@ Github mirror: https://github.com/KiCad/kicad-source-mirror
To perform a full build on Linux, run the following commands:
cd kicad_source_tree
cd <your kicad source mirror>
mkdir -p build/release
mkdir build/debug # Optional for debug build.
cd build/release
@ -280,7 +272,7 @@ the following commands:
mingw-w64-x86_64-boost \
mingw-w64-x86_64-cairo \
mingw-w64-x86_64-glew \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-curl \
mingw-w64-x86_64-wxPython \
mingw-w64-x86_64-wxWidgets
cd kicad-source
@ -292,7 +284,6 @@ the following commands:
-DCMAKE_PREFIX_PATH=/mingw64 \
-DCMAKE_INSTALL_PREFIX=/mingw64 \
-DDEFAULT_INSTALL_PATH=/mingw64 \
-DOPENSSL_ROOT_DIR=/mingw64 \
-DKICAD_SKIP_BOOST=ON \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
@ -313,7 +304,7 @@ currently known issues when building KiCad using MSYS2.
### 64-bit Package of Boost 1.59 ### {#ki_msys2_64bit_boost}
The context library of the x86_64 package of Boost version 1.59 is broken and will cause KiCad
to crash. You must downgrade to version 1.47 by running the command:
to crash. You must downgrade to version 1.57 by running the command:
pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-boost-1.57.0-4-any.pkg.tar.xz
@ -415,7 +406,6 @@ Boost patches in the KiCad source [patches folder][].
[wxWidgets]: http://wxwidgets.org/
[patches folder]: http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/files/head:/patches/
[Boost]: http://www.boost.org/
[OpenSSL]: https://www.openssl.org/
[GLEW]: http://glew.sourceforge.net/
[GLUT]: https://www.opengl.org/resources/libraries/glut/
[Cairo]: http://cairographics.org/

View File

@ -1,12 +1,9 @@
--== notes about wxWidgets problems ==--
Last Revised: 02-jul-2015
Last Revised: 28-dec-2015
Kicad needs wxWidgets, the multi platform G.U.I toolkit.
use *only* wxWidgets
>= 3.0.1 On Windows
>= 3.0.2 on Linux (prevision versions have bugs which crash Kicad)
>= 3.0.2 on OSX (which need patches: see patches/wxwidgets-3.0.0_macosx_xxx)
use *only* wxWidgets >= 3.0.2
Known bug on Windows:
Postscript printers print tracks like thin line.
@ -14,7 +11,7 @@ It happens only for PS drivers, and PDF printer.
Other drivers (PCL for instance) work fine,
so it is unlikely a bug inside Kicad/wxWidgets
On 3.0.2 Window version 64 bits:
Window version :
The mirror mode gives a blank sheet.
This is a bug in wxWidgets 3.0.2
wxWidgets 3.0.2 must be patched (see patches/wxWidgets-3.0.2-msw-dc-orientation-fix.patch) and rebuilt.

View File

@ -84,22 +84,42 @@ them when a new project is created.
Installation from source code
-----------------------------
Currently the only supported compilers are GCC on linux and windows and clang on OS X.
Some dependencies must be satisfied for the correct installation of KiCad:
wxWidgets >= 3.0.0 http://www.wxwidgets.org/
CMake >= 2.8.4 http://www.cmake.org/
Boost C++ Libraries:
Boost C++ Libraries: >= 1.54 http://www.boost.org/
files used by kicad are autmatically downloaded and patched if needed
from boost site ( http://www.boost.org/ )
from boost site.
OpenGL
OpenGL >= 2.1
Linux: Mesa 3D Graphics Library http://www.mesa3d.org/
Windows: built-in
Zlib Compression Library http://www.zlib.net/
cairo http://cairographics.org/
GLEW http://glew.sourceforge.net/
libcurl http://curl.haxx.se/
OpenMP (optional) http://openmp.org/
GLM >= 9.5.4 http://glm.g-truc.net/
pkg-config http://pkgconfig.freedesktop.org/
Doxygen (optional) http://www.stack.nl/~dimitri/doxygen/index.html
python >= 2.6 (optional) http://python.org/
wxPython (optional) http://www.wxpython.org/
In source-tree-build are mostly unwanted, so make a subdir called "build" and
change to it.

View File

@ -28,6 +28,7 @@
* @brief EDA_BASE_FRAME class implementation.
*/
#include <kicad_curl/kicad_curl.h> /* Include before any wx file */
#include <wx/aboutdlg.h>
#include <wx/fontdlg.h>
#include <wx/clipbrd.h>
@ -573,6 +574,8 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
<< ( BOOST_VERSION % 100 ) << wxT( "\n" );
msg_version << KICAD_CURL::GetSimpleVersion() << wxT( "\n" );
msg_version << wxT( " USE_WX_GRAPHICS_CONTEXT=" );
#ifdef USE_WX_GRAPHICS_CONTEXT
msg_version << wxT( "ON\n" );

View File

@ -725,8 +725,9 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
org.y += KiROUND( gridSize.y );
// Use a pixel based draw to display grid. There are a lot of calls, so the cost is
// high and grid is slowly drawn on some platforms. Please note that this should
// always be enabled until the bitmap based solution below is fixed.
// high and grid is slowly drawn on some platforms. An other way using blit transfert was used,
// a long time ago, but it did not give very good results.
// The better way is highly dependent on the platform and the graphic card.
#ifndef __WXMAC__
GRSetColorPen( aDC, GetParent()->GetGridColor() );
#else
@ -996,7 +997,7 @@ void EDA_DRAW_PANEL::OnMagnify( wxMouseEvent& event )
void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
{
int localrealbutt = 0, localbutt = 0;
int localbutt = 0;
BASE_SCREEN* screen = GetScreen();
if( !screen )
@ -1030,12 +1031,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( m_ignoreMouseEvents )
return;
if( event.LeftIsDown() )
localrealbutt |= GR_M_LEFT_DOWN;
if( event.MiddleIsDown() )
localrealbutt |= GR_M_MIDDLE_DOWN;
if( event.LeftDown() )
localbutt = GR_M_LEFT_DOWN;
@ -1045,8 +1040,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if( event.MiddleDown() )
localbutt = GR_M_MIDDLE_DOWN;
localrealbutt |= localbutt; // compensation default wxGTK
INSTALL_UNBUFFERED_DC( DC, this );
DC.SetBackground( *wxBLACK_BRUSH );

View File

@ -51,4 +51,30 @@ std::string KICAD_CURL::GetVersion()
}
std::string KICAD_CURL::GetSimpleVersion()
{
curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
std::string res;
if( info->version )
{
res += "libcurl version: " + std::string(info->version);
}
res += " (";
if( info->features & CURL_VERSION_SSL )
{
res += "with SSL - ";
res += std::string(info->ssl_version);
}
else
{
res += "without SSL";
}
res += ")";
return res;
}
bool KICAD_CURL::m_initialized = false;

View File

@ -43,8 +43,8 @@ KICAD_CURL_EASY::KICAD_CURL_EASY()
THROW_IO_ERROR( "Unable to initialize CURL session" );
}
m_Buffer.payload = (char*)malloc( 1 );
m_Buffer.size = 0;
m_Buffer.Payload = (char*)malloc( 1 );
m_Buffer.Size = 0;
curl_easy_setopt( m_CURL, CURLOPT_WRITEFUNCTION, write_callback );
curl_easy_setopt( m_CURL, CURLOPT_WRITEDATA, (void *)&m_Buffer );
@ -53,7 +53,7 @@ KICAD_CURL_EASY::KICAD_CURL_EASY()
KICAD_CURL_EASY::~KICAD_CURL_EASY()
{
free(m_Buffer.payload);
free(m_Buffer.Payload);
curl_easy_cleanup(m_CURL);
}
@ -110,27 +110,27 @@ static size_t write_callback( void *contents, size_t size, size_t nmemb, void *u
struct KICAD_EASY_CURL_BUFFER *p = ( struct KICAD_EASY_CURL_BUFFER * ) userp;
/* expand buffer */
p->payload = (char *) realloc( p->payload, p->size + realsize + 1 );
p->Payload = (char *) realloc( p->Payload, p->Size + realsize + 1 );
/* check buffer */
if ( p->payload == NULL )
if ( p->Payload == NULL )
{
wxLogError( wxT( "Failed to expand buffer in curl_callback" ) );
/* free buffer */
free( p->payload );
free( p->Payload );
return -1;
}
/* copy contents to buffer */
memcpy( &(p->payload[p->size]), contents, realsize );
memcpy( &(p->Payload[p->Size]), contents, realsize );
/* set new buffer size */
p->size += realsize;
p->Size += realsize;
/* ensure null termination */
p->payload[p->size] = 0;
p->Payload[p->Size] = 0;
/* return size */
return realsize;
@ -144,11 +144,11 @@ void KICAD_CURL_EASY::Perform()
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
}
if( m_Buffer.size > 0 )
if( m_Buffer.Size > 0 )
{
free( m_Buffer.payload );
m_Buffer.payload = (char*)malloc( 1 );
m_Buffer.size = 0;
free( m_Buffer.Payload );
m_Buffer.Payload = (char*)malloc( 1 );
m_Buffer.Size = 0;
}
CURLcode res = curl_easy_perform( m_CURL );

View File

@ -62,7 +62,7 @@ void KIWAY::player_destroy_handler( wxWindowDestroyEvent& event )
{
wxWindow* w = event.GetWindow();
for( unsigned i=0; i<DIM(m_player); ++i )
for( unsigned i=0; i < KIWAY_PLAYER_COUNT; ++i )
{
// if destroying one of our flock, then mark it as deceased.
if( (wxWindow*) m_player[i] == w )
@ -273,7 +273,7 @@ KIWAY_PLAYER* KIWAY::Player( FRAME_T aFrameType, bool doCreate )
{
// Since this will be called from python, cannot assume that code will
// not pass a bad aFrameType.
if( unsigned( aFrameType ) >= DIM( m_player ) )
if( unsigned( aFrameType ) >= KIWAY_PLAYER_COUNT )
{
// @todo : throw an exception here for python's benefit, at least that
// way it gets some explanatory text.
@ -316,7 +316,7 @@ bool KIWAY::PlayerClose( FRAME_T aFrameType, bool doForce )
{
// Since this will be called from python, cannot assume that code will
// not pass a bad aFrameType.
if( unsigned( aFrameType ) >= DIM( m_player ) )
if( unsigned( aFrameType ) >= KIWAY_PLAYER_COUNT )
{
// @todo : throw an exception here for python's benefit, at least that
// way it gets some explanatory text.
@ -344,7 +344,7 @@ bool KIWAY::PlayersClose( bool doForce )
{
bool ret = true;
for( unsigned i=0; i < DIM( m_player ); ++i )
for( unsigned i=0; i < KIWAY_PLAYER_COUNT; ++i )
{
ret = ret && PlayerClose( FRAME_T( i ), doForce );
}
@ -383,7 +383,7 @@ void KIWAY::SetLanguage( int aLanguage )
}
#endif
for( unsigned i=0; i < DIM( m_player ); ++i )
for( unsigned i=0; i < KIWAY_PLAYER_COUNT; ++i )
{
KIWAY_PLAYER* frame = m_player[i];

View File

@ -101,14 +101,14 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult, wxWindow* aResultantFocusWindow
m_modal_resultant_parent = aResultantFocusWindow;
Show( true );
Raise(); // Needed on sole Window managers to always display the frame
Raise(); // Needed on some Window managers to always display the frame
SetFocus();
{
// We have to disable all frames but the the modal one.
// wxWindowDisabler does that, but remember it disables all top level windows
// We do not want to disable top level windows which are child off the modal one,
// wxWindowDisabler does that, but it also disables all top level windows
// We do not want to disable top level windows which are child of the modal one,
// if they are enabled.
// An example is an aui toolbar which was moved
// or a dialog or an other frame or miniframe opened by the modal one.
@ -130,7 +130,7 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult, wxWindow* aResultantFocusWindow
m_modal_loop = &event_loop;
event_loop.Run();
} // End of scop for some variables.
} // End of scope for some variables.
// End nesting before setting focus below.
if( aResult )

View File

@ -441,7 +441,7 @@ LSEQ LSET::SeqStackupBottom2Top() const
}
LAYER_ID FlipLayer( LAYER_ID aLayerId )
LAYER_ID FlipLayer( LAYER_ID aLayerId, int aCopperLayersCount )
{
switch( aLayerId )
{
@ -466,14 +466,28 @@ LAYER_ID FlipLayer( LAYER_ID aLayerId )
case B_Fab: return F_Fab;
case F_Fab: return B_Fab;
default: // change internal layer if aCopperLayersCount is >= 4
if( IsCopperLayer( aLayerId ) && aCopperLayersCount >= 4 )
{
// internal copper layers count is aCopperLayersCount-2
LAYER_ID fliplayer = LAYER_ID(aCopperLayersCount - 2 - ( aLayerId - In1_Cu ) );
// Ensure fliplayer has a value which does not crash pcbnew:
if( fliplayer < F_Cu )
fliplayer = F_Cu;
if( fliplayer > B_Cu )
fliplayer = B_Cu;
return fliplayer;
}
// No change for the other layers
default:
return aLayerId;
}
}
LSET FlipLayerMask( LSET aMask )
LSET FlipLayerMask( LSET aMask, int aCopperLayersCount )
{
// layers on physical outside of a board:
const static LSET and_mask( 16, // !! update count
@ -537,6 +551,25 @@ LSET FlipLayerMask( LSET aMask )
if( aMask[F_Fab] )
newMask.set( B_Fab );
if( aCopperLayersCount >= 4 ) // Internal layers exist
{
LSET internalMask = aMask & ~LSET::InternalCuMask();
if( internalMask != LSET::InternalCuMask() )
{ // the mask does not include all internal layers. Therefore
// the flipped mask for internal copper layers must be built
int innerLayerCnt = aCopperLayersCount -2;
for( int ii = 0; ii < innerLayerCnt; ii++ )
{
if( internalMask[innerLayerCnt - ii + In1_Cu] )
newMask.set( ii + In1_Cu );
else
newMask.reset( ii + In1_Cu );
}
}
}
return newMask;
}

View File

@ -537,7 +537,7 @@ void LIB_PART::RemoveDrawItem( LIB_ITEM* aItem, EDA_DRAW_PANEL* aPanel, wxDC* aD
LIB_ITEMS::iterator i;
for( i = drawings.begin(); i < drawings.end(); i++ )
for( i = drawings.begin(); i != drawings.end(); i++ )
{
if( *i == aItem )
{
@ -1222,7 +1222,7 @@ void LIB_PART::deleteAllFields()
{
LIB_ITEMS::iterator it;
for( it = drawings.begin(); it!=drawings.end(); /* deleting */ )
for( it = drawings.begin(); it != drawings.end(); /* deleting */ )
{
if( it->Type() != LIB_FIELD_T )
{
@ -1709,7 +1709,7 @@ wxArrayString LIB_PART::GetAliasNames( bool aIncludeRoot ) const
LIB_ALIASES::const_iterator it;
for( it=m_aliases.begin(); it<m_aliases.end(); ++it )
for( it=m_aliases.begin(); it != m_aliases.end(); ++it )
{
if( !aIncludeRoot && (*it)->IsRoot() )
continue;
@ -1756,7 +1756,7 @@ void LIB_PART::SetAliases( const wxArrayString& aAliasList )
// Remove names in the current component that are not in the new alias list.
LIB_ALIASES::iterator it;
for( it = m_aliases.begin(); it < m_aliases.end(); it++ )
for( it = m_aliases.begin(); it != m_aliases.end(); it++ )
{
int index = aAliasList.Index( (*it)->GetName(), false );
@ -1778,7 +1778,7 @@ void LIB_PART::RemoveAlias( const wxString& aName )
LIB_ALIASES::iterator it;
for( it = m_aliases.begin(); it < m_aliases.end(); it++ )
for( it = m_aliases.begin(); it != m_aliases.end(); it++ )
{
if( Cmp_KEEPCASE( aName, (*it)->GetName() ) == 0 )
{

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// C++ code generated with wxFormBuilder (version Dec 19 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -35,250 +35,320 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_notebook->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_panel1 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* p1mainSizer;
p1mainSizer = new wxBoxSizer( wxHORIZONTAL );
m_panel5 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer82;
bSizer82 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer32;
fgSizer32 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer32->AddGrowableCol( 0 );
fgSizer32->AddGrowableCol( 1 );
fgSizer32->AddGrowableCol( 2 );
fgSizer32->SetFlexibleDirection( wxBOTH );
fgSizer32->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer1->AddGrowableCol( 0 );
fgSizer1->AddGrowableCol( 1 );
fgSizer1->AddGrowableCol( 2 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText2 = new wxStaticText( m_panel1, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
fgSizer1->Add( m_staticText2, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
wxArrayString m_choiceUnitsChoices;
m_choiceUnits = new wxChoice( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsChoices, 0 );
m_choiceUnits->SetSelection( 0 );
fgSizer1->Add( m_choiceUnits, 0, wxALL|wxEXPAND, 3 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 3 );
m_staticText3 = new wxStaticText( m_panel1, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3 = new wxStaticText( m_panel5, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizer1->Add( m_staticText3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticText3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
wxArrayString m_choiceGridSizeChoices;
m_choiceGridSize = new wxChoice( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 );
m_choiceGridSize = new wxChoice( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 );
m_choiceGridSize->SetSelection( 0 );
fgSizer1->Add( m_choiceGridSize, 0, wxEXPAND|wxALL, 3 );
fgSizer32->Add( m_choiceGridSize, 0, wxEXPAND|wxALL, 3 );
m_staticGridUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticGridUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticGridUnits->Wrap( -1 );
fgSizer1->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText51 = new wxStaticText( m_panel1, wxID_ANY, _("&Default bus thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText51 = new wxStaticText( m_panel5, wxID_ANY, _("&Bus thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText51->Wrap( -1 );
fgSizer1->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinBusWidth = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
fgSizer1->Add( m_spinBusWidth, 0, wxALL|wxEXPAND, 3 );
m_spinBusWidth = new wxSpinCtrl( m_panel5, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
fgSizer32->Add( m_spinBusWidth, 0, wxALL|wxEXPAND, 3 );
m_staticBusWidthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticBusWidthUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticBusWidthUnits->Wrap( -1 );
fgSizer1->Add( m_staticBusWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticBusWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText5 = new wxStaticText( m_panel1, wxID_ANY, _("D&efault line thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5 = new wxStaticText( m_panel5, wxID_ANY, _("&Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
fgSizer1->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinLineWidth = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
fgSizer1->Add( m_spinLineWidth, 0, wxALL|wxEXPAND, 3 );
m_spinLineWidth = new wxSpinCtrl( m_panel5, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
fgSizer32->Add( m_spinLineWidth, 0, wxALL|wxEXPAND, 3 );
m_staticLineWidthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticLineWidthUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticLineWidthUnits->Wrap( -1 );
fgSizer1->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText7 = new wxStaticText( m_panel1, wxID_ANY, _("De&fault text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
fgSizer1->Add( m_staticText7, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinTextSize = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 1000, 0 );
fgSizer1->Add( m_spinTextSize, 0, wxALL|wxEXPAND, 3 );
m_staticTextSizeUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSizeUnits->Wrap( -1 );
fgSizer1->Add( m_staticTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText9 = new wxStaticText( m_panel1, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizer1->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatHorizontal = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 0 );
fgSizer1->Add( m_spinRepeatHorizontal, 0, wxALL|wxEXPAND, 3 );
m_staticRepeatXUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticRepeatXUnits->Wrap( -1 );
fgSizer1->Add( m_staticRepeatXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText12 = new wxStaticText( m_panel1, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
fgSizer1->Add( m_staticText12, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatVertical = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 100 );
fgSizer1->Add( m_spinRepeatVertical, 0, wxALL|wxEXPAND, 3 );
m_staticRepeatYUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticRepeatYUnits->Wrap( -1 );
fgSizer1->Add( m_staticRepeatYUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText16 = new wxStaticText( m_panel1, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText16->Wrap( -1 );
fgSizer1->Add( m_staticText16, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatLabel = new wxSpinCtrl( m_panel1, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 );
fgSizer1->Add( m_spinRepeatLabel, 0, wxALL|wxEXPAND, 3 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 3 );
m_staticText221 = new wxStaticText( m_panel1, wxID_ANY, _("&Auto-save time interval"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText221->Wrap( -1 );
fgSizer1->Add( m_staticText221, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinAutoSaveInterval = new wxSpinCtrl( m_panel1, ID_M_SPINAUTOSAVEINTERVAL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000, 10 );
fgSizer1->Add( m_spinAutoSaveInterval, 0, wxALL|wxEXPAND, 3 );
m_staticText23 = new wxStaticText( m_panel1, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_stMaxUndoItems = new wxStaticText( m_panel1, wxID_ANY, _("Ma&ximum undo items (0 = unlimited):"), wxDefaultPosition, wxDefaultSize, 0 );
m_stMaxUndoItems->Wrap( -1 );
fgSizer1->Add( m_stMaxUndoItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_spinMaxUndoItems = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65536, 0 );
fgSizer1->Add( m_spinMaxUndoItems, 0, wxALL|wxEXPAND, 3 );
m_stMaxUndoItemsUnit = new wxStaticText( m_panel1, wxID_ANY, _("actions"), wxDefaultPosition, wxDefaultSize, 0 );
m_stMaxUndoItemsUnit->Wrap( -1 );
fgSizer1->Add( m_stMaxUndoItemsUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_staticText26 = new wxStaticText( m_panel1, wxID_ANY, _("&Part id notation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26 = new wxStaticText( m_panel5, wxID_ANY, _("&Part ID notation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26->Wrap( -1 );
fgSizer1->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 3 );
fgSizer32->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 3 );
wxString m_choiceSeparatorRefIdChoices[] = { _("A"), _(".A"), _("-A"), _("_A"), _(".1"), _("-1"), _("_1") };
int m_choiceSeparatorRefIdNChoices = sizeof( m_choiceSeparatorRefIdChoices ) / sizeof( wxString );
m_choiceSeparatorRefId = new wxChoice( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSeparatorRefIdNChoices, m_choiceSeparatorRefIdChoices, 0 );
m_choiceSeparatorRefId = new wxChoice( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSeparatorRefIdNChoices, m_choiceSeparatorRefIdChoices, 0 );
m_choiceSeparatorRefId->SetSelection( 0 );
fgSizer1->Add( m_choiceSeparatorRefId, 0, wxALL|wxEXPAND, 3 );
fgSizer32->Add( m_choiceSeparatorRefId, 0, wxALL|wxEXPAND, 3 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticText221 = new wxStaticText( m_panel5, wxID_ANY, _("&Auto-save time interval"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText221->Wrap( -1 );
fgSizer32->Add( m_staticText221, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinAutoSaveInterval = new wxSpinCtrl( m_panel5, ID_M_SPINAUTOSAVEINTERVAL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000, 10 );
fgSizer32->Add( m_spinAutoSaveInterval, 0, wxALL|wxEXPAND, 3 );
m_staticText23 = new wxStaticText( m_panel5, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
fgSizer32->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
bSizer3->Add( fgSizer1, 0, wxEXPAND, 0 );
bSizer82->Add( fgSizer32, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer92;
bSizer92 = new wxBoxSizer( wxVERTICAL );
m_staticline1 = new wxStaticLine( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer2->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_staticline3 = new wxStaticLine( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer92->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
m_checkShowGrid = new wxCheckBox( m_panel1, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkShowGrid = new wxCheckBox( m_panel5, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkShowHiddenPins = new wxCheckBox( m_panel1, wxID_ANY, _("Sho&w hidden pins"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkHVOrientation = new wxCheckBox( m_panel5, wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_checkHVOrientation, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkEnableZoomCenter = new wxCheckBox( m_panel1, wxID_ANY, _("Ce&nter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkShowHiddenPins = new wxCheckBox( m_panel5, wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkPageLimits = new wxCheckBox( m_panel5, wxID_ANY, _("Sho&w page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_checkPageLimits, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
bSizer82->Add( bSizer92, 0, wxALL|wxEXPAND, 5 );
m_panel5->SetSizer( bSizer82 );
m_panel5->Layout();
bSizer82->Fit( m_panel5 );
m_notebook->AddPage( m_panel5, _("&Display"), false );
m_panel3 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer3->AddGrowableCol( 0 );
fgSizer3->AddGrowableCol( 1 );
fgSizer3->AddGrowableCol( 2 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText2 = new wxStaticText( m_panel3, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
fgSizer3->Add( m_staticText2, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
wxArrayString m_choiceUnitsChoices;
m_choiceUnits = new wxChoice( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsChoices, 0 );
m_choiceUnits->SetSelection( 0 );
fgSizer3->Add( m_choiceUnits, 0, wxALL|wxEXPAND, 3 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 );
m_staticText9 = new wxStaticText( m_panel3, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizer3->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatHorizontal = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 0 );
fgSizer3->Add( m_spinRepeatHorizontal, 0, wxALL|wxEXPAND, 3 );
m_staticRepeatXUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticRepeatXUnits->Wrap( -1 );
fgSizer3->Add( m_staticRepeatXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText12 = new wxStaticText( m_panel3, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
fgSizer3->Add( m_staticText12, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatVertical = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 100 );
fgSizer3->Add( m_spinRepeatVertical, 0, wxALL|wxEXPAND, 3 );
m_staticRepeatYUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticRepeatYUnits->Wrap( -1 );
fgSizer3->Add( m_staticRepeatYUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_staticText16 = new wxStaticText( m_panel3, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText16->Wrap( -1 );
fgSizer3->Add( m_staticText16, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatLabel = new wxSpinCtrl( m_panel3, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 );
fgSizer3->Add( m_spinRepeatLabel, 0, wxALL|wxEXPAND, 3 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 );
m_staticText7 = new wxStaticText( m_panel3, wxID_ANY, _("Def&ault text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
fgSizer3->Add( m_staticText7, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinTextSize = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 1000, 0 );
fgSizer3->Add( m_spinTextSize, 0, wxALL|wxEXPAND, 3 );
m_staticTextSizeUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSizeUnits->Wrap( -1 );
fgSizer3->Add( m_staticTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_stMaxUndoItems = new wxStaticText( m_panel3, wxID_ANY, _("Ma&ximum undo items:"), wxDefaultPosition, wxDefaultSize, 0 );
m_stMaxUndoItems->Wrap( -1 );
fgSizer3->Add( m_stMaxUndoItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_spinMaxUndoItems = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65536, 0 );
fgSizer3->Add( m_spinMaxUndoItems, 0, wxALL|wxEXPAND, 3 );
m_staticText22 = new wxStaticText( m_panel3, wxID_ANY, _("(0 = unlimited)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText22->Wrap( -1 );
fgSizer3->Add( m_staticText22, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 );
bSizer8->Add( fgSizer3, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer9;
bSizer9 = new wxBoxSizer( wxVERTICAL );
m_staticline2 = new wxStaticLine( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer9->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
m_checkAutoplaceFields = new wxCheckBox( m_panel3, wxID_ANY, _("A&utomatically place component fields"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
m_checkAutoplaceJustify = new wxCheckBox( m_panel3, wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
m_checkAutoplaceAlign = new wxCheckBox( m_panel3, wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer9->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
bSizer8->Add( bSizer9, 0, wxALL|wxEXPAND, 5 );
m_panel3->SetSizer( bSizer8 );
m_panel3->Layout();
bSizer8->Fit( m_panel3 );
m_notebook->AddPage( m_panel3, _("&Editing"), false );
m_panel4 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer81;
bSizer81 = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer31;
fgSizer31 = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizer31->AddGrowableCol( 0 );
fgSizer31->AddGrowableCol( 1 );
fgSizer31->AddGrowableCol( 2 );
fgSizer31->SetFlexibleDirection( wxBOTH );
fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
bSizer81->Add( fgSizer31, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer91;
bSizer91 = new wxBoxSizer( wxVERTICAL );
m_checkEnableZoomCenter = new wxCheckBox( m_panel4, wxID_ANY, _("Cen&ter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkEnableZoomCenter->SetToolTip( _("Keep the cursor at its current location when zooming") );
bSizer2->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
bSizer91->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkEnableMiddleButtonPan = new wxCheckBox( m_panel1, xwID_ANY, _("&Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkEnableMiddleButtonPan = new wxCheckBox( m_panel4, xwID_ANY, _("&Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkEnableMiddleButtonPan->SetToolTip( _("Use middle mouse button dragging to pan") );
bSizer2->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
bSizer91->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkMiddleButtonPanLimited = new wxCheckBox( m_panel1, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkMiddleButtonPanLimited = new wxCheckBox( m_panel4, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkMiddleButtonPanLimited->SetToolTip( _("Middle mouse button panning limited by current scrollbar size") );
bSizer2->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
bSizer91->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkAutoPan = new wxCheckBox( m_panel1, wxID_ANY, _("Pan while moving ob&ject"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkHVOrientation = new wxCheckBox( m_panel1, wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkHVOrientation, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkPageLimits = new wxCheckBox( m_panel1, wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkPageLimits, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
m_checkAutoplaceFields = new wxCheckBox( m_panel1, wxID_ANY, _("Automatically place component fields"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
m_checkAutoplaceJustify = new wxCheckBox( m_panel1, wxID_ANY, _("Allow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
m_checkAutoplaceAlign = new wxCheckBox( m_panel1, wxID_ANY, _("Always align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer2->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
m_checkAutoPan = new wxCheckBox( m_panel4, wxID_ANY, _("&Pan while moving ob&ject"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer91->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
bSizer3->Add( bSizer2, 0, wxEXPAND, 0 );
bSizer81->Add( bSizer91, 0, wxALL|wxEXPAND, 5 );
p1mainSizer->Add( bSizer3, 1, wxALL|wxEXPAND, 6 );
m_panel1->SetSizer( p1mainSizer );
m_panel1->Layout();
p1mainSizer->Fit( m_panel1 );
m_notebook->AddPage( m_panel1, _("General Options"), false );
m_panel4->SetSizer( bSizer81 );
m_panel4->Layout();
bSizer81->Fit( m_panel4 );
m_notebook->AddPage( m_panel4, _("Co&ntrols"), false );
m_panel2 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panel2->SetToolTip( _("User defined field names for schematic components. ") );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxVERTICAL );
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer( wxVERTICAL );
templateFieldListCtrl = new wxListView( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
templateFieldListCtrl->SetMinSize( wxSize( 500,-1 ) );
bSizer6->Add( templateFieldListCtrl, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 );
bSizer11->Add( templateFieldListCtrl, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 );
wxStaticBoxSizer* fieldSizer;
fieldSizer = new wxStaticBoxSizer( new wxStaticBox( m_panel2, wxID_ANY, _("Field Settings") ), wxVERTICAL );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer4->AddGrowableCol( 1 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fieldNameLabel = new wxStaticText( m_panel2, wxID_ANY, _("&Name"), wxDefaultPosition, wxDefaultSize, 0 );
fieldNameLabel = new wxStaticText( m_panel2, wxID_ANY, _("Na&me"), wxDefaultPosition, wxDefaultSize, 0 );
fieldNameLabel->Wrap( -1 );
fieldSizer->Add( fieldNameLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
fgSizer4->Add( fieldNameLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
fieldNameTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
fieldSizer->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
fgSizer4->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
fieldDefaultValueLabel = new wxStaticText( m_panel2, wxID_ANY, _("D&efault Value"), wxDefaultPosition, wxDefaultSize, 0 );
fieldDefaultValueLabel = new wxStaticText( m_panel2, wxID_ANY, _("Defa&ult Value"), wxDefaultPosition, wxDefaultSize, 0 );
fieldDefaultValueLabel->Wrap( -1 );
fieldSizer->Add( fieldDefaultValueLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
fgSizer4->Add( fieldDefaultValueLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
fieldDefaultValueTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
fieldSizer->Add( fieldDefaultValueTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
fgSizer4->Add( fieldDefaultValueTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
fieldVisibleCheckbox = new wxCheckBox( m_panel2, wxID_ANY, _("&Visible"), wxDefaultPosition, wxDefaultSize, 0 );
fieldSizer->Add( fieldVisibleCheckbox, 0, wxALL, 5 );
fgSizer4->Add( fieldVisibleCheckbox, 0, wxALL, 5 );
bSizer6->Add( fieldSizer, 0, wxEXPAND, 5 );
fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer11->Add( fgSizer4, 0, wxEXPAND, 5 );
bSizer6->Add( bSizer11, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxVERTICAL );
addFieldButton = new wxButton( m_panel2, wxID_ADD_FIELD, _("&Add"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer6->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 );
bSizer10->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 );
deleteFieldButton = new wxButton( m_panel2, wxID_DELETE_FIELD, _("&Delete"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer6->Add( deleteFieldButton, 0, wxALL|wxEXPAND, 5 );
deleteFieldButton = new wxButton( m_panel2, wxID_DELETE_FIELD, _("De&lete"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer10->Add( deleteFieldButton, 0, wxALL|wxEXPAND, 5 );
bSizer10->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer6->Add( bSizer10, 0, wxEXPAND, 5 );
m_panel2->SetSizer( bSizer6 );
m_panel2->Layout();
bSizer6->Fit( m_panel2 );
m_notebook->AddPage( m_panel2, _("Template Field Names"), true );
m_notebook->AddPage( m_panel2, _("Default &Fields"), true );
bOptionsSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 );

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// C++ code generated with wxFormBuilder (version Dec 19 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -32,7 +32,6 @@ class wxListView;
#include <wx/icon.h>
#include <wx/listctrl.h>
#include <wx/textctrl.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
@ -69,9 +68,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
};
wxNotebook* m_notebook;
wxPanel* m_panel1;
wxStaticText* m_staticText2;
wxChoice* m_choiceUnits;
wxPanel* m_panel5;
wxStaticText* m_staticText3;
wxChoice* m_choiceGridSize;
wxStaticText* m_staticGridUnits;
@ -81,9 +78,19 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
wxStaticText* m_staticText5;
wxSpinCtrl* m_spinLineWidth;
wxStaticText* m_staticLineWidthUnits;
wxStaticText* m_staticText7;
wxSpinCtrl* m_spinTextSize;
wxStaticText* m_staticTextSizeUnits;
wxStaticText* m_staticText26;
wxChoice* m_choiceSeparatorRefId;
wxStaticText* m_staticText221;
wxSpinCtrl* m_spinAutoSaveInterval;
wxStaticText* m_staticText23;
wxStaticLine* m_staticline3;
wxCheckBox* m_checkShowGrid;
wxCheckBox* m_checkHVOrientation;
wxCheckBox* m_checkShowHiddenPins;
wxCheckBox* m_checkPageLimits;
wxPanel* m_panel3;
wxStaticText* m_staticText2;
wxChoice* m_choiceUnits;
wxStaticText* m_staticText9;
wxSpinCtrl* m_spinRepeatHorizontal;
wxStaticText* m_staticRepeatXUnits;
@ -92,26 +99,21 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
wxStaticText* m_staticRepeatYUnits;
wxStaticText* m_staticText16;
wxSpinCtrl* m_spinRepeatLabel;
wxStaticText* m_staticText221;
wxSpinCtrl* m_spinAutoSaveInterval;
wxStaticText* m_staticText23;
wxStaticText* m_staticText7;
wxSpinCtrl* m_spinTextSize;
wxStaticText* m_staticTextSizeUnits;
wxStaticText* m_stMaxUndoItems;
wxSpinCtrl* m_spinMaxUndoItems;
wxStaticText* m_stMaxUndoItemsUnit;
wxStaticText* m_staticText26;
wxChoice* m_choiceSeparatorRefId;
wxStaticLine* m_staticline1;
wxCheckBox* m_checkShowGrid;
wxCheckBox* m_checkShowHiddenPins;
wxStaticText* m_staticText22;
wxStaticLine* m_staticline2;
wxCheckBox* m_checkAutoplaceFields;
wxCheckBox* m_checkAutoplaceJustify;
wxCheckBox* m_checkAutoplaceAlign;
wxPanel* m_panel4;
wxCheckBox* m_checkEnableZoomCenter;
wxCheckBox* m_checkEnableMiddleButtonPan;
wxCheckBox* m_checkMiddleButtonPanLimited;
wxCheckBox* m_checkAutoPan;
wxCheckBox* m_checkHVOrientation;
wxCheckBox* m_checkPageLimits;
wxCheckBox* m_checkAutoplaceFields;
wxCheckBox* m_checkAutoplaceJustify;
wxCheckBox* m_checkAutoplaceAlign;
wxPanel* m_panel2;
wxListView* templateFieldListCtrl;
wxStaticText* fieldNameLabel;

View File

@ -498,7 +498,7 @@ void SCH_SHEET::CleanupSheet()
}
if( HLabel == NULL ) // Hlabel not found: delete sheet label.
m_pins.erase( i );
i = m_pins.erase( i );
else
++i;
}

View File

@ -878,11 +878,9 @@ bool SCH_SHEET_LIST::TestForRecursion( const SCH_SHEET_LIST& aSrcSheetHierarchy,
SCH_SHEET* SCH_SHEET_LIST::FindSheetByName( const wxString& aSheetName )
{
SCH_SHEET* sheet = NULL;
for( int i = 0; i < m_count; i++ )
{
sheet = m_list[i].FindSheetByName( aSheetName );
SCH_SHEET* sheet = m_list[i].FindSheetByName( aSheetName );
if( sheet )
return sheet;

View File

@ -93,6 +93,7 @@ END_EVENT_TABLE()
*/
#define LIB_VIEW_FRAME_NAME wxT( "ViewlibFrame" )
#define LIB_VIEW_FRAME_NAME_MODAL wxT( "ViewlibFrameModal" )
LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
PART_LIB* aLibrary ) :
@ -100,18 +101,23 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
wxDefaultPosition, wxDefaultSize,
aFrameType==FRAME_SCH_VIEWER_MODAL ?
#ifdef __WINDOWS__
KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP :
KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP
#else
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT :
aParent ? KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT
: KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP
#endif
KICAD_DEFAULT_DRAWFRAME_STYLE,
LIB_VIEW_FRAME_NAME )
: KICAD_DEFAULT_DRAWFRAME_STYLE,
aFrameType == FRAME_SCH_VIEWER_MODAL ?
LIB_VIEW_FRAME_NAME_MODAL : LIB_VIEW_FRAME_NAME )
{
wxASSERT( aFrameType == FRAME_SCH_VIEWER || aFrameType == FRAME_SCH_VIEWER_MODAL );
if( aFrameType == FRAME_SCH_VIEWER_MODAL )
SetModal( true );
// Force the frame name used in config. the lib viewer frame has a name
// depending on aFrameType (needed to identify the frame by wxWidgets),
// but only one configuration is preferable.
m_configFrameName = LIB_VIEW_FRAME_NAME;
// Give an icon

View File

@ -75,6 +75,13 @@ public:
*/
static std::string GetVersion();
/**
* Function GetSimpleVersion
* Reports back curl version only and SSL library support
*
* @return std::string - Generated version string
*/
static std::string GetSimpleVersion();
private:
static bool m_initialized;
};

View File

@ -52,8 +52,8 @@
*/
struct KICAD_EASY_CURL_BUFFER
{
char* payload;
size_t size;
char* Payload;
size_t Size;
};

View File

@ -616,16 +616,24 @@ inline bool IsBackLayer( LAYER_ID aLayerId )
/**
* Function FlippedLayerNumber
* @return the layer number after flipping an item
* some (not all) layers: external copper, Mask, Paste, and solder
* some (not all) layers: external copper, and paired layers( Mask, Paste, solder ... )
* are swapped between front and back sides
* internal layers are flipped only if the copper layers count is known
* @param aLayer = the LAYER_ID to flip
* @param aCopperLayersCount = the number of copper layers. if 0 (in fact if < 4 )
* internal layers will be not flipped because the layer count is not known
*/
LAYER_ID FlipLayer( LAYER_ID oldlayer );
LAYER_ID FlipLayer( LAYER_ID aLayerId, int aCopperLayersCount = 0 );
/**
* Calculate the mask layer when flipping a footprint
* BACK and FRONT copper layers, mask, paste, solder layers are swapped
* internal layers are flipped only if the copper layers count is known
* @param aMask = the LSET to flip
* @param aCopperLayersCount = the number of copper layers. if 0 (in fact if < 4 )
* internal layers will be not flipped because the layer count is not known
*/
LSET FlipLayerMask( LSET aMask );
LSET FlipLayerMask( LSET aMask, int aCopperLayersCount = 0 );
/**
* Return a string (to be shown to the user) describing a layer mask.

View File

@ -224,12 +224,9 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe )
OpenPDF( fullFileName );
break;
/* No, use a text editor. Netlists can only be handled sanely now from within
eeschema's launcher for the *.kiface, NOT THE EXE which is now gone.
case TREE_NET:
frame->Execute( m_parent, CVPCB_EXE, fullFileName );
// Nothing to do ( can be read only by Pcbnew, or by a text editor)
break;
*/
case TREE_TXT:
{

View File

@ -105,7 +105,7 @@ void PL_EDITOR_FRAME::GetLayoutFromRedoList( wxCommandEvent& event )
lastcmd = GetScreen()->PopCommandFromRedoList();
wrapper = lastcmd->PopItem();
copyItem = (PL_ITEM_LAYOUT*)wrapper.GetItem();
copyItem = static_cast<PL_ITEM_LAYOUT*>( wrapper.GetItem() );
pglayout.SetPageLayout( TO_UTF8(copyItem->m_Layout) );
delete copyItem;
@ -136,7 +136,7 @@ void PL_EDITOR_FRAME::GetLayoutFromUndoList( wxCommandEvent& event )
lastcmd = GetScreen()->PopCommandFromUndoList();
wrapper = lastcmd->PopItem();
copyItem = (PL_ITEM_LAYOUT*)wrapper.GetItem();
copyItem = static_cast<PL_ITEM_LAYOUT*>( wrapper.GetItem() );
pglayout.SetPageLayout( TO_UTF8(copyItem->m_Layout) );
delete copyItem;
@ -156,6 +156,6 @@ void PL_EDITOR_FRAME::RemoveLastCommandInUndoList()
PICKED_ITEMS_LIST* lastcmd = GetScreen()->PopCommandFromUndoList();
ITEM_PICKER wrapper = lastcmd->PopItem();
PL_ITEM_LAYOUT* copyItem = (PL_ITEM_LAYOUT*)wrapper.GetItem();
PL_ITEM_LAYOUT* copyItem = static_cast<PL_ITEM_LAYOUT*>( wrapper.GetItem() );
delete copyItem;
}

View File

@ -936,7 +936,7 @@ void PCB_BASE_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
switch( aEvent.GetId() )
{
case ID_MENU_CANVAS_DEFAULT:
case ID_MENU_CANVAS_LEGACY:
break;
case ID_MENU_CANVAS_CAIRO:

View File

@ -752,6 +752,7 @@ void PCB_EDIT_FRAME::Block_Flip()
itemsList->SetPickedItemStatus( UR_FLIPPED, ii );
item->Flip( center );
// If a connected item is flipped, the ratsnest is no more OK
switch( item->Type() )
{
case PCB_MODULE_T:
@ -759,9 +760,8 @@ void PCB_EDIT_FRAME::Block_Flip()
m_Pcb->m_Status_Pcb = 0;
break;
// Move and rotate the track segments
case PCB_TRACE_T: // a track segment (segment on a copper layer)
case PCB_VIA_T: // a via (like track segment on a copper layer)
case PCB_TRACE_T:
case PCB_VIA_T:
m_Pcb->m_Status_Pcb = 0;
break;

View File

@ -161,6 +161,9 @@ void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
void DIMENSION::Flip( const wxPoint& aCentre )
{
Mirror( aCentre );
// DIMENSION items are not usually on copper layers, so
// copper layers count is not taken in accoun in Flip transform
SetLayer( FlipLayer( GetLayer() ) );
}

View File

@ -138,6 +138,8 @@ void DRAWSEGMENT::Flip( const wxPoint& aCentre )
if( m_Shape == S_ARC )
m_Angle = -m_Angle;
// DRAWSEGMENT items are not allowed on copper layers, so
// copper layers count is not taken in accoun in Flip transform
SetLayer( FlipLayer( GetLayer() ) );
}

View File

@ -318,6 +318,10 @@ void EDGE_MODULE::Flip( const wxPoint& aCentre )
MIRROR( m_PolyPoints[ii].y, 0 );
}
// DRAWSEGMENT items are not usually on copper layers, but
// it can happen in microwave apps.
// However, currently, only on Front or Back layers.
// So the copper layers count is not taken in account
SetLayer( FlipLayer( GetLayer() ) );
}

View File

@ -292,6 +292,9 @@ void D_PAD::Flip( const wxPoint& aCentre )
SetOrientation( -GetOrientation() );
// flip pads layers
// PADS items are currently on all copper layers, or
// currently, only on Front or Back layers.
// So the copper layers count is not taken in account
SetLayerSet( FlipLayerMask( m_layerMask ) );
// m_boundingRadius = -1; the shape has not been changed
@ -335,16 +338,11 @@ const wxPoint D_PAD::ShapePos() const
if( m_Offset.x == 0 && m_Offset.y == 0 )
return m_Pos;
wxPoint shape_pos;
int dX, dY;
wxPoint loc_offset = m_Offset;
dX = m_Offset.x;
dY = m_Offset.y;
RotatePoint( &loc_offset, m_Orient );
RotatePoint( &dX, &dY, m_Orient );
shape_pos.x = m_Pos.x + dX;
shape_pos.y = m_Pos.y + dY;
wxPoint shape_pos = m_Pos + loc_offset;
return shape_pos;
}
@ -352,26 +350,10 @@ const wxPoint D_PAD::ShapePos() const
const wxString D_PAD::GetPadName() const
{
#if 0 // m_Padname is not ASCII and not UTF8, it is LATIN1 basically, whatever
// 8 bit font is supported in KiCad plotting and drawing.
// Return pad name as wxString, assume it starts as a non-terminated
// utf8 character sequence
char temp[sizeof(m_Padname)+1]; // a place to terminate with '\0'
strncpy( temp, m_Padname, sizeof(m_Padname) );
temp[sizeof(m_Padname)] = 0;
return FROM_UTF8( temp );
#else
wxString name;
StringPadName( name );
return name;
#endif
}
@ -988,7 +970,7 @@ unsigned int D_PAD::ViewGetLOD( int aLayer ) const
if( ( m_Size.x == 0 ) && ( m_Size.y == 0 ) )
return UINT_MAX;
return ( 100000000 / std::max( m_Size.x, m_Size.y ) );
return ( Millimeter2iu( 100 ) / std::max( m_Size.x, m_Size.y ) );
}
// Other layers are shown without any conditions

View File

@ -179,7 +179,8 @@ void TEXTE_PCB::Rotate( const wxPoint& aRotCentre, double aAngle )
void TEXTE_PCB::Flip(const wxPoint& aCentre )
{
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
SetLayer( FlipLayer( GetLayer() ) );
int copperLayerCount = GetBoard()->GetCopperLayerCount();
SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
m_Mirror = !m_Mirror;
}

View File

@ -339,7 +339,8 @@ void TRACK::Flip( const wxPoint& aCentre )
{
m_Start.y = aCentre.y - (m_Start.y - aCentre.y);
m_End.y = aCentre.y - (m_End.y - aCentre.y);
SetLayer( FlipLayer( GetLayer() ) );
int copperLayerCount = GetBoard()->GetCopperLayerCount();
SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
}
@ -347,6 +348,17 @@ void VIA::Flip( const wxPoint& aCentre )
{
m_Start.y = aCentre.y - (m_Start.y - aCentre.y);
m_End.y = aCentre.y - (m_End.y - aCentre.y);
if( GetViaType() != VIA_THROUGH )
{
int copperLayerCount = GetBoard()->GetCopperLayerCount();
LAYER_ID top_layer;
LAYER_ID bottom_layer;
LayerPair( &top_layer, &bottom_layer );
top_layer = FlipLayer( top_layer, copperLayerCount );
bottom_layer = FlipLayer( bottom_layer, copperLayerCount );
SetLayerPair( top_layer, bottom_layer );
}
}

View File

@ -722,7 +722,8 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, double angle )
void ZONE_CONTAINER::Flip( const wxPoint& aCentre )
{
Mirror( aCentre );
SetLayer( FlipLayer( GetLayer() ) );
int copperLayerCount = GetBoard()->GetCopperLayerCount();
SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// C++ code generated with wxFormBuilder (version Aug 23 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -19,14 +19,14 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_DRnotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
m_panelNetClassesEditor = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
m_panelNetClassesEditor = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bpanelNetClassesSizer;
bpanelNetClassesSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerUpper;
sbSizerUpper = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClassesEditor, wxID_ANY, _("Net Classes:") ), wxVERTICAL );
m_grid = new wxGrid( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxTAB_TRAVERSAL|wxVSCROLL );
m_grid = new wxGrid( sbSizerUpper->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxTAB_TRAVERSAL|wxVSCROLL );
// Grid
m_grid->CreateGrid( 1, 6 );
@ -70,17 +70,17 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* buttonBoxSizer;
buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
m_addButton = new wxButton( m_panelNetClassesEditor, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_addButton = new wxButton( sbSizerUpper->GetStaticBox(), wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_addButton->SetToolTip( _("Add another Net Class") );
buttonBoxSizer->Add( m_addButton, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_removeButton = new wxButton( m_panelNetClassesEditor, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeButton = new wxButton( sbSizerUpper->GetStaticBox(), wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeButton->SetToolTip( _("Remove the currently select Net Class\nThe default Net Class cannot be removed") );
buttonBoxSizer->Add( m_removeButton, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_moveUpButton = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
m_moveUpButton = new wxButton( sbSizerUpper->GetStaticBox(), wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
m_moveUpButton->SetToolTip( _("Move the currently selected Net Class up one row") );
buttonBoxSizer->Add( m_moveUpButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
@ -97,10 +97,10 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* leftNetSelectBoxSizer;
leftNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
m_leftClassChoice = new wxComboBox( m_panelNetClassesEditor, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
m_leftClassChoice = new wxComboBox( sbSizerNetSelectMain->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxEXPAND, 5 );
m_leftListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
m_leftListCtrl = new NETS_LIST_CTRL( sbSizerNetSelectMain->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxEXPAND|wxTOP, 5 );
@ -109,22 +109,22 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* bmiddleSizerNetSelect;
bmiddleSizerNetSelect = new wxBoxSizer( wxVERTICAL );
m_buttonRightToLeft = new wxButton( m_panelNetClassesEditor, ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRightToLeft = new wxButton( sbSizerNetSelectMain->GetStaticBox(), ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRightToLeft->SetToolTip( _("Move the selected nets in the right list to the left list") );
bmiddleSizerNetSelect->Add( m_buttonRightToLeft, 0, wxALL, 5 );
m_buttonLeftToRight = new wxButton( m_panelNetClassesEditor, ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonLeftToRight = new wxButton( sbSizerNetSelectMain->GetStaticBox(), ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonLeftToRight->SetToolTip( _("Move the selected nets in the left list to the right list") );
bmiddleSizerNetSelect->Add( m_buttonLeftToRight, 0, wxALL, 5 );
m_buttonLeftSelAll = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonLeftSelAll = new wxButton( sbSizerNetSelectMain->GetStaticBox(), wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonLeftSelAll->SetToolTip( _("Select all nets in the left list") );
bmiddleSizerNetSelect->Add( m_buttonLeftSelAll, 0, wxALL, 5 );
m_buttonRightSelAll = new wxButton( m_panelNetClassesEditor, wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRightSelAll = new wxButton( sbSizerNetSelectMain->GetStaticBox(), wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRightSelAll->SetToolTip( _("Select all nets in the right list") );
bmiddleSizerNetSelect->Add( m_buttonRightSelAll, 0, wxALL, 5 );
@ -135,10 +135,10 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* rghtNetSelectBoxSizer;
rghtNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
m_rightClassChoice = new wxComboBox( m_panelNetClassesEditor, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
m_rightClassChoice = new wxComboBox( sbSizerNetSelectMain->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxEXPAND, 5 );
m_rightListCtrl = new NETS_LIST_CTRL( m_panelNetClassesEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
m_rightListCtrl = new NETS_LIST_CTRL( sbSizerNetSelectMain->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VIRTUAL|wxLC_VRULES|wxSUNKEN_BORDER );
rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxEXPAND|wxTOP, 5 );
@ -152,7 +152,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_panelNetClassesEditor->Layout();
bpanelNetClassesSizer->Fit( m_panelNetClassesEditor );
m_DRnotebook->AddPage( m_panelNetClassesEditor, _("Net Classes Editor"), true );
m_panelGolbalDesignRules = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
m_panelGolbalDesignRules = new wxPanel( m_DRnotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bpanelGlobRulesSizer;
bpanelGlobRulesSizer = new wxBoxSizer( wxVERTICAL );
@ -164,7 +164,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxString m_OptViaTypeChoices[] = { _("Do not allow blind/buried vias"), _("Allow blind/buried vias") };
int m_OptViaTypeNChoices = sizeof( m_OptViaTypeChoices ) / sizeof( wxString );
m_OptViaType = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Blind/buried Vias:"), wxDefaultPosition, wxDefaultSize, m_OptViaTypeNChoices, m_OptViaTypeChoices, 1, wxRA_SPECIFY_COLS );
m_OptViaType = new wxRadioBox( sbViasOptionSizer->GetStaticBox(), wxID_ANY, _("Blind/buried Vias:"), wxDefaultPosition, wxDefaultSize, m_OptViaTypeNChoices, m_OptViaTypeChoices, 1, wxRA_SPECIFY_COLS );
m_OptViaType->SetSelection( 0 );
m_OptViaType->SetToolTip( _("Allows or not blind/buried vias.\nDo not allow is the usual selection.\nNote: micro vias are a special type of blind vias and are not managed here") );
@ -172,7 +172,7 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxString m_AllowMicroViaCtrlChoices[] = { _("Do not allow micro vias"), _("Allow micro vias") };
int m_AllowMicroViaCtrlNChoices = sizeof( m_AllowMicroViaCtrlChoices ) / sizeof( wxString );
m_AllowMicroViaCtrl = new wxRadioBox( m_panelGolbalDesignRules, wxID_ANY, _("Micro Vias:"), wxDefaultPosition, wxDefaultSize, m_AllowMicroViaCtrlNChoices, m_AllowMicroViaCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_AllowMicroViaCtrl = new wxRadioBox( sbViasOptionSizer->GetStaticBox(), wxID_ANY, _("Micro Vias:"), wxDefaultPosition, wxDefaultSize, m_AllowMicroViaCtrlNChoices, m_AllowMicroViaCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_AllowMicroViaCtrl->SetSelection( 0 );
m_AllowMicroViaCtrl->SetToolTip( _("Allows or do not allow use of micro vias\nThey are very small vias only from an external copper layer to its near neightbour") );
@ -190,43 +190,43 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
fgMinValuesSizer->SetFlexibleDirection( wxBOTH );
fgMinValuesSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_TrackMinWidthTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min track width"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackMinWidthTitle = new wxStaticText( sbMinSizesSizer->GetStaticBox(), wxID_ANY, _("Min track width"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackMinWidthTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetTrackMinWidthCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetTrackMinWidthCtrl = new wxTextCtrl( sbMinSizesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetTrackMinWidthCtrl->SetMaxLength( 0 );
fgMinValuesSizer->Add( m_SetTrackMinWidthCtrl, 0, wxALL|wxEXPAND, 5 );
m_ViaMinTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle = new wxStaticText( sbMinSizesSizer->GetStaticBox(), wxID_ANY, _("Min via diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 );
m_SetViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetViasMinSizeCtrl = new wxTextCtrl( sbMinSizesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetViasMinSizeCtrl->SetMaxLength( 0 );
fgMinValuesSizer->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_ViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min via drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinDrillTitle = new wxStaticText( sbMinSizesSizer->GetStaticBox(), wxID_ANY, _("Min via drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinDrillTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_ViaMinDrillTitle, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_RIGHT, 5 );
m_SetViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetViasMinDrillCtrl = new wxTextCtrl( sbMinSizesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetViasMinDrillCtrl->SetMaxLength( 0 );
fgMinValuesSizer->Add( m_SetViasMinDrillCtrl, 0, wxALL|wxEXPAND, 5 );
m_MicroViaMinSizeTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinSizeTitle = new wxStaticText( sbMinSizesSizer->GetStaticBox(), wxID_ANY, _("Min uvia diameter"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinSizeTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_MicroViaMinSizeTitle, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 );
m_SetMicroViasMinSizeCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinSizeCtrl = new wxTextCtrl( sbMinSizesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinSizeCtrl->SetMaxLength( 6 );
fgMinValuesSizer->Add( m_SetMicroViasMinSizeCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_MicroViaMinDrillTitle = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Min uvia drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinDrillTitle = new wxStaticText( sbMinSizesSizer->GetStaticBox(), wxID_ANY, _("Min uvia drill dia"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinDrillTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_MicroViaMinDrillTitle, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SetMicroViasMinDrillCtrl = new wxTextCtrl( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinDrillCtrl = new wxTextCtrl( sbMinSizesSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViasMinDrillCtrl->SetMaxLength( 6 );
fgMinValuesSizer->Add( m_SetMicroViasMinDrillCtrl, 0, wxEXPAND|wxALL, 5 );
@ -252,11 +252,11 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxStaticBoxSizer* sViaSizeBox;
sViaSizeBox = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Custom Via Sizes:") ), wxVERTICAL );
m_staticText7 = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, _("Drill value: a blank or 0 => default Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7 = new wxStaticText( sViaSizeBox->GetStaticBox(), wxID_ANY, _("Drill value: a blank or 0 => default Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
sViaSizeBox->Add( m_staticText7, 0, wxALL, 5 );
m_gridViaSizeList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_gridViaSizeList = new wxGrid( sViaSizeBox->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_gridViaSizeList->CreateGrid( 8, 2 );
@ -302,11 +302,11 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxStaticBoxSizer* sbTracksListSizer;
sbTracksListSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelGolbalDesignRules, wxID_ANY, _("Custom Track Widths:") ), wxVERTICAL );
m_staticText8 = new wxStaticText( m_panelGolbalDesignRules, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8 = new wxStaticText( sbTracksListSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8->Wrap( -1 );
sbTracksListSizer->Add( m_staticText8, 0, wxALL, 5 );
m_gridTrackWidthList = new wxGrid( m_panelGolbalDesignRules, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_gridTrackWidthList = new wxGrid( sbTracksListSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_gridTrackWidthList->CreateGrid( 8, 1 );

View File

@ -229,7 +229,7 @@
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -1538,7 +1538,7 @@
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// C++ code generated with wxFormBuilder (version Aug 23 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!

View File

@ -206,6 +206,9 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
dlg.FilePicker()->SetPath( fn.GetFullPath() );
dlg.SetSubdir( subDirFor3Dshapes );
if( dlg.ShowModal() != wxID_OK )
return;
double aXRef = dlg.GetXRef();
double aYRef = dlg.GetYRef();
@ -221,9 +224,6 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
bool useRelativePaths = dlg.GetUseRelativePathsOption();
bool usePlainPCB = dlg.GetUsePlainPCBOption();
if( dlg.ShowModal() != wxID_OK )
return;
last_vrmlName = dlg.FilePicker()->GetPath();
wxFileName modelPath = last_vrmlName;
wxBusyCursor dummy;

View File

@ -58,6 +58,7 @@ DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent,
m_stdButtonsOK->SetDefault();
GetSizer()->SetSizeHints( this );
Layout();
}

View File

@ -275,7 +275,7 @@ void DIALOG_PAD_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event )
{
dim = m_dummyPad->GetDrillSize().y;
if( dim == 0 )
dim = 1000000;
dim = Millimeter2iu( 0.1 );
}
if( m_dummyPad->GetLocalClearance() > 0 )
@ -731,6 +731,7 @@ void DIALOG_PAD_PROPERTIES::OnSetLayers( wxCommandEvent& event )
bool DIALOG_PAD_PROPERTIES::padValuesOK()
{
bool error = transferDataToPad( m_dummyPad );
bool skip_tstoffset = false; // the offset prm is not always tested
wxArrayString error_msgs;
wxString msg;
@ -746,6 +747,8 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
(m_dummyPad->GetSize().y < m_dummyPad->GetDrillSize().y) )
{
error_msgs.Add( _( "Incorrect value for pad drill: pad drill bigger than pad size" ) );
skip_tstoffset = true; // offset prm will be not tested because if the drill value
// is incorrect the offset prm is always seen as incorrect, even if it is 0
}
LSET padlayers_mask = m_dummyPad->GetLayerSet();
@ -772,6 +775,8 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
}
}
if( !skip_tstoffset )
{
wxPoint max_size;
max_size.x = std::abs( m_dummyPad->GetOffset().x );
max_size.y = std::abs( m_dummyPad->GetOffset().y );
@ -783,6 +788,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
{
error_msgs.Add( _( "Incorrect value for pad offset" ) );
}
}
if( error )
{

View File

@ -95,11 +95,12 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway,
#ifdef __WINDOWS__
KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP,
#else
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT,
aParent ? KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT
: KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP,
#endif
FOOTPRINT_WIZARD_FRAME_NAME )
{
wxASSERT( aFrameType==FRAME_PCB_FOOTPRINT_WIZARD_MODAL );
wxASSERT( aFrameType == FRAME_PCB_FOOTPRINT_WIZARD_MODAL );
// This frame is always show modal:
SetModal( true );

View File

@ -20,11 +20,6 @@
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
# Download avhttp and install the headers, not actually compiled
#################################################
# These are additions to any inherited from pcbnew dir:
include_directories( . )
@ -37,8 +32,6 @@ set( GITHUB_PLUGIN_SRCS
add_library( github_plugin STATIC ${GITHUB_PLUGIN_SRCS} )
# No, you don't get github without boost and openssl. Boost_LIBRARIES now moved up
# into CMakeLists.txt for pcbnew and cvpcb:
target_link_libraries( github_plugin
common
)

View File

@ -220,7 +220,8 @@ bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& aFullURLCommand, wxStr
try
{
kcurl.Perform();
m_image.assign(kcurl.GetBuffer()->payload, kcurl.GetBuffer()->size);
m_image.reserve( kcurl.GetBuffer()->Size );
m_image.assign( kcurl.GetBuffer()->Payload, kcurl.GetBuffer()->Size );
return true;
}
catch( const IO_ERROR& ioe )

View File

@ -538,7 +538,8 @@ void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL ) throw( IO_ERROR )
try
{
kcurl.Perform();
m_zip_image.assign(kcurl.GetBuffer()->payload, kcurl.GetBuffer()->size);
m_zip_image.reserve( kcurl.GetBuffer()->Size );
m_zip_image.assign( kcurl.GetBuffer()->Payload, kcurl.GetBuffer()->Size );
}
catch( const IO_ERROR& ioe )
{
@ -551,6 +552,16 @@ void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL ) throw( IO_ERROR )
THROW_IO_ERROR( msg );
}
// If the zip archive is not existing, the received data is "Not Found",
// and no error is returned by kcurl.Perform().
if( m_zip_image.compare( 0, 9, "Not Found" ) == 0 )
{
UTF8 fmt( _( "Cannot download library '%s'.\nThe library does not exist on the server" ) );
std::string msg = StrPrintf( fmt.c_str(), TO_UTF8( aRepoURL ) );
THROW_IO_ERROR( msg );
}
}
#if 0 && defined(STANDALONE)

View File

@ -131,8 +131,8 @@ static EDA_HOTKEY HkSwitchHighContrastMode( _HKI( "Toggle High Contrast Mode" ),
static EDA_HOTKEY HkSetGridOrigin( _HKI( "Set Grid Origin" ), HK_SET_GRID_ORIGIN, 'S' );
static EDA_HOTKEY HkResetGridOrigin( _HKI( "Reset Grid Origin" ), HK_RESET_GRID_ORIGIN, 'Z' );
static EDA_HOTKEY HkCanvasDefault( _HKI( "Switch to Default Canvas" ),
HK_CANVAS_DEFAULT,
static EDA_HOTKEY HkCanvasDefault( _HKI( "Switch to Legacy Canvas" ),
HK_CANVAS_LEGACY,
#ifdef __WXMAC__
GR_KB_ALT +
#endif

View File

@ -116,7 +116,7 @@ enum hotkey_id_commnand {
HK_CALL_MACROS_9,
HK_MACRO_ID_END,
HK_SWITCH_HIGHCONTRAST_MODE,
HK_CANVAS_DEFAULT,
HK_CANVAS_LEGACY,
HK_CANVAS_OPENGL,
HK_CANVAS_CAIRO,
HK_LEFT_CLICK,

View File

@ -586,8 +586,8 @@ bool PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
evt_type = ID_MENU_CANVAS_OPENGL;
break;
case HK_CANVAS_DEFAULT:
evt_type = ID_MENU_CANVAS_DEFAULT;
case HK_CANVAS_LEGACY:
evt_type = ID_MENU_CANVAS_LEGACY;
break;
case HK_ZONE_FILL_OR_REFILL:
evt_type = ID_POPUP_PCB_FILL_ALL_ZONES;

View File

@ -142,6 +142,7 @@ wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser()
if( viewer )
viewer->Destroy();
// Creates the modal Lib browser:
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true );
wxString fpid;
@ -149,8 +150,6 @@ wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser()
int ret = viewer->ShowModal( &fpid, this );
(void) ret; // make static analyser quiet
//DBG(printf("%s: fpid:'%s'\n", __func__, TO_UTF8( fpid ) );)
viewer->Destroy();
return fpid;

View File

@ -240,11 +240,11 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Add canvas selection
viewMenu->AppendSeparator();
text = AddHotkeyName( _( "&Switch Canvas to Default" ), m_hotkeysDescrList,
HK_CANVAS_DEFAULT );
text = AddHotkeyName( _( "&Switch Canvas to Legacy" ), m_hotkeysDescrList,
HK_CANVAS_LEGACY );
AddMenuItem( viewMenu, ID_MENU_CANVAS_DEFAULT,
text, _( "Switch the canvas implementation to default" ),
AddMenuItem( viewMenu, ID_MENU_CANVAS_LEGACY,
text, _( "Switch the canvas implementation to Legacy" ),
KiBitmap( tools_xpm ) );
text = AddHotkeyName( _( "Switch Canvas to Open&GL" ), m_hotkeysDescrList,

View File

@ -357,11 +357,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
viewMenu->AppendSeparator();
text = AddHotkeyName( _( "&Switch Canvas to Default" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_CANVAS_DEFAULT );
text = AddHotkeyName( _( "&Switch Canvas to Legacy" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_CANVAS_LEGACY );
AddMenuItem( viewMenu, ID_MENU_CANVAS_DEFAULT,
text, _( "Switch the canvas implementation to default" ),
AddMenuItem( viewMenu, ID_MENU_CANVAS_LEGACY,
text, _( "Switch the canvas implementation to Legacy" ),
KiBitmap( tools_xpm ) );
text = AddHotkeyName( _( "Switch Canvas to Open&GL" ), g_Pcbnew_Editor_Hokeys_Descr,

View File

@ -167,7 +167,7 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, FOOTPRINT_EDIT_FRAME::Show3D_Frame )
// Switching canvases
EVT_MENU( ID_MENU_CANVAS_DEFAULT, PCB_BASE_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_LEGACY, PCB_BASE_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_CAIRO, PCB_BASE_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_OPENGL, PCB_BASE_FRAME::SwitchCanvas )
@ -740,7 +740,8 @@ void FOOTPRINT_EDIT_FRAME::OnModify()
EDA_3D_FRAME* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame )
draw3DFrame->ReloadRequest();}
draw3DFrame->ReloadRequest();
}
void FOOTPRINT_EDIT_FRAME::updateTitle()

View File

@ -97,11 +97,11 @@ END_EVENT_TABLE()
/* Note:
* FOOTPRINT_VIEWER_FRAME can be build in "modal mode", or as a usual frame.
* FOOTPRINT_VIEWER_FRAME can be created in "modal mode", or as a usual frame.
* In modal mode:
* a tool to export the selected footprint is shown in the toolbar
* the style is wxSTAY_ON_TOP on Windows and wxFRAME_FLOAT_ON_PARENT on unix
* reason:
* Reason:
* the parent is usually the kicad window manager (not easy to change)
* On windows, when the frame with stype wxFRAME_FLOAT_ON_PARENT is displayed
* its parent frame is brought to the foreground, on the top of the calling frame.
@ -109,11 +109,12 @@ END_EVENT_TABLE()
* this issue does not happen on unix
*
* So we use wxSTAY_ON_TOP on Windows, and wxFRAME_FLOAT_ON_PARENT on unix
* to simulate a dialog called by ShowModal.
* to force FOOTPRINT_VIEWER_FRAME to stay on parent when it is Modal.
*/
#define FOOTPRINT_VIEWER_FRAME_NAME wxT( "ModViewFrame" )
#define FOOTPRINT_VIEWER_FRAME_NAME_MODAL wxT( "ModViewFrameModal" )
FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType ) :
@ -121,19 +122,28 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
wxDefaultPosition, wxDefaultSize,
aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ?
#ifdef __WINDOWS__
KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP :
KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP
#else
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT :
aParent ?
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT
: KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP
#endif
KICAD_DEFAULT_DRAWFRAME_STYLE,
FOOTPRINT_VIEWER_FRAME_NAME )
: KICAD_DEFAULT_DRAWFRAME_STYLE,
aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ?
FOOTPRINT_VIEWER_FRAME_NAME_MODAL
: FOOTPRINT_VIEWER_FRAME_NAME )
{
wxASSERT( aFrameType==FRAME_PCB_MODULE_VIEWER || aFrameType==FRAME_PCB_MODULE_VIEWER_MODAL );
wxASSERT( aFrameType==FRAME_PCB_MODULE_VIEWER ||
aFrameType==FRAME_PCB_MODULE_VIEWER_MODAL );
if( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL )
SetModal( true );
// Force the frame name used in config. the footprint viewer frame has a name
// depending on aFrameType (needed to identify the frame by wxWidgets),
// but only one configuration is preferable.
m_configFrameName = FOOTPRINT_VIEWER_FRAME_NAME;
m_showAxis = true; // true to draw axis.
// Give an icon

View File

@ -67,8 +67,6 @@ private:
wxListBox* m_libList; // The list of libs names
wxListBox* m_footprintList; // The list of footprint names
wxString m_configPath; // subpath for configuration
const wxString getCurNickname();
void setCurNickname( const wxString& aNickname );

View File

@ -177,7 +177,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, PCB_EDIT_FRAME::Show3D_Frame )
// Switching canvases
EVT_MENU( ID_MENU_CANVAS_DEFAULT, PCB_BASE_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_LEGACY, PCB_BASE_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_CAIRO, PCB_BASE_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_OPENGL, PCB_BASE_FRAME::SwitchCanvas )

View File

@ -149,7 +149,7 @@ static struct IFACE : public KIFACE_I
break;
default:
;
break;
}
return frame;

View File

@ -290,7 +290,7 @@ enum pcbnew_ids
ID_PCB_GEN_CMP_FILE,
ID_MENU_PCB_SHOW_3D_FRAME,
ID_MENU_CANVAS_DEFAULT,
ID_MENU_CANVAS_LEGACY,
ID_MENU_CANVAS_OPENGL,
ID_MENU_CANVAS_CAIRO,
ID_PCB_USER_GRID_SETUP,

View File

@ -1,19 +0,0 @@
add_library( s3d_plugin_demo1 MODULE
s3d_plugin_demo1.cpp
)
target_link_libraries( s3d_plugin_demo1 ${wxWidgets_LIBRARIES} )
add_library( s3d_plugin_demo2 MODULE
s3d_plugin_demo2.cpp
)
target_link_libraries( s3d_plugin_demo2 kicad_3dsg ${wxWidgets_LIBRARIES} )
install( TARGETS
s3d_plugin_demo1
s3d_plugin_demo2
DESTINATION ${KICAD_USER_PLUGIN}/3d
COMPONENT binary
)

View File

@ -1,174 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Cirilo Bernardo <cirilo.bernardo@gmail.com>
*
* 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 <iostream>
#include "plugins/3d/3d_plugin.h"
#define PLUGIN_3D_DEMO1_MAJOR 1
#define PLUGIN_3D_DEMO1_MINOR 0
#define PLUGIN_3D_DEMO1_PATCH 0
#define PLUGIN_3D_DEMO1_REVNO 0
const char* GetKicadPluginName( void )
{
return "PLUGIN_3D_DEMO1";
}
void GetPluginVersion( unsigned char* Major, unsigned char* Minor,
unsigned char* Patch, unsigned char* Revision )
{
if( Major )
*Major = PLUGIN_3D_DEMO1_MAJOR;
if( Minor )
*Minor = PLUGIN_3D_DEMO1_MINOR;
if( Patch )
*Patch = PLUGIN_3D_DEMO1_PATCH;
if( Revision )
*Revision = PLUGIN_3D_DEMO1_REVNO;
return;
}
// number of extensions supported
#ifdef _WIN32
#define NEXTS 7
#else
#define NEXTS 14
#endif
// number of filter sets supported
#define NFILS 5
static char ext0[] = "wrl";
static char ext1[] = "x3d";
static char ext2[] = "emn";
static char ext3[] = "iges";
static char ext4[] = "igs";
static char ext5[] = "stp";
static char ext6[] = "step";
#ifdef _WIN32
static char fil0[] = "VRML 1.0/2.0 (*.wrl)|*.wrl";
static char fil1[] = "X3D (*.x3d)|*.x3d";
static char fil2[] = "IDF 2.0/3.0 (*.emn)|*.emn";
static char fil3[] = "IGESv5.3 (*.igs;*.iges)|*.igs;*.iges";
static char fil4[] = "STEP (*.stp;*.step)|*.stp;*.step";
#else
static char ext7[] = "WRL";
static char ext8[] = "X3D";
static char ext9[] = "EMN";
static char ext10[] = "IGES";
static char ext11[] = "IGS";
static char ext12[] = "STP";
static char ext13[] = "STEP";
static char fil0[] = "VRML 1.0/2.0 (*.wrl;*.WRL)|*.wrl;*.WRL";
static char fil1[] = "X3D (*.x3d;*.X3D)|*.x3d;*.X3D";
static char fil2[] = "IDF 2.0/3.0 (*.emn;*.EMN)|*.emn;*.EMN";
static char fil3[] = "IGESv5.3 (*.igs;*.iges;*.IGS;*.IGES)|*.igs;*.iges;*.IGS;*.IGES";
static char fil4[] = "STEP (*.stp;*.step;*.STP;*.STEP)|*.stp;*.step;*.STP;*.STEP";
#endif
static struct FILE_DATA
{
char const* extensions[NEXTS];
char const* filters[NFILS];
FILE_DATA()
{
extensions[0] = ext0;
extensions[1] = ext1;
extensions[2] = ext2;
extensions[3] = ext3;
extensions[4] = ext4;
extensions[5] = ext5;
extensions[6] = ext6;
filters[0] = fil0;
filters[1] = fil1;
filters[2] = fil2;
filters[3] = fil3;
filters[4] = fil4;
#ifndef _WIN32
extensions[7] = ext7;
extensions[8] = ext8;
extensions[9] = ext9;
extensions[10] = ext10;
extensions[11] = ext11;
extensions[12] = ext12;
extensions[13] = ext13;
#endif
return;
}
} file_data;
int GetNExtensions( void )
{
return NEXTS;
}
char const* GetModelExtension( int aIndex )
{
if( aIndex < 0 || aIndex >= NEXTS )
return NULL;
return file_data.extensions[aIndex];
}
int GetNFilters( void )
{
return NFILS;
}
char const* GetFileFilter( int aIndex )
{
if( aIndex < 0 || aIndex >= NFILS )
return NULL;
return file_data.filters[aIndex];
}
bool CanRender( void )
{
// this dummy plugin does not support rendering of any models
return false;
}
SCENEGRAPH* Load( char const* aFileName )
{
// this dummy plugin does not support rendering of any models
return NULL;
}

View File

@ -1,318 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Cirilo Bernardo <cirilo.bernardo@gmail.com>
*
* 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 <cmath>
#include "plugins/3d/3d_plugin.h"
#include "plugins/3dapi/ifsg_all.h"
#define PLUGIN_3D_DEMO2_MAJOR 1
#define PLUGIN_3D_DEMO2_MINOR 0
#define PLUGIN_3D_DEMO2_PATCH 0
#define PLUGIN_3D_DEMO2_REVNO 0
const char* GetKicadPluginName( void )
{
return "PLUGIN_3D_DEMO2";
}
void GetPluginVersion( unsigned char* Major, unsigned char* Minor,
unsigned char* Patch, unsigned char* Revision )
{
if( Major )
*Major = PLUGIN_3D_DEMO2_MAJOR;
if( Minor )
*Minor = PLUGIN_3D_DEMO2_MINOR;
if( Patch )
*Patch = PLUGIN_3D_DEMO2_PATCH;
if( Revision )
*Revision = PLUGIN_3D_DEMO2_REVNO;
return;
}
// number of extensions supported
#ifdef _WIN32
#define NEXTS 1
#else
#define NEXTS 2
#endif
// number of filter sets supported
#define NFILS 1
static char ext0[] = "wrl";
#ifdef _WIN32
static char fil0[] = "VRML 1.0/2.0 (*.wrl)|*.wrl";
#else
static char ext1[] = "WRL";
static char fil0[] = "VRML 1.0/2.0 (*.wrl;*.WRL)|*.wrl;*.WRL";
#endif
static struct FILE_DATA
{
char const* extensions[NEXTS];
char const* filters[NFILS];
FILE_DATA()
{
extensions[0] = ext0;
filters[0] = fil0;
#ifndef _WIN32
extensions[1] = ext1;
#endif
return;
}
} file_data;
int GetNExtensions( void )
{
return NEXTS;
}
char const* GetModelExtension( int aIndex )
{
if( aIndex < 0 || aIndex >= NEXTS )
return NULL;
return file_data.extensions[aIndex];
}
int GetNFilters( void )
{
return NFILS;
}
char const* GetFileFilter( int aIndex )
{
if( aIndex < 0 || aIndex >= NFILS )
return NULL;
return file_data.filters[aIndex];
}
bool CanRender( void )
{
// this dummy pretends to render a VRML model
return true;
}
SCENEGRAPH* Load( char const* aFileName )
{
// For this demonstration we create a tetrahedron (tx1) consisting of a SCENEGRAPH
// (VRML Transform) which in turn contains 4 SGSHAPE (VRML Shape) objects
// representing each of the sides of the tetrahedron. Each Shape is associated
// with a color (SGAPPEARANCE) and a SGFACESET (VRML Geometry->indexedFaceSet).
// Each SGFACESET is associated with a vertex list (SGCOORDS), a per-vertex normals
// list (SGNORMALS), and a coordinate index (SGCOORDINDEX). One shape is used to
// represent each face so that we may use per-vertex-per-face normals.
//
// The tetrahedron in turn is a child of a top level SCENEGRAPH (tx0) which has
// a second SCENEGRAPH child (tx2) which is a transformation of the tetrahedron tx1
// (rotation + translation). This demonstrates the reuse of components within
// the model heirarchy.
// define the vertices of the tetrahedron
// face 1: 0, 3, 1
// face 2: 0, 2, 3
// face 3: 1, 3, 2
// face 4: 0, 1, 2
double SQ2 = sqrt( 0.5 );
SGPOINT vert[4];
vert[0] = SGPOINT( 1.0, 0.0, -SQ2 );
vert[1] = SGPOINT( -1.0, 0.0, -SQ2 );
vert[2] = SGPOINT( 0.0, 1.0, SQ2 );
vert[3] = SGPOINT( 0.0, -1.0, SQ2 );
// create the top level transform; this will hold all other
// scenegraph objects; a transform may hold other transforms and
// shapes
IFSG_TRANSFORM* tx0 = new IFSG_TRANSFORM( true );
// create the transform which will house the shapes
IFSG_TRANSFORM* tx1 = new IFSG_TRANSFORM( tx0->GetRawPtr() );
// add a shape which we will use to define one face of the tetrahedron; shapes
// hold facesets and appearances
IFSG_SHAPE* shape = new IFSG_SHAPE( *tx1 );
// add a faceset; these contain coordinate lists, coordinate indices,
// vertex lists, vertex indices, and may also contain color lists and
// their indices.
IFSG_FACESET* face = new IFSG_FACESET( *shape );
IFSG_COORDS* cp = new IFSG_COORDS( *face );
cp->AddCoord( vert[0] );
cp->AddCoord( vert[3] );
cp->AddCoord( vert[1] );
// coordinate indices - note: enforce triangles;
// in real plugins where it is not necessarily possible
// to determine which side a triangle is visible from,
// 2 point orders must be specified for each triangle
IFSG_COORDINDEX* coordIdx = new IFSG_COORDINDEX( *face );
coordIdx->AddIndex( 0 );
coordIdx->AddIndex( 1 );
coordIdx->AddIndex( 2 );
// create an appearance; appearances are owned by shapes
// magenta
IFSG_APPEARANCE* material = new IFSG_APPEARANCE( *shape);
material->SetSpecular( 1.0, 0.0, 1.0 );
material->SetDiffuse( 0.9, 0.0, 0.9 );
material->SetAmbient( 0.9 );
material->SetShininess( 0.3 );
// normals
IFSG_NORMALS* np = new IFSG_NORMALS( *face );
SGVECTOR nval = S3D::CalcTriNorm( vert[0], vert[3], vert[1] );
np->AddNormal( nval );
np->AddNormal( nval );
np->AddNormal( nval );
//
// Shape2
// Note: we reuse the IFSG* wrappers to create and manipulate new
// data structures.
//
shape->NewNode( *tx1 );
face->NewNode( *shape );
coordIdx->NewNode( *face );
cp->NewNode( *face );
np->NewNode( *face );
// vertices
cp->AddCoord( vert[0] );
cp->AddCoord( vert[2] );
cp->AddCoord( vert[3] );
// indices
coordIdx->AddIndex( 0 );
coordIdx->AddIndex( 1 );
coordIdx->AddIndex( 2 );
// normals
nval = S3D::CalcTriNorm( vert[0], vert[2], vert[3] );
np->AddNormal( nval );
np->AddNormal( nval );
np->AddNormal( nval );
// color (red)
material->NewNode( *shape );
material->SetSpecular( 1.0, 0.0, 0.0 );
material->SetDiffuse( 0.9, 0.0, 0.0 );
material->SetAmbient( 0.9 );
material->SetShininess( 0.3 );
//
// Shape3
//
shape->NewNode( *tx1 );
face->NewNode( *shape );
coordIdx->NewNode( *face );
cp->NewNode( *face );
np->NewNode( *face );
// vertices
cp->AddCoord( vert[1] );
cp->AddCoord( vert[3] );
cp->AddCoord( vert[2] );
// indices
coordIdx->AddIndex( 0 );
coordIdx->AddIndex( 1 );
coordIdx->AddIndex( 2 );
// normals
nval = S3D::CalcTriNorm( vert[1], vert[3], vert[2] );
np->AddNormal( nval );
np->AddNormal( nval );
np->AddNormal( nval );
// color (green)
material->NewNode( *shape );
material->SetSpecular( 0.0, 1.0, 0.0 );
material->SetDiffuse( 0.0, 0.9, 0.0 );
material->SetAmbient( 0.9 );
material->SetShininess( 0.3 );
//
// Shape4
//
shape->NewNode( *tx1 );
face->NewNode( *shape );
coordIdx->NewNode( *face );
cp->NewNode( *face );
np->NewNode( *face );
// vertices
cp->AddCoord( vert[0] );
cp->AddCoord( vert[1] );
cp->AddCoord( vert[2] );
// indices
coordIdx->AddIndex( 0 );
coordIdx->AddIndex( 1 );
coordIdx->AddIndex( 2 );
// normals
nval = S3D::CalcTriNorm( vert[0], vert[1], vert[2] );
np->AddNormal( nval );
np->AddNormal( nval );
np->AddNormal( nval );
// color (blue)
material->NewNode( *shape );
material->SetSpecular( 0.0, 0.0, 1.0 );
material->SetDiffuse( 0.0, 0.0, 0.9 );
material->SetAmbient( 0.9 );
material->SetShininess( 0.3 );
// create a copy of the entire tetrahedron shifted Z+2 and rotated 2/3PI
IFSG_TRANSFORM* tx2 = new IFSG_TRANSFORM( tx0->GetRawPtr() );
tx2->AddRefNode( *tx1 );
tx2->SetTranslation( SGPOINT( 0, 0, 2 ) );
tx2->SetRotation( SGVECTOR( 0, 0, 1 ), M_PI*2.0/3.0 );
SGNODE* data = tx0->GetRawPtr();
// delete the wrappers
delete shape;
delete face;
delete coordIdx;
delete material;
delete cp;
delete np;
delete tx0;
delete tx1;
delete tx2;
return (SCENEGRAPH*)data;
}

View File

@ -78,13 +78,32 @@ bool WRL2TRANSFORM::Read( WRLPROC& proc, WRL2BASE* aTopNode )
* exposedField MFNode children []
* exposedField SFRotation rotation 0 0 1 0
* exposedField SFVec3f scale 1 1 1
* exposedField SFRotation ScaleOrientation 0 0 1 0
* exposedField SFRotation scaleOrientation 0 0 1 0
* exposedField SFVec3f translation 0 0 0
* field SFVec3f bboxCenter 0 0 0
* field SFVec3f bboxSize 0 0 0
* }
*/
center.x = 0.0;
center.y = 0.0;
center.z = 0.0;
translation = center;
bboxCenter = center;
bboxSize = center;
rotation.x = 0.0;
rotation.y = 0.0;
rotation.z = 1.0;
rotation.w = 0.0;
scaleOrientation = rotation;
scale.x = 1.0;
scale.y = 1.0;
scale.z = 1.0;
// XXX - TO BE IMPLEMENTED
// XXX - at the moment this is half-assed code; it needs to be checked and expanded
@ -114,7 +133,10 @@ bool WRL2TRANSFORM::Read( WRLPROC& proc, WRL2BASE* aTopNode )
while( true )
{
if( proc.Peek() == '}' )
return true;
{
proc.Pop();
break;
}
if( !proc.ReadName( glob ) )
{
@ -132,12 +154,46 @@ bool WRL2TRANSFORM::Read( WRLPROC& proc, WRL2BASE* aTopNode )
// rotation
// scale
// ScaleOrientation
// translation
// XXX - TO BE IMPLEMENTED
if( !glob.compare( "center" ) )
{
// XXX -
}
else if( !glob.compare( "rotation" ) )
{
// XXX -
}
else if( !glob.compare( "scale" ) )
{
// XXX -
}
else if( !glob.compare( "scaleOrientation" ) )
{
// XXX -
}
else if( !glob.compare( "translation" ) )
{
// XXX -
}
else if( !glob.compare( "children" ) )
{
// XXX -
}
else
{
#ifdef DEBUG
std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
std::cerr << " * [INFO] bad Transform at line " << line << ", column ";
std::cerr << column << "\n";
std::cerr << " * [INFO] file: '" << proc.GetFileName() << "'\n";
#endif
// XXX - TO BE IMPLEMENTED
return false;
}
} // while( true ) -- reading contents of Transform{}
return true;
}

View File

@ -39,6 +39,15 @@
*/
class WRL2TRANSFORM : public WRL2NODE
{
private:
WRLVEC3F center;
WRLVEC3F scale;
WRLVEC3F translation;
WRLROTATION rotation;
WRLROTATION scaleOrientation;
WRLVEC3F bboxCenter;
WRLVEC3F bboxSize;
public:
// functions inherited from WRL2NODE

View File

@ -854,11 +854,12 @@ bool WRLPROC::ReadSFInt( int& aSFInt32, bool* hasComma )
if( std::string::npos != tmp.find( "0x" ) )
{
#warning TO BE IMPLEMENTED
// XXX - handle the case of a hex value.
// Rules: "0x" + "0-9, A-F" - pay attention to capitalization;
// if we encounter defective hex values (using 'a-f') we may
// consider relaxing the requirements.
// Rules: "0x" + "0-9, A-F" - VRML is case sensitive but in
// this instance we do no enforce case.
std::stringstream sstr;
sstr << std::hex << tmp;
sstr >> aSFInt32;
return true;
}
std::istringstream istr;
@ -2186,6 +2187,12 @@ bool WRLPROC::GetFilePosData( size_t& line, size_t& column )
}
std::string WRLPROC::GetFileName( void )
{
return m_filename;
}
char WRLPROC::Peek( void )
{
if( !m_file.is_open() )

View File

@ -71,6 +71,7 @@ public:
// helper routines
std::string GetError( void );
bool GetFilePosData( size_t& line, size_t& column );
std::string GetFileName( void );
// eatSpace discards all leading white space from the current m_linepos
// and continues until a non-empty line is found which contains non-blank
// characters

View File

@ -578,7 +578,7 @@ void make_hcyl( bool inch, bool axial, double dia, double length,
fprintf( fp, ".END_ELECTRICAL\n" );
fclose( fp );
return;
return;
}

View File

@ -83,7 +83,8 @@ bool IDF3::GetIDFString( const std::string& aLine, std::string& aIDFString,
if( idx < 0 || idx >= len )
return false;
while( isspace( aLine[idx] ) && idx < len ) ++idx;
while( idx < len && isspace( aLine[idx] ) )
++idx;
if( idx == len )
{
@ -95,7 +96,7 @@ bool IDF3::GetIDFString( const std::string& aLine, std::string& aIDFString,
{
hasQuotes = true;
++idx;
while( aLine[idx] != '"' && idx < len )
while( idx < len && aLine[idx] != '"' )
ostr << aLine[idx++];
if( idx == len )
@ -112,7 +113,7 @@ bool IDF3::GetIDFString( const std::string& aLine, std::string& aIDFString,
{
hasQuotes = false;
while( !isspace( aLine[idx] ) && idx < len )
while( idx < len && !isspace( aLine[idx] ) )
ostr << aLine[idx++];
}

View File

@ -2720,8 +2720,6 @@ bool IDF3_BOARD::ReadFile( const wxString& aFullFileName, bool aNoSubstituteOutl
// 2. Check if a file with extension 'emp' exists and read it
// 3. Open the specified filename and read it
std::string fname = TO_UTF8( aFullFileName );
wxFileName brdname( aFullFileName );
wxFileName libname( aFullFileName );
wxString ext = brdname.GetExt();
@ -3149,8 +3147,6 @@ bool IDF3_BOARD::WriteFile( const wxString& aFullFileName, bool aUnitMM, bool aF
// 2. Write the *.emn file according to the IDFv3 spec
// 3. Write the *.emp file according to the IDFv3 spec
std::string fname = TO_UTF8( aFullFileName );
wxFileName brdname( aFullFileName );
wxFileName libname( aFullFileName );

View File

@ -1596,9 +1596,6 @@ int VRML_LAYER::checkNContours( bool holes )
if( contours.empty() )
return 0;
std::list<int>::const_iterator begin;
std::list<int>::const_iterator end;
for( size_t i = 0; i < contours.size(); ++i )
{
if( contours[i]->size() < 3 )