Compare commits
233 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c3dc1f65d4 | |||
| 238fb00727 | |||
| 2d48c81d58 | |||
| 0893e0043f | |||
| 72c0267fe6 | |||
| c9956def36 | |||
| 5d60fe6812 | |||
| 6051dfae30 | |||
| 3518153d5b | |||
| cf949609b2 | |||
| d482a8805c | |||
| 161dc9ce7e | |||
| 090073cc3b | |||
| 6ae718e4d6 | |||
| 783b1cb611 | |||
| 4b01f80e8d | |||
| c8278f377b | |||
| d34b664933 | |||
| c8f40e1d26 | |||
| 185a8d7582 | |||
| 8373e91a1b | |||
| 6aeedfb70c | |||
| e7f3851212 | |||
| 7df05ade4c | |||
| 24b032ce5b | |||
| b6fe4ff637 | |||
| 8f1aa28b37 | |||
| 55c1e22a67 | |||
| ca0d4511a9 | |||
| b56855c542 | |||
| 72e8eb3b94 | |||
| 281a1cdc2c | |||
| 3c8f901a1f | |||
| e0589d2908 | |||
| dfd53976d4 | |||
| 02d43be93c | |||
| 2e8bceb676 | |||
| 16f9e697ab | |||
| 269f88ee28 | |||
| f11d950448 | |||
| 6ba2c44e88 | |||
| d1ed4665de | |||
| 5b68cfa018 | |||
| 85f88b6b05 | |||
| ea467441d2 | |||
| 40ba502853 | |||
| 09d7d0f1bc | |||
| 3418d53a6d | |||
| d5440d60ab | |||
| 2ba237ec12 | |||
| 01a343f28e | |||
| 85220591e2 | |||
| ecadc8bbba | |||
| 26c92eaf0f | |||
| d129abb9c9 | |||
| 3b98b00d6f | |||
| ce329e13fb | |||
| be9cd98cb1 | |||
| 216acd98d6 | |||
| 10fd8a59b2 | |||
| 3974c6fd89 | |||
| f82962e42c | |||
| bf1ced4184 | |||
| cabfcbc73c | |||
| 574473c480 | |||
| 17143fd53f | |||
| b8fff99e68 | |||
| 3b038feae0 | |||
| 032bda223e | |||
| b16d4d18e0 | |||
| df3a57dcda | |||
| 3bf7ab910f | |||
| e8ce0ba6ef | |||
| d8fff5c820 | |||
| aa9897d932 | |||
| f265a52c96 | |||
| f214cfae12 | |||
| febc8cd6aa | |||
| 463e061740 | |||
| d80759efb8 | |||
| 1d66aad4df | |||
| f5284ced54 | |||
| c951ca6f47 | |||
| f25ae373bb | |||
| 845833e8fd | |||
| f0ac61a8fd | |||
| 8f7278e34f | |||
| b124599de3 | |||
| 697234dd51 | |||
| ba97494d6f | |||
| 1996fba8a6 | |||
| a6bbe907ee | |||
| 43579f4c02 | |||
| 909a25c147 | |||
| aa3aafc4ff | |||
| b32439a694 | |||
| ddbc25077c | |||
| b075886b19 | |||
| eae999a85a | |||
| 77f0799750 | |||
| 8de93ad8b4 | |||
| b377b5bbed | |||
| 75b5324762 | |||
| 610d200e8a | |||
| 8002692f3e | |||
| 9496b57b01 | |||
| a5cd5844ec | |||
| da16b479a0 | |||
| 44f1059000 | |||
| cf4b41f7d9 | |||
| a84ca5b147 | |||
| 71f5f96e64 | |||
| 2aa8e444ee | |||
| cfa187f477 | |||
| 1ed411e431 | |||
| 9233ae97d0 | |||
| 0ee38653f7 | |||
| df89b5bf8a | |||
| cca4037fec | |||
| e015da8d95 | |||
| 4ceb186251 | |||
| 370109b868 | |||
| 3b3165ad51 | |||
| 98e68cd66a | |||
| 407301a28c | |||
| 5ce0e7265b | |||
| f1704fd61a | |||
| 35e87128f5 | |||
| dd93f89931 | |||
| fb85612f81 | |||
| 966173c129 | |||
| 55757039fa | |||
| 1113e18c40 | |||
| 02947345e8 | |||
| 63f18f0b03 | |||
| cd6da987cc | |||
| 006d7ddd31 | |||
| 81842fc9d0 | |||
| ec9e0b2086 | |||
| 64b71644bb | |||
| 1e58b09d96 | |||
| 455136ee50 | |||
| 1058ba6a0f | |||
| f8c541c0d7 | |||
| b485e78030 | |||
| d8e7892081 | |||
| 1638c3b1c2 | |||
| 2d0e92d412 | |||
| f1a43f4977 | |||
| 18f7d0129a | |||
| 356ccd0314 | |||
| 4adf89b40b | |||
| eb4aded5d6 | |||
| 5230f45658 | |||
| b4e70e56a6 | |||
| cb3edf2607 | |||
| 720b26d11e | |||
| e35be13b23 | |||
| ba19d93df9 | |||
| 5d1dcb4387 | |||
| f101934909 | |||
| ede2575018 | |||
| fb80ee5a0e | |||
| 44fc69398c | |||
| c162337cab | |||
| 821faaf3c0 | |||
| bf85eb9b4e | |||
| 691c6614a8 | |||
| 6db7cb8937 | |||
| 6afc572eae | |||
| 2a932a2176 | |||
| b2bcde1bfc | |||
| ec6fd23636 | |||
| 6f34f95c52 | |||
| 94e5b36279 | |||
| f0ce4d6336 | |||
| d06b42b917 | |||
| 764986a9b0 | |||
| c4efa95b4a | |||
| 5a655779d7 | |||
| 0403437ad0 | |||
| b62f94f5c2 | |||
| daf09ed9fe | |||
| 72794f1416 | |||
| b00e20b23f | |||
| e99a2181ff | |||
| 65b38e8dcf | |||
| 9b8780a2fd | |||
| 9c0e4cae74 | |||
| deb387f54c | |||
| 5d5422b4c5 | |||
| 85b8dd8b34 | |||
| b93d34dff4 | |||
| e997a7db9a | |||
| d1a065119e | |||
| 1dab468e20 | |||
| c5cd0c73a3 | |||
| ae139403e4 | |||
| d3c9154f9a | |||
| caba60968a | |||
| 2e0def8670 | |||
| 8c3d16a395 | |||
| 3f48531da7 | |||
| 128cdca068 | |||
| bd997a3900 | |||
| 8e93eda449 | |||
| a6674ecd56 | |||
| 654651856f | |||
| c489659a20 | |||
| 18377e0c9f | |||
| cebba6c0b9 | |||
| 89f9bf545d | |||
| 055d36abd7 | |||
| 7bafc5fa8b | |||
| 6946c0bedb | |||
| bb40f86daa | |||
| 89d198659c | |||
| c56e540e5d | |||
| d3fd74246f | |||
| 616061a6ca | |||
| d94b8b9c0e | |||
| 89d39cf8ff | |||
| 0ba130dbd3 | |||
| 434935613c | |||
| 454585d3d2 | |||
| 65a6e341ad | |||
| fc933034db | |||
| 20c8b094d6 | |||
| 552ddfbdfa | |||
| 9743eec3ab | |||
| b3ad1dc26e | |||
| b6c9d4a88c | |||
| 25b6ac61cb |
+19
@@ -59,6 +59,16 @@ demos/**/*-bak
|
||||
demos/**/_autosave-*
|
||||
demos/**/fp-info-cache
|
||||
|
||||
# MacOS package info created by CMake
|
||||
bitmap2component/Info.plist
|
||||
cvpcb/Info.plist
|
||||
eeschema/Info.plist
|
||||
gerbview/Info.plist
|
||||
kicad/Info.plist
|
||||
pagelayout_editor/Info.plist
|
||||
pcb_calculator/Info.plist
|
||||
pcbnew/Info.plist
|
||||
|
||||
# editor/OS fluff
|
||||
.*.swp
|
||||
*~
|
||||
@@ -76,3 +86,12 @@ demos/**/fp-info-cache
|
||||
*.gch
|
||||
*.orig
|
||||
*.patch
|
||||
|
||||
# These CMake files are wanted
|
||||
!CMakeModules/*.cmake
|
||||
|
||||
# Eclipse IDE
|
||||
.project
|
||||
.cproject
|
||||
.pydevproject
|
||||
__pycache__
|
||||
|
||||
@@ -221,7 +221,7 @@ void DLG_SELECT_3DMODEL::OnFileActivated( wxTreeEvent& event )
|
||||
|
||||
void DLG_SELECT_3DMODEL::SetRootDir( wxCommandEvent& event )
|
||||
{
|
||||
if( m_FileTree )
|
||||
if( m_FileTree && dirChoices->GetSelection() > 0 )
|
||||
m_FileTree->SetPath( dirChoices->GetString( dirChoices->GetSelection() ) );
|
||||
|
||||
return;
|
||||
@@ -263,21 +263,31 @@ void DLG_SELECT_3DMODEL::updateDirChoiceList( void )
|
||||
|
||||
if( !cl.empty() )
|
||||
{
|
||||
unsigned int choice = 0;
|
||||
dirChoices->Clear();
|
||||
dirChoices->Append( "" ); //Insert a blank string at the beginning to allow selection
|
||||
|
||||
if( !prjDir.empty() )
|
||||
{
|
||||
dirChoices->Append( prjDir );
|
||||
|
||||
if( prjDir == m_FileTree->GetPath() )
|
||||
choice = 1;
|
||||
}
|
||||
|
||||
std::set< wxString >::const_iterator sI = cl.begin();
|
||||
std::set< wxString >::const_iterator eI = cl.end();
|
||||
|
||||
while( sI != eI )
|
||||
{
|
||||
if( *sI == m_FileTree->GetPath() )
|
||||
choice = dirChoices->GetCount();
|
||||
|
||||
dirChoices->Append( *sI );
|
||||
++sI;
|
||||
}
|
||||
|
||||
dirChoices->Select( 0 );
|
||||
dirChoices->Select( choice );
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -28,10 +28,11 @@
|
||||
*/
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <climits>
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include <climits>
|
||||
#include <thread>
|
||||
|
||||
#include "c3d_render_raytracing.h"
|
||||
#include "mortoncodes.h"
|
||||
@@ -2074,6 +2075,13 @@ bool C3D_RENDER_RAYTRACING::initializeOpenGL()
|
||||
}
|
||||
|
||||
|
||||
static float distance( const SFVEC2UI& a, const SFVEC2UI& b )
|
||||
{
|
||||
const float dx = (float) a.x - (float) b.x;
|
||||
const float dy = (float) a.y - (float) b.y;
|
||||
return hypotf( dx, dy );
|
||||
}
|
||||
|
||||
void C3D_RENDER_RAYTRACING::initialize_block_positions()
|
||||
{
|
||||
|
||||
@@ -2123,26 +2131,24 @@ void C3D_RENDER_RAYTRACING::initialize_block_positions()
|
||||
m_postshader_ssao.UpdateSize( m_realBufferSize );
|
||||
|
||||
|
||||
// Calc block positions
|
||||
// Calc block positions for regular rendering. Choose an 'inside out'
|
||||
// style of rendering
|
||||
// /////////////////////////////////////////////////////////////////////
|
||||
m_blockPositions.clear();
|
||||
m_blockPositions.reserve( (m_realBufferSize.x / RAYPACKET_DIM) *
|
||||
(m_realBufferSize.y / RAYPACKET_DIM) );
|
||||
const int blocks_x = m_realBufferSize.x / RAYPACKET_DIM;
|
||||
const int blocks_y = m_realBufferSize.y / RAYPACKET_DIM;
|
||||
m_blockPositions.reserve( blocks_x * blocks_y );
|
||||
|
||||
i = 0;
|
||||
for( int x = 0; x < blocks_x; ++x )
|
||||
for( int y = 0; y < blocks_y; ++y )
|
||||
m_blockPositions.push_back( SFVEC2UI( x * RAYPACKET_DIM, y * RAYPACKET_DIM ) );
|
||||
|
||||
while(1)
|
||||
{
|
||||
SFVEC2UI blockPos( DecodeMorton2X(i) * RAYPACKET_DIM,
|
||||
DecodeMorton2Y(i) * RAYPACKET_DIM );
|
||||
i++;
|
||||
|
||||
if( (blockPos.x >= m_realBufferSize.x) && (blockPos.y >= m_realBufferSize.y) )
|
||||
break;
|
||||
|
||||
if( (blockPos.x < m_realBufferSize.x) && (blockPos.y < m_realBufferSize.y) )
|
||||
m_blockPositions.push_back( blockPos );
|
||||
}
|
||||
const SFVEC2UI center( m_realBufferSize.x / 2, m_realBufferSize.y / 2 );
|
||||
std::sort( m_blockPositions.begin(), m_blockPositions.end(),
|
||||
[&]( const SFVEC2UI& a, const SFVEC2UI& b ) {
|
||||
// Sort order: inside out.
|
||||
return distance( a, center ) < distance( b, center );
|
||||
} );
|
||||
|
||||
// Create m_shader buffer
|
||||
delete[] m_shaderBuffer;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -310,7 +310,7 @@ void CCAMERA::MakeRay( const SFVEC2I &aWindowPos,
|
||||
|
||||
case PROJECTION_ORTHO:
|
||||
aOutOrigin = up_plus_right * 0.5f + m_frustum.nc;
|
||||
aOutDirection = -m_dir;
|
||||
aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -341,7 +341,7 @@ void CCAMERA::MakeRay( const SFVEC2F &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &
|
||||
|
||||
case PROJECTION_ORTHO:
|
||||
aOutOrigin = up_plus_right * 0.5f + m_frustum.nc;
|
||||
aOutDirection = -m_dir;
|
||||
aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,6 +166,8 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent,
|
||||
|
||||
m_canvas = NULL;
|
||||
m_disable_ray_tracing = false;
|
||||
m_mainToolBar = nullptr;
|
||||
m_AboutTitle = "3D Viewer";
|
||||
|
||||
// Give it an icon
|
||||
wxIcon icon;
|
||||
|
||||
+53
-20
@@ -102,28 +102,43 @@ option( KICAD_INSTALL_DEMOS
|
||||
"Install KiCad demos and examples (default ON)"
|
||||
ON )
|
||||
|
||||
option( KICAD_BUILD_QA_TESTS
|
||||
"Build software Quality assurance unit tests (default ON)"
|
||||
ON )
|
||||
|
||||
option( BUILD_GITHUB_PLUGIN
|
||||
"Build the GITHUB_PLUGIN for pcbnew."
|
||||
ON )
|
||||
|
||||
option( KICAD_SPICE
|
||||
"Build KiCad with internal Spice simulator."
|
||||
ON )
|
||||
|
||||
# when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
|
||||
# PYTHON_EXECUTABLE can be defined when invoking cmake
|
||||
# ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
|
||||
# when not defined by user, the default is python.exe under Windows and python2 for others
|
||||
# python binary file should be in exec path.
|
||||
|
||||
# KICAD_SCRIPTING_MODULES requires KICAD_SCRIPTING enable it here if KICAD_SCRIPTING_MODULES is ON
|
||||
if ( KICAD_SCRIPTING_MODULES AND NOT KICAD_SCRIPTING )
|
||||
message(STATUS "Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_MODULES")
|
||||
set ( KICAD_SCRIPTING ON )
|
||||
# KICAD_SCRIPTING controls the entire python scripting system. If it is off, no other scripting
|
||||
# functions are available.
|
||||
if ( NOT KICAD_SCRIPTING )
|
||||
message( STATUS "KICAD_SCRIPTING is OFF: Disabling all python scripting support" )
|
||||
set( KICAD_SCRIPTING_MODULES OFF )
|
||||
set( KICAD_SCRIPTING_ACTION_MENU OFF )
|
||||
set( KICAD_SCRIPTING_PYTHON3 OFF )
|
||||
set( KICAD_SCRIPTING_WXPYTHON OFF )
|
||||
set( KICAD_SCRIPTING_WXPYTHON_PHOENIX OFF)
|
||||
endif()
|
||||
|
||||
# same with KICAD_SCRIPTING_ACTION_MENUS
|
||||
if ( KICAD_SCRIPTING_ACTION_MENU AND NOT KICAD_SCRIPTING )
|
||||
message(STATUS "Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_ACTION_MENU")
|
||||
set ( KICAD_SCRIPTING ON )
|
||||
# KICAD_SCRIPTING_WXPYTHON_PHOENIX requires enabling the KICAD_SCRIPTING_WXPYTHON flag
|
||||
# so that the wxWidgets library is properly versioned
|
||||
if ( KICAD_SCRIPTING AND NOT KICAD_SCRIPTING_WXPYTHON AND KICAD_SCRIPTING_WXPYTHON_PHOENIX )
|
||||
message( STATUS
|
||||
"KICAD_SCRIPTING_WXPYTHON_PHOENIX has been requested, setting KICAD_SCRIPTING_WXPYTHON to ON")
|
||||
set( KICAD_SCRIPTING_WXPYTHON ON)
|
||||
endif()
|
||||
|
||||
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON )
|
||||
|
||||
option( KICAD_SPICE "Build KiCad with internal Spice simulator." ON )
|
||||
|
||||
# Global setting: exports are explicit
|
||||
set( CMAKE_CXX_VISIBILITY_PRESET "hidden" )
|
||||
set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
|
||||
@@ -655,8 +670,9 @@ set( INC_AFTER
|
||||
${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Find Python and other scripting resources
|
||||
#
|
||||
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
||||
|
||||
# SWIG 3.0 or later require for C++11 support.
|
||||
@@ -714,19 +730,36 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
||||
find_package( PythonLibs 2.6 REQUIRED )
|
||||
endif()
|
||||
|
||||
if( KICAD_SCRIPTING_WXPYTHON )
|
||||
find_package( wxPython REQUIRED )
|
||||
message( STATUS "Found ${WXPYTHON_FLAVOR} "
|
||||
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
|
||||
"(wxWidgets ${WXPYTHON_WXVERSION})" )
|
||||
endif()
|
||||
|
||||
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
|
||||
# although is used for all components, should be a harmless hit for something like eeschema
|
||||
# so long as unused search paths are at the end like this.
|
||||
set( INC_AFTER ${INC_AFTER} ${PYTHON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/scripting )
|
||||
endif()
|
||||
|
||||
# Find the wxPython installation if requested
|
||||
if( KICAD_SCRIPTING_WXPYTHON )
|
||||
find_package( wxPython REQUIRED )
|
||||
|
||||
if( KICAD_SCRIPTING_WXPYTHON_PHOENIX AND WXPYTHON_VERSION VERSION_LESS 4.0.0 )
|
||||
message( FATAL_ERROR
|
||||
"Unable to find wxPython Phoenix,"
|
||||
" instead found wxPython Classic ${WXPYTHON_VERSION}" )
|
||||
endif()
|
||||
|
||||
# The test VERSION_GREATER_EQUAL is only available in cmake >3.7, so use the max possible
|
||||
# version for the 3.0 line as the basis of the comparison
|
||||
if( NOT KICAD_SCRIPTING_WXPYTHON_PHOENIX AND WXPYTHON_VERSION VERSION_GREATER 3.9.999 )
|
||||
message( FATAL_ERROR
|
||||
"Unable to find wxPython Classic,"
|
||||
" instead found wxPython Phoenix ${WXPYTHON_VERSION}" )
|
||||
endif()
|
||||
|
||||
message( STATUS "Found ${WXPYTHON_FLAVOR} "
|
||||
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
|
||||
"(wxWidgets ${WXPYTHON_WXVERSION})" )
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# Find wxWidgets library, required
|
||||
#
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h
|
||||
PATHS ${NGSPICE_ROOT_DIR} $ENV{NGSPICE_ROOT_DIR} ${NGSPICE_INCLUDE_PATH}
|
||||
${NGSPICE_ROOT_DIR}/include
|
||||
PATH_SUFFIXES src/include share/ngspice/include share/ngspice/include/ngspice
|
||||
)
|
||||
|
||||
|
||||
@@ -25,9 +25,13 @@
|
||||
# Function make_lexer
|
||||
# is a standard way to invoke TokenList2DsnLexer.cmake.
|
||||
# Extra arguments are treated as source files which depend on the generated
|
||||
# outHeaderFile
|
||||
# files. Some detail here on the indirection:
|
||||
# - Parallel builds all depend on the same files, and CMake will generate the same file multiple times in the same location.
|
||||
# This can be problematic if the files are generated at the same time and overwrite each other.
|
||||
# - To fix this, we create a custom target (outputTarget) that the parallel builds depend on.
|
||||
# AND build dependencies. This creates the needed rebuild for appropriate source object changes.
|
||||
function( make_lexer outputTarget inputFile outHeaderFile outCppFile enum )
|
||||
|
||||
function( make_lexer inputFile outHeaderFile outCppFile enum )
|
||||
add_custom_command(
|
||||
OUTPUT ${outHeaderFile}
|
||||
${outCppFile}
|
||||
@@ -37,14 +41,17 @@ function( make_lexer inputFile outHeaderFile outCppFile enum )
|
||||
-DoutHeaderFile=${outHeaderFile}
|
||||
-DoutCppFile=${outCppFile}
|
||||
-P ${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake
|
||||
DEPENDS ${inputFile}
|
||||
${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake
|
||||
COMMENT "TokenList2DsnLexer.cmake creating:
|
||||
${outHeaderFile} and
|
||||
${outCppFile} from
|
||||
${inputFile}"
|
||||
)
|
||||
|
||||
add_custom_target( ${outputTarget}
|
||||
DEPENDS ${outHeaderFile} ${outCppFile}
|
||||
${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake
|
||||
)
|
||||
|
||||
# extra_args, if any, are treated as source files (typically headers) which
|
||||
# are known to depend on the generated outHeader.
|
||||
foreach( extra_arg ${ARGN} )
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
# be set after each version tag is added to the git repo. This will
|
||||
# give developers a reasonable idea where which branch was used to build
|
||||
# KiCad.
|
||||
set( KICAD_VERSION "5.1.2" )
|
||||
set( KICAD_VERSION "5.1.4" )
|
||||
|
||||
@@ -76,26 +76,38 @@ to "true" for the KiCad repo:
|
||||
git config kicad.check-format true
|
||||
|
||||
Without this config, the format checker will not run on commit, but you can
|
||||
still check files staged for commit manually:
|
||||
|
||||
tools/check_coding.sh --diff
|
||||
still check files staged for commit manually (see below).
|
||||
|
||||
If the hook is enabled, when you commit a change, you will be told if you
|
||||
have caused any style violations (only in your changed code). You can fix your
|
||||
staged changes automatically with this tool:
|
||||
have caused any style violations (only in your changed code). You can then fix
|
||||
the errors, either manually, or with the tools below.
|
||||
|
||||
tools/check_coding.sh
|
||||
|
||||
Or you can proceed anyway, if you are sure your style is correct:
|
||||
If you are warned about formatting errors, but you are sure your style is correct,
|
||||
you can still commit:
|
||||
|
||||
git commit --no-verify
|
||||
|
||||
The `check_coding.sh` tool has other modes:
|
||||
### Correcting Formatting Errors ## {#correcting-formatting-errors}
|
||||
|
||||
* Make (or see only) changes to files modified in the previous commit:
|
||||
There is a Git aliases file that provides the right commands to show and correct
|
||||
formatting errors. Add to your repository config by running this command from
|
||||
the source directory:
|
||||
|
||||
git config --add include.path $(pwd)/helpers/git/format_alias
|
||||
|
||||
Then you can use the following aliases:
|
||||
|
||||
* `git check-format`: show any formatting warnings (but make no changes)
|
||||
* `git fix-format`: correct formatting (you will need to `git add` afterwards)
|
||||
|
||||
These aliases use a script, `tools/check-coding.sh`, which takes care of only
|
||||
checking the formatting for files that should be formatted. This script has
|
||||
other uses:
|
||||
|
||||
* Make (or see only) violations in files modified in the previous commit (useful
|
||||
when interactive-rebasing):
|
||||
* `check_coding.sh --amend [--diff]`
|
||||
|
||||
|
||||
# 2. Naming Conventions # {#naming_conventions}
|
||||
Before delving into anything as esoteric as indentation and formatting,
|
||||
naming conventions need to be addressed. This section does not attempt
|
||||
@@ -467,6 +479,20 @@ The case statement is to be indented to the same level as the switch.
|
||||
}
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
It is permitted to place all cases on a single line each, if that makes the
|
||||
code more readable. This is often done for look-ups or translation functions. In
|
||||
this case, you will have to manually align for readability as appropriate and
|
||||
reject clang-format's suggested changes, if you use it:
|
||||
|
||||
~~~~~~~~~~~~~{.cpp}
|
||||
switch( m_orientation )
|
||||
{
|
||||
case PIN_RIGHT: m_orientation = PIN_UP; break;
|
||||
case PIN_UP: m_orientation = PIN_LEFT; break;
|
||||
case PIN_LEFT: m_orientation = PIN_DOWN; break;
|
||||
case PIN_DOWN: m_orientation = PIN_RIGHT; break;
|
||||
}
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
# 5. License Statement # {#license_statement}
|
||||
There is a the file copyright.h which you can copy into the top of
|
||||
@@ -835,6 +861,6 @@ learn something new.
|
||||
|
||||
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
|
||||
[cppstandard]:http://www.possibility.com/Cpp/CppCodingStandard.html
|
||||
[kernel]:http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/CodingStyle
|
||||
[kernel]:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/process/coding-style.rst
|
||||
[overloading]:http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.html
|
||||
[style]:http://en.wikipedia.org/wiki/Programming_style
|
||||
|
||||
@@ -149,27 +149,40 @@ on macOS. This is enabled on macOS by default and disabled on all other platfor
|
||||
## Scripting Support ## {#scripting_opt}
|
||||
|
||||
The KICAD_SCRIPTING option is used to enable building the Python scripting support into Pcbnew.
|
||||
This options is enabled by default.
|
||||
This options is enabled by default, and will disable all other KICAD_SCRIPTING_* options when
|
||||
it is disabled.
|
||||
|
||||
## Python 3 Scripting Support ## {#python3}
|
||||
|
||||
The KICAD_SCRIPTING_PYTHON3 option is used to enable using Python 3 for the scripting support
|
||||
instead of Python 2. This option is disabled by default and only is relevant if
|
||||
[KICAD_SCRIPTING](#scripting_opt) is enabled.
|
||||
|
||||
## Scripting Module Support ## {#scripting_mod_opt}
|
||||
|
||||
The KICAD_SCRIPTING_MODULES option is used to enable building and installing the Python modules
|
||||
supplied by KiCad. This option is enabled by default.
|
||||
|
||||
## Python 3 Scripting Support ## {#python3}
|
||||
|
||||
The KICAD_SCRIPTING_PYTHON3 option is used to enable building of the Python 3 interface instead
|
||||
of Python 2. This option is disabled by default.
|
||||
supplied by KiCad. This option is enabled by default, but will be disabled if
|
||||
[KICAD_SCRIPTING](#scripting_opt) is disabled.
|
||||
|
||||
## wxPython Scripting Support ## {#wxpython_opt}
|
||||
|
||||
The KICAD_SCRIPTING_WXPYTHON option is used to enable building the wxPython interface into
|
||||
Pcbnew including the wxPython console. This option is enabled by default.
|
||||
Pcbnew including the wxPython console. This option is enabled by default, but will be disabled if
|
||||
[KICAD_SCRIPTING](#scripting_opt) is disabled.
|
||||
|
||||
## wxPython Phoenix Scripting Support ## {#wxpython_phoenix}
|
||||
|
||||
The KICAD_SCRIPTING_WXPYTHON_PHOENIX option is used to enable building the wxPython interface with
|
||||
the new Phoenix binding instead of the legacy one. This option is disabled by default.
|
||||
the new Phoenix binding instead of the legacy one. This option is disabled by default, and
|
||||
enabling it requires [KICAD_SCRIPTING](#scripting_opt) to be enabled.
|
||||
|
||||
## Python Scripting Action Menu Support ## {#python_action_menu_opt}
|
||||
|
||||
The KICAD_SCRIPTING_ACTION_MENU option allows Python scripts to be added directly to the Pcbnew
|
||||
menu. This option is enabled by default, but will be disabled if
|
||||
[KICAD_SCRIPTING](#scripting_opt) is disabled. Please note that this option is highly
|
||||
experimental and can cause Pcbnew to crash if Python scripts create an invalid object state
|
||||
within Pcbnew.
|
||||
|
||||
## GitHub Plugin ## {#github_opt}
|
||||
|
||||
@@ -336,6 +349,12 @@ configure pacman to prevent upgrading the 64-bit Boost package by adding:
|
||||
|
||||
to your /etc/pacman.conf file.
|
||||
|
||||
### Building with Boost 1.70 ### {#ki_msys2_boost_1_70}
|
||||
|
||||
There is an issue building KiCad with Boost version 1.70 due to CMake not defining the proper
|
||||
link libraries during configuration. Boost 1.70 can be used but `-DBoost_NO_BOOST_CMAKE=ON`
|
||||
needs to be added during CMake configuration to insure the link libraries are properly generated.
|
||||
|
||||
### Building OCE from source
|
||||
|
||||
KiCad requires OCE by default, and the version installed by `pacman` can cause build errors in
|
||||
|
||||
@@ -1,461 +0,0 @@
|
||||
# Version 5 Road Map # {#v5_road_map}
|
||||
|
||||
This document is the KiCad version 5 Developer's road map document. It is
|
||||
living document that should be maintained during the version 5 development
|
||||
cycle. The goal of this document is to provide an overview for developers
|
||||
of the goals for the project for the version 5 release of KiCad. It is
|
||||
broken into sections for each major component of the KiCad source code and
|
||||
documentation. It defines tasks that developers an use to contribute to the
|
||||
project and provides updated status information. Tasks should define clear
|
||||
objectives and avoid vague generalizations so that a new developer can complete
|
||||
the task. It is not a place for developers to add their own personal wish.
|
||||
list. It should only be updated with approval of the project manager after
|
||||
discussion with the lead developers.
|
||||
|
||||
Each entry in the road map is made up of four sections. The goal should
|
||||
be a brief description of the what the road map entry will accomplish. The
|
||||
task section should be a list of deliverable items that are specific enough
|
||||
hat they can be documented as completed. The dependencies sections is a list
|
||||
of requirements that must be completed before work can begin on any of the
|
||||
tasks. The status section should include a list of completed tasks or marked
|
||||
as complete as when the goal is met.
|
||||
|
||||
[TOC]
|
||||
|
||||
# Project # {#v5_project}
|
||||
This section defines the tasks for the project related goals that are not
|
||||
related to coding or documentation. It is a catch all for issues such as
|
||||
developer and user relations, dissemination of information on websites,
|
||||
policies, etc.
|
||||
|
||||
|
||||
# General # {#v5_general}
|
||||
This section defines the tasks that affect all or most of KiCad or do not
|
||||
fit under as specific part of the code such as the board editor or the
|
||||
schematic editor.
|
||||
|
||||
## Search Tree Control ## {#v5_re_search_control}
|
||||
|
||||
**Goal:**
|
||||
Create a user interface element that allows searching through a list of
|
||||
items in a tree control for library searching.
|
||||
|
||||
**Task:**
|
||||
- Create hybrid tree control with search text control for displaying filtered
|
||||
objects (both symbol and footprint libraries) in a parent window.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- Initial container searching code completed.
|
||||
- Wildcard and regular expression container searching completed.
|
||||
- Control code in progress.
|
||||
|
||||
# Common Library # {#v5_common_lib}
|
||||
This section covers the source code shared between all of the KiCad
|
||||
applications
|
||||
|
||||
## Unified Rendering Framework ## {#v5_unified_rendering}
|
||||
**Goal:**
|
||||
|
||||
Provide a single framework for developing new tools. Port existing tools
|
||||
to the new framework and remove the legacy framework tools.
|
||||
|
||||
**Task:**
|
||||
- Port wxDC to GAL or get Cairo rendering to nearly the performance of the
|
||||
current wxDC rendering so that we have a single framework to develop new
|
||||
tools and we can continue to support systems that don't have a complete
|
||||
OpenGL stack.
|
||||
|
||||
**Dependencies**
|
||||
- [Tool framework](http://www.ohwr.org/projects/cern-kicad/wiki/WorkPackages)
|
||||
|
||||
**Status**
|
||||
- In progress
|
||||
|
||||
## Printing Improvements ## {#v5_print}
|
||||
**Goal:**
|
||||
|
||||
Make printing quality consistent across platforms.
|
||||
|
||||
**Task:**
|
||||
- Resolve printing issues on all platforms.
|
||||
|
||||
**Dependencies**
|
||||
- None
|
||||
|
||||
**Status**
|
||||
- No progress.
|
||||
|
||||
## Object Properties and Introspection ## {#v5_object_props}
|
||||
**Goal:**
|
||||
|
||||
Provide an object introspection system using properties.
|
||||
|
||||
**Task:**
|
||||
- Select existing or develop property system.
|
||||
- Add definable properties to base objects.
|
||||
- Create introspection framework for manipulating object properties.
|
||||
- Serialization of properties to and from files and/or other I/O structures.
|
||||
- Create tool to edit property namespace/object name/name/type/value table.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## 3D Viewer Dynamic Library Plugin ## {#v5_plugin_base}
|
||||
**Goal:**
|
||||
|
||||
Create a base library plugin for handling external file I/O for the 3D viewer.
|
||||
This will allow plugins to be provided that are external to the project such
|
||||
as providing solid model file support (STEP, IGES, etc.) using OpenCascade
|
||||
without making it a project dependency.
|
||||
|
||||
**Task:**
|
||||
- Create a plugin to handle dynamically registered plugins for loading and
|
||||
saving file formats.
|
||||
- This object should be flexible enough to be extended for handling all file
|
||||
plugin types including schematic, board, footprint library, component
|
||||
library, etc. (optional)
|
||||
- See [blueprint](https://blueprints.launchpad.net/kicad/+spec/pluggable-file-io)
|
||||
on Launchpad for more information.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- 3D plugin code complete and legacy formats implemented.
|
||||
|
||||
|
||||
# Eeschema: Schematic Editor # {#v5_eeschema}
|
||||
This section applies to the source code for the Eeschema schematic editor.
|
||||
|
||||
## Coherent SCHEMATIC Object ## {#v5_sch_object}
|
||||
**Goal:**
|
||||
|
||||
Clean up the code related to the schematic object(s) into a coherent object for
|
||||
managing and manipulating the schematic that can be used by third party tools
|
||||
and Python scripting.
|
||||
|
||||
**Task:**
|
||||
- Move handling of root sheet object to SCHEMATIC object.
|
||||
- Move SCH_SCREENS code into SCH_OBJECT.
|
||||
- Build and maintain schematic hierarchy in SCHEMATIC object rather than
|
||||
recreating on the fly every time the hierarchical information is required.
|
||||
- Optionally build and maintain netlist during editing for extended editing
|
||||
features.
|
||||
- Add any missing functionality to the SCHEMATIC object.
|
||||
|
||||
**Dependencies:**
|
||||
- [Schematic and Component Library Plugin](#v5_sch_plugin)
|
||||
|
||||
**Status:**
|
||||
- In progress.
|
||||
|
||||
## Schematic and Component Library I/O Manager Plugin ## {#v5_sch_plugin}
|
||||
**Goal:**
|
||||
Create a plugin manager for loading and saving schematics and component
|
||||
libraries similar to the board plugin manager.
|
||||
|
||||
**Task:**
|
||||
- Design plugin manager for schematics and component libraries.
|
||||
- Port the current schematic and component library file formats to use the
|
||||
plugin.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- I/O manager and plugin objects are complete.
|
||||
- Legacy schematic file parser almost ready to commit.
|
||||
|
||||
|
||||
## S-Expression File Format ## {#v5_sch_sexpr}
|
||||
**Goal:**
|
||||
|
||||
Make schematic file format more readable, add new features, and take advantage
|
||||
of the s-expression parser and formatter capability used in Pcbnew.
|
||||
|
||||
**Task:**
|
||||
- Finalize feature set and file format.
|
||||
- Discuss the possibility of dropping the unit-less proposal temporarily to get
|
||||
the s-expression file format and SWEET library format implemented without
|
||||
completely rewriting Eeschema.
|
||||
- Add new s-expression file format to plugin.
|
||||
|
||||
**Dependencies:**
|
||||
- [Schematic and component I/O manager plugin](#v5_sch_plugin)
|
||||
|
||||
**Status:**
|
||||
- File format document nearly complete.
|
||||
|
||||
## Implement Sweet Component Libraries ## {#v5_sch_sweet}
|
||||
**Goal:**
|
||||
|
||||
Make component library design more robust and feature rich. Use s-expressions
|
||||
to make component library files more readable.
|
||||
|
||||
**Task:**
|
||||
- Use sweet component file format for component libraries.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-expression file format](#v5_sch_sexpr).
|
||||
[Schematic and component I/O manager plugin](#v5_sch_plugin)
|
||||
|
||||
**Status:**
|
||||
- Initial SWEET library file format document written.
|
||||
|
||||
## Component Library Editor Usability Improvements ## {#v5_lib_editor_usability}
|
||||
**Goal:**
|
||||
|
||||
Make editing schematic symbol libraries easier to manage.
|
||||
|
||||
**Task:**
|
||||
- Determine usability improvements in the library editor for components with
|
||||
multiple units and/or alternate graphical representations.
|
||||
- Replace current library/symbols selection process with new hybrid tree search
|
||||
widget in new window pain for selection libraries and symbols. Provide drag
|
||||
and drop symbol copy/move between libraries.
|
||||
- Allow editing of symbol libraries not defined in footprint library table(s)
|
||||
using the file/path dialog to open a library.
|
||||
|
||||
**Dependencies:**
|
||||
- [Search Tree Control](#v5_re_search_control)
|
||||
|
||||
**Status:**
|
||||
- Determined alternate UI designs using new hybrid search tree control.
|
||||
|
||||
## Component and Netlist Attributes ## {#v5_netlist_attributes}
|
||||
**Goal:**
|
||||
|
||||
Provide a method of passing information to other tools via the net list.
|
||||
|
||||
**Task:**
|
||||
- Add virtual components and attributes to netlist to define properties that
|
||||
can be used by other tools besides the board editor.
|
||||
- Attributes (properties) are automatically included as part of the new file
|
||||
format.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-expression schematic file format](#v5_sch_sexpr).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
|
||||
# Circuit Simulation # {#simulation}
|
||||
**Goal:**
|
||||
|
||||
Provide quality circuit simulation capabilities similar to commercial products.
|
||||
|
||||
**Task:**
|
||||
- Evaluate and select simulation library (ngspice, gnucap, qucs, etc).
|
||||
- Evaluate and select plotting library with wxWidgets support.
|
||||
- Confirm current spice netlist export is up to the task and add missing
|
||||
support for simulations.
|
||||
- Use plotting library to handle simulator output in a consistent manor similar
|
||||
to LTSpice.
|
||||
- Develop a tool that allows fine tuning of components on the fly.
|
||||
- Use plugin for the simulation code to allow support of different simulation
|
||||
libraries.
|
||||
- Create dialogs for configuring of simulation of Spice primitive components
|
||||
such as voltage sources, current sources, etc.
|
||||
- Create dialog(s) for configuration of simulation types transient, DC operating
|
||||
point, AC analysis, etc.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- Complete ([announcement message](https://lists.launchpad.net/kicad-developers/msg25483.html))
|
||||
|
||||
|
||||
# Pcbnew: Circuit Board Editor # {#v5_pcbnew}
|
||||
This section covers the source code of the board editing application Pcbnew.
|
||||
|
||||
## Tool Framework ## {#v5_pcb_tool_framework}
|
||||
**Goal:**
|
||||
|
||||
Unify all board editing tools under a single framework.
|
||||
|
||||
**Task:**
|
||||
- Drop footprint edit mode.
|
||||
- Port auto-router to GAL.
|
||||
- Complete porting of all board editing tools to new tool framework so they
|
||||
are available in the OpenGL and Cairo canvases.
|
||||
- Remove all duplicate legacy editing tools.
|
||||
|
||||
**Dependencies:**
|
||||
- In progress.
|
||||
|
||||
**Status:**
|
||||
- Initial porting work in progress.
|
||||
|
||||
## Modeling ## {#v5_modeling}
|
||||
|
||||
**Goal:**
|
||||
|
||||
Provide improved solid modeling support for KiCad including the file formats
|
||||
available in OpenCascade.
|
||||
|
||||
**Task:**
|
||||
- Improve low level code design.
|
||||
- Design plugin architecture to handle loading and saving 3D models.
|
||||
- Back port existing 3D formats (IDF and S3D) to plugin
|
||||
|
||||
**Dependencies:**
|
||||
- [Dynamic library plugin](#v5_plugin_base).
|
||||
|
||||
**Status:**
|
||||
- Completed.
|
||||
|
||||
## Push and Shove Router Improvements ## {#v5_ps_router_improvements}
|
||||
|
||||
**Goal:**
|
||||
|
||||
Add finishing touches to push and shove router.
|
||||
|
||||
**Task:**
|
||||
- Determine which features are feasible.
|
||||
- Factor out KiCad-specific code from PNS_ROUTER class.
|
||||
- Delete and backspace in idle mode
|
||||
- Differential pair clearance fixes.
|
||||
- Differential pair optimizer improvements (recognize differential pairs)
|
||||
- Persistent differential pair gap/width setting.
|
||||
- Walk around in drag mode.
|
||||
- Optimize trace being dragged too. (currently no optimization)
|
||||
- Backspace to erase last routed segment.
|
||||
- Auto-finish traces (if time permits)
|
||||
- Additional optimization pass for spring back algorithm using area-minimization
|
||||
strategy. (improves tightness of routing)
|
||||
- Restrict optimization area to view port (if user wants to)
|
||||
- Support 45 degree tuning meanders.
|
||||
- Respect trace/via locking!
|
||||
- Keep out zone support.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- Feature feasibility determined.
|
||||
- In Progress.
|
||||
|
||||
## Selection Filtering ## {#v5_pcb_selection_filtering}
|
||||
**Goal:**
|
||||
|
||||
Make the selection tool easier for the user to determine which object(s) are
|
||||
being selected by filtering.
|
||||
|
||||
**Task:**
|
||||
- Provide filtered object selection by adding a third tab to the layer manager
|
||||
or possibly some other UI element to provide filtered selection options.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- Initial design concept discussed.
|
||||
|
||||
## Segment End Point Snapping. ## {#v5_segment_snapping}
|
||||
**Goal:**
|
||||
|
||||
It is not uncommon for board edge segment end points to inadvertently not
|
||||
be closed causing issues for the 3D viewer and exporting to different file
|
||||
formats due the board outline not being a fully enclosed polygon. This
|
||||
feature would add segment end snapping support to allow the board outline
|
||||
to be fully enclosed. This feature would only need to be supported by the
|
||||
GAL rendering.
|
||||
|
||||
**Tasks**
|
||||
- Mark board edge segment ends with a drag indicator to make it visible to the
|
||||
user that the segment end does not have an endpoint with any other board edge
|
||||
segment.
|
||||
- Allow the user to snap the unconnected segment end to the nearest segment end
|
||||
point.
|
||||
- Automatically connect unconnected segments with and additional segment when
|
||||
opening the 3D viewer or exporting the board to another format. Warn the
|
||||
user that an addition segment has be added and should be verified.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Progress:**
|
||||
- Initial discussion.
|
||||
|
||||
## Stitching Via Support ## {#v5_pcb_stitching_vias}
|
||||
**Goal:**
|
||||
|
||||
Add capability to add vias for stitching and thermal transfer purposes
|
||||
that do not require being attached to tracks.
|
||||
|
||||
**Task:**
|
||||
- Develop more robust connectivity checking algorithm.
|
||||
- Create a UI element to allow the user to select a net from the list of
|
||||
valid nets.
|
||||
- Connection propagation fix for the current issue of vias that are not
|
||||
connected to tracks being tagged as unassigned and removed.
|
||||
- Manual via placement tool.
|
||||
- Improve the DRC to handle cases of orphaned vias.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Progress:**
|
||||
- Patch available to fix via propagation issue.
|
||||
|
||||
|
||||
# Documentation # {#v5_documentation}
|
||||
This section defines the tasks for both the user and developer documentation.
|
||||
|
||||
## Grammar Check ## {#v5_doc_grammar}
|
||||
**Goal:**
|
||||
|
||||
Improve user documentation readability and make life easier to for translators.
|
||||
|
||||
**Task:**
|
||||
- Review and revise all of the English documentation so that it is update with
|
||||
the current functionality of the code.
|
||||
- Translate the update documentation into other languages.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Maintenance ## {#v5_doc_maintenance}
|
||||
**Task:**
|
||||
- Keep screen shots current with the source changes.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Convert Developer Documentation to Markup/down Format ## {#v5_dev_doc_format}
|
||||
**Goal:**
|
||||
|
||||
Improve developers documentation to make life easier for new developers to get
|
||||
involved with the project.
|
||||
|
||||
**Task:**
|
||||
- Convert platform build instructions from plain text to new format to be
|
||||
merged with the developer documentation.
|
||||
- Convert how to contribute to KiCad instructions from plain text to the new
|
||||
format to merged with the developer documentation.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- In progress. Most of the developer documentation has been converted to
|
||||
[Doxygen markdown](http://www.doxygen.nl/manual/markdown.html)
|
||||
and the [output][kicad-docs] is rebuilt automatically when a commit is
|
||||
made to the KiCad repo.
|
||||
|
||||
[kicad-website]:http://kicad-pcb.org/
|
||||
[kicad-docs]:http://ci.kicad-pcb.org/job/kicad-doxygen/ws/Documentation/doxygen/html/index.html
|
||||
@@ -54,10 +54,84 @@ Create perspectives to allow users to arrange dockable windows as they prefer.
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Object Properties and Introspection ## {#v6_object_props}
|
||||
**Goal:**
|
||||
|
||||
Provide an object introspection system using properties.
|
||||
|
||||
**Task:**
|
||||
- Select existing or develop property system.
|
||||
- Add definable properties to base objects.
|
||||
- Create introspection framework for manipulating object properties.
|
||||
- Serialization of properties to and from files and/or other I/O structures.
|
||||
- Create tool to edit property namespace/object name/name/type/value table.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- In progress.
|
||||
|
||||
|
||||
# Eeschema: Schematic Editor # {#v6_eeschema}
|
||||
This section applies to the source code for the Eeschema schematic editor.
|
||||
|
||||
## Coherent SCHEMATIC Object ## {#v6_sch_object}
|
||||
**Goal:**
|
||||
|
||||
Clean up the code related to the schematic object(s) into a coherent object for
|
||||
managing and manipulating the schematic that can be used by third party tools
|
||||
and Python scripting.
|
||||
|
||||
**Task:**
|
||||
- Move handling of root sheet object to SCHEMATIC object.
|
||||
- Move SCH_SCREENS code into SCH_OBJECT.
|
||||
- Build and maintain schematic hierarchy in SCHEMATIC object rather than
|
||||
recreating on the fly every time the hierarchical information is required.
|
||||
- Optionally build and maintain netlist during editing for extended editing
|
||||
features.
|
||||
- Add any missing functionality to the SCHEMATIC object.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- In progress.
|
||||
|
||||
## Implement Sweet (S-Expression) Symbol Libraries ## {#v6_sch_sweet}
|
||||
**Goal:**
|
||||
|
||||
Make symbol library design more robust and feature rich. Use s-expressions
|
||||
to make component library files more readable.
|
||||
|
||||
**Task:**
|
||||
- Use sweet component file format for component libraries.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- Initial SWEET library file format document written.
|
||||
|
||||
## S-Expression File Format ## {#v6_sch_sexpr}
|
||||
**Goal:**
|
||||
|
||||
Make schematic file format more readable, add new features, and take advantage
|
||||
of the s-expression parser and formatter capability used in Pcbnew.
|
||||
|
||||
**Task:**
|
||||
- Finalize feature set and file format.
|
||||
- Discuss the possibility of dropping the unit-less proposal temporarily to get
|
||||
the s-expression file format and SWEET library format implemented without
|
||||
completely rewriting Eeschema.
|
||||
- Add new s-expression file format to plugin.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-expression file format](#v6_sch_sweet).
|
||||
|
||||
**Status:**
|
||||
- File format document initial draft complete.
|
||||
|
||||
## Move Common Schematic Code into a Shared Object ## {#v6_sch_shared_object}
|
||||
**Goal:**
|
||||
|
||||
@@ -93,37 +167,22 @@ Improve the coverage and usability of the electrical rules checker (ERC).
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Implement GAL and New Tool Framework ## {#v6_sch_gal}
|
||||
**Goal:**
|
||||
|
||||
Implement the GAL and the tool framework used by Pcbnew in Eechema to
|
||||
provide advanced graphics and tool capabilities.
|
||||
|
||||
**Task:**
|
||||
- Implement graphics abstraction layer along side current legacy rendering
|
||||
framework.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- Initial Discussion..
|
||||
|
||||
## Port Editing Tools ## {#v6_sch_tool_framework}
|
||||
## Port Editing Tools to New Tool Framework ## {#v6_sch_tool_framework}
|
||||
**Goal:**
|
||||
|
||||
Convert all editing tool to new tool framework.
|
||||
|
||||
-**Task:**
|
||||
**Task:**
|
||||
- Rewrite existing editing tools using the new tool framework.
|
||||
- Add new capabilities supported by the new tool framework to existing
|
||||
editing tools.
|
||||
- Remove legacy tool framework.
|
||||
|
||||
-**Dependencies:**
|
||||
- [GAL and new tool framework port](#v6_sch_gal).
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
-**Status:**
|
||||
- Initial Discussion..
|
||||
**Status:**
|
||||
- Schematic editor complete.
|
||||
|
||||
## Net Highlighting ## {#v6_sch_net_highlight}
|
||||
**Goal:**
|
||||
@@ -134,28 +193,11 @@ Highlight wires, buses, and junctions when corresponding net in Pcbnew is select
|
||||
- Implement highlight algorithm for net objects.
|
||||
- Highlight objects connected to net selected in Pcbnew.
|
||||
|
||||
**Dependencies:**
|
||||
- [GAL and new tool framework port, maybe](#v6_sch_gal).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Component Library Editor Improvements ## {#lib_editor_usability}
|
||||
**Goal:**
|
||||
|
||||
Make editing components with multiple units and/or alternate graphical
|
||||
representations easier.
|
||||
|
||||
**Task:**
|
||||
- Determine usability improvements in the library editor for components with
|
||||
multiple units and/or alternate graphical representations.
|
||||
- Implement said usability improvements.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
- Complete.
|
||||
|
||||
## Allow Use of System Fonts ## {#v6_sch_sys_fonts}
|
||||
**Goal:**
|
||||
@@ -170,33 +212,112 @@ for schematic text.
|
||||
- Add support for selecting text object fonts.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-expression schematic file format](#sch_sexpr).
|
||||
- [S-expression schematic file format](#v6_sch_sexpr).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Symbol and Netlist Attributes ## {#v6_netlist_attributes}
|
||||
**Goal:**
|
||||
|
||||
Provide a method of passing information to other tools via the net list.
|
||||
|
||||
**Task:**
|
||||
- Add virtual components and attributes to netlist to define properties that
|
||||
can be used by other tools besides the board editor.
|
||||
- Attributes (properties) are automatically included as part of the new file
|
||||
format.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-expression schematic file format](#v6_sch_sexpr).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Orthogonal Wire Drag ## {#v6_orthogonal_drag}
|
||||
**Goal:**
|
||||
|
||||
Keep wires and buses orthogonal when dragging a symbol.
|
||||
|
||||
**Task:**
|
||||
- Add code to new tool framework to allow for orthogonal dragging of symbols.
|
||||
|
||||
**Dependencies:**
|
||||
- [New tool framework](#v6_sch_tool_framework).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Custom Wire and Bus Attributes ## {#v6_sch_bus_wire_attr}
|
||||
**Goal:**
|
||||
|
||||
Allow for wires and buses to have different widths, colors, and line types.
|
||||
|
||||
**Task:**
|
||||
- Add code to support custom wire and bus attributes.
|
||||
- Add user interface element to support changing wire and bus attributes.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-Expression File Format](#v6_sch_sexpr).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Connectivity Improvements ## {#v6_sch_connectivity}
|
||||
**Goal:**
|
||||
|
||||
Support structured buses, real time netlist calculations, and other
|
||||
connectivity improvements.
|
||||
|
||||
**Task:**
|
||||
- Keep netlist up to date real time.
|
||||
- Add support for structured bus definitions.
|
||||
- Possible real time ERC checking.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Real time netlist and structured bus support complete.
|
||||
|
||||
## ERC Improvements ## {#v6_sch_erc}
|
||||
**Goal:**
|
||||
|
||||
Improve ERC test coverage and other ERC usability features.
|
||||
|
||||
**Task:**
|
||||
- Add missing ERC tests to improve coverage.
|
||||
- Save ERC settings in project file.
|
||||
- Add mechanism to allow import and export of ERC settings.
|
||||
- ERC user interface improvements.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Preliminary specification draft complete.
|
||||
|
||||
## Python Support ## {#v6_sch_python}
|
||||
**Goal:**
|
||||
|
||||
SWIG all schematic low level objects and coherent schematic object to
|
||||
provide Python interface for manipulating schematic objects.
|
||||
|
||||
**Task:**-
|
||||
- Create SWIG wrappers for all low level schematic, symbol library, and
|
||||
coherent schematic object code.
|
||||
- Add Python interpreter launcher.
|
||||
|
||||
**Dependencies:**
|
||||
- [Coherent Schematic Object](#v6_sch_object).
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
|
||||
# CvPcb: Footprint Association Tool # {#v6_cvpcb}
|
||||
This section covers the source code of the footprint assignment tool CvPcb.
|
||||
|
||||
## Improved Footprint Search Tool ## {#v6_cvpcb_search}
|
||||
|
||||
**Goal:**
|
||||
|
||||
Provide advanced search features such as wild card and regular expression
|
||||
searches using the type as you go feature of the current search dialog.
|
||||
|
||||
**Task:**
|
||||
- Add code for wild card and regular expression pattern matching to search
|
||||
container objects.
|
||||
- Add search dialog to CvPcb to search container of footprint names.
|
||||
|
||||
**Dependencies:**
|
||||
- [Search Tree Control](#v6_re_search_control)
|
||||
|
||||
**Status:**
|
||||
- Pattern matching added to search container objects.
|
||||
|
||||
|
||||
# Pcbnew: Circuit Board Editor # {#v6_pcbnew}
|
||||
This section covers the source code of the board editing application Pcbnew.
|
||||
@@ -208,14 +329,45 @@ This section covers the source code of the board editing application Pcbnew.
|
||||
Add finishing touches to push and shove router.
|
||||
|
||||
**Task:**
|
||||
- Microwave tools to be added as parametrized shapes generated by Python
|
||||
- Delete and backspace in idle mode
|
||||
- Differential pair clearance fixes.
|
||||
- Differential pair optimizer improvements (recognize differential pairs)
|
||||
- Persistent differential pair gap/width setting.
|
||||
- Walk around in drag mode.
|
||||
- Optimize trace being dragged too. (currently no optimization)
|
||||
- Auto-finish traces (if time permits)
|
||||
- Additional optimization pass for spring back algorithm using area-minimization
|
||||
strategy. (improves tightness of routing)
|
||||
- Restrict optimization area to view port (if user wants to)
|
||||
- Support 45 degree tuning meanders.
|
||||
- Respect trace/via locking!
|
||||
- Keep out zone support.
|
||||
- Microwave tools to be added as parameterized shapes generated by Python
|
||||
scripts.
|
||||
- BGA fan out support.
|
||||
- Drag footprints with traces connected.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- In progress.
|
||||
|
||||
## Selection Filtering ## {#v6_pcb_selection_filtering}
|
||||
**Goal:**
|
||||
|
||||
Make the selection tool easier for the user to determine which object(s) are
|
||||
being selected by filtering.
|
||||
|
||||
**Task:**
|
||||
- Provide filtered object selection by adding a third tab to the layer manager
|
||||
or possibly some other UI element to provide filtered selection options.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- None
|
||||
- In progress.
|
||||
|
||||
## Design Rule Check (DRC) Improvements. ## {#v6_drc_improvements}
|
||||
**Goal:**
|
||||
@@ -223,7 +375,6 @@ Add finishing touches to push and shove router.
|
||||
Create additional DRC tests for improved error checking.
|
||||
|
||||
**Task:**
|
||||
- Replace geometry code with [unified geometry library](#v6_geometry_lib).
|
||||
- Remove floating point code from clearance calculations to prevent rounding
|
||||
errors.
|
||||
- Add checks for component, silk screen, and mask clearances.
|
||||
@@ -232,7 +383,7 @@ Create additional DRC tests for improved error checking.
|
||||
- Add option for saving and loading DRC options.
|
||||
|
||||
**Dependencies:**
|
||||
- [Unified geometry library.](#v6_geometry_lib)
|
||||
- [Constraint Management System](#v6_pcb_constraint).
|
||||
|
||||
**Progress:**
|
||||
- In progress.
|
||||
@@ -273,7 +424,7 @@ does not have to do it in Eeschema and re-import the net list.
|
||||
- Add support to handle net label back annotation changes.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
- [S-Expression File Format](#v6_sch_sexpr).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
@@ -292,7 +443,7 @@ Add support for keepout zones on boards and footprints.
|
||||
- [DRC Improvements.](#v6_drc_improvements)
|
||||
|
||||
**Progress:**
|
||||
- Planning
|
||||
- In progress.
|
||||
|
||||
## Clipboard Support ## {#v6_fp_edit_clipboard}
|
||||
**Goal:**
|
||||
@@ -307,7 +458,7 @@ Provide clipboard cut and paste for footprints.
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
- Complete.
|
||||
|
||||
## Net Highlighting ## {#v6_pcb_net_highlight}
|
||||
**Goal:**
|
||||
@@ -323,7 +474,7 @@ Highlight rats nest links and/or traces when corresponding net in Eeschema is se
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
- Complete.
|
||||
|
||||
## Hatched Zone Filling ## {#v6_pcb_hatched_zones}
|
||||
**Goal:**
|
||||
@@ -339,7 +490,7 @@ with hatching.
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
- Complete.
|
||||
|
||||
## Board Stack Up Impedance Calculator ## {#v6_pcb_impedance_calc}
|
||||
**Goal:**
|
||||
@@ -354,7 +505,7 @@ Maybe this should be included in the PCB calculator application.
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
- In progress.
|
||||
|
||||
## Net Class Improvements ## {#v6_pcb_net_class_improvements}
|
||||
**Goal:**
|
||||
@@ -378,9 +529,10 @@ Add support for route impedance, color selection, etc in net class object.
|
||||
## Ratsnest Improvements ## {#v6_pcb_ratsnest_improvements}
|
||||
**Goal:**
|
||||
|
||||
Add support for per net color and visibility settings.
|
||||
Add support for curved rats and per net color and visibility settings.
|
||||
|
||||
**Task:**
|
||||
- Implement rat curving to minimize overlapped rats.
|
||||
- Implement UI code to configure ratsnest color and visibility.
|
||||
- Update ratsnest code to handle per net color and visibility.
|
||||
|
||||
@@ -388,23 +540,312 @@ Add support for per net color and visibility settings.
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
- Curved rat support complete.
|
||||
|
||||
|
||||
# GerbView: Gerber File Viewer # {#v6_gerbview}
|
||||
|
||||
This section covers the source code for the GerbView gerber file viewer.
|
||||
|
||||
## Graphics Abstraction Layer ## {#v6_gerbview_gal}
|
||||
## DXF Improvements ## {#v6_pcb_dxf_import}
|
||||
**Goal:**
|
||||
|
||||
Graphics rendering unification.
|
||||
- Allow for anchor point setting and layer mapping support on DXF import and
|
||||
export multiple board layers to a single DXF file.
|
||||
|
||||
**Task:**
|
||||
- Port graphics rendering layer to GAL.
|
||||
- Provide method to select DXF import anchor point.
|
||||
- Add user interface to allow mapping DXF layers to board layers.
|
||||
- Modify DXF plotting to export multiple layers to a single file.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Improve Dimension Tool ## {#v6_pcb_dim_tool}
|
||||
**Goal:**
|
||||
|
||||
Make dimensions link to objects and change when objects are modified and add
|
||||
basic mechanical constraints.
|
||||
|
||||
**Task:**
|
||||
- Add code to link dimension to objects.
|
||||
- Add basic mechanical constraints like linear distance and angle.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- In progress.
|
||||
|
||||
## Constraint Management System ## {#v6_pcb_constraint}
|
||||
**Goal:**
|
||||
|
||||
Implement full featured constraint management system to allow for complex
|
||||
board constraints instead of netclass only constraints.
|
||||
|
||||
**Task:**
|
||||
- Write specification to define requirement of new constraint system.
|
||||
- Implement new constraint system including file format changes.
|
||||
- Allow constraints to be defined in schematic editor and passed to board
|
||||
editor via netlist.
|
||||
- Update netlist file format to support constraints.
|
||||
- Update DRC to test new constraints.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status**
|
||||
- No Progress.
|
||||
|
||||
## Append Board in Project Mode ## {#v6_pcb_append}
|
||||
**Goal:**
|
||||
|
||||
Allow appending to the board when running Pcbnew in the project mode.
|
||||
|
||||
**Task:**
|
||||
- Enable append board feature in project mode.
|
||||
- Extend copy/paste feature to introduce paste special tool to add prefix
|
||||
and/or suffix to nets of pasted/appended objects.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Grid and Auxiliary Origin Improvements ## {#v6_pcb_origin}
|
||||
**Goal:**
|
||||
|
||||
Allow reset grid and auxiliary origin without hotkey only. Add support to
|
||||
make all coordinates relative to the plot origin.
|
||||
|
||||
**Task:**
|
||||
- Add reset grid and auxiliary origin commands to menu entry and/or toolbar
|
||||
button.
|
||||
- Add code to dialogs to allow coordinates to be specified relative to the
|
||||
plot origin.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Relative coordinate entry in progress.
|
||||
|
||||
## Addition Mechanical Layers ## {#v6_pcb_mech_layers}
|
||||
**Goal:**
|
||||
|
||||
Add more mechanical layers.
|
||||
|
||||
**Task:**
|
||||
- Add remaining mechanical layers for a total of 32.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Layer Renaming ## {#v6_pcb_layer_rename}
|
||||
**Goal:**
|
||||
|
||||
Allow mechanical layers to be renamed.
|
||||
|
||||
**Task:**
|
||||
- Quote layer names in file format to support any printable characters in
|
||||
layer names.
|
||||
- Add user interface to allow mechanical layers to be renamed.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Quoted layer names complete.
|
||||
|
||||
## Stable Python API ## {#v6_pcb_python_api}
|
||||
**Goal:**
|
||||
|
||||
Create a Python wrapper to hide the SWIG generated API.
|
||||
|
||||
**Task:**
|
||||
- Document new Python API.
|
||||
- Write Python API.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Initial technical specification drafted.
|
||||
|
||||
## Track Refining ## {#v6_pcb_track_refine}
|
||||
**Goal:**
|
||||
|
||||
Add support for teardrops and automatically updating length tuning
|
||||
meandering.
|
||||
|
||||
**Task:**
|
||||
- Draft specification for track refining.
|
||||
- Implement support for teardrops.
|
||||
- Implement support for changing tuned length meandering.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Initial technical specification drafted.
|
||||
|
||||
## Groups and Rooms ## {#v6_pcb_groups}
|
||||
**Goal:**
|
||||
|
||||
Support grouping board objects into reusable snippets.
|
||||
|
||||
**Task:**
|
||||
- Write design specification.
|
||||
- Update board file format to support grouped objects.
|
||||
- Add user interface code to support grouped board objects.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Initial technical specification drafted.
|
||||
|
||||
## Pad Stack Support ## {#v6_pcb_padstack}
|
||||
**Goal:**
|
||||
|
||||
Add padstack support.
|
||||
|
||||
**Task:**
|
||||
- Write pad stack design specification.
|
||||
- Update board file format to support pad stacks.
|
||||
- Add user interface code to support designing pad stack objects.
|
||||
- Update push and shove router to handle pad stacks.
|
||||
- Update zone filling to handle pad stacks.
|
||||
- Update DRC to handle pad stacks.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- Initial technical specification drafted.
|
||||
|
||||
## Net Ties ## {#v6_pcb_net_ties}
|
||||
**Goal:**
|
||||
|
||||
Add support for net ties.
|
||||
|
||||
**Task:**
|
||||
- Write net tie design specification.
|
||||
- Implement board file support for net ties.
|
||||
- Implement schematic file support for net ties.
|
||||
- Update ERC and DRC to handle net ties.
|
||||
- Update netlist to pass net tie information from schematic to board.
|
||||
- Add user interface support for net ties to editors.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-Expression File Format](#v6_sch_sexpr).
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
## Anti-pad Improvements ## {#v6_pcb_anti_pad}
|
||||
**Goal:**
|
||||
|
||||
Use anti-pads on vias and through hold pads on internal layers as required.
|
||||
|
||||
**Task:**-
|
||||
- Revise zone filling algorithm to create anti-pad on internal layers.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
## Thermal Relief Improvements ## {#v6_pcb_thermal_relief}
|
||||
**Goal:**
|
||||
|
||||
Allow for custom thermal reliefs in zones and custom pad shapes.
|
||||
|
||||
**Task:**-
|
||||
- Write technical specification to define requirements, alternate unions,
|
||||
knockouts, union spokes, etc.
|
||||
- Revise zone filling thermal relief support to handle new requirements.
|
||||
- Update board file format for new thermal relief requirements.
|
||||
- Add user interface support for thermal relief definitions.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
## Merge KiCad2Step ## {#v6_pcb_kicad2step}
|
||||
**Goal:**
|
||||
|
||||
Merge export to STEP file code from KiCad2Step so that conversion does
|
||||
not run in a separate process.
|
||||
|
||||
**Task:**-
|
||||
- Merge KiCad2Step code into Pcbnew code base.
|
||||
- Remove unused parser code.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
## 3D Model Improvements ## {#v6_pcb_3d_model_opacity}
|
||||
**Goal:**
|
||||
|
||||
Add opacity to 3D model support and convert from path look up to library
|
||||
table to access 3D models.
|
||||
|
||||
**Task:**-
|
||||
- Add opacity support to footprint library file format.
|
||||
- Add library table 3D model support to footprint library file format.
|
||||
- Create remapping utility to map from path look up to library table look up.
|
||||
- Add user interface support for 3D model opacity.
|
||||
- Add user interface support accessing 3D models via library table.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
## IPC-2581 Support ## {#v6_pcb_ipc_2581}
|
||||
**Goal:**
|
||||
|
||||
Add support for exporting to and importing from IPC-2581.
|
||||
|
||||
**Task:**-
|
||||
- Add IPC-2581 export code.
|
||||
- Add IPC-2581 import code.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
## Curved Trace Support ## {#v6_pcb}
|
||||
**Goal:**
|
||||
|
||||
Add curved trace support to the board editor.
|
||||
|
||||
**Task:**-
|
||||
- Add curved trace support to track object code.
|
||||
- Add support to board file format for curved traces.
|
||||
- Update zone fill algorithm to support curved fills.
|
||||
- Update router to support curved traces.
|
||||
- Update DRC to handle curved traces and fills.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No Progress.
|
||||
|
||||
|
||||
# GerbView: Gerber File Viewer # {#v6_gerbview}
|
||||
|
||||
This section covers the source code for the GerbView gerber file viewer.
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
This document is the KiCad Developer's road map document. It is a living
|
||||
document that should be maintained as the project progresses. The goal of
|
||||
this document is to provide an overview for developers of where the project
|
||||
is headed to prevent resource conflicts and endless rehashing of previously
|
||||
discussed topics. It is broken into sections for each major component of
|
||||
the KiCad source code and documentation. It defines tasks that developers
|
||||
an use to contribute to the project and provides updated status information.
|
||||
Tasks should define clear objective and avoid vague generalizations so that
|
||||
a new developer can complete the task. It is not a place for developers to
|
||||
add their own personal wish list It should only be updated with approval
|
||||
of the project manager after discussion with the lead developers.
|
||||
is headed beyond the current development cycle road map (currently
|
||||
[version 6](./v6_road_map.html) to prevent resource conflicts and endless
|
||||
rehashing of previously discussed topics. It is broken into sections for
|
||||
each major component of the KiCad source code and documentation. It defines
|
||||
tasks that developers an use to contribute to the project and provides updated
|
||||
status information. Tasks should define clear objectives and avoid vague
|
||||
generalizations so that a new developer can complete the task. It is not a
|
||||
place for developers to add their own personal wish list It should only be
|
||||
updated with approval of the project manager after discussion with the lead
|
||||
developers.
|
||||
|
||||
Each entry in the road map is made up of four sections. The goal should
|
||||
be a brief description of the what the road map entry will accomplish. The
|
||||
@@ -34,59 +36,16 @@ This section defines the tasks that affect all or most of KiCad or do not
|
||||
fit under as specific part of the code such as the board editor or the
|
||||
schematic editor.
|
||||
|
||||
## User Interface Modernization ## {#wxaui}
|
||||
**Goal:**
|
||||
|
||||
Give KiCad a more modern user interface with dockable tool bars and windows.
|
||||
Create perspectives to allow users to arrange dockable windows as they prefer.
|
||||
|
||||
**Task:**
|
||||
- Take advantage of the advanced UI features in wxAui such as detaching and
|
||||
hiding.
|
||||
- Study ergonomics of various commercial/proprietary PCB applications (when
|
||||
in doubt about any particular UI solution, check how it has been done in a
|
||||
certain proprietary app that is very popular among OSHW folks and do exactly
|
||||
opposite).
|
||||
- Clean up menu structure. Menus must allow access to all features of the
|
||||
program in a clear and logical way. Currently some functions of Pcbnew are
|
||||
accessible only through tool bars
|
||||
- Redesign dialogs, make sure they are following same style rules.
|
||||
- Check quality of translations. Either fix or remove bad quality translations.
|
||||
- Develop a global shortcut manager that allows the user assign arbitrary
|
||||
shortcuts for any tool or action.
|
||||
|
||||
**Dependencies:**
|
||||
- [wxWidgets 3](#wxwidgets3)
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
|
||||
# Build Tools # {#build_tools}
|
||||
This section covers build tools for both the KiCad source as well as the
|
||||
custom dependency builds required to build KiCad.
|
||||
|
||||
|
||||
# Common Library # {#common_lib}
|
||||
This section covers the source code shared between all of the KiCad
|
||||
applications
|
||||
|
||||
## Unified Rendering Framework ## {#unified_rendering}
|
||||
**Goal:**
|
||||
|
||||
Provide a single framework for developing new tools. Port existing tools
|
||||
to the new framework and remove the legacy framework tools.
|
||||
|
||||
**Task:**
|
||||
- Port wxDC to GAL or get Cairo rendering to nearly the performance of the
|
||||
current wxDC rendering so that we have a single framework to develop new
|
||||
tools and we can continue to support systems that don't have a complete
|
||||
OpenGL stack.
|
||||
|
||||
**Dependencies**
|
||||
- [Tool framework](http://www.ohwr.org/projects/cern-kicad/wiki/WorkPackages)
|
||||
|
||||
**Status**
|
||||
- No progress
|
||||
|
||||
# KiCad: Application Launcher # {#kicad}
|
||||
This section applies to the source code for the KiCad application launcher.
|
||||
@@ -95,277 +54,19 @@ This section applies to the source code for the KiCad application launcher.
|
||||
# Eeschema: Schematic Editor # {#eeschema}
|
||||
This section applies to the source code for the Eeschema schematic editor.
|
||||
|
||||
## Graphics Abstraction Layer Conversion ## {#sch_gal}
|
||||
**Goal:**
|
||||
|
||||
Take advantage of advanced graphics rendering in Eeschema.
|
||||
|
||||
**Task:**
|
||||
- Port graphics rendering to GAL.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Port Editing Tools ## {#sch_tool_framework}
|
||||
**Goal:**
|
||||
|
||||
Use standard tool framework across all applications.
|
||||
|
||||
**Task:**
|
||||
- Rewrite editing tools using the new tool framework.
|
||||
|
||||
**Dependencies:**
|
||||
- [GAL port](#sch_gal).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Allow Use of System Fonts ## {#sch_sys_fonts}
|
||||
**Goal:**
|
||||
|
||||
Currently the schematic editor uses the stroke drawn fonts which aren't really
|
||||
necessary for accurated printing of schematics. Allow the use of system fonts
|
||||
for schematic text.
|
||||
|
||||
**Task:**
|
||||
- Determine which library for font handling makes the most sense, wxWidgets or
|
||||
freetype.
|
||||
- Add support for selecting text object fonts.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-expression schematic file format](#sch_sexpr).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
# CvPcb: Footprint Association Tool # {#cvpcb}
|
||||
This section covers the source code of the footprint assignment tool CvPcb.
|
||||
|
||||
|
||||
# Pcbnew: Circuit Board Editor # {#pcbnew}
|
||||
This section covers the source code of the board editing application Pcbnew.
|
||||
|
||||
## Model Export ## {#model_export}
|
||||
|
||||
**Goal:**
|
||||
|
||||
Provide improved solid modeling export to the file formats available in
|
||||
OpenCascade.
|
||||
|
||||
**Task:**
|
||||
- Add STEP 3D modeling capability.
|
||||
- Add IGES 3D modeling capability.
|
||||
- Add any other file formats supported by OpenCascade that make sense for
|
||||
KiCad.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- None
|
||||
|
||||
## Linked Objects ## {#pcb_linked_objects}
|
||||
**Goal:**
|
||||
|
||||
Provide a way to allow external objects such as footprints to be externally
|
||||
linked in the board file so that changes in the footprint are automatically
|
||||
updated. This will all a one to many object relationship which can pave the
|
||||
way for real board modules.
|
||||
|
||||
**Task:**
|
||||
- Add externally and internally linked objects to the file format to allow for
|
||||
footprints and/or other board objects to be shared (one to many relationship)
|
||||
instead of only supporting embedded objects (one to one relationship) that
|
||||
can only be edited in place.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Pin and Part Swapping ## {#pcb_drc}
|
||||
**Goal:**
|
||||
|
||||
Allow Pcbnew to perform pin and/or part swapping during layout so the user
|
||||
does not have to do it in Eeschema and re-import the net list.
|
||||
|
||||
**Task:**
|
||||
- Provide forward and back annotation between the schematic and board editors.
|
||||
- Define netlist file format changes required to handle pin/part swapping.
|
||||
- Update netlist file formatter and parser to handle file format changes.
|
||||
- Develop a netlist comparison engine that will produce a netlist diff that
|
||||
can be passed between the schematic and board editors.
|
||||
- Create pin/part swap dialog to manipulate swappable pins and parts.
|
||||
- Add support to handle net label back annotation changes.
|
||||
|
||||
**Dependencies:**
|
||||
- [S-expression schematic file format](#sch_sexpr).
|
||||
- [Convert to a single process application](#kiway).
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Clipboard Support ## {#fp_edit_clipboard}
|
||||
**Goal:**
|
||||
|
||||
Provide clipboard cut and paste for footprints..
|
||||
|
||||
**Task:**
|
||||
- Clipboard cut and paste to and from clipboard of footprints in footprint
|
||||
editor.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Segment End Point Snapping. ## {#segment_snapping}
|
||||
**Goal:**
|
||||
|
||||
It is not uncommon for board edge segment end points to inadvertently not
|
||||
be closed causing issues for the 3D viewer and exporting to different file
|
||||
formats due the board outline not being a fully enclosed polygon. This
|
||||
feature would add segment end snapping support to allow the board outline
|
||||
to be fully enclosed. This feature would only need to be supported by the
|
||||
GAL rendering.
|
||||
|
||||
**Tasks**
|
||||
- Mark board edge segment ends with a drag indicator to make it visible to the
|
||||
user that the segment end does not have an endpoint with any other board edge
|
||||
segment.
|
||||
- Allow the user to smap the unconnected segment end to the nearest segment end
|
||||
point.
|
||||
- Automatically connect unconnected segments with and additional segment when
|
||||
opening the 3D viewer or exporting the board to another format. Warn the
|
||||
user that an addition segment has be added and should be verified.
|
||||
|
||||
**Dependencies:**
|
||||
- None
|
||||
|
||||
**Progress:**
|
||||
- Initial discussion.
|
||||
|
||||
## Keepout Zones. ## {#keepout_zones}
|
||||
**Goal:**
|
||||
|
||||
Add support for keepout zones on boards and footprints.
|
||||
|
||||
**Task:**
|
||||
- Add keepout support to zone classes.
|
||||
- Add keepout zone support to board editor.
|
||||
- Add keepout zone support to library editor.
|
||||
|
||||
**Dependencies:**
|
||||
- [DRC Improvements.](#drc_improvements)
|
||||
|
||||
**Progress:**
|
||||
- Planning
|
||||
|
||||
|
||||
## Net Highlighting ## {#pcb_net_highlight}
|
||||
**Goal:**
|
||||
|
||||
Highlight rats nest links and/or traces when corresponding net in Eeschema is selected.
|
||||
|
||||
**Task:**
|
||||
- Add communications link to handle net selection from Eeschema.
|
||||
- Implement highlight algorithm for objects connected to the selected net.
|
||||
- Highlight objects connected to net selected in Eeschema
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Hatched Zone Filling ## {#pcb_hatched_zones}
|
||||
**Goal:**
|
||||
|
||||
Currently Pcbnew only supports solid zone files. Add option to fill zones
|
||||
with hatching.
|
||||
|
||||
**Task:**
|
||||
- Determine zone fill method, required filling code, and file format requirements.
|
||||
- Add hatch option and hatch configuration to zone dialog.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
|
||||
## Board Stack Up Impedance Calculator ## {#pcb_impedance_calc}
|
||||
**Goal:**
|
||||
|
||||
Provide a calculator to compute trace impedances using a full board stackup.
|
||||
Maybe this should be included in the PCB calculator application.
|
||||
|
||||
**Task:**
|
||||
- Design a trace impedance calculator that includes full board stackup.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Net Class Improvements ## {#pcb_net_class_improvements}
|
||||
**Goal:**
|
||||
|
||||
Add support for route impedance, color selection, etc in net class object.
|
||||
|
||||
**Task:**
|
||||
- Determine parameters to add to net class object.
|
||||
- Implement file parser and formatter changes to support net class object
|
||||
changes.
|
||||
- Implement tools to work with new net class parameters.
|
||||
- Create UI elements to configure new net class parameters.
|
||||
- Update the render tab UI code to view traces by net class.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
## Ratsnest Improvements ## {#pcb_ratsnest_improvements}
|
||||
**Goal:**
|
||||
|
||||
Add support for per net color and visibility settings.
|
||||
|
||||
**Task:**
|
||||
- Implement UI code to configure ratsnest color and visibility.
|
||||
- Update ratsnest code to handle per net color and visibility.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
|
||||
# GerbView: Gerber File Viewer # {#gerbview}
|
||||
|
||||
This section covers the source code for the GerbView gerber file viewer.
|
||||
|
||||
## Graphics Abstraction Layer ## {#gerbview_gal}
|
||||
**Goal:**
|
||||
|
||||
Graphics rendering unification.
|
||||
|
||||
**Task:**
|
||||
- Port graphics rendering layer to GAL.
|
||||
|
||||
**Dependencies:**
|
||||
- None.
|
||||
|
||||
**Status**
|
||||
- No progress.
|
||||
|
||||
# Documentation # {#documentation}
|
||||
This section defines the tasks for both the user and developer documentation.
|
||||
@@ -380,6 +81,7 @@ This section defines the tasks for both the user and developer documentation.
|
||||
**Status:**
|
||||
- No progress.
|
||||
|
||||
|
||||
# Unit Testing # {#unittest}
|
||||
**Goal:**
|
||||
|
||||
|
||||
@@ -105,18 +105,18 @@ The major parts of tool's implementation are the functions used by the
|
||||
when the GAL canvas is switched, and also just after tool registration.
|
||||
Any resource claimed from the GAL view or the model must be released
|
||||
in this function, as they could become invalid.
|
||||
* `SetTransitions()` function, which maps tool actions to functions
|
||||
* `setTransitions()` function, which maps tool actions to functions
|
||||
within the tool class.
|
||||
* One or more functions to call when actions are invoked. Many actions
|
||||
can invoke the same function if desired. The functions have the
|
||||
following signature:
|
||||
* int TOOL_CLASS::FunctionName( const TOOL_EVENT& aEvent )
|
||||
* Returning 0 means success.
|
||||
* Returning 0 means success.
|
||||
* These functions are called by the `TOOL_MANAGER` in case an associated
|
||||
event arrives (association is created with TOOL_INTERACTIVE::Go() function).
|
||||
* These can generally be private, as they are not called directly
|
||||
by any other code, but are invoked by the tool manager's coroutine
|
||||
framework according to the `SetTransitions()` map.
|
||||
framework according to the `setTransitions()` map.
|
||||
|
||||
### Interactive actions {#interactive-actions}
|
||||
|
||||
@@ -171,7 +171,7 @@ provide their own context menu. Tools that are called only from other
|
||||
tools' interactive modes add their menu items to those tools' menus.
|
||||
|
||||
To use a `TOOL_MENU` in a top level tool, simply add one as a member
|
||||
and initialise it with a reference to the tools at construction time:
|
||||
and initialize it with a reference to the tools at construction time:
|
||||
|
||||
TOOL_NAME: public PCB_TOOL
|
||||
{
|
||||
@@ -215,7 +215,7 @@ The procedure of a commit is:
|
||||
unless you are going to abort the commit.
|
||||
* When removing an item, call `Remove( item )`. You should not delete the
|
||||
removed item, it will be stored in the undo buffer.
|
||||
* Finalise the commit with `Push( "Description" )`. If you performed
|
||||
* Finalize the commit with `Push( "Description" )`. If you performed
|
||||
no modifications, additions or removals, this is a no-op, so you
|
||||
don't need to check if you made any changes before pushing.
|
||||
|
||||
@@ -284,7 +284,7 @@ In `pcbnew/tools/pcb_actions.h`, we add the following to the
|
||||
static TOOL_ACTION uselessFixedCircle;
|
||||
|
||||
Definitions of actions generally happen in the .cpp of the relevant tool.
|
||||
It doesn't actually matter where the defintion occurs (the declaration
|
||||
It doesn't actually matter where the definition occurs (the declaration
|
||||
is enough to use the action), as long as it's linked in the end.
|
||||
Similar tools should always be defined together.
|
||||
|
||||
@@ -337,11 +337,11 @@ the following class:
|
||||
///> React to model/view changes
|
||||
void Reset( RESET_REASON aReason ) override;
|
||||
|
||||
///> Basic initalization
|
||||
///> Basic initialization
|
||||
bool Init() override;
|
||||
|
||||
///> Bind handlers to corresponding TOOL_ACTIONs
|
||||
void SetTransitions() override;
|
||||
void setTransitions() override;
|
||||
|
||||
private:
|
||||
///> 'Move selected left' interactive tool
|
||||
@@ -392,7 +392,7 @@ Below you will find the contents of useless_tool.cpp:
|
||||
|
||||
|
||||
/*
|
||||
* Tool-specific action defintions
|
||||
* Tool-specific action definitions
|
||||
*/
|
||||
TOOL_ACTION PCB_ACTIONS::uselessMoveItemLeft(
|
||||
"pcbnew.UselessTool.MoveItemLeft",
|
||||
@@ -443,7 +443,7 @@ Below you will find the contents of useless_tool.cpp:
|
||||
void USELESS_TOOL::moveLeftInt()
|
||||
{
|
||||
// we will call actions on the selection tool to get the current
|
||||
// selection. The selection tools will handle item deisambiguation
|
||||
// selection. The selection tools will handle item disambiguation
|
||||
SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
||||
assert( selectionTool );
|
||||
|
||||
@@ -535,7 +535,7 @@ Below you will find the contents of useless_tool.cpp:
|
||||
}
|
||||
|
||||
|
||||
void USELESS_TOOL::SetTransitions()
|
||||
void USELESS_TOOL::setTransitions()
|
||||
{
|
||||
Go( &USELESS_TOOL::fixedCircle, PCB_ACTIONS::uselessFixedCircle.MakeEvent() );
|
||||
Go( &USELESS_TOOL::moveLeft, PCB_ACTIONS::uselessMoveItemLeft.MakeEvent() );
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+4
-2
@@ -1,7 +1,7 @@
|
||||
The majority of KiCad's source code is developed and distributed under the terms
|
||||
of the GPLv3 or later. However, It does include some third-party code licensed
|
||||
under AGPLv3 or later as well as sections licensed under the BOOST license v1.0
|
||||
and portions licensed under the ISC license.
|
||||
under AGPLv3 or later as well as sections licensed under the BOOST license v1.0,
|
||||
the ISC license and the MIT license.
|
||||
|
||||
These licenses are compatible, but a combined works as is will be governed under
|
||||
the terms of the AGPLv3 (or later). This includes any binary distribution of the
|
||||
@@ -15,6 +15,8 @@ Licensed under BOOSTv1:
|
||||
- libcontext [https://github.com/boostorg/context], sources in common/system/libcontext.cpp
|
||||
Licensed under ISC:
|
||||
- portions of code in include/geometry/polygon_triangulation.h
|
||||
Licensed under MIT:
|
||||
- tinyspline_lib in dxflib_qcad/tinyspline_lib
|
||||
Licensed under CC-BY-SA-4.0:
|
||||
- All the demo files provided in demos/*
|
||||
Licensed under GPLv3 (or later):
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
|
||||
@@ -54,6 +54,9 @@ target_link_libraries( bitmap2component
|
||||
)
|
||||
|
||||
if( APPLE )
|
||||
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
|
||||
|
||||
set_target_properties( bitmap2component PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
|
||||
)
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string></string>
|
||||
<string>@KICAD_VERSION_FULL@</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Bitmap 2 Component</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<string>@KICAD_VERSION@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string></string>
|
||||
<string>@KICAD_VERSION_FULL@</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>LSRequiresCarbon</key>
|
||||
@@ -450,7 +450,7 @@ void BM2CMP_FRAME::Binarize( double aThreshold )
|
||||
auto alpha = m_Greyscale_Image.HasAlpha() ?
|
||||
m_Greyscale_Image.GetAlpha( x, y ) : wxALPHA_OPAQUE;
|
||||
|
||||
if( pixin < threshold || alpha < alpha_thresh )
|
||||
if( pixin < threshold && alpha > alpha_thresh )
|
||||
pixout = 0;
|
||||
else
|
||||
pixout = 255;
|
||||
|
||||
@@ -155,7 +155,6 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Step 1\n");
|
||||
BITMAPCONV_INFO info;
|
||||
info.m_PixmapWidth = aPotrace_bitmap->w;
|
||||
info.m_PixmapHeight = aPotrace_bitmap->h; // the bitmap size in pixels
|
||||
|
||||
@@ -7,30 +7,23 @@
|
||||
|
||||
static const unsigned char png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
|
||||
0xce, 0x00, 0x00, 0x01, 0x4b, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0xd5, 0xbf, 0x4b, 0x02,
|
||||
0x61, 0x00, 0x87, 0xf1, 0x77, 0x51, 0x9c, 0x0c, 0x91, 0xa0, 0x25, 0x30, 0xc2, 0xa0, 0x6c, 0x15,
|
||||
0x22, 0xa4, 0xa8, 0x21, 0xa7, 0xa2, 0x21, 0xb2, 0x74, 0x09, 0x49, 0x73, 0x13, 0x13, 0xd4, 0x6a,
|
||||
0x13, 0x5c, 0x0c, 0x44, 0xa4, 0x1f, 0xc4, 0x21, 0x35, 0xa4, 0x21, 0x18, 0x05, 0x81, 0x24, 0x38,
|
||||
0x35, 0x34, 0x49, 0x4b, 0xfd, 0x07, 0x81, 0xe0, 0x12, 0xb7, 0x1c, 0x0d, 0x05, 0x4f, 0xc3, 0x91,
|
||||
0x60, 0x5a, 0x17, 0x62, 0x11, 0xe1, 0xc1, 0x03, 0x77, 0xf0, 0x85, 0x0f, 0xef, 0xbb, 0x9c, 0xa8,
|
||||
0xd5, 0x6a, 0xfc, 0x46, 0xa2, 0x07, 0xfd, 0x7d, 0x48, 0x96, 0x65, 0x7e, 0xfa, 0x51, 0x14, 0xa5,
|
||||
0x07, 0x75, 0x1b, 0xaa, 0xd7, 0xc1, 0xef, 0x57, 0x8b, 0xc7, 0x21, 0x12, 0x51, 0xdf, 0xc3, 0xe1,
|
||||
0xce, 0xa1, 0xeb, 0xca, 0x03, 0xa9, 0x83, 0xdb, 0xa6, 0xaa, 0xa7, 0x65, 0x10, 0x02, 0xec, 0x76,
|
||||
0xc8, 0x64, 0x20, 0x10, 0x00, 0xab, 0x15, 0x8c, 0x46, 0xce, 0xce, 0xef, 0x5b, 0xf6, 0x5a, 0xe5,
|
||||
0x8b, 0x77, 0x88, 0xf4, 0xe1, 0x0d, 0x7d, 0x43, 0xbb, 0x4d, 0x1d, 0x87, 0x24, 0x15, 0x72, 0xb9,
|
||||
0x20, 0x97, 0x83, 0x44, 0x02, 0x1c, 0x0e, 0xd0, 0xeb, 0x99, 0x77, 0x17, 0x5a, 0xf6, 0x5a, 0xad,
|
||||
0x07, 0x2f, 0xda, 0x43, 0x85, 0xf0, 0x11, 0xe8, 0x74, 0x50, 0x2a, 0xa9, 0x65, 0xb3, 0x20, 0xa9,
|
||||
0xf8, 0xaa, 0xb7, 0xd8, 0x3d, 0x68, 0x7f, 0xf3, 0x44, 0x3d, 0x91, 0x10, 0x3c, 0x7b, 0x7d, 0xbc,
|
||||
0x8e, 0xda, 0xd4, 0x6f, 0x93, 0x09, 0xe7, 0x52, 0xbe, 0x7b, 0xd0, 0xc4, 0x5c, 0x96, 0xaa, 0x6d,
|
||||
0x86, 0x84, 0xc9, 0xc9, 0xd8, 0xe0, 0x0e, 0x8b, 0x03, 0x3e, 0x62, 0xe6, 0x05, 0x1e, 0xdd, 0x1b,
|
||||
0xf4, 0x8f, 0xa4, 0x3a, 0x83, 0xca, 0xd2, 0x15, 0xe9, 0xd9, 0x50, 0x4b, 0x95, 0xe8, 0x1e, 0x16,
|
||||
0x4b, 0xbc, 0x31, 0x9e, 0x1c, 0xde, 0xe6, 0x32, 0x98, 0x6e, 0xbb, 0xd5, 0x2a, 0xbf, 0x25, 0x21,
|
||||
0xe4, 0x64, 0xb2, 0x71, 0x4d, 0x1f, 0x7b, 0x5a, 0x59, 0x63, 0x79, 0x3c, 0x4a, 0xcc, 0x11, 0xe5,
|
||||
0x65, 0x6a, 0xfa, 0xd3, 0x9d, 0x56, 0x8a, 0xc7, 0xf3, 0x35, 0x84, 0x10, 0x60, 0x36, 0x83, 0xc1,
|
||||
0xd0, 0x31, 0xf2, 0x7d, 0xa8, 0x0b, 0xfd, 0x53, 0xa8, 0xf7, 0x2b, 0xef, 0x41, 0xef, 0xbd, 0x01,
|
||||
0xd4, 0x13, 0x20, 0xa3, 0x03, 0x4f, 0x86, 0x07, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
|
||||
0xae, 0x42, 0x60, 0x82,
|
||||
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x02, 0x00, 0x00, 0x00, 0x26, 0x28, 0xdb,
|
||||
0x99, 0x00, 0x00, 0x00, 0xdc, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0x78, 0x46, 0x55, 0xc0,
|
||||
0x30, 0x6a, 0x1c, 0xf9, 0xc6, 0x7d, 0xf8, 0xf0, 0xe1, 0x3f, 0x95, 0xc0, 0xd7, 0xaf, 0x5f, 0x69,
|
||||
0x6c, 0xdc, 0xdd, 0xbb, 0xdf, 0x96, 0x2e, 0xbe, 0x3d, 0x73, 0xfa, 0x8d, 0xbd, 0x7b, 0xdf, 0xfd,
|
||||
0xfe, 0xfd, 0x8f, 0x32, 0xe3, 0x7e, 0xff, 0x51, 0x55, 0x38, 0xcc, 0xcb, 0xbd, 0x55, 0x5d, 0x71,
|
||||
0x11, 0x03, 0xc3, 0xfe, 0xed, 0xf3, 0xaf, 0x50, 0xea, 0x3a, 0x13, 0xdd, 0xa3, 0x2c, 0x2c, 0x07,
|
||||
0x0c, 0x0d, 0x4f, 0x33, 0x32, 0xee, 0x3f, 0xbe, 0xe6, 0x2a, 0xc9, 0xc6, 0x6d, 0xd9, 0xf2, 0xb0,
|
||||
0xa3, 0xe3, 0x2e, 0x1c, 0xb9, 0xd9, 0x1f, 0xbf, 0x71, 0xe3, 0xeb, 0x8b, 0x17, 0x3f, 0x6b, 0x6b,
|
||||
0xef, 0x35, 0xa7, 0xed, 0x47, 0x96, 0x22, 0x88, 0x16, 0x2e, 0xbc, 0xc7, 0xd0, 0xd5, 0x75, 0x0d,
|
||||
0xe8, 0x2f, 0x38, 0xf2, 0xb5, 0x3d, 0x34, 0x7f, 0xfe, 0x73, 0x20, 0x6a, 0x6a, 0xbc, 0x2f, 0xca,
|
||||
0xbc, 0x11, 0x59, 0x8a, 0x20, 0x8a, 0x8e, 0x3e, 0x87, 0x6e, 0x9c, 0x08, 0xf3, 0xa6, 0x86, 0x9a,
|
||||
0xdb, 0x3b, 0x76, 0xbc, 0xb5, 0x50, 0xd8, 0x4c, 0x92, 0x59, 0xd8, 0x8d, 0x03, 0x22, 0x1e, 0xc6,
|
||||
0xed, 0x32, 0xcc, 0x6b, 0x48, 0x35, 0x0b, 0xa7, 0x71, 0x64, 0x23, 0x90, 0x71, 0x5b, 0x27, 0xef,
|
||||
0xef, 0x34, 0x6e, 0xa7, 0x0a, 0x5a, 0x98, 0xb7, 0x9a, 0xe1, 0x43, 0x57, 0xd7, 0x7f, 0x06, 0x06,
|
||||
0xaa, 0xa0, 0xaf, 0xd1, 0xd1, 0xa3, 0xc6, 0x51, 0x60, 0xdc, 0x68, 0x5d, 0x31, 0x58, 0x8c, 0x03,
|
||||
0x00, 0x7a, 0x13, 0x67, 0x71, 0xe0, 0xcc, 0x56, 0x20, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
|
||||
0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE lang_sl_xpm[1] = {{ png, sizeof( png ), "lang_sl_xpm" }};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
version="1.1"
|
||||
viewBox="-2100 -1470 151.66666 151.66666"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="lang_sl.svg">
|
||||
<metadata
|
||||
id="metadata37">
|
||||
@@ -22,6 +22,7 @@
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>Flag of Brazil</dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
@@ -34,29 +35,23 @@
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="744"
|
||||
inkscape:window-width="1015"
|
||||
inkscape:window-height="938"
|
||||
id="namedview35"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.921875"
|
||||
inkscape:cx="-38.508475"
|
||||
inkscape:cy="128"
|
||||
inkscape:zoom="5.6568542"
|
||||
inkscape:cx="5.7280975"
|
||||
inkscape:cy="9.0111021"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
inkscape:window-y="90"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="g918"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true" />
|
||||
<title
|
||||
id="title4">Flag of Brazil</title>
|
||||
<defs
|
||||
id="defs6">
|
||||
<clipPath
|
||||
id="a">
|
||||
<path
|
||||
d="m 171.82,258.25 c -26.762,-12.893 -65.044,-38.479 -65.044,-89.094 0,-50.614 2.42,-73.633 2.42,-73.633 h 125.25 c 0,0 2.422,23.019 2.422,73.633 -0.001,50.616 -38.286,76.201 -65.05,89.094 z"
|
||||
id="path9"
|
||||
inkscape:connector-curvature="0" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
id="defs6" />
|
||||
<clipPath
|
||||
id="clipPath11">
|
||||
<circle
|
||||
@@ -86,7 +81,7 @@
|
||||
y="-540.56"
|
||||
x="-116.67"
|
||||
id="rect19"
|
||||
style="fill:#0f218b" />
|
||||
style="fill:#0000bf;fill-opacity:1" />
|
||||
<rect
|
||||
height="252.78"
|
||||
width="1225"
|
||||
@@ -101,30 +96,49 @@
|
||||
x="-116.67"
|
||||
id="rect23"
|
||||
style="fill:#ff0000" />
|
||||
<path
|
||||
d="m 121.41,-423.58 c 0,-111.98 7.1462,-174.77 7.1462,-174.77 h 321.57 c 0,0 7.1486,62.786 7.1486,174.77 0,119.2 -97.529,178.65 -161.74,207.37 l -6.1942,2.7706 -6.1871,-2.7706 c -64.207,-28.717 -161.74,-88.167 -161.74,-207.37 z"
|
||||
id="path25"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-rule:evenodd" />
|
||||
<path
|
||||
d="m 289.34,-228.14 c -63.222,-28.283 -153.66,-84.409 -153.66,-195.44 0,-111.031 5.717,-161.52 5.717,-161.52 h 295.89 c 0,0 5.7217,50.495 5.7217,161.52 -0.002,111.03 -90.446,167.16 -153.67,195.44 z"
|
||||
id="path27"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ff0000" />
|
||||
<path
|
||||
d="m 302.86,-452.69 c 17.118,0.25665 50.522,0.87964 80.262,-8.3622 0,0 -0.78666,9.8824 -0.78666,21.395 0,11.514 0.78666,21.397 0.78666,21.397 -27.281,-8.4762 -60.971,-8.6539 -80.262,-8.4258 v 61.325 h -27.04 v -61.325 c -19.294,-0.22801 -52.979,-0.0506 -80.262,8.4258 0,0 0.78666,-9.8824 0.78666,-21.397 0,-11.512 -0.78666,-21.395 -0.78666,-21.395 29.74,9.2418 63.142,8.6188 80.262,8.3622 v -38.514 c -15.604,-0.12944 -38.089,0.56377 -63.51,8.4631 0,0 0.7867,-9.8824 0.7867,-21.397 0,-11.512 -0.7867,-21.395 -0.7867,-21.395 25.386,7.8862 47.841,8.5903 63.439,8.4631 -0.80085,-24.389 -8.4526,-55.126 -8.4526,-55.126 0,0 15.748,1.1429 22.041,1.1429 6.3028,0 22.046,-1.1429 22.046,-1.1429 0,0 -7.6495,30.74 -8.4526,55.126 15.601,0.1251 38.056,-0.57694 63.442,-8.4631 0,0 -0.7867,9.8823 -0.7867,21.395 0,11.514 0.7867,21.397 0.7867,21.397 -25.424,-7.8993 -47.909,-8.5925 -63.513,-8.4631 v 38.514 z"
|
||||
id="path29"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<g
|
||||
transform="matrix(2.3624,0,0,2.1936,-116.57,-794.65)"
|
||||
clip-path="url(#a)"
|
||||
id="g31">
|
||||
transform="matrix(2.9274818,0,0,2.8240134,133.11513,-26.272245)"
|
||||
id="g918">
|
||||
<path
|
||||
d="m 170.64,274.85 -55.454,-49.43 c 0,0 7.089,-22.927 20.927,-22.927 10.996,0 15.009,8.865 15.009,8.865 0,0 7.22,-18.689 20.696,-18.689 13.479,0 20.699,18.689 20.699,18.689 0,0 4.013,-8.865 15.01,-8.865 13.838,0 20.927,22.927 20.927,22.927 l -57.814,49.43 z"
|
||||
id="path33"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#0f218b;fill-rule:evenodd" />
|
||||
id="path13"
|
||||
style="fill:#ed1c24;fill-opacity:1"
|
||||
d="m -9.8011001,-221.38606 c -0.8919999,0.39333 -1.7773329,0.80166 -2.6559999,1.22466 l 2.7679999,43.79933 c 0.754,11.94066 5.831999,23.241 14.3419982,31.75066 5.8193329,5.819 12.9433319,10.034 20.6849979,12.358 h 6.67e-4 c 7.741666,-2.32433 14.865998,-6.539 20.684998,-12.358 8.509666,-8.50966 13.587999,-19.81 14.341665,-31.75066 l 2.768333,-43.79933 c -0.879,-0.423 -1.763666,-0.83133 -2.656333,-1.22466 l 6.67e-4,3.3e-4 -2.833333,44.83632 c -0.709,11.28567 -5.507,21.96667 -13.549332,30.009 -5.3,5.30067 -11.746666,9.19133 -18.756332,11.43167 h -10e-4 c -7.009999,-2.24034 -13.455998,-6.131 -18.7559979,-11.43167 -8.0426662,-8.04233 -12.8406652,-18.72333 -13.5493322,-30.009 l -2.833666,-44.83665 h 6.66e-4" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path15"
|
||||
style="fill:#0000bf;fill-opacity:1"
|
||||
d="m 60.477893,-221.38573 c -10.967666,-4.83567 -22.921331,-7.403 -35.139663,-7.403 -12.218666,0 -24.1723311,2.56733 -35.1399971,7.403 l 2.834,44.83632 c 0.708666,11.28567 5.506666,21.96667 13.5493322,30.009 5.3003329,5.30067 11.7463319,9.19133 18.7559979,11.43167 h 0.001 c 7.009666,-2.24034 13.456332,-6.131 18.755665,-11.43167 8.042999,-8.04233 12.840998,-18.72333 13.549332,-30.009" />
|
||||
<polyline
|
||||
transform="matrix(0.3333333,0,0,0.3333333,-12.4571,-228.78873)"
|
||||
points="119.764,62.917 124.434,56.539 116.574,57.394 113.386,50.161 110.197,57.394 102.338,56.539 107.008,62.917 102.338,69.295 110.197,68.44 113.386,75.673 116.574,68.44 124.434,69.295 "
|
||||
id="polyline17"
|
||||
style="fill:#ffdd00;fill-opacity:1" />
|
||||
<polyline
|
||||
transform="matrix(0.3333333,0,0,0.3333333,-12.4571,-228.78873)"
|
||||
points="90,23.232 94.669,16.854 86.811,17.709 83.622,10.476 80.433,17.709 72.575,16.854 77.244,23.232 72.575,29.61 80.433,28.755 83.622,35.988 86.811,28.755 94.669,29.61 "
|
||||
id="polyline19"
|
||||
style="fill:#ffdd00;fill-opacity:1" />
|
||||
<polyline
|
||||
transform="matrix(0.3333333,0,0,0.3333333,-12.4571,-228.78873)"
|
||||
points="149.527,23.232 154.195,16.854 146.338,17.709 143.148,10.476 139.959,17.709 132.102,16.854 136.771,23.232 132.102,29.61 139.959,28.755 143.148,35.988 146.338,28.755 154.195,29.61 "
|
||||
id="polyline21"
|
||||
style="fill:#ffdd00;fill-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path23"
|
||||
style="fill:#ffffff"
|
||||
d="m 53.684893,-170.02074 -14.173665,-18.89799 -5.669333,7.55933 -8.503999,-17.008 -8.503999,17.008 -5.669333,-7.55933 -14.1733321,18.89799 c 0,2.506 0.995667,4.909 2.76766698,6.681 1.77200002,1.77133 4.17499922,2.76767 6.68133222,2.76767 1.673334,0 3.301,-0.444 4.7249999,-1.26634 0.0093,-0.006 -0.01133,0.007 -0.0023,0.001 0.709666,-0.41 1.475333,-0.72934 2.280333,-0.94467 2.420666,-0.64833 4.999666,-0.30933 7.169999,0.94333 1.449,0.83667 3.080666,1.26634 4.725333,1.26634 0.007,0 -0.0087,0 -0.0017,0 1.645,0 3.276333,-0.42967 4.725666,-1.26634 2.17,-1.25266 4.749333,-1.59233 7.17,-0.94333 0.804666,0.21533 1.570333,0.53467 2.279999,0.94467 0.0097,0.005 -0.011,-0.007 -0.002,-0.001 1.424334,0.82234 3.051333,1.26634 4.724667,1.26634 2.506666,0 4.909666,-0.996 6.681666,-2.76767 1.771999,-1.772 2.767666,-4.175 2.767666,-6.681" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path25-4"
|
||||
style="fill:#ffffff"
|
||||
d="m 0.34889888,-159.76041 c 0.650333,1.29234 1.36533322,2.55334 2.14233322,3.778 0,0 -3.33e-4,6.7e-4 0,10e-4 1.994666,0.91733 4.256333,1.11533 6.394666,0.54233 0.805333,-0.21533 1.5706659,-0.535 2.2803329,-0.94467 0.0093,-0.005 -0.01133,0.007 -0.002,0.001 1.424,-0.823 3.051666,-1.26634 4.724999,-1.26634 0.0033,0 -0.0043,0 -10e-4,0 1.644667,-6.6e-4 3.276334,0.429 4.725333,1.26634 2.170333,1.25266 4.749333,1.59166 7.170333,0.94333 0.804667,-0.21533 1.570333,-0.535 2.28,-0.94467 0.0097,-0.005 -0.011,0.007 -0.002,10e-4 1.423666,-0.823 3.051333,-1.26634 4.725333,-1.26634 0.0033,0 -0.0047,0 -0.0013,0 1.644667,-6.6e-4 3.276667,0.429 4.725333,1.26634 2.170667,1.25266 4.749333,1.59166 7.169999,0.94333 0.519667,-0.13867 1.022,-0.32167 1.504,-0.543 v 0 c 0.777333,-1.22533 1.492334,-2.48633 2.142667,-3.778 0,-6.7e-4 0,0 0,0 -0.472,0.17967 -0.929667,0.397 -1.368334,0.65033 -0.009,0.005 0.01167,-0.007 0.0027,-0.001 -0.709666,0.40967 -1.475333,0.72867 -2.280666,0.94467 -2.420667,0.64833 -4.999333,0.30933 -7.17,-0.944 -1.448666,-0.83667 -3.080666,-1.26567 -4.725332,-1.26567 -0.0033,0 0.0047,0 0.0013,0 -1.673667,0 -3.301333,0.444 -4.725333,1.26633 -0.009,0.005 0.01167,-0.007 0.002,-0.001 -0.709667,0.41 -1.475333,0.72933 -2.28,0.94467 -2.420999,0.649 -4.999999,0.31 -7.170332,-0.94334 -1.449,-0.83666 -3.080667,-1.26633 -4.725333,-1.26633 -0.0037,0 0.0043,0 10e-4,0 -1.673333,0 -3.301,0.444 -4.725,1.267 -0.0093,0.005 0.01133,-0.007 0.002,-10e-4 -0.709666,0.40966 -1.4749999,0.72866 -2.2803329,0.94466 -2.420666,0.64834 -4.999666,0.30934 -7.169999,-0.944 -0.4403332,-0.254 -0.89766722,-0.47066 -1.36700022,-0.649 -3.33e-4,0 0,-6.6e-4 0,0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path27-3"
|
||||
style="fill:#ffffff"
|
||||
d="m 45.737561,-152.50907 c -1.101,1.41066 -2.293,2.76099 -3.572333,4.03966 -4.78,4.78 -10.549332,8.34233 -16.827332,10.48833 h -3.33e-4 c -6.277999,-2.146 -12.047666,-5.70766 -16.8276649,-10.48833 -1.279,-1.27867 -2.471,-2.629 -3.572,-4.03966 0,0 -3.33e-4,0 0,0 1.303,0.20966 2.648333,0.146 3.947667,-0.20167 0.805333,-0.216 1.5706659,-0.535 2.2803329,-0.94467 0.0093,-0.005 -0.01133,0.007 -0.002,10e-4 1.423999,-0.823 3.051666,-1.26634 4.724999,-1.26634 0.0033,0 -0.0043,0 -10e-4,0 1.644667,-6.6e-4 3.276333,0.429 4.725333,1.26567 2.170333,1.25333 4.749333,1.59233 7.169999,0.944 0.805334,-0.216 1.571,-0.535 2.280667,-0.94467 0.009,-0.005 -0.01167,0.007 -0.002,0.001 1.423666,-0.823 3.051333,-1.26634 4.724666,-1.26634 0.0033,0 -0.004,0 -6.67e-4,0 1.644667,-6.6e-4 3.276,0.429 4.725333,1.26567 1.89,1.09167 4.091,1.48967 6.226666,1.14533 6.67e-4,0 0,0 -6.66e-4,6.7e-4" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 8.6 KiB |
+19
-36
@@ -188,7 +188,6 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/dialog_configure_paths_base.cpp
|
||||
dialogs/dialog_display_info_HTML_base.cpp
|
||||
dialogs/dialog_edit_library_tables.cpp
|
||||
dialogs/dialog_exit_base.cpp
|
||||
dialogs/dialog_file_dir_picker.cpp
|
||||
dialogs/dialog_global_lib_table_config.cpp
|
||||
dialogs/dialog_global_lib_table_config_base.cpp
|
||||
@@ -323,7 +322,6 @@ set( COMMON_SRCS
|
||||
hotkey_store.cpp
|
||||
hotkeys_basic.cpp
|
||||
html_messagebox.cpp
|
||||
incremental_text_ctrl.cpp
|
||||
kiface_i.cpp
|
||||
kiway.cpp
|
||||
kiway_express.cpp
|
||||
@@ -382,6 +380,14 @@ if( BUILD_GITHUB_PLUGIN )
|
||||
)
|
||||
endif()
|
||||
|
||||
# Link-time optimization (LTO) on GCC conflicts with embedded assembly (__asm),
|
||||
# following GCC's recommendation to disable LTO per translation unit.
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
set_source_files_properties( system/libcontext.cpp PROPERTIES
|
||||
COMPILE_FLAGS "-fno-lto"
|
||||
)
|
||||
endif()
|
||||
|
||||
set( COMMON_SRCS
|
||||
${COMMON_SRCS}
|
||||
system/libcontext.cpp
|
||||
@@ -516,6 +522,7 @@ target_link_libraries( pcbcommon PUBLIC
|
||||
|
||||
# auto-generate netlist_lexer.h and netlist_keywords.cpp
|
||||
make_lexer(
|
||||
netlist_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/netlist.keywords
|
||||
${PROJECT_SOURCE_DIR}/include/netlist_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/netlist_keywords.cpp
|
||||
@@ -525,18 +532,12 @@ make_lexer(
|
||||
${CMAKE_PROJECT_SOURCE_DIR}/pcbnew/netlist_reader.h
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
netlist_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/include/netlist_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/netlist_keywords.cpp
|
||||
)
|
||||
|
||||
add_dependencies( common netlist_lexer_source_files )
|
||||
add_dependencies( pcbcommon netlist_lexer_source_files )
|
||||
|
||||
# auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
|
||||
make_lexer(
|
||||
pcb_plot_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params.keywords
|
||||
${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
|
||||
@@ -546,17 +547,11 @@ make_lexer(
|
||||
${PROJECT_SOURCE_DIR}/pcbnew/pcb_plot_params.h
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
pcb_plot_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
|
||||
)
|
||||
|
||||
add_dependencies( pcbcommon pcb_plot_lexer_source_files )
|
||||
|
||||
# auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
|
||||
make_lexer(
|
||||
pcb_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pcb.keywords
|
||||
${PROJECT_SOURCE_DIR}/include/pcb_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp
|
||||
@@ -566,28 +561,22 @@ make_lexer(
|
||||
${PROJECT_SOURCE_DIR}/pcbnew/pcb_parser.h
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
pcb_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/include/pcb_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp
|
||||
)
|
||||
|
||||
add_dependencies( pcbcommon pcb_lexer_source_files )
|
||||
|
||||
# auto-generate s-expression library table code.
|
||||
make_lexer(
|
||||
lib_table_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib_table.keywords
|
||||
${PROJECT_SOURCE_DIR}/include/lib_table_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib_table_keywords.cpp
|
||||
LIB_TABLE_T
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
lib_table_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/include/lib_table_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib_table_keywords.cpp
|
||||
# These files consume *_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib_table_base.cpp
|
||||
${PROJECT_SOURCE_DIR}/pcbnew/dialogs/panel_fp_lib_table.cpp
|
||||
${PROJECT_SOURCE_DIR}/eeschema/symbol_lib_table.cpp
|
||||
${PROJECT_SOURCE_DIR}/eeschema/dialogs/panel_sym_lib_table.cpp
|
||||
)
|
||||
|
||||
add_dependencies( common lib_table_lexer_source_files )
|
||||
@@ -596,19 +585,13 @@ add_dependencies( pcbcommon lib_table_lexer_source_files )
|
||||
# auto-generate page layout reader s-expression page_layout_reader_lexer.h
|
||||
# and title_block_reader_keywords.cpp.
|
||||
make_lexer(
|
||||
page_layout_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/page_layout/page_layout_reader.keywords
|
||||
${PROJECT_SOURCE_DIR}/include/page_layout_reader_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/page_layout/page_layout_reader_keywords.cpp
|
||||
TB_READER_T
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
page_layout_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/include/page_layout_reader_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/page_layout/page_layout_reader_keywords.cpp
|
||||
)
|
||||
|
||||
add_dependencies( common page_layout_lexer_source_files )
|
||||
|
||||
# This one gets made only when testing.
|
||||
|
||||
@@ -266,6 +266,10 @@ wxString StringFromValue( EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, b
|
||||
stringValue += wxT( " deg" );
|
||||
break;
|
||||
|
||||
case PERCENT:
|
||||
stringValue += wxT( "%" );
|
||||
break;
|
||||
|
||||
case UNSCALED_UNITS:
|
||||
break;
|
||||
}
|
||||
@@ -294,6 +298,7 @@ double From_User_Unit( EDA_UNITS_T aUnits, double aValue, bool aUseMils )
|
||||
|
||||
default:
|
||||
case UNSCALED_UNITS:
|
||||
case PERCENT:
|
||||
return aValue;
|
||||
}
|
||||
}
|
||||
@@ -442,6 +447,9 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS_T aUnit, bool aUseMils )
|
||||
case MILLIMETRES:
|
||||
return _( "mm" );
|
||||
|
||||
case PERCENT:
|
||||
return _( "%" );
|
||||
|
||||
case UNSCALED_UNITS:
|
||||
return wxEmptyString;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <bin_mod.h>
|
||||
#include <common.h>
|
||||
#include <pgm_base.h>
|
||||
#include <id.h>
|
||||
|
||||
|
||||
BIN_MOD::BIN_MOD( const char* aName ) :
|
||||
|
||||
+14
-4
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "bitmap_base.h"
|
||||
|
||||
#include <wx/dc.h>
|
||||
#include <wx/mstream.h>
|
||||
|
||||
|
||||
@@ -238,10 +239,19 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
aDC->SetUserScale( scale * GetScalingFactor(), scale * GetScalingFactor() );
|
||||
aDC->SetLogicalOrigin( logicalOriginX / GetScalingFactor(),
|
||||
logicalOriginY / GetScalingFactor() );
|
||||
aDC->DrawBitmap( *m_bitmap,
|
||||
KiROUND( pos.x / GetScalingFactor() ),
|
||||
KiROUND( pos.y / GetScalingFactor() ),
|
||||
true );
|
||||
|
||||
if( GetGRForceBlackPenState() )
|
||||
{
|
||||
wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
|
||||
aDC->DrawBitmap( result, KiROUND( pos.x / GetScalingFactor() ),
|
||||
KiROUND( pos.y / GetScalingFactor() ), true );
|
||||
}
|
||||
else
|
||||
{
|
||||
aDC->DrawBitmap( *m_bitmap, KiROUND( pos.x / GetScalingFactor() ),
|
||||
KiROUND( pos.y / GetScalingFactor() ), true );
|
||||
}
|
||||
|
||||
aDC->SetUserScale( scale, scale );
|
||||
aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
|
||||
}
|
||||
|
||||
+41
-46
@@ -33,7 +33,6 @@
|
||||
#include <confirm.h>
|
||||
#include <bitmaps.h>
|
||||
#include <html_messagebox.h>
|
||||
#include <dialog_exit_base.h>
|
||||
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
@@ -153,65 +152,56 @@ long KIDIALOG::getStyle( KD_TYPE aType )
|
||||
}
|
||||
|
||||
|
||||
class DIALOG_EXIT: public DIALOG_EXIT_BASE
|
||||
{
|
||||
public:
|
||||
DIALOG_EXIT( wxWindow *aParent, const wxString& aWarning, const wxString& aMessage,
|
||||
const wxString& aOKLabel, const wxString& aCancelLabel ) :
|
||||
DIALOG_EXIT_BASE( aParent )
|
||||
{
|
||||
m_bitmap->SetBitmap( KiBitmap( dialog_warning_xpm ) );
|
||||
m_TextInfo->SetLabel( aWarning );
|
||||
m_staticTextWarningMessage->SetLabel( aMessage );
|
||||
|
||||
m_sdbSizerOK->SetLabel( aOKLabel );
|
||||
m_sdbSizerCancel->SetLabel( aCancelLabel );
|
||||
m_sdbSizerOK->SetDefault();
|
||||
|
||||
FinishDialogSettings();
|
||||
};
|
||||
|
||||
private:
|
||||
void OnSave( wxCommandEvent& event ) override { EndModal( wxID_YES ); }
|
||||
void OnDiscard( wxCommandEvent& event ) override { EndModal( wxID_NO ); }
|
||||
};
|
||||
|
||||
|
||||
int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage, bool* aApplyToAll )
|
||||
{
|
||||
DIALOG_EXIT dlg( parent, aMessage,
|
||||
_( "If you don't save, all your changes will be permanently lost." ),
|
||||
_( "Save" ), _( "Cancel" ) );
|
||||
wxRichMessageDialog dlg( parent, aMessage, wxEmptyString,
|
||||
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.ShowDetailedText( _( "If you don't save, all your changes will be permanently lost." ) );
|
||||
dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Save" ) ),
|
||||
wxMessageDialog::ButtonLabel( _( "Discard Changes" ) ) );
|
||||
|
||||
dlg.m_ApplyToAllOpt->Show( aApplyToAll != nullptr );
|
||||
if( aApplyToAll )
|
||||
dlg.ShowCheckBox( _( "Apply to all" ), true );
|
||||
|
||||
int ret = dlg.ShowModal();
|
||||
|
||||
if( aApplyToAll )
|
||||
*aApplyToAll = dlg.m_ApplyToAllOpt->GetValue();
|
||||
*aApplyToAll = dlg.IsCheckBoxChecked();
|
||||
|
||||
// Returns wxID_YES, wxID_NO, or wxID_CANCEL
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
|
||||
{
|
||||
wxMessageDialog dlg( parent, aMessage, wxEmptyString,
|
||||
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
|
||||
dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Save" ) ),
|
||||
wxMessageDialog::ButtonLabel( _( "Discard Changes" ) ) );
|
||||
|
||||
// Returns wxID_YES, wxID_NO, or wxID_CANCEL
|
||||
return dlg.ShowModal();
|
||||
}
|
||||
|
||||
|
||||
bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage )
|
||||
{
|
||||
DIALOG_EXIT dlg( parent, aMessage,
|
||||
_( "Your current changes will be permanently lost." ),
|
||||
_( "Revert" ), _( "Cancel" ) );
|
||||
wxMessageDialog dlg( parent, aMessage, wxEmptyString,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "Your current changes will be permanently lost." ) );
|
||||
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( _( "Revert" ) ),
|
||||
wxMessageDialog::ButtonLabel( _( "Cancel" ) ) );
|
||||
|
||||
dlg.m_ApplyToAllOpt->Show( false );
|
||||
dlg.m_DiscardButton->Show( false );
|
||||
|
||||
return dlg.ShowModal() == wxID_YES;
|
||||
return dlg.ShowModal() == wxID_OK;
|
||||
}
|
||||
|
||||
|
||||
bool HandleUnsavedChanges( wxWindow* aParent, const wxString& aMessage,
|
||||
const std::function<bool()>& aSaveFunction )
|
||||
{
|
||||
switch( UnsavedChangesDialog( aParent, aMessage, nullptr ) )
|
||||
switch( UnsavedChangesDialog( aParent, aMessage ) )
|
||||
{
|
||||
case wxID_YES: return aSaveFunction();
|
||||
case wxID_NO: return true;
|
||||
@@ -221,20 +211,24 @@ bool HandleUnsavedChanges( wxWindow* aParent, const wxString& aMessage,
|
||||
}
|
||||
|
||||
|
||||
int YesOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxString& aMessage,
|
||||
const wxString& aOKLabel, const wxString& aCancelLabel, bool* aApplyToAll )
|
||||
int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxString& aMessage,
|
||||
const wxString& aOKLabel, const wxString& aCancelLabel, bool* aApplyToAll )
|
||||
{
|
||||
DIALOG_EXIT dlg( aParent, aWarning, aMessage, aOKLabel, aCancelLabel );
|
||||
wxRichMessageDialog dlg( aParent, aMessage, wxEmptyString,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.ShowDetailedText( _( "If you don't save, all your changes will be permanently lost." ) );
|
||||
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( aOKLabel ),
|
||||
wxMessageDialog::ButtonLabel( aCancelLabel ) );
|
||||
|
||||
dlg.m_ApplyToAllOpt->Show( aApplyToAll != nullptr );
|
||||
dlg.m_DiscardButton->Show( false );
|
||||
if( aApplyToAll )
|
||||
dlg.ShowCheckBox( _( "Apply to all" ), true );
|
||||
|
||||
int ret = dlg.ShowModal();
|
||||
|
||||
if( aApplyToAll )
|
||||
*aApplyToAll = dlg.m_ApplyToAllOpt->GetValue();
|
||||
*aApplyToAll = dlg.IsCheckBoxChecked();
|
||||
|
||||
// Returns wxID_YES, wxID_NO, or wxID_CANCEL
|
||||
// Returns wxID_OK or wxID_CANCEL
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -300,7 +294,8 @@ bool IsOK( wxWindow* aParent, const wxString& aMessage )
|
||||
}
|
||||
|
||||
|
||||
int SelectSingleOption( wxWindow* aParent, const wxString& aTitle, const wxString& aMessage, const wxArrayString& aOptions )
|
||||
int SelectSingleOption( wxWindow* aParent, const wxString& aTitle,
|
||||
const wxString& aMessage, const wxArrayString& aOptions )
|
||||
{
|
||||
wxSingleChoiceDialog dlg( aParent, aMessage, aTitle, aOptions );
|
||||
|
||||
|
||||
@@ -32,11 +32,42 @@
|
||||
#include <common.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
|
||||
/**
|
||||
* Function TransformCircleToPolygon
|
||||
* convert a circle to a polygon, using multiple straight lines
|
||||
* @param aBuffer = a SHAPE_LINE_CHAIN to store the polygon corners
|
||||
* @param aCenter = the center of the circle
|
||||
* @param aRadius = the radius of the circle
|
||||
* @param aCircleToSegmentsCount = the number of segments to approximate a circle
|
||||
* Note: the polygon is inside the circle, so if you want to have the polygon
|
||||
* outside the circle, you should give aRadius calculated with a correction factor
|
||||
*/
|
||||
void TransformCircleToPolygon( SHAPE_LINE_CHAIN& aBuffer,
|
||||
wxPoint aCenter, int aRadius,
|
||||
int aCircleToSegmentsCount )
|
||||
{
|
||||
wxPoint corner_position;
|
||||
double delta = 3600.0 / aCircleToSegmentsCount; // rot angle in 0.1 degree
|
||||
double halfstep = delta/2; // the starting value for rot angles
|
||||
|
||||
for( int ii = 0; ii < aCircleToSegmentsCount; ii++ )
|
||||
{
|
||||
corner_position.x = aRadius;
|
||||
corner_position.y = 0;
|
||||
double angle = (ii * delta) + halfstep;
|
||||
RotatePoint( &corner_position, angle );
|
||||
corner_position += aCenter;
|
||||
aBuffer.Append( corner_position.x, corner_position.y );
|
||||
}
|
||||
|
||||
aBuffer.SetClosed( true );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function TransformCircleToPolygon
|
||||
* convert a circle to a polygon, using multiple straight lines
|
||||
* @param aCornerBuffer = a buffer to store the polygon
|
||||
* @param aCornerBuffer = a SHAPE_POLY_SET to store the polygon
|
||||
* @param aCenter = the center of the circle
|
||||
* @param aRadius = the radius of the circle
|
||||
* @param aCircleToSegmentsCount = the number of segments to approximate a circle
|
||||
@@ -397,40 +428,14 @@ void TransformRingToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
return;
|
||||
}
|
||||
|
||||
aCornerBuffer.NewOutline();
|
||||
SHAPE_POLY_SET buffer;
|
||||
|
||||
// Draw the inner circle of the ring
|
||||
int delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
|
||||
TransformCircleToPolygon( buffer, aCentre, outer_radius, aCircleToSegmentsCount );
|
||||
|
||||
for( int ii = 0; ii < 3600; ii += delta )
|
||||
{
|
||||
curr_point.x = inner_radius;
|
||||
curr_point.y = 0;
|
||||
RotatePoint( &curr_point, ii );
|
||||
curr_point += aCentre;
|
||||
aCornerBuffer.Append( curr_point.x, curr_point.y );
|
||||
}
|
||||
// Build the hole:
|
||||
buffer.NewHole();
|
||||
TransformCircleToPolygon( buffer.Hole( 0, 0 ), aCentre, inner_radius, aCircleToSegmentsCount );
|
||||
|
||||
// Draw the last point of inner circle
|
||||
aCornerBuffer.Append( aCentre.x + inner_radius, aCentre.y );
|
||||
|
||||
// Draw the outer circle of the ring
|
||||
// the first point creates also a segment from the inner to the outer polygon
|
||||
for( int ii = 0; ii < 3600; ii += delta )
|
||||
{
|
||||
curr_point.x = outer_radius;
|
||||
curr_point.y = 0;
|
||||
RotatePoint( &curr_point, -ii );
|
||||
curr_point += aCentre;
|
||||
aCornerBuffer.Append( curr_point.x, curr_point.y );
|
||||
}
|
||||
|
||||
// Draw the last point of outer circle
|
||||
aCornerBuffer.Append( aCentre.x + outer_radius, aCentre.y );
|
||||
|
||||
// And connect the outer polygon to the inner polygon,.
|
||||
// because a segment from inner to the outer polygon was already created,
|
||||
// the final polygon is the inner and the outer outlines connected by
|
||||
// 2 overlapping segments
|
||||
aCornerBuffer.Append( aCentre.x + inner_radius, aCentre.y );
|
||||
buffer.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
aCornerBuffer.Append( buffer );
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
|
||||
* Copyright (C) 2017 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2017-2019 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -68,6 +68,8 @@ extern std::string GetCurlLibVersion();
|
||||
DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
|
||||
: DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo )
|
||||
{
|
||||
wxASSERT( aParent != nullptr );
|
||||
|
||||
m_picInformation = KiBitmap( info_xpm );
|
||||
m_picDevelopers = KiBitmap( preference_xpm );
|
||||
m_picDocWriters = KiBitmap( editor_xpm );
|
||||
@@ -89,11 +91,13 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
|
||||
m_bitmapApp->SetBitmap( icon );
|
||||
}
|
||||
|
||||
m_staticTextAppTitle->SetLabel( m_info.GetAppName() );
|
||||
m_titleName = aParent->GetAboutTitle();
|
||||
m_staticTextAppTitle->SetLabel( m_titleName );
|
||||
m_staticTextCopyright->SetLabel( m_info.GetCopyright() );
|
||||
m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
|
||||
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() );
|
||||
|
||||
SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
|
||||
createNotebooks();
|
||||
|
||||
GetSizer()->SetSizeHints( this );
|
||||
@@ -124,10 +128,13 @@ void DIALOG_ABOUT::createNotebooks()
|
||||
createNotebookHtmlPage( m_auiNotebook, _( "Information" ), m_picInformation,
|
||||
m_info.GetDescription() );
|
||||
|
||||
createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers, m_info.GetDevelopers() );
|
||||
createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters, m_info.GetDocWriters() );
|
||||
createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers,
|
||||
m_info.GetDevelopers() );
|
||||
createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters,
|
||||
m_info.GetDocWriters() );
|
||||
|
||||
createNotebookPageByCategory( m_auiNotebook, _( "Artists" ), m_picArtists, m_info.GetArtists() );
|
||||
createNotebookPageByCategory( m_auiNotebook, _( "Artists" ), m_picArtists,
|
||||
m_info.GetArtists() );
|
||||
createNotebookPageByCategory( m_auiNotebook, _( "Translators" ), m_picTranslators,
|
||||
m_info.GetTranslators() );
|
||||
createNotebookPageByCategory( m_auiNotebook, _( "Packagers" ), m_picPackagers,
|
||||
@@ -237,7 +244,8 @@ void DIALOG_ABOUT::createNotebookPageByCategory(wxAuiNotebook* aParent, const wx
|
||||
wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
|
||||
contributor->GetCategory() + wxT( ":" ),
|
||||
wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false,
|
||||
m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
|
||||
wxFONTWEIGHT_BOLD, false,
|
||||
wxEmptyString ) ); // bold font
|
||||
m_staticText1->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
|
||||
@@ -444,7 +452,7 @@ void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml )
|
||||
#define OFF "OFF" << eol
|
||||
|
||||
wxPlatformInfo platform;
|
||||
aMsg << "Application: " << m_info.GetAppName() << eol;
|
||||
aMsg << "Application: " << m_titleName << eol;
|
||||
aMsg << "Version: " << m_info.GetBuildVersion() << eol;
|
||||
aMsg << "Libraries:" << eol;
|
||||
aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
|
||||
* Copyright (C) 2010-2017 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2010-2019 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -49,6 +49,7 @@ private:
|
||||
wxBitmap m_picTranslators;
|
||||
wxBitmap m_picPackagers;
|
||||
wxBitmap m_picLicense;
|
||||
wxString m_titleName;
|
||||
|
||||
ABOUT_APP_INFO& m_info;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||
// C++ code generated with wxFormBuilder (version Mar 28 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_about_base.h"
|
||||
@@ -12,77 +12,78 @@
|
||||
DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerTitle;
|
||||
bSizerTitle = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerTitle->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_bitmapApp = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerTitle->Add( m_bitmapApp, 1, wxALIGN_CENTER|wxALL, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* b_apptitleSizer;
|
||||
b_apptitleSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticTextAppTitle = new wxStaticText( this, wxID_ANY, _("App Title"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
|
||||
|
||||
m_staticTextAppTitle = new wxStaticText( this, wxID_ANY, _("App Title"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
|
||||
m_staticTextAppTitle->Wrap( -1 );
|
||||
m_staticTextAppTitle->SetFont( wxFont( 14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
|
||||
b_apptitleSizer->Add( m_staticTextAppTitle, 0, wxALIGN_CENTER|wxALL, 5 );
|
||||
|
||||
m_staticTextCopyright = new wxStaticText( this, wxID_ANY, _("Copyright Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
|
||||
|
||||
m_staticTextCopyright = new wxStaticText( this, wxID_ANY, _("Copyright Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
|
||||
m_staticTextCopyright->Wrap( -1 );
|
||||
b_apptitleSizer->Add( m_staticTextCopyright, 0, wxALIGN_CENTER|wxALL, 1 );
|
||||
|
||||
m_staticTextBuildVersion = new wxStaticText( this, wxID_ANY, _("Build Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
|
||||
|
||||
m_staticTextBuildVersion = new wxStaticText( this, wxID_ANY, _("Build Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
|
||||
m_staticTextBuildVersion->Wrap( -1 );
|
||||
b_apptitleSizer->Add( m_staticTextBuildVersion, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_staticTextLibVersion = new wxStaticText( this, wxID_ANY, _("Lib Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
|
||||
|
||||
m_staticTextLibVersion = new wxStaticText( this, wxID_ANY, _("Lib Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
|
||||
m_staticTextLibVersion->Wrap( -1 );
|
||||
b_apptitleSizer->Add( m_staticTextLibVersion, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerTitle->Add( b_apptitleSizer, 10, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerTitle->Add( 0, 0, 2, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerTitle, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_auiNotebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_SCROLL_BUTTONS|wxAUI_NB_TAB_FIXED_WIDTH );
|
||||
m_auiNotebook->SetMinSize( wxSize( 750,350 ) );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerMain->Add( m_auiNotebook, 2, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizerButtons;
|
||||
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_btShowVersionInfo = new wxButton( this, wxID_COPY, _("Show Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_btShowVersionInfo = new wxButton( this, wxID_COPY, _("&Show Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_btShowVersionInfo, 0, wxALL, 5 );
|
||||
|
||||
m_btCopyVersionInfo = new wxButton( this, wxID_COPY, _("Copy Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_btCopyVersionInfo = new wxButton( this, wxID_COPY, _("&Copy Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_btCopyVersionInfo->SetToolTip( _("Copy KiCad version info to the clipboard") );
|
||||
|
||||
|
||||
bSizerButtons->Add( m_btCopyVersionInfo, 0, wxALL, 5 );
|
||||
|
||||
m_btOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_btOk->SetDefault();
|
||||
|
||||
m_btOk = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_btOk->SetDefault();
|
||||
bSizerButtons->Add( m_btOk, 0, wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
|
||||
|
||||
// Connect Events
|
||||
m_btShowVersionInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onShowVersionInfo ), NULL, this );
|
||||
m_btCopyVersionInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onCopyVersionInfo ), NULL, this );
|
||||
@@ -93,5 +94,5 @@ DIALOG_ABOUT_BASE::~DIALOG_ABOUT_BASE()
|
||||
// Disconnect Events
|
||||
m_btShowVersionInfo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onShowVersionInfo ), NULL, this );
|
||||
m_btCopyVersionInfo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onCopyVersionInfo ), NULL, this );
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="13" />
|
||||
<FileVersion major="1" minor="15" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
@@ -14,6 +14,8 @@
|
||||
<property name="file">dialog_about_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">MyProject</property>
|
||||
<property name="namespace"></property>
|
||||
@@ -24,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@@ -52,42 +55,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnAuiFindManager"></event>
|
||||
<event name="OnAuiPaneButton"></event>
|
||||
<event name="OnAuiPaneClose"></event>
|
||||
<event name="OnAuiPaneMaximize"></event>
|
||||
<event name="OnAuiPaneRestore"></event>
|
||||
<event name="OnAuiRender"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnClose"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize"></event>
|
||||
<event name="OnIdle"></event>
|
||||
<event name="OnInitDialog"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
@@ -168,29 +135,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@@ -235,6 +179,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">App Title</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -252,7 +197,7 @@
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxALIGN_CENTRE</property>
|
||||
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
@@ -260,29 +205,6 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
@@ -318,6 +240,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Copyright Info</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -335,7 +258,7 @@
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxALIGN_CENTRE</property>
|
||||
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
@@ -343,29 +266,6 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
@@ -401,6 +301,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Build Version Info</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -418,7 +319,7 @@
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxALIGN_CENTRE</property>
|
||||
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
@@ -426,29 +327,6 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
@@ -484,6 +362,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Lib Version Info</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -501,7 +380,7 @@
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxALIGN_CENTRE</property>
|
||||
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
@@ -509,29 +388,6 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@@ -606,37 +462,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAuiNotebookAllowDND"></event>
|
||||
<event name="OnAuiNotebookBeginDrag"></event>
|
||||
<event name="OnAuiNotebookButton"></event>
|
||||
<event name="OnAuiNotebookDragMotion"></event>
|
||||
<event name="OnAuiNotebookEndDrag"></event>
|
||||
<event name="OnAuiNotebookPageChanged"></event>
|
||||
<event name="OnAuiNotebookPageChanging"></event>
|
||||
<event name="OnAuiNotebookPageClose"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@@ -663,25 +488,31 @@
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_COPY</property>
|
||||
<property name="label">Show Version Info</property>
|
||||
<property name="label">&Show Version Info</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -696,6 +527,8 @@
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
@@ -711,29 +544,6 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onShowVersionInfo</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
@@ -751,25 +561,31 @@
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_COPY</property>
|
||||
<property name="label">Copy Version Info</property>
|
||||
<property name="label">&Copy Version Info</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -784,6 +600,8 @@
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
@@ -799,29 +617,6 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">onCopyVersionInfo</event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
@@ -839,25 +634,31 @@
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_OK</property>
|
||||
<property name="label">OK</property>
|
||||
<property name="label">&OK</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -872,6 +673,8 @@
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
@@ -886,30 +689,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||
// C++ code generated with wxFormBuilder (version Mar 28 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_ABOUT_BASE_H__
|
||||
#define __DIALOG_ABOUT_BASE_H__
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
@@ -31,10 +30,10 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_ABOUT_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_ABOUT_BASE : public wxDialog
|
||||
class DIALOG_ABOUT_BASE : public wxDialog
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
wxStaticBitmap* m_bitmapApp;
|
||||
wxStaticText* m_staticTextAppTitle;
|
||||
@@ -45,17 +44,16 @@ class DIALOG_ABOUT_BASE : public wxDialog
|
||||
wxButton* m_btShowVersionInfo;
|
||||
wxButton* m_btCopyVersionInfo;
|
||||
wxButton* m_btOk;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void onShowVersionInfo( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onCopyVersionInfo( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,471 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,471 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_ABOUT_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_ABOUT_BASE_H__
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 21 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_exit_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DIALOG_EXIT_BASE::DIALOG_EXIT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizerUpper;
|
||||
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerUpper->Add( m_bitmap, 0, wxALL, 5 );
|
||||
|
||||
wxBoxSizer* bSizerMessages;
|
||||
bSizerMessages = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_TextInfo = new wxStaticText( this, wxID_ANY, _("Save changes?"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextInfo->Wrap( -1 );
|
||||
m_TextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
bSizerMessages->Add( m_TextInfo, 0, wxALL, 5 );
|
||||
|
||||
m_staticTextWarningMessage = new wxStaticText( this, wxID_ANY, _("If you don't save, all your changes will be permanently lost."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextWarningMessage->Wrap( 300 );
|
||||
bSizerMessages->Add( m_staticTextWarningMessage, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerUpper->Add( bSizerMessages, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerMain->Add( m_staticline, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 );
|
||||
|
||||
m_buttonSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_ApplyToAllOpt = new wxCheckBox( this, wxID_ANY, _("Apply to all"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonSizer->Add( m_ApplyToAllOpt, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxTOP, 5 );
|
||||
|
||||
|
||||
m_buttonSizer->Add( 20, 0, 1, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_DiscardButton = new wxButton( this, wxID_ANY, _("Discard Changes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonSizer->Add( m_DiscardButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
|
||||
m_buttonSizer->Add( 20, 0, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
m_buttonSizer->Add( m_sdbSizer, 0, wxBOTTOM|wxTOP, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( m_buttonSizer, 0, wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
bSizerMain->Fit( this );
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_DiscardButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnDiscard ), NULL, this );
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnSave ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_EXIT_BASE::~DIALOG_EXIT_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_DiscardButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnDiscard ), NULL, this );
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnSave ), NULL, this );
|
||||
|
||||
}
|
||||
@@ -1,511 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="15" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_exit_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_exit_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_EXIT_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerUpper</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticBitmap" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">Load From File; </property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_bitmap</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMessages</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font">,90,92,-1,70,0</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Save changes?</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_TextInfo</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">If you don't save, all your changes will be permanently lost.</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextWarningMessage</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">300</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticline</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxLI_HORIZONTAL</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="name">m_buttonSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Apply to all</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_ApplyToAllOpt</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">public</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">20</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Discard Changes</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_DiscardButton</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">public</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnDiscard</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">20</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">1</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
<property name="Help">0</property>
|
||||
<property name="No">0</property>
|
||||
<property name="OK">1</property>
|
||||
<property name="Save">0</property>
|
||||
<property name="Yes">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnOKButtonClick">OnSave</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
||||
@@ -1,63 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 21 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/statbmp.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_EXIT_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_EXIT_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticBitmap* m_bitmap;
|
||||
wxStaticText* m_TextInfo;
|
||||
wxStaticText* m_staticTextWarningMessage;
|
||||
wxStaticLine* m_staticline;
|
||||
wxBoxSizer* m_buttonSizer;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnDiscard( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSave( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
wxCheckBox* m_ApplyToAllOpt;
|
||||
wxButton* m_DiscardButton;
|
||||
|
||||
DIALOG_EXIT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_EXIT_BASE();
|
||||
|
||||
};
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <dpi_scaling.h>
|
||||
#include <kiface_i.h>
|
||||
#include <pgm_base.h>
|
||||
#include <id.h>
|
||||
|
||||
#include <wx/graphics.h>
|
||||
|
||||
|
||||
@@ -21,13 +21,16 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <panel_hotkeys_editor.h>
|
||||
#include <bitmaps.h>
|
||||
#include <confirm.h>
|
||||
#include <eda_base_frame.h>
|
||||
#include <panel_hotkeys_editor.h>
|
||||
|
||||
#include <wx/srchctrl.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/srchctrl.h>
|
||||
#include <wx/statline.h>
|
||||
|
||||
#include <widgets/button_row_panel.h>
|
||||
#include <widgets/ui_common.h>
|
||||
@@ -70,7 +73,33 @@ PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aW
|
||||
m_hotkeyStore( aShowHotkeys )
|
||||
{
|
||||
const auto margin = KIUI::GetStdMargin();
|
||||
auto mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
m_errorMessageSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
// Setup the sub-sizer to contain the bitmap and header text
|
||||
wxBoxSizer* errImgHeadSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxStaticBitmap* valid_img = new wxStaticBitmap(
|
||||
this, wxID_ANY, KiBitmap( cancel_xpm ), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
wxStaticText* err_head = new wxStaticText( this, wxID_ANY, _( "Hotkey errors detected" ),
|
||||
wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
|
||||
errImgHeadSizer->Add( valid_img, 0, wxALL, 5 );
|
||||
errImgHeadSizer->Add( err_head, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_errorMessageSizer->Add( errImgHeadSizer, 0, wxTOP | wxLEFT | wxRIGHT, margin );
|
||||
|
||||
// Setup the error message to give the user information about any problems with the hotkeys,
|
||||
// but only do this if they can actually change them
|
||||
if( !m_readOnly )
|
||||
{
|
||||
m_errorMessage = new wxStaticText(
|
||||
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
|
||||
m_errorMessageSizer->Add( m_errorMessage, 0, wxALL, 5 );
|
||||
}
|
||||
m_errorMessageSizer->Add( new wxStaticLine( this ), 0, wxALL | wxEXPAND, 2 );
|
||||
|
||||
// Add the validity text to the main sizer and hide the entire sizer
|
||||
m_mainSizer->Add( m_errorMessageSizer, 0, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, margin );
|
||||
|
||||
// Sub-sizer for setting a wider side margin
|
||||
// TODO: Can this be set by the parent widget- doesn't seem to be
|
||||
@@ -87,9 +116,9 @@ PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aW
|
||||
if( !m_readOnly )
|
||||
installButtons( bMargins );
|
||||
|
||||
mainSizer->Add( bMargins, 1, wxEXPAND | wxRIGHT | wxLEFT, side_margins );
|
||||
m_mainSizer->Add( bMargins, 1, wxEXPAND | wxRIGHT | wxLEFT, side_margins );
|
||||
|
||||
this->SetSizer( mainSizer );
|
||||
this->SetSizer( m_mainSizer );
|
||||
this->Layout();
|
||||
|
||||
// Connect Events
|
||||
@@ -125,7 +154,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
||||
_( "Import..." ),
|
||||
_( "Import hotkey definitions from an external file, replacing the current values" ),
|
||||
[this]( wxCommandEvent& ){
|
||||
m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname );
|
||||
onImportHotkeyConfigFromFile();
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -144,6 +173,22 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
||||
}
|
||||
|
||||
|
||||
void PANEL_HOTKEYS_EDITOR::onImportHotkeyConfigFromFile()
|
||||
{
|
||||
m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname );
|
||||
|
||||
if( !m_hotkeyStore.TestStoreValidity() )
|
||||
{
|
||||
wxString msg = _( "The imported file contains invalid hotkeys. "
|
||||
"Please correct the errors before continuing." );
|
||||
|
||||
wxString errKeys;
|
||||
m_hotkeyStore.GetStoreValidityMessage( errKeys );
|
||||
DisplayErrorMessage( this, msg, errKeys );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_HOTKEYS_EDITOR::TransferDataToWindow()
|
||||
{
|
||||
return m_hotkeyListCtrl->TransferDataToControl();
|
||||
@@ -167,3 +212,34 @@ void PANEL_HOTKEYS_EDITOR::OnFilterSearch( wxCommandEvent& aEvent )
|
||||
const auto searchStr = aEvent.GetString();
|
||||
m_hotkeyListCtrl->ApplyFilterString( searchStr );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_HOTKEYS_EDITOR::UpdateErrorMessage()
|
||||
{
|
||||
wxString validMessage;
|
||||
bool isValid = m_hotkeyStore.GetStoreValidityMessage( validMessage );
|
||||
|
||||
if( isValid )
|
||||
{
|
||||
// Hide the error message sizer if all the hotkeys are valid
|
||||
if( !m_readOnly )
|
||||
{
|
||||
m_errorMessage->SetLabelText( wxEmptyString );
|
||||
m_errorMessage->Update();
|
||||
}
|
||||
|
||||
m_mainSizer->Hide( m_errorMessageSizer );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update the message text and ensure it is showing if there are errors
|
||||
if( !m_readOnly )
|
||||
{
|
||||
m_errorMessage->SetLabelText( validMessage );
|
||||
m_errorMessage->Update();
|
||||
}
|
||||
|
||||
m_mainSizer->Show( m_errorMessageSizer );
|
||||
}
|
||||
m_mainSizer->Layout();
|
||||
}
|
||||
|
||||
+11
-4
@@ -109,7 +109,9 @@ long long int ECOORD::ConvertToNm( int aValue, enum EAGLE_UNIT aUnit )
|
||||
case EU_MIL: ret = (long long) aValue * 25400; break;
|
||||
}
|
||||
|
||||
wxASSERT( ( ret > 0 ) == ( aValue > 0 ) ); // check for overflow
|
||||
if( ( ret > 0 ) != ( aValue > 0 ) )
|
||||
wxLogError( _( "Invalid size %lld: too large" ), aValue );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -283,8 +285,13 @@ wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAn
|
||||
wxPoint mid = ( aStart + aEnd ) / 2;
|
||||
|
||||
double dlen = sqrt( dx*dx + dy*dy );
|
||||
wxASSERT( dlen != 0 );
|
||||
wxASSERT( aAngle != 0 );
|
||||
|
||||
if( !std::isnormal( dlen ) || !std::isnormal( aAngle ) )
|
||||
{
|
||||
THROW_IO_ERROR(
|
||||
wxString::Format( _( "Invalid Arc with radius %f and angle %f" ), dlen, aAngle ) );
|
||||
}
|
||||
|
||||
double dist = dlen / ( 2 * tan( DEG2RAD( aAngle ) / 2 ) );
|
||||
|
||||
wxPoint center(
|
||||
@@ -608,7 +615,7 @@ wxSize ETEXT::ConvertSize() const
|
||||
}
|
||||
else
|
||||
{
|
||||
wxASSERT( false );
|
||||
wxLogDebug( "Invalid font name \"%s\"", fontName );
|
||||
textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,8 +341,11 @@ bool FP_LIB_TABLE::FootprintExists( const wxString& aNickname, const wxString& a
|
||||
{
|
||||
try
|
||||
{
|
||||
std::unique_ptr<MODULE> m( FootprintLoad( aNickname, aFootprintName ) );
|
||||
return m.get() != nullptr;
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
|
||||
return row->plugin->FootprintExists( row->GetFullURI( true ), aFootprintName,
|
||||
row->GetProperties() );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
|
||||
@@ -117,9 +117,47 @@ const VECTOR2D CAIRO_GAL_BASE::xform( const VECTOR2D& aP )
|
||||
|
||||
const double CAIRO_GAL_BASE::angle_xform( const double aAngle )
|
||||
{
|
||||
double world_angle = -std::atan2( currentWorld2Screen.xy, currentWorld2Screen.xx );
|
||||
// calculate rotation angle due to the rotation transform
|
||||
// and if flipped on X axis.
|
||||
double world_rotation = -std::atan2( currentWorld2Screen.xy, currentWorld2Screen.xx );
|
||||
|
||||
return std::fmod( aAngle + world_angle, 2.0 * M_PI );
|
||||
// When flipped on X axis, the rotation angle is M_PI - initial angle:
|
||||
if( IsFlippedX() )
|
||||
world_rotation = M_PI - world_rotation;
|
||||
|
||||
return std::fmod( aAngle + world_rotation, 2.0 * M_PI );
|
||||
}
|
||||
|
||||
|
||||
void CAIRO_GAL_BASE::arc_angles_xform_and_normalize( double& aStartAngle, double& aEndAngle )
|
||||
{
|
||||
double startAngle = aStartAngle;
|
||||
double endAngle = aEndAngle;
|
||||
|
||||
// When the view is flipped, the coordinates are flipped by the matrix transform
|
||||
// However, arc angles need to be "flipped": the flipped angle is M_PI - initial angle.
|
||||
if( IsFlippedX() )
|
||||
{
|
||||
startAngle = M_PI - startAngle;
|
||||
endAngle = M_PI - endAngle;
|
||||
}
|
||||
|
||||
// Normalize arc angles
|
||||
SWAP( startAngle, >, endAngle );
|
||||
|
||||
// now rotate arc according to the rotation transform matrix
|
||||
// Remark:
|
||||
// We call angle_xform() to calculate angles according to the flip/rotation
|
||||
// transform and normatize between -2M_PI and +2M_PI.
|
||||
// Therefore, if aStartAngle = aEndAngle + 2*n*M_PI, the transform gives
|
||||
// aEndAngle = aStartAngle
|
||||
// So, if this is the case, force the aEndAngle value to draw a circle.
|
||||
aStartAngle = angle_xform( startAngle );
|
||||
|
||||
if( std::abs( aEndAngle - aStartAngle ) >= 2*M_PI ) // arc is a full circle
|
||||
aEndAngle = aStartAngle + 2*M_PI;
|
||||
else
|
||||
aEndAngle = angle_xform( endAngle );
|
||||
}
|
||||
|
||||
|
||||
@@ -259,10 +297,11 @@ void CAIRO_GAL_BASE::DrawArc( const VECTOR2D& aCenterPoint, double aRadius, doub
|
||||
{
|
||||
syncLineWidth();
|
||||
|
||||
SWAP( aStartAngle, >, aEndAngle );
|
||||
auto startAngleS = angle_xform( aStartAngle );
|
||||
auto endAngleS = angle_xform( aEndAngle );
|
||||
auto r = xform( aRadius );
|
||||
// calculate start and end arc angles according to the rotation transform matrix
|
||||
// and normalize:
|
||||
arc_angles_xform_and_normalize( aStartAngle, aEndAngle );
|
||||
|
||||
double r = xform( aRadius );
|
||||
|
||||
// N.B. This is backwards. We set this because we want to adjust the center
|
||||
// point that changes both endpoints. In the worst case, this is twice as far.
|
||||
@@ -278,7 +317,7 @@ void CAIRO_GAL_BASE::DrawArc( const VECTOR2D& aCenterPoint, double aRadius, doub
|
||||
if( isFillEnabled )
|
||||
cairo_move_to( currentContext, mid.x, mid.y );
|
||||
|
||||
cairo_arc( currentContext, mid.x, mid.y, r, startAngleS, endAngleS );
|
||||
cairo_arc( currentContext, mid.x, mid.y, r, aStartAngle, aEndAngle );
|
||||
|
||||
if( isFillEnabled )
|
||||
cairo_close_path( currentContext );
|
||||
@@ -304,10 +343,14 @@ void CAIRO_GAL_BASE::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadiu
|
||||
}
|
||||
|
||||
syncLineWidth();
|
||||
SWAP( aStartAngle, >, aEndAngle );
|
||||
auto startAngleS = angle_xform( aStartAngle );
|
||||
auto endAngleS = angle_xform( aEndAngle );
|
||||
auto r = xform( aRadius );
|
||||
|
||||
// calculate start and end arc angles according to the rotation transform matrix
|
||||
// and normalize:
|
||||
double startAngleS = aStartAngle;
|
||||
double endAngleS = aEndAngle;
|
||||
arc_angles_xform_and_normalize( startAngleS, endAngleS );
|
||||
|
||||
double r = xform( aRadius );
|
||||
|
||||
// N.B. This is backwards. We set this because we want to adjust the center
|
||||
// point that changes both endpoints. In the worst case, this is twice as far.
|
||||
@@ -316,7 +359,7 @@ void CAIRO_GAL_BASE::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadiu
|
||||
lineWidthIsOdd = !( static_cast<int>( aRadius ) % 1 );
|
||||
|
||||
auto mid = roundp( xform( aCenterPoint ) );
|
||||
auto width = xform( aWidth / 2.0 );
|
||||
double width = xform( aWidth / 2.0 );
|
||||
auto startPointS = VECTOR2D( r, 0.0 ).Rotate( startAngleS );
|
||||
auto endPointS = VECTOR2D( r, 0.0 ).Rotate( endAngleS );
|
||||
|
||||
@@ -1491,14 +1534,6 @@ void CAIRO_GAL_BASE::DrawGrid()
|
||||
VECTOR2D worldStartPoint = screenWorldMatrix * VECTOR2D( 0.0, 0.0 );
|
||||
VECTOR2D worldEndPoint = screenWorldMatrix * VECTOR2D( screenSize );
|
||||
|
||||
double gridThreshold = KiROUND( computeMinGridSpacing() / worldScale );
|
||||
|
||||
if( gridStyle == GRID_STYLE::SMALL_CROSS )
|
||||
gridThreshold *= 2.0;
|
||||
|
||||
int gridScreenSizeDense = gridSize.x;
|
||||
int gridScreenSizeCoarse = KiROUND( gridSize.x * static_cast<double>( gridTick ) );
|
||||
|
||||
// Compute the line marker or point radius of the grid
|
||||
// Note: generic grids can't handle sub-pixel lines without
|
||||
// either losing fine/course distinction or having some dots
|
||||
@@ -1516,21 +1551,27 @@ void CAIRO_GAL_BASE::DrawGrid()
|
||||
if( !gridVisibility )
|
||||
return;
|
||||
|
||||
VECTOR2D gridScreenSize( gridSize );
|
||||
|
||||
double gridThreshold = KiROUND( computeMinGridSpacing() / worldScale );
|
||||
|
||||
if( gridStyle == GRID_STYLE::SMALL_CROSS )
|
||||
gridThreshold *= 2.0;
|
||||
|
||||
// If we cannot display the grid density, scale down by a tick size and
|
||||
// try again. Eventually, we get some representation of the grid
|
||||
while( std::min( gridScreenSizeDense, gridScreenSizeCoarse ) <= gridThreshold )
|
||||
while( std::min( gridScreenSize.x, gridScreenSize.y ) <= gridThreshold )
|
||||
{
|
||||
gridScreenSizeCoarse *= gridTick;
|
||||
gridScreenSizeDense *= gridTick;
|
||||
gridScreenSize = gridScreenSize * static_cast<double>( gridTick );
|
||||
}
|
||||
|
||||
// Compute grid starting and ending indexes to draw grid points on the
|
||||
// visible screen area
|
||||
// Note: later any point coordinate will be offsetted by gridOrigin
|
||||
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSizeDense );
|
||||
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSizeDense );
|
||||
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSizeDense );
|
||||
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSizeDense );
|
||||
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSize.x );
|
||||
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSize.x );
|
||||
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSize.y );
|
||||
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSize.y );
|
||||
|
||||
// Ensure start coordinate > end coordinate
|
||||
|
||||
@@ -1551,27 +1592,27 @@ void CAIRO_GAL_BASE::DrawGrid()
|
||||
// Vertical lines
|
||||
for( int j = gridStartY; j <= gridEndY; j++ )
|
||||
{
|
||||
const double y = j * gridScreenSizeDense + gridOrigin.y;
|
||||
const double y = j * gridScreenSize.y + gridOrigin.y;
|
||||
|
||||
if( axesEnabled && y == 0 )
|
||||
if( axesEnabled && y == 0.0 )
|
||||
continue;
|
||||
|
||||
SetLineWidth( ( j % gridTick ) ? marker : doubleMarker );
|
||||
drawGridLine( VECTOR2D( gridStartX * gridScreenSizeDense + gridOrigin.x, y ),
|
||||
VECTOR2D( gridEndX * gridScreenSizeDense + gridOrigin.x, y ) );
|
||||
drawGridLine( VECTOR2D( gridStartX * gridScreenSize.x + gridOrigin.x, y ),
|
||||
VECTOR2D( gridEndX * gridScreenSize.x + gridOrigin.x, y ) );
|
||||
}
|
||||
|
||||
// Horizontal lines
|
||||
for( int i = gridStartX; i <= gridEndX; i++ )
|
||||
{
|
||||
const double x = i * gridScreenSizeDense + gridOrigin.x;
|
||||
const double x = i * gridScreenSize.x + gridOrigin.x;
|
||||
|
||||
if( axesEnabled && x == 0 )
|
||||
if( axesEnabled && x == 0.0 )
|
||||
continue;
|
||||
|
||||
SetLineWidth( ( i % gridTick ) ? marker : doubleMarker );
|
||||
drawGridLine( VECTOR2D( x, gridStartY * gridScreenSizeDense + gridOrigin.y ),
|
||||
VECTOR2D( x, gridEndY * gridScreenSizeDense + gridOrigin.y ) );
|
||||
drawGridLine( VECTOR2D( x, gridStartY * gridScreenSize.y + gridOrigin.y ),
|
||||
VECTOR2D( x, gridEndY * gridScreenSize.y + gridOrigin.y ) );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1585,8 +1626,8 @@ void CAIRO_GAL_BASE::DrawGrid()
|
||||
{
|
||||
bool tickX = ( i % gridTick == 0 );
|
||||
SetLineWidth( ( ( tickX && tickY ) ? doubleMarker : marker ) );
|
||||
auto pos = VECTOR2D( i * gridScreenSizeDense + gridOrigin.x,
|
||||
j * gridScreenSizeDense + gridOrigin.y );
|
||||
auto pos = VECTOR2D( i * gridScreenSize.x + gridOrigin.x,
|
||||
j * gridScreenSize.y + gridOrigin.y );
|
||||
|
||||
if( gridStyle == GRID_STYLE::SMALL_CROSS )
|
||||
drawGridCross( pos );
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <gal/gal_display_options.h>
|
||||
|
||||
#include <wx/config.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
#include <config_map.h>
|
||||
#include <dpi_scaling.h>
|
||||
@@ -50,6 +51,16 @@ static const UTIL::CFG_MAP<KIGFX::GRID_STYLE> gridStyleConfigVals =
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Flag to enable GAL_DISPLAY_OPTIONS loggin
|
||||
*
|
||||
* Use "KICAD_GAL_DISPLAY_OPTIONS" to enable.
|
||||
*
|
||||
* @ingroup trace_env_vars
|
||||
*/
|
||||
static const wxChar* traceGalDispOpts = wxT( "KICAD_GAL_DISPLAY_OPTIONS" );
|
||||
|
||||
|
||||
GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS()
|
||||
: gl_antialiasing_mode( OPENGL_ANTIALIASING_MODE::NONE ),
|
||||
cairo_antialiasing_mode( CAIRO_ANTIALIASING_MODE::NONE ),
|
||||
@@ -67,6 +78,8 @@ void GAL_DISPLAY_OPTIONS::ReadAppConfig( wxConfigBase& aCfg, const wxString& aBa
|
||||
{
|
||||
const wxString baseName = aBaseName + GAL_DISPLAY_OPTIONS_KEY;
|
||||
|
||||
wxLogTrace( traceGalDispOpts, "Reading options with base name '%s'", baseName );
|
||||
|
||||
long readLong; // Temp value buffer
|
||||
|
||||
aCfg.Read( baseName + GalGridStyleConfig, &readLong,
|
||||
@@ -85,6 +98,8 @@ void GAL_DISPLAY_OPTIONS::ReadAppConfig( wxConfigBase& aCfg, const wxString& aBa
|
||||
|
||||
void GAL_DISPLAY_OPTIONS::ReadCommonConfig( wxConfigBase& aCommonConfig, wxWindow* aWindow )
|
||||
{
|
||||
wxLogTrace( traceGalDispOpts, "Reading common config" );
|
||||
|
||||
int temp;
|
||||
aCommonConfig.Read(
|
||||
GAL_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
|
||||
@@ -106,6 +121,8 @@ void GAL_DISPLAY_OPTIONS::ReadCommonConfig( wxConfigBase& aCommonConfig, wxWindo
|
||||
void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase& aCommonConfig, wxConfigBase& aAppConfig,
|
||||
const wxString& aBaseCfgName, wxWindow* aWindow )
|
||||
{
|
||||
wxLogTrace( traceGalDispOpts, "Reading common and app config (%s)", aBaseCfgName );
|
||||
|
||||
ReadAppConfig( aAppConfig, aBaseCfgName );
|
||||
|
||||
ReadCommonConfig( aCommonConfig, aWindow );
|
||||
@@ -116,6 +133,8 @@ void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase& aCfg, const wxString& aBase
|
||||
{
|
||||
const wxString baseName = aBaseName + GAL_DISPLAY_OPTIONS_KEY;
|
||||
|
||||
wxLogTrace( traceGalDispOpts, "Writing app config (%s)", baseName );
|
||||
|
||||
aCfg.Write( baseName + GalGridStyleConfig,
|
||||
UTIL::GetConfigForVal( gridStyleConfigVals, m_gridStyle ) );
|
||||
|
||||
@@ -129,5 +148,7 @@ void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase& aCfg, const wxString& aBase
|
||||
|
||||
void GAL_DISPLAY_OPTIONS::NotifyChanged()
|
||||
{
|
||||
wxLogTrace( traceGalDispOpts, "Change notification" );
|
||||
|
||||
Notify( &GAL_DISPLAY_OPTIONS_OBSERVER::OnGalDisplayOptionsChanged, *this );
|
||||
}
|
||||
@@ -1256,29 +1256,27 @@ void OPENGL_GAL::DrawGrid()
|
||||
if( !gridVisibility )
|
||||
return;
|
||||
|
||||
int gridScreenSizeDense = gridSize.x;
|
||||
int gridScreenSizeCoarse = KiROUND( gridSize.x * static_cast<double>( gridTick ) );
|
||||
VECTOR2D gridScreenSize( gridSize );
|
||||
|
||||
double gridThreshold = KiROUND( computeMinGridSpacing() / worldScale );
|
||||
double gridThreshold = computeMinGridSpacing() / worldScale;
|
||||
|
||||
if( gridStyle == GRID_STYLE::SMALL_CROSS )
|
||||
gridThreshold *= 2.0;
|
||||
|
||||
// If we cannot display the grid density, scale down by a tick size and
|
||||
// try again. Eventually, we get some representation of the grid
|
||||
while( std::min( gridScreenSizeDense, gridScreenSizeCoarse ) <= gridThreshold )
|
||||
while( std::min( gridScreenSize.x, gridScreenSize.y ) <= gridThreshold )
|
||||
{
|
||||
gridScreenSizeCoarse *= gridTick;
|
||||
gridScreenSizeDense *= gridTick;
|
||||
gridScreenSize = gridScreenSize * static_cast<double>( gridTick );
|
||||
}
|
||||
|
||||
// Compute grid staring and ending indexes to draw grid points on the
|
||||
// Compute grid starting and ending indexes to draw grid points on the
|
||||
// visible screen area
|
||||
// Note: later any point coordinate will be offsetted by gridOrigin
|
||||
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSizeDense );
|
||||
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSizeDense );
|
||||
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSizeDense );
|
||||
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSizeDense );
|
||||
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSize.x );
|
||||
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSize.x );
|
||||
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSize.y );
|
||||
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSize.y );
|
||||
|
||||
// Ensure start coordinate > end coordinate
|
||||
SWAP( gridStartX, >, gridEndX );
|
||||
@@ -1312,7 +1310,7 @@ void OPENGL_GAL::DrawGrid()
|
||||
for( int j = gridStartY; j <= gridEndY; j++ )
|
||||
{
|
||||
bool tickY = ( j % gridTick == 0 );
|
||||
int posY = j * gridScreenSizeDense + gridOrigin.y;
|
||||
const double posY = j * gridScreenSize.y + gridOrigin.y;
|
||||
|
||||
// Horizontal positions
|
||||
for( int i = gridStartX; i <= gridEndX; i++ )
|
||||
@@ -1320,7 +1318,7 @@ void OPENGL_GAL::DrawGrid()
|
||||
bool tickX = ( i % gridTick == 0 );
|
||||
SetLineWidth( ( ( tickX && tickY ) ? majorLineWidth : minorLineWidth ) );
|
||||
auto lineLen = 2.0 * GetLineWidth();
|
||||
auto posX = i * gridScreenSizeDense + gridOrigin.x;
|
||||
auto posX = i * gridScreenSize.x + gridOrigin.x;
|
||||
|
||||
DrawLine( VECTOR2D( posX - lineLen, posY ), VECTOR2D( posX + lineLen, posY ) );
|
||||
DrawLine( VECTOR2D( posX, posY - lineLen ), VECTOR2D( posX, posY + lineLen ) );
|
||||
@@ -1334,15 +1332,15 @@ void OPENGL_GAL::DrawGrid()
|
||||
// Vertical lines
|
||||
for( int j = gridStartY; j <= gridEndY; j++ )
|
||||
{
|
||||
const double y = j * gridScreenSizeDense + gridOrigin.y;
|
||||
const double y = j * gridScreenSize.y + gridOrigin.y;
|
||||
|
||||
// If axes are drawn, skip the lines that would cover them
|
||||
if( axesEnabled && y == 0 )
|
||||
if( axesEnabled && y == 0.0 )
|
||||
continue;
|
||||
|
||||
SetLineWidth( ( j % gridTick == 0 ) ? majorLineWidth : minorLineWidth );
|
||||
VECTOR2D a ( gridStartX * gridScreenSizeDense + gridOrigin.x, y );
|
||||
VECTOR2D b ( gridEndX * gridScreenSizeDense + gridOrigin.x, y );
|
||||
VECTOR2D a ( gridStartX * gridScreenSize.x + gridOrigin.x, y );
|
||||
VECTOR2D b ( gridEndX * gridScreenSize.x + gridOrigin.x, y );
|
||||
|
||||
DrawLine( a, b );
|
||||
}
|
||||
@@ -1359,15 +1357,15 @@ void OPENGL_GAL::DrawGrid()
|
||||
// Horizontal lines
|
||||
for( int i = gridStartX; i <= gridEndX; i++ )
|
||||
{
|
||||
const double x = i * gridScreenSizeDense + gridOrigin.x;
|
||||
const double x = i * gridScreenSize.x + gridOrigin.x;
|
||||
|
||||
// If axes are drawn, skip the lines that would cover them
|
||||
if( axesEnabled && x == 0 )
|
||||
if( axesEnabled && x == 0.0 )
|
||||
continue;
|
||||
|
||||
SetLineWidth( ( i % gridTick == 0 ) ? majorLineWidth : minorLineWidth );
|
||||
VECTOR2D a ( x, gridStartY * gridScreenSizeDense + gridOrigin.y );
|
||||
VECTOR2D b ( x, gridEndY * gridScreenSizeDense + gridOrigin.y );
|
||||
VECTOR2D a ( x, gridStartY * gridScreenSize.y + gridOrigin.y );
|
||||
VECTOR2D b ( x, gridEndY * gridScreenSize.y + gridOrigin.y );
|
||||
DrawLine( a, b );
|
||||
}
|
||||
|
||||
|
||||
+18
-7
@@ -150,7 +150,8 @@ wxString GbrMakeProjectGUIDfromString( wxString& aText )
|
||||
std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribute,
|
||||
bool aUseX1StructuredComment )
|
||||
{
|
||||
std::string attribute_string;
|
||||
std::string attribute_string; // the specific aperture attribute (TA.xxx)
|
||||
std::string comment_string; // a optional G04 comment line to write before the TA. line
|
||||
|
||||
// generate a string to print a Gerber Aperture attribute
|
||||
switch( aAttribute )
|
||||
@@ -226,13 +227,18 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
|
||||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_COMPONENTDRILL: // print info associated to a component
|
||||
// round hole in drill files
|
||||
// round pad hole in drill files
|
||||
attribute_string = "TA.AperFunction,ComponentDrill";
|
||||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_SLOTDRILL: // print info associated to a oblong hole in drill files
|
||||
attribute_string = "TA.AperFunction,Slot";
|
||||
break;
|
||||
// print info associated to a component oblong pad hole in drill files
|
||||
// Same as a round pad hole, but is a specific aperture in drill file and
|
||||
// a G04 comment is added to the aperture function
|
||||
case GBR_APERTURE_ATTRIB_COMPONENTOBLONGDRILL:
|
||||
comment_string = "aperture for slot hole";
|
||||
attribute_string = "TA.AperFunction,ComponentDrill";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
std::string full_attribute_string;
|
||||
@@ -240,14 +246,19 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
|
||||
|
||||
if( !attribute_string.empty() )
|
||||
{
|
||||
if( !comment_string.empty() )
|
||||
{
|
||||
full_attribute_string = "G04 " + comment_string + "*\n";
|
||||
}
|
||||
|
||||
if( aUseX1StructuredComment )
|
||||
{
|
||||
full_attribute_string = "G04 #@! ";
|
||||
full_attribute_string += "G04 #@! ";
|
||||
eol_string = "*\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
full_attribute_string = "%";
|
||||
full_attribute_string += "%";
|
||||
eol_string = "*%\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ const SHAPE_LINE_CHAIN SHAPE_ARC::ConvertToPolyline( double aAccuracy ) const
|
||||
double a = sa;
|
||||
|
||||
if( n != 0 )
|
||||
sa += m_centralAngle * (double) i / (double) n;
|
||||
a += m_centralAngle * (double) i / (double) n;
|
||||
|
||||
double x = c.x + r * cos( a * M_PI / 180.0 );
|
||||
double y = c.y + r * sin( a * M_PI / 180.0 );
|
||||
|
||||
@@ -396,12 +396,12 @@ bool SHAPE_POLY_SET::GetNeighbourIndexes( int aGlobalIndex, int* aPrevious, int*
|
||||
}
|
||||
|
||||
|
||||
bool SHAPE_POLY_SET::IsPolygonSelfIntersecting( int aPolygonIndex )
|
||||
bool SHAPE_POLY_SET::IsPolygonSelfIntersecting( int aPolygonIndex ) const
|
||||
{
|
||||
SEGMENT_ITERATOR iterator = IterateSegmentsWithHoles( aPolygonIndex );
|
||||
SEGMENT_ITERATOR innerIterator;
|
||||
CONST_SEGMENT_ITERATOR iterator = CIterateSegmentsWithHoles( aPolygonIndex );
|
||||
CONST_SEGMENT_ITERATOR innerIterator;
|
||||
|
||||
for( iterator = IterateSegmentsWithHoles( aPolygonIndex ); iterator; iterator++ )
|
||||
for( iterator = CIterateSegmentsWithHoles( aPolygonIndex ); iterator; iterator++ )
|
||||
{
|
||||
SEG firstSegment = *iterator;
|
||||
|
||||
@@ -423,7 +423,7 @@ bool SHAPE_POLY_SET::IsPolygonSelfIntersecting( int aPolygonIndex )
|
||||
}
|
||||
|
||||
|
||||
bool SHAPE_POLY_SET::IsSelfIntersecting()
|
||||
bool SHAPE_POLY_SET::IsSelfIntersecting() const
|
||||
{
|
||||
for( unsigned int polygon = 0; polygon < m_polys.size(); polygon++ )
|
||||
{
|
||||
@@ -544,7 +544,15 @@ void SHAPE_POLY_SET::BooleanIntersection( const SHAPE_POLY_SET& a,
|
||||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
|
||||
void SHAPE_POLY_SET::InflateWithLinkedHoles( int aFactor, int aCircleSegmentsCount, POLYGON_MODE aFastMode )
|
||||
{
|
||||
Simplify( aFastMode );
|
||||
Inflate( aFactor, aCircleSegmentsCount );
|
||||
Fracture( aFastMode );
|
||||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount, bool aPreseveCorners )
|
||||
{
|
||||
// A static table to avoid repetitive calculations of the coefficient
|
||||
// 1.0 - cos( M_PI/aCircleSegmentsCount)
|
||||
@@ -554,10 +562,14 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
|
||||
|
||||
ClipperOffset c;
|
||||
|
||||
// N.B. using jtSquare here does not create square corners. They end up mitered by
|
||||
// aFactor. Setting jtMiter and forcing the limit to be aFactor creates sharp corners.
|
||||
JoinType type = aPreseveCorners ? jtMiter : jtRound;
|
||||
|
||||
for( const POLYGON& poly : m_polys )
|
||||
{
|
||||
for( size_t i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( poly[i].convertToClipper( i == 0 ), jtRound, etClosedPolygon );
|
||||
c.AddPath( poly[i].convertToClipper( i == 0 ), type, etClosedPolygon );
|
||||
}
|
||||
|
||||
PolyTree solution;
|
||||
@@ -583,6 +595,7 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
|
||||
coeff = arc_tolerance_factor[aCircleSegmentsCount];
|
||||
|
||||
c.ArcTolerance = std::abs( aFactor ) * coeff;
|
||||
c.MiterLimit = std::abs( aFactor );
|
||||
|
||||
c.Execute( solution, aFactor );
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ bool IsPointOnSegment( const wxPoint& aSegStart, const wxPoint& aSegEnd,
|
||||
|
||||
// Returns true if the segment 1 intersectd the segment 2.
|
||||
bool SegmentIntersectsSegment( const wxPoint &a_p1_l1, const wxPoint &a_p2_l1,
|
||||
const wxPoint &a_p1_l2, const wxPoint &a_p2_l2 )
|
||||
const wxPoint &a_p1_l2, const wxPoint &a_p2_l2,
|
||||
wxPoint* aIntersectionPoint )
|
||||
{
|
||||
|
||||
//We are forced to use 64bit ints because the internal units can oveflow 32bit ints when
|
||||
@@ -87,10 +88,13 @@ bool SegmentIntersectsSegment( const wxPoint &a_p1_l1, const wxPoint &a_p2_l1,
|
||||
num_a = dY_ab * dX_b - dY_b * dX_ab;
|
||||
num_b = dY_ab * dX_a - dY_a * dX_ab;
|
||||
|
||||
//We wont calculate directly the u_k of the intersection point to avoid floating point
|
||||
// division but they could be calculated with:
|
||||
// u_a = (float) num_a / (float) den;
|
||||
// u_b = (float) num_b / (float) den;
|
||||
// Only compute the intersection point if requested
|
||||
if( aIntersectionPoint )
|
||||
{
|
||||
*aIntersectionPoint = a_p1_l1;
|
||||
aIntersectionPoint->x += KiROUND( dX_a * ( double )num_a / ( double )den );
|
||||
aIntersectionPoint->y += KiROUND( dY_a * ( double )num_b / ( double )den );
|
||||
}
|
||||
|
||||
if( den < 0 )
|
||||
{
|
||||
@@ -147,6 +151,15 @@ bool TestSegmentHit( const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int
|
||||
if( aStart.y == aEnd.y && aRefPoint.x > xmin && aRefPoint.x < xmax )
|
||||
return std::abs( delta.y ) <= aDist;
|
||||
|
||||
// Special case for a segment with start == end (equal to a circle)
|
||||
if ( aStart == aEnd )
|
||||
{
|
||||
long double length_square = (long double) delta.x * delta.x + (long double) delta.y * delta.y;
|
||||
long double dist_square = (long double) aDist * aDist;
|
||||
|
||||
return ( length_square <= dist_square );
|
||||
}
|
||||
|
||||
wxPoint len = aEnd - aStart;
|
||||
// Precision note here:
|
||||
// These are 32-bit integers, so squaring requires 64 bits to represent
|
||||
|
||||
+103
-5
@@ -25,6 +25,9 @@
|
||||
|
||||
HOTKEY_STORE::HOTKEY_STORE( EDA_HOTKEY_CONFIG* aHotkeys )
|
||||
{
|
||||
m_isValid = false;
|
||||
m_invalidityCauses = _( "Hotkeys not checked" );
|
||||
|
||||
for( EDA_HOTKEY_CONFIG* section = aHotkeys; section->m_HK_InfoList; ++section )
|
||||
{
|
||||
m_hk_sections.push_back( genSection( *section ) );
|
||||
@@ -113,13 +116,13 @@ void HOTKEY_STORE::ResetAllHotkeysToOriginal()
|
||||
}
|
||||
|
||||
|
||||
bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag,
|
||||
EDA_HOTKEY** aConfKey, EDA_HOTKEY_CONFIG** aConfSect )
|
||||
bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag, EDA_HOTKEY** aConfKey,
|
||||
EDA_HOTKEY_CONFIG** aConfSect, const int aIdCommand )
|
||||
{
|
||||
EDA_HOTKEY* conflicting_key = nullptr;
|
||||
EDA_HOTKEY_CONFIG* conflicting_section = nullptr;
|
||||
|
||||
for( auto& section: m_hk_sections )
|
||||
for( auto& section : m_hk_sections )
|
||||
{
|
||||
const auto& sectionTag = *section.m_section.m_SectionTag;
|
||||
|
||||
@@ -135,7 +138,7 @@ bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag,
|
||||
for( auto& hotkey: section.m_hotkeys )
|
||||
{
|
||||
auto& curr_hk = hotkey.GetCurrentValue();
|
||||
if( aKey == curr_hk.m_KeyCode )
|
||||
if( ( aKey == curr_hk.m_KeyCode ) && ( aIdCommand != curr_hk.m_Idcommand ) )
|
||||
{
|
||||
conflicting_key = &curr_hk;
|
||||
conflicting_section = §ion.m_section;
|
||||
@@ -151,4 +154,99 @@ bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag,
|
||||
*aConfSect = conflicting_section;
|
||||
|
||||
return conflicting_key == nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool HOTKEY_STORE::CheckKeyValidity( long aKey, wxString& aMessage )
|
||||
{
|
||||
// Extract the modifiers and the keycode
|
||||
int modifiers = aKey & ( GR_KB_SHIFT | GR_KB_CTRL | GR_KB_ALT );
|
||||
int keycode = aKey & 0x00FFFFFF;
|
||||
|
||||
// Hotkeys may not contain the shift+SYMBOL sequence.
|
||||
// This sequence gets mapped to (UPPER SYMBOL) in the hotkey logic
|
||||
if( modifiers & GR_KB_SHIFT )
|
||||
{
|
||||
// These catch the ASCII codes for the special characters
|
||||
if( ( keycode <= 64 && keycode >= 32 ) ||
|
||||
( keycode <= 96 && keycode >= 91 ) ||
|
||||
( keycode <= 126 && keycode >= 123 ) )
|
||||
{
|
||||
aMessage = _( "A hotkey cannot contain the shift key and a symbol key." );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// This code block can be used to test the key validity checks
|
||||
#if 0
|
||||
if( modifiers & GR_KB_CTRL )
|
||||
{
|
||||
if( keycode == 'K' )
|
||||
{
|
||||
aMessage = "A hotkey cannot be ctrl+K";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool HOTKEY_STORE::TestStoreValidity()
|
||||
{
|
||||
m_isValid = true;
|
||||
m_invalidityCauses.Clear();
|
||||
|
||||
// Iterate over every key to test it
|
||||
for( HOTKEY_SECTION& section : m_hk_sections )
|
||||
{
|
||||
for( CHANGED_HOTKEY& hotkey : section.m_hotkeys )
|
||||
{
|
||||
EDA_HOTKEY& curr_hk = hotkey.GetCurrentValue();
|
||||
wxString validMessage;
|
||||
|
||||
bool isValid = CheckKeyValidity( curr_hk.m_KeyCode, validMessage );
|
||||
|
||||
// If the key isn't valid, set it and continue
|
||||
if( !isValid )
|
||||
{
|
||||
hotkey.SetValidity( false, validMessage );
|
||||
|
||||
m_invalidityCauses << wxGetTranslation( curr_hk.m_InfoMsg );
|
||||
m_invalidityCauses << ": " << validMessage << "\n";
|
||||
m_isValid = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Test for duplication
|
||||
const wxString& sectionTag = *section.m_section.m_SectionTag;
|
||||
EDA_HOTKEY* conflicting_key = nullptr;
|
||||
EDA_HOTKEY_CONFIG* conflicting_section = nullptr;
|
||||
|
||||
CheckKeyConflicts( curr_hk.m_KeyCode, sectionTag, &conflicting_key,
|
||||
&conflicting_section, curr_hk.m_Idcommand );
|
||||
|
||||
// Not valid if a conflicting key was found
|
||||
if( conflicting_key != nullptr )
|
||||
{
|
||||
wxString keyInfoMsg = wxGetTranslation( conflicting_key->m_InfoMsg );
|
||||
validMessage =
|
||||
wxString::Format( _( "Duplicate of hotkey for \"%s\"" ), keyInfoMsg );
|
||||
|
||||
hotkey.SetValidity( false, validMessage );
|
||||
|
||||
m_invalidityCauses << wxGetTranslation( curr_hk.m_InfoMsg );
|
||||
m_invalidityCauses << ": " << validMessage << "\n";
|
||||
m_isValid = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
// If it made it this far, it is a valid hotkey
|
||||
validMessage = _( "Hotkey is valid" );
|
||||
hotkey.SetValidity( true, validMessage );
|
||||
}
|
||||
}
|
||||
|
||||
return m_isValid;
|
||||
}
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <incremental_text_ctrl.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
/**
|
||||
* Check that a string looks like a floating point number that can
|
||||
* be dealt with.
|
||||
*/
|
||||
static bool validateFloatField( const wxString& aStr )
|
||||
{
|
||||
// Skip empty fields
|
||||
if( aStr.size() == 0 )
|
||||
return false;
|
||||
|
||||
// a single . or , doesn't count as number, although valid in a float
|
||||
if( aStr.size() == 1 )
|
||||
{
|
||||
if( (aStr.compare( "." ) == 0) ||
|
||||
(aStr.compare( "," ) == 0) )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
INCREMENTAL_TEXT_CTRL::INCREMENTAL_TEXT_CTRL() :
|
||||
m_minVal( 0.0 ),
|
||||
m_maxVal( 1.0 ),
|
||||
m_currentValue( 0.0 ),
|
||||
m_precision( 4 )
|
||||
{}
|
||||
|
||||
|
||||
void INCREMENTAL_TEXT_CTRL::SetStep( double aMin, double aMax,
|
||||
STEP_FUNCTION aStepFunc )
|
||||
{
|
||||
wxASSERT( aMin <= aMax );
|
||||
|
||||
m_minVal = std::min( aMin, aMax );
|
||||
m_maxVal = std::max( aMin, aMax );
|
||||
m_stepFunc = std::move( aStepFunc );
|
||||
|
||||
// finally, clamp the current value and re-display
|
||||
updateTextValue();
|
||||
}
|
||||
|
||||
|
||||
void INCREMENTAL_TEXT_CTRL::updateTextValue()
|
||||
{
|
||||
if( m_currentValue > m_maxVal )
|
||||
m_currentValue = m_maxVal;
|
||||
|
||||
if( m_currentValue < m_minVal )
|
||||
m_currentValue = m_minVal;
|
||||
|
||||
wxString fmt = wxString::Format( "%%.%df", m_precision );
|
||||
setTextCtrl( wxString::Format( fmt, m_currentValue ) );
|
||||
}
|
||||
|
||||
|
||||
void INCREMENTAL_TEXT_CTRL::incrementCtrlBy( double aInc )
|
||||
{
|
||||
const wxString txt = getCtrlText();
|
||||
if( !validateFloatField( txt ) )
|
||||
return;
|
||||
|
||||
txt.ToDouble( &m_currentValue );
|
||||
m_currentValue += aInc;
|
||||
|
||||
updateTextValue();
|
||||
}
|
||||
|
||||
|
||||
void INCREMENTAL_TEXT_CTRL::incrementCtrl( bool aUp )
|
||||
{
|
||||
incrementCtrlBy( m_stepFunc( aUp, m_currentValue ) );
|
||||
}
|
||||
|
||||
|
||||
void INCREMENTAL_TEXT_CTRL::SetPrecision( int aPrecision )
|
||||
{
|
||||
m_precision = aPrecision;
|
||||
}
|
||||
|
||||
|
||||
void INCREMENTAL_TEXT_CTRL::SetValue( double aValue )
|
||||
{
|
||||
m_currentValue = aValue;
|
||||
updateTextValue();
|
||||
}
|
||||
|
||||
|
||||
double INCREMENTAL_TEXT_CTRL::GetValue()
|
||||
{
|
||||
// sanitise before handing the value - if the user did something
|
||||
// like close a window with outstanding text changes, we need
|
||||
// to clamp the value and re-interpret the text
|
||||
incrementCtrlBy( 0.0 );
|
||||
|
||||
return m_currentValue;
|
||||
}
|
||||
|
||||
|
||||
SPIN_INCREMENTAL_TEXT_CTRL::SPIN_INCREMENTAL_TEXT_CTRL( wxSpinButton& aSpinBtn,
|
||||
wxTextCtrl& aTextCtrl ):
|
||||
m_spinBtn( aSpinBtn ),
|
||||
m_textCtrl( aTextCtrl )
|
||||
{
|
||||
(void) m_spinBtn;
|
||||
|
||||
// set always enabled, otherwise it's very hard to keep in sync
|
||||
aSpinBtn.SetRange( -INT_MAX, INT_MAX );
|
||||
|
||||
auto spinUpHandler = [this] ( wxSpinEvent& event )
|
||||
{
|
||||
incrementCtrl( true );
|
||||
};
|
||||
|
||||
// spin up/down if a single step of the field
|
||||
auto spinDownHandler = [this] ( wxSpinEvent& event )
|
||||
{
|
||||
incrementCtrl( false );
|
||||
};
|
||||
|
||||
auto mouseWheelHandler = [this] ( wxMouseEvent& aEvent )
|
||||
{
|
||||
incrementCtrl( aEvent.GetWheelRotation() >= 0 );
|
||||
};
|
||||
|
||||
aSpinBtn.Bind( wxEVT_SPIN_UP, spinUpHandler );
|
||||
aSpinBtn.Bind( wxEVT_SPIN_DOWN, spinDownHandler );
|
||||
|
||||
m_textCtrl.Bind( wxEVT_MOUSEWHEEL, mouseWheelHandler );
|
||||
|
||||
m_textCtrl.Bind( wxEVT_KILL_FOCUS, &SPIN_INCREMENTAL_TEXT_CTRL::onFocusLoss, this );
|
||||
}
|
||||
|
||||
SPIN_INCREMENTAL_TEXT_CTRL::~SPIN_INCREMENTAL_TEXT_CTRL()
|
||||
{
|
||||
// this must be unbound, as kill focus can arrive after the
|
||||
// text control is gone
|
||||
m_textCtrl.Unbind( wxEVT_KILL_FOCUS, &SPIN_INCREMENTAL_TEXT_CTRL::onFocusLoss, this );
|
||||
}
|
||||
|
||||
|
||||
void SPIN_INCREMENTAL_TEXT_CTRL::onFocusLoss( wxFocusEvent& aEvent )
|
||||
{
|
||||
// re-read the input and sanitize any user changes
|
||||
incrementCtrlBy( 0.0 );
|
||||
}
|
||||
|
||||
|
||||
void SPIN_INCREMENTAL_TEXT_CTRL::setTextCtrl( const wxString& val )
|
||||
{
|
||||
m_textCtrl.SetValue( val );
|
||||
}
|
||||
|
||||
|
||||
wxString SPIN_INCREMENTAL_TEXT_CTRL::getCtrlText() const
|
||||
{
|
||||
return m_textCtrl.GetValue();
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||
|
||||
m_auimgr.SetFlags(wxAUI_MGR_DEFAULT);
|
||||
|
||||
CreateStatusBar( 6 );
|
||||
CreateStatusBar( 7 );
|
||||
|
||||
// set the size of the status bar subwindows:
|
||||
|
||||
@@ -192,6 +192,9 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||
// delta distances
|
||||
GetTextSize( wxT( "dx 0234.567890 dx 0234.567890 d 0234.567890" ), stsbar ).x + 10,
|
||||
|
||||
// grid size
|
||||
GetTextSize( wxT( "grid X 0234.567890 Y 0234.567890" ), stsbar ).x + 10,
|
||||
|
||||
// units display, Inches is bigger than mm
|
||||
GetTextSize( _( "Inches" ), stsbar ).x + 10,
|
||||
|
||||
@@ -614,6 +617,37 @@ void EDA_DRAW_FRAME::DisplayToolMsg( const wxString& msg )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Display the grid status.
|
||||
*/
|
||||
void EDA_DRAW_FRAME::DisplayGridMsg()
|
||||
{
|
||||
wxString line;
|
||||
wxString gridformatter;
|
||||
|
||||
switch( m_UserUnits )
|
||||
{
|
||||
case INCHES:
|
||||
gridformatter = "grid %.3f";
|
||||
break;
|
||||
|
||||
case MILLIMETRES:
|
||||
gridformatter = "grid %.4f";
|
||||
break;
|
||||
|
||||
default:
|
||||
gridformatter = "grid %f";
|
||||
break;
|
||||
}
|
||||
|
||||
wxRealPoint curr_grid_size = GetScreen()->GetGridSize();
|
||||
double grid = To_User_Unit( m_UserUnits, curr_grid_size.x );
|
||||
line.Printf( gridformatter, grid );
|
||||
|
||||
SetStatusText( line, 4 );
|
||||
}
|
||||
|
||||
|
||||
void EDA_DRAW_FRAME::DisplayUnitsMsg()
|
||||
{
|
||||
wxString msg;
|
||||
@@ -625,7 +659,7 @@ void EDA_DRAW_FRAME::DisplayUnitsMsg()
|
||||
default: msg = _( "Units" ); break;
|
||||
}
|
||||
|
||||
SetStatusText( msg, 4 );
|
||||
SetStatusText( msg, 5 );
|
||||
}
|
||||
|
||||
|
||||
@@ -1260,56 +1294,56 @@ bool EDA_DRAW_FRAME::GeneralControlKeyMovement( int aHotKey, wxPoint *aPos,
|
||||
* sub-pixel movement. The m_movingCursorWithKeyboard oneshot 'eats'
|
||||
* the automatic motion event generated by cursor warping */
|
||||
wxRealPoint gridSize = GetScreen()->GetGridSize();
|
||||
*aPos = GetCrossHairPosition();
|
||||
*aPos = (wxPoint) m_galCanvas->GetViewControls()->GetRawCursorPosition( false );
|
||||
|
||||
// Bonus: ^key moves faster (x10)
|
||||
switch( aHotKey )
|
||||
{
|
||||
case GR_KB_CTRL|WXK_NUMPAD8:
|
||||
case GR_KB_CTRL|WXK_UP:
|
||||
aPos->y -= KiROUND( 10 * gridSize.y );
|
||||
aPos->y = GetNearestGridPosition( *aPos ).y - KiROUND( 10 * gridSize.y );
|
||||
break;
|
||||
|
||||
case GR_KB_CTRL|WXK_NUMPAD2:
|
||||
case GR_KB_CTRL|WXK_DOWN:
|
||||
aPos->y += KiROUND( 10 * gridSize.y );
|
||||
aPos->y = GetNearestGridPosition( *aPos ).y + KiROUND( 10 * gridSize.y );
|
||||
break;
|
||||
|
||||
case GR_KB_CTRL|WXK_NUMPAD4:
|
||||
case GR_KB_CTRL|WXK_LEFT:
|
||||
aPos->x -= KiROUND( 10 * gridSize.x );
|
||||
aPos->x = GetNearestGridPosition( *aPos ).x - KiROUND( 10 * gridSize.x );
|
||||
break;
|
||||
|
||||
case GR_KB_CTRL|WXK_NUMPAD6:
|
||||
case GR_KB_CTRL|WXK_RIGHT:
|
||||
aPos->x += KiROUND( 10 * gridSize.x );
|
||||
aPos->x = GetNearestGridPosition( *aPos ).x + KiROUND( 10 * gridSize.x );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD8:
|
||||
case WXK_UP:
|
||||
aPos->y -= KiROUND( gridSize.y );
|
||||
aPos->y = GetNearestGridPosition( *aPos ).y - KiROUND( gridSize.y );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD2:
|
||||
case WXK_DOWN:
|
||||
aPos->y += KiROUND( gridSize.y );
|
||||
aPos->y = GetNearestGridPosition( *aPos ).y + KiROUND( gridSize.y );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD4:
|
||||
case WXK_LEFT:
|
||||
aPos->x -= KiROUND( gridSize.x );
|
||||
aPos->x = GetNearestGridPosition( *aPos ).x - KiROUND( gridSize.x );
|
||||
break;
|
||||
|
||||
case WXK_NUMPAD6:
|
||||
case WXK_RIGHT:
|
||||
aPos->x += KiROUND( gridSize.x );
|
||||
aPos->x = GetNearestGridPosition( *aPos ).x + KiROUND( gridSize.x );
|
||||
break;
|
||||
|
||||
default: /* Can't happen since we entered the statement */
|
||||
break;
|
||||
}
|
||||
|
||||
m_canvas->MoveCursor( *aPos );
|
||||
m_galCanvas->GetViewControls()->SetCursorPosition( *aPos, true, true );
|
||||
m_movingCursorWithKeyboard = true;
|
||||
}
|
||||
break;
|
||||
@@ -1802,7 +1836,7 @@ void DrawPageLayout( wxDC* aDC, EDA_RECT* aClipBox,
|
||||
|
||||
void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
|
||||
double aScalar, const wxString &aFilename,
|
||||
const wxString &aSheetLayer )
|
||||
const wxString &aSheetLayer, COLOR4D aColor )
|
||||
{
|
||||
if( !m_showBorderAndTitleBlock )
|
||||
return;
|
||||
@@ -1820,7 +1854,7 @@ void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWi
|
||||
}
|
||||
|
||||
TITLE_BLOCK t_block = GetTitleBlock();
|
||||
COLOR4D color = COLOR4D( RED );
|
||||
COLOR4D color = ( aColor != COLOR4D::UNSPECIFIED ) ? aColor : COLOR4D( RED );
|
||||
|
||||
wxPoint origin = aDC->GetDeviceOrigin();
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||
|
||||
m_auimgr.SetFlags(wxAUI_MGR_DEFAULT);
|
||||
|
||||
CreateStatusBar( 6 );
|
||||
CreateStatusBar( 7 );
|
||||
|
||||
// set the size of the status bar subwindows:
|
||||
|
||||
@@ -195,6 +195,9 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||
// delta distances
|
||||
GetTextSize( wxT( "dx 0234.567890 dx 0234.567890 d 0234.567890" ), stsbar ).x + 10,
|
||||
|
||||
// grid size
|
||||
GetTextSize( wxT( "grid X 0234.567890 Y 0234.567890" ), stsbar ).x + 10,
|
||||
|
||||
// units display, Inches is bigger than mm
|
||||
GetTextSize( _( "Inches" ), stsbar ).x + 10,
|
||||
|
||||
@@ -524,20 +527,24 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
|
||||
int index = m_gridSelectBox->GetSelection();
|
||||
wxASSERT( index != wxNOT_FOUND );
|
||||
|
||||
if( index == int( m_gridSelectBox->GetCount() - 2 ) )
|
||||
// GerbView does not support custom grid
|
||||
if( m_Ident != FRAME_GERBER )
|
||||
{
|
||||
// this is the separator
|
||||
wxUpdateUIEvent dummy;
|
||||
OnUpdateSelectGrid( dummy );
|
||||
return;
|
||||
}
|
||||
else if( index == int( m_gridSelectBox->GetCount() - 1 ) )
|
||||
{
|
||||
wxUpdateUIEvent dummy;
|
||||
OnUpdateSelectGrid( dummy );
|
||||
wxCommandEvent dummy2;
|
||||
OnGridSettings( dummy2 );
|
||||
return;
|
||||
if( index == int( m_gridSelectBox->GetCount() - 2 ) )
|
||||
{
|
||||
// this is the separator
|
||||
wxUpdateUIEvent dummy;
|
||||
OnUpdateSelectGrid( dummy );
|
||||
return;
|
||||
}
|
||||
else if( index == int( m_gridSelectBox->GetCount() - 1 ) )
|
||||
{
|
||||
wxUpdateUIEvent dummy;
|
||||
OnUpdateSelectGrid( dummy );
|
||||
wxCommandEvent dummy2;
|
||||
OnGridSettings( dummy2 );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( index );
|
||||
@@ -618,6 +625,37 @@ void EDA_DRAW_FRAME::DisplayToolMsg( const wxString& msg )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Display the grid status.
|
||||
*/
|
||||
void EDA_DRAW_FRAME::DisplayGridMsg()
|
||||
{
|
||||
wxString line;
|
||||
wxString gridformatter;
|
||||
|
||||
switch( m_UserUnits )
|
||||
{
|
||||
case INCHES:
|
||||
gridformatter = "grid %.3f";
|
||||
break;
|
||||
|
||||
case MILLIMETRES:
|
||||
gridformatter = "grid %.4f";
|
||||
break;
|
||||
|
||||
default:
|
||||
gridformatter = "grid %f";
|
||||
break;
|
||||
}
|
||||
|
||||
wxRealPoint curr_grid_size = GetScreen()->GetGridSize();
|
||||
double grid = To_User_Unit( m_UserUnits, curr_grid_size.x );
|
||||
line.Printf( gridformatter, grid );
|
||||
|
||||
SetStatusText( line, 4 );
|
||||
}
|
||||
|
||||
|
||||
void EDA_DRAW_FRAME::DisplayUnitsMsg()
|
||||
{
|
||||
wxString msg;
|
||||
@@ -637,7 +675,7 @@ void EDA_DRAW_FRAME::DisplayUnitsMsg()
|
||||
break;
|
||||
}
|
||||
|
||||
SetStatusText( msg, 4 );
|
||||
SetStatusText( msg, 5 );
|
||||
}
|
||||
|
||||
|
||||
@@ -742,7 +780,13 @@ void EDA_DRAW_FRAME::SetPresetGrid( int aIndex )
|
||||
|
||||
if( m_gridSelectBox )
|
||||
{
|
||||
if( glistIdx < 0 || glistIdx >= (int) m_gridSelectBox->GetCount() - 2 )
|
||||
int highestGrid = ( int )m_gridSelectBox->GetCount();
|
||||
|
||||
// GerbView does not support the user grid setting
|
||||
if( m_Ident != FRAME_GERBER )
|
||||
highestGrid -= 2;
|
||||
|
||||
if( glistIdx < 0 || glistIdx >= highestGrid )
|
||||
{
|
||||
wxASSERT_MSG( false, "Invalid grid index" );
|
||||
return;
|
||||
@@ -1342,14 +1386,14 @@ bool EDA_DRAW_FRAME::saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas
|
||||
// a parent frame)
|
||||
FRAME_T allowed_frames[] =
|
||||
{
|
||||
FRAME_SCH, FRAME_PCB, FRAME_PCB_MODULE_EDITOR
|
||||
FRAME_SCH, FRAME_PCB, FRAME_PCB_MODULE_EDITOR, FRAME_GERBER
|
||||
};
|
||||
|
||||
bool allow_save = false;
|
||||
|
||||
for( int ii = 0; ii < 3; ii++ )
|
||||
for( FRAME_T frame : allowed_frames )
|
||||
{
|
||||
if( m_Ident == allowed_frames[ii] )
|
||||
if( m_Ident == frame )
|
||||
{
|
||||
allow_save = true;
|
||||
break;
|
||||
@@ -2141,7 +2185,7 @@ void DrawPageLayout( wxDC* aDC, EDA_RECT* aClipBox,
|
||||
|
||||
void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
|
||||
double aScalar, const wxString &aFilename,
|
||||
const wxString &aSheetLayer )
|
||||
const wxString &aSheetLayer, COLOR4D aColor )
|
||||
{
|
||||
if( !m_showBorderAndTitleBlock )
|
||||
return;
|
||||
@@ -2159,7 +2203,7 @@ void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWi
|
||||
}
|
||||
|
||||
TITLE_BLOCK t_block = GetTitleBlock();
|
||||
COLOR4D color = COLOR4D( RED );
|
||||
COLOR4D color = ( aColor != COLOR4D::UNSPECIFIED ) ? aColor : COLOR4D( RED );
|
||||
|
||||
wxPoint origin = aDC->GetDeviceOrigin();
|
||||
|
||||
|
||||
@@ -182,6 +182,22 @@ void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( wxString const& aSearch )
|
||||
{
|
||||
auto item = wxDataViewItem( bestMatch );
|
||||
m_widget->Select( item );
|
||||
|
||||
// Make sure the *parent* item is visible. The selected item is the
|
||||
// first (shown) child of the parent. So it's always right below the parent,
|
||||
// and this way the user can also see what library the selected part belongs to,
|
||||
// without having a case where the selection is off the screen (unless the
|
||||
// window is a single row high, which is unlikely)
|
||||
//
|
||||
// This also happens to circumvent https://bugs.launchpad.net/kicad/+bug/1804400
|
||||
// which appears to be a GTK+3 bug.
|
||||
{
|
||||
wxDataViewItem parent = GetParent( item );
|
||||
|
||||
if( parent.IsOk() )
|
||||
item = parent;
|
||||
}
|
||||
|
||||
m_widget->EnsureVisible( item );
|
||||
}
|
||||
|
||||
|
||||
@@ -118,13 +118,25 @@ inline void drawMarker( EDA_RECT* aClipBox, wxDC* aDC,
|
||||
*/
|
||||
void WS_DRAW_ITEM_LIST::Draw( EDA_RECT* aClipBox, wxDC* aDC )
|
||||
{
|
||||
|
||||
// Draw the bitmaps in the background
|
||||
for( WS_DRAW_ITEM_BASE* item = GetFirst(); item; item = GetNext() )
|
||||
{
|
||||
if( item->GetParent() && item->GetParent()->IsSelected() )
|
||||
continue;
|
||||
|
||||
if( item->GetType() == WS_DRAW_ITEM_BASE::wsg_bitmap )
|
||||
item->DrawWsItem( aClipBox, aDC );
|
||||
|
||||
}
|
||||
// The not selected items are drawn first (most of items)
|
||||
for( WS_DRAW_ITEM_BASE* item = GetFirst(); item; item = GetNext() )
|
||||
{
|
||||
if( item->GetParent() && item->GetParent()->IsSelected() )
|
||||
continue;
|
||||
|
||||
item->DrawWsItem( aClipBox, aDC );
|
||||
if( item->GetType() != WS_DRAW_ITEM_BASE::wsg_bitmap )
|
||||
item->DrawWsItem( aClipBox, aDC );
|
||||
}
|
||||
|
||||
// The selected items are drawn after (usually 0 or 1)
|
||||
@@ -492,7 +504,6 @@ void WS_DRAW_ITEM_BITMAP::DrawWsItem( EDA_RECT* aClipBox, wxDC* aDC, const wxPoi
|
||||
{
|
||||
GRSetDrawMode( aDC, ( aDrawMode == UNSPECIFIED_DRAWMODE ) ? GR_COPY : aDrawMode );
|
||||
parent->m_ImageBitmap->DrawBitmap( aDC, m_pos + aOffset );
|
||||
GRSetDrawMode( aDC, GR_COPY );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -445,7 +445,7 @@ bool PGM_BASE::InitPgm()
|
||||
else
|
||||
{
|
||||
// Default user template path.
|
||||
tmpFileName = wxStandardPaths::Get().GetDocumentsDir();
|
||||
tmpFileName.AssignDir( wxStandardPaths::Get().GetDocumentsDir() );
|
||||
tmpFileName.AppendDir( "kicad" );
|
||||
tmpFileName.AppendDir( "template" );
|
||||
envVarItem.SetDefinedExternally( false );
|
||||
|
||||
+143
-117
@@ -121,6 +121,26 @@ static wxString getDXFColorName( COLOR4D aColor )
|
||||
return cname;
|
||||
}
|
||||
|
||||
|
||||
void DXF_PLOTTER::SetUnits( DXF_UNITS aUnit )
|
||||
{
|
||||
m_plotUnits = aUnit;
|
||||
|
||||
switch( aUnit )
|
||||
{
|
||||
case DXF_UNIT_MILLIMETERS:
|
||||
m_unitScalingFactor = 0.00254;
|
||||
m_measurementDirective = 1;
|
||||
break;
|
||||
|
||||
case DXF_UNIT_INCHES:
|
||||
default:
|
||||
m_unitScalingFactor = 0.0001;
|
||||
m_measurementDirective = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the scale/position for the DXF plot
|
||||
* The DXF engine doesn't support line widths and mirroring. The output
|
||||
@@ -139,14 +159,14 @@ void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
|
||||
paperSize.y = 0;
|
||||
|
||||
/* Like paper size DXF units are abstract too. Anyway there is a
|
||||
* system variable (MEASUREMENT) which will be set to 1 to indicate
|
||||
* metric units */
|
||||
* system variable (MEASUREMENT) which will be set to 0 to indicate
|
||||
* english units */
|
||||
m_IUsPerDecimil = aIusPerDecimil;
|
||||
iuPerDeviceUnit = 1.0 / aIusPerDecimil; // Gives a DXF in decimils
|
||||
iuPerDeviceUnit *= 0.00254; // ... now in mm
|
||||
iuPerDeviceUnit *= GetUnitScaling(); // Get the scaling factor for the current units
|
||||
|
||||
SetDefaultLineWidth( 0 ); // No line width on DXF
|
||||
m_plotMirror = false; // No mirroring on DXF
|
||||
m_plotMirror = false; // No mirroring on DXF
|
||||
m_currentColor = COLOR4D::BLACK;
|
||||
}
|
||||
|
||||
@@ -160,117 +180,118 @@ bool DXF_PLOTTER::StartPlot()
|
||||
// DXF HEADER - Boilerplate
|
||||
// Defines the minimum for drawing i.e. the angle system and the
|
||||
// 4 linetypes (CONTINUOUS, DOTDASH, DASHED and DOTTED)
|
||||
fputs( " 0\n"
|
||||
"SECTION\n"
|
||||
" 2\n"
|
||||
"HEADER\n"
|
||||
" 9\n"
|
||||
"$ANGBASE\n"
|
||||
" 50\n"
|
||||
"0.0\n"
|
||||
" 9\n"
|
||||
"$ANGDIR\n"
|
||||
" 70\n"
|
||||
" 1\n"
|
||||
" 9\n"
|
||||
"$MEASUREMENT\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 0\n" // This means 'metric units'
|
||||
"ENDSEC\n"
|
||||
" 0\n"
|
||||
"SECTION\n"
|
||||
" 2\n"
|
||||
"TABLES\n"
|
||||
" 0\n"
|
||||
"TABLE\n"
|
||||
" 2\n"
|
||||
"LTYPE\n"
|
||||
" 70\n"
|
||||
"4\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"40F\n"
|
||||
" 2\n"
|
||||
"CONTINUOUS\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Solid line\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"0\n"
|
||||
" 40\n"
|
||||
"0.0\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"410\n"
|
||||
" 2\n"
|
||||
"DASHDOT\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Dash Dot ____ _ ____ _\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"4\n"
|
||||
" 40\n"
|
||||
"2.0\n"
|
||||
" 49\n"
|
||||
"1.25\n"
|
||||
" 49\n"
|
||||
"-0.25\n"
|
||||
" 49\n"
|
||||
"0.25\n"
|
||||
" 49\n"
|
||||
"-0.25\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"411\n"
|
||||
" 2\n"
|
||||
"DASHED\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Dashed __ __ __ __ __\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"2\n"
|
||||
" 40\n"
|
||||
"0.75\n"
|
||||
" 49\n"
|
||||
"0.5\n"
|
||||
" 49\n"
|
||||
"-0.25\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"43B\n"
|
||||
" 2\n"
|
||||
"DOTTED\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Dotted . . . .\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"2\n"
|
||||
" 40\n"
|
||||
"0.2\n"
|
||||
" 49\n"
|
||||
"0.0\n"
|
||||
" 49\n"
|
||||
"-0.2\n"
|
||||
" 0\n"
|
||||
"ENDTAB\n",
|
||||
outputFile );
|
||||
fprintf( outputFile,
|
||||
" 0\n"
|
||||
"SECTION\n"
|
||||
" 2\n"
|
||||
"HEADER\n"
|
||||
" 9\n"
|
||||
"$ANGBASE\n"
|
||||
" 50\n"
|
||||
"0.0\n"
|
||||
" 9\n"
|
||||
"$ANGDIR\n"
|
||||
" 70\n"
|
||||
"1\n"
|
||||
" 9\n"
|
||||
"$MEASUREMENT\n"
|
||||
" 70\n"
|
||||
"%u\n"
|
||||
" 0\n"
|
||||
"ENDSEC\n"
|
||||
" 0\n"
|
||||
"SECTION\n"
|
||||
" 2\n"
|
||||
"TABLES\n"
|
||||
" 0\n"
|
||||
"TABLE\n"
|
||||
" 2\n"
|
||||
"LTYPE\n"
|
||||
" 70\n"
|
||||
"4\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"40F\n"
|
||||
" 2\n"
|
||||
"CONTINUOUS\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Solid line\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"0\n"
|
||||
" 40\n"
|
||||
"0.0\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"410\n"
|
||||
" 2\n"
|
||||
"DASHDOT\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Dash Dot ____ _ ____ _\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"4\n"
|
||||
" 40\n"
|
||||
"2.0\n"
|
||||
" 49\n"
|
||||
"1.25\n"
|
||||
" 49\n"
|
||||
"-0.25\n"
|
||||
" 49\n"
|
||||
"0.25\n"
|
||||
" 49\n"
|
||||
"-0.25\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"411\n"
|
||||
" 2\n"
|
||||
"DASHED\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Dashed __ __ __ __ __\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"2\n"
|
||||
" 40\n"
|
||||
"0.75\n"
|
||||
" 49\n"
|
||||
"0.5\n"
|
||||
" 49\n"
|
||||
"-0.25\n"
|
||||
" 0\n"
|
||||
"LTYPE\n"
|
||||
" 5\n"
|
||||
"43B\n"
|
||||
" 2\n"
|
||||
"DOTTED\n"
|
||||
" 70\n"
|
||||
"0\n"
|
||||
" 3\n"
|
||||
"Dotted . . . .\n"
|
||||
" 72\n"
|
||||
"65\n"
|
||||
" 73\n"
|
||||
"2\n"
|
||||
" 40\n"
|
||||
"0.2\n"
|
||||
" 49\n"
|
||||
"0.0\n"
|
||||
" 49\n"
|
||||
"-0.2\n"
|
||||
" 0\n"
|
||||
"ENDTAB\n",
|
||||
GetMeasurementDirective() );
|
||||
|
||||
// Text styles table
|
||||
// Defines 4 text styles, one for each bold/italic combination
|
||||
@@ -309,6 +330,11 @@ bool DXF_PLOTTER::StartPlot()
|
||||
style_name[i], i < 2 ? 0 : DXF_OBLIQUE_ANGLE );
|
||||
}
|
||||
|
||||
EDA_COLOR_T numLayers = NBCOLORS;
|
||||
|
||||
// If printing in monochrome, only output the black layer
|
||||
if( !GetColorMode() )
|
||||
numLayers = static_cast<EDA_COLOR_T>( 1 );
|
||||
|
||||
// Layer table - one layer per color
|
||||
fprintf( outputFile,
|
||||
@@ -319,7 +345,7 @@ bool DXF_PLOTTER::StartPlot()
|
||||
" 2\n"
|
||||
"LAYER\n"
|
||||
" 70\n"
|
||||
"%d\n", NBCOLORS );
|
||||
"%d\n", numLayers );
|
||||
|
||||
/* The layer/colors palette. The acad/DXF palette is divided in 3 zones:
|
||||
|
||||
@@ -328,7 +354,7 @@ bool DXF_PLOTTER::StartPlot()
|
||||
- Greys (251 - 255)
|
||||
*/
|
||||
|
||||
for( EDA_COLOR_T i = BLACK; i < NBCOLORS; i = NextColor(i) )
|
||||
for( EDA_COLOR_T i = BLACK; i < numLayers; i = NextColor(i) )
|
||||
{
|
||||
fprintf( outputFile,
|
||||
" 0\n"
|
||||
|
||||
@@ -390,12 +390,37 @@ void PDF_PLOTTER::PlotImage( const wxImage & aImage, const wxPoint& aPos,
|
||||
unsigned char r = aImage.GetRed( x, y ) & 0xFF;
|
||||
unsigned char g = aImage.GetGreen( x, y ) & 0xFF;
|
||||
unsigned char b = aImage.GetBlue( x, y ) & 0xFF;
|
||||
|
||||
// PDF inline images don't support alpha, so premultiply against white background
|
||||
if( aImage.HasAlpha() )
|
||||
{
|
||||
unsigned char alpha = aImage.GetAlpha( x, y ) & 0xFF;
|
||||
|
||||
if( alpha < 0xFF )
|
||||
{
|
||||
float a = 1.0 - ( (float) alpha / 255.0 );
|
||||
r = ( int )( r + ( a * 0xFF ) ) & 0xFF;
|
||||
g = ( int )( g + ( a * 0xFF ) ) & 0xFF;
|
||||
b = ( int )( b + ( a * 0xFF ) ) & 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
if( aImage.HasMask() )
|
||||
{
|
||||
if( r == aImage.GetMaskRed() && g == aImage.GetMaskGreen() && b == aImage.GetMaskBlue() )
|
||||
{
|
||||
r = 0xFF;
|
||||
g = 0xFF;
|
||||
b = 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
// As usual these days, stdio buffering has to suffeeeeerrrr
|
||||
if( colorMode )
|
||||
{
|
||||
putc( r, workFile );
|
||||
putc( g, workFile );
|
||||
putc( b, workFile );
|
||||
putc( r, workFile );
|
||||
putc( g, workFile );
|
||||
putc( b, workFile );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -711,6 +711,31 @@ void PS_PLOTTER::PlotImage( const wxImage & aImage, const wxPoint& aPos,
|
||||
green = aImage.GetGreen( xx, yy) & 0xFF;
|
||||
blue = aImage.GetBlue( xx, yy) & 0xFF;
|
||||
|
||||
// PS doesn't support alpha, so premultiply against white background
|
||||
if( aImage.HasAlpha() )
|
||||
{
|
||||
unsigned char alpha = aImage.GetAlpha( xx, yy ) & 0xFF;
|
||||
|
||||
if( alpha < 0xFF )
|
||||
{
|
||||
float a = 1.0 - ( (float) alpha / 255.0 );
|
||||
red = ( int )( red + ( a * 0xFF ) ) & 0xFF;
|
||||
green = ( int )( green + ( a * 0xFF ) ) & 0xFF;
|
||||
blue = ( int )( blue + ( a * 0xFF ) ) & 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
if( aImage.HasMask() )
|
||||
{
|
||||
if( red == aImage.GetMaskRed() && green == aImage.GetMaskGreen()
|
||||
&& blue == aImage.GetMaskBlue() )
|
||||
{
|
||||
red = 0xFF;
|
||||
green = 0xFF;
|
||||
blue = 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
if( colorMode )
|
||||
fprintf( outputFile, "%2.2X%2.2X%2.2X", red, green, blue );
|
||||
else
|
||||
|
||||
@@ -303,6 +303,8 @@ void SVG_PLOTTER::StartBlock( void* aData )
|
||||
void SVG_PLOTTER::EndBlock( void* aData )
|
||||
{
|
||||
fprintf( outputFile, "</g>\n" );
|
||||
|
||||
m_graphics_changed = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,13 +73,17 @@ wxString GetDefaultPlotExtension( PlotFormat aFormat )
|
||||
void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
|
||||
const PAGE_INFO& aPageInfo,
|
||||
int aSheetNumber, int aNumberOfSheets,
|
||||
const wxString &aSheetDesc, const wxString &aFilename )
|
||||
const wxString &aSheetDesc, const wxString &aFilename, const COLOR4D aColor )
|
||||
{
|
||||
/* Note: Page sizes values are given in mils
|
||||
*/
|
||||
double iusPerMil = plotter->GetIUsPerDecimil() * 10.0;
|
||||
|
||||
COLOR4D plotColor = plotter->GetColorMode() ? COLOR4D( RED ) : COLOR4D::BLACK;
|
||||
COLOR4D plotColor = plotter->GetColorMode() ? aColor : COLOR4D::BLACK;
|
||||
|
||||
if( plotColor == COLOR4D::UNSPECIFIED )
|
||||
plotColor = COLOR4D( RED );
|
||||
|
||||
plotter->SetColor( plotColor );
|
||||
WS_DRAW_ITEM_LIST drawList;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
%include <std_map.i>
|
||||
%include <std_shared_ptr.i>
|
||||
%include <std_set.i>
|
||||
%include <stdint.i>
|
||||
|
||||
%include "ki_exception.i" // affects all that follow it
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ TOOL_ACTION ACTIONS::cursorDblClick( "common.Control.cursorDblClick",
|
||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_LEFT_DCLICK ),
|
||||
"", "", NULL, AF_NONE, (void*) CURSOR_DBL_CLICK );
|
||||
|
||||
TOOL_ACTION ACTIONS::refreshPreview( "common.Control.refreshPreview",
|
||||
AS_GLOBAL );
|
||||
|
||||
TOOL_ACTION ACTIONS::panUp( "common.Control.panUp",
|
||||
AS_GLOBAL, MD_SHIFT + WXK_UP,
|
||||
|
||||
@@ -117,6 +117,7 @@ int COMMON_TOOLS::CursorControl( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
getViewControls()->SetCursorPosition( cursor, true, true );
|
||||
m_toolMgr->RunAction( ACTIONS::refreshPreview );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -232,13 +233,12 @@ int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent )
|
||||
EDA_BASE_FRAME* frame = getEditFrame<EDA_BASE_FRAME>();
|
||||
|
||||
BOX2I bBox = model->ViewBBox();
|
||||
BOX2I defaultBox = galCanvas->GetDefaultViewBBox();
|
||||
VECTOR2D scrollbarSize = VECTOR2D( galCanvas->GetSize() - galCanvas->GetClientSize() );
|
||||
VECTOR2D screenSize = view->ToWorld( galCanvas->GetClientSize(), false );
|
||||
|
||||
if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
|
||||
{
|
||||
bBox = galCanvas->GetDefaultViewBBox();
|
||||
}
|
||||
bBox = defaultBox;
|
||||
|
||||
VECTOR2D vsize = bBox.GetSize();
|
||||
double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
|
||||
|
||||
@@ -442,8 +442,10 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
|
||||
evt = TOOL_EVENT( TC_KEYBOARD, TA_KEY_PRESSED, key | mods );
|
||||
}
|
||||
|
||||
bool handled = false;
|
||||
|
||||
if( evt )
|
||||
m_toolMgr->ProcessEvent( *evt );
|
||||
handled = m_toolMgr->ProcessEvent( *evt );
|
||||
|
||||
// pass the event to the GUI, it might still be interested in it
|
||||
// Note wxEVT_CHAR_HOOK event is already skipped for special keys not used by KiCad
|
||||
@@ -466,7 +468,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
|
||||
// must be Skipped (sent to GUI).
|
||||
// Otherwise accelerators and shortcuts in main menu or toolbars are not seen.
|
||||
#ifndef __APPLE__
|
||||
if( type == wxEVT_CHAR && !keyIsSpecial )
|
||||
if( type == wxEVT_CHAR && !keyIsSpecial && !handled )
|
||||
aEvent.Skip();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013-2018 CERN
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
@@ -374,11 +375,20 @@ bool TOOL_MANAGER::runTool( TOOL_BASE* aTool )
|
||||
static_cast<TOOL_INTERACTIVE*>( aTool )->resetTransitions();
|
||||
|
||||
// If the tool is already active, bring it to the top of the active tools stack
|
||||
if( isActive( aTool ) )
|
||||
if( isActive( aTool ) && m_activeTools.size() > 1 )
|
||||
{
|
||||
m_activeTools.erase( std::find( m_activeTools.begin(), m_activeTools.end(), id ) );
|
||||
m_activeTools.push_front( id );
|
||||
return false;
|
||||
auto it = std::find( m_activeTools.begin(), m_activeTools.end(), id );
|
||||
|
||||
if( it != m_activeTools.end() )
|
||||
{
|
||||
if( it != m_activeTools.begin() )
|
||||
{
|
||||
m_activeTools.erase( it );
|
||||
m_activeTools.push_front( id );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
setActiveState( m_toolIdIndex[id] );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2018 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2018-2019 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -44,6 +44,7 @@ const wxChar* const tracePathsAndFiles = wxT( "KICAD_PATHS_AND_FILES" );
|
||||
const wxChar* const traceLocale = wxT( "KICAD_LOCALE" );
|
||||
const wxChar* const traceScreen = wxT( "KICAD_SCREEN" );
|
||||
const wxChar* const traceZoomScroll = wxT( "KICAD_ZOOM_SCROLL" );
|
||||
const wxChar* const traceSymbolResolver = wxT( "KICAD_SYM_RESOLVE" );
|
||||
|
||||
|
||||
wxString dump( const wxArrayString& aArray )
|
||||
|
||||
+107
-5
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2004-2019 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2018 CERN
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -27,6 +28,7 @@
|
||||
* @brief Custom text control validator implementations.
|
||||
*/
|
||||
|
||||
#include <confirm.h>
|
||||
#include <kicad_string.h>
|
||||
#include <validators.h>
|
||||
|
||||
@@ -133,7 +135,7 @@ ENV_VAR_NAME_VALIDATOR::~ENV_VAR_NAME_VALIDATOR()
|
||||
|
||||
void ENV_VAR_NAME_VALIDATOR::OnChar( wxKeyEvent& aEvent )
|
||||
{
|
||||
if (!m_validatorWindow)
|
||||
if( !m_validatorWindow )
|
||||
{
|
||||
aEvent.Skip();
|
||||
return;
|
||||
@@ -142,7 +144,7 @@ void ENV_VAR_NAME_VALIDATOR::OnChar( wxKeyEvent& aEvent )
|
||||
int keyCode = aEvent.GetKeyCode();
|
||||
|
||||
// we don't filter special keys and delete
|
||||
if (keyCode < WXK_SPACE || keyCode == WXK_DELETE || keyCode >= WXK_START)
|
||||
if( keyCode < WXK_SPACE || keyCode == WXK_DELETE || keyCode >= WXK_START )
|
||||
{
|
||||
aEvent.Skip();
|
||||
return;
|
||||
@@ -160,6 +162,7 @@ void ENV_VAR_NAME_VALIDATOR::OnChar( wxKeyEvent& aEvent )
|
||||
// not as first character
|
||||
long from, to;
|
||||
GetTextEntry()->GetSelection( &from, &to );
|
||||
|
||||
if( from < 1 )
|
||||
wxBell();
|
||||
else
|
||||
@@ -220,6 +223,105 @@ void ENV_VAR_NAME_VALIDATOR::OnTextChanged( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
bool REGEX_VALIDATOR::Validate( wxWindow* aParent )
|
||||
{
|
||||
// If window is disabled, simply return
|
||||
if( !m_validatorWindow->IsEnabled() )
|
||||
return true;
|
||||
|
||||
wxTextEntry* const textEntry = GetTextEntry();
|
||||
|
||||
if( !textEntry )
|
||||
return false;
|
||||
|
||||
bool valid = true;
|
||||
const wxString& value = textEntry->GetValue();
|
||||
|
||||
if( m_regEx.Matches( value ) )
|
||||
{
|
||||
size_t start, len;
|
||||
m_regEx.GetMatch( &start, &len );
|
||||
|
||||
if( start != 0 || len != value.Length() ) // whole string must match
|
||||
valid = false;
|
||||
}
|
||||
else // no match at all
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if( !valid )
|
||||
{
|
||||
m_validatorWindow->SetFocus();
|
||||
DisplayError( aParent, wxString::Format( _( "Incorrect value: %s" ), value ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void REGEX_VALIDATOR::compileRegEx( const wxString& aRegEx, int aFlags )
|
||||
{
|
||||
if( !m_regEx.Compile( aRegEx, aFlags ) )
|
||||
{
|
||||
throw std::runtime_error( "REGEX_VALIDATOR: Invalid regular expression: "
|
||||
+ aRegEx.ToStdString() );
|
||||
}
|
||||
|
||||
m_regExString = aRegEx;
|
||||
m_regExFlags = aFlags;
|
||||
}
|
||||
|
||||
|
||||
bool LIB_ID_VALIDATOR::Validate( wxWindow *aParent )
|
||||
{
|
||||
LIB_ID dummy;
|
||||
|
||||
// If window is disabled, simply return
|
||||
if( !m_validatorWindow->IsEnabled() )
|
||||
return true;
|
||||
|
||||
wxTextEntry* const text = GetTextEntry();
|
||||
|
||||
if( !text )
|
||||
return false;
|
||||
|
||||
wxString msg;
|
||||
wxString val( text->GetValue() );
|
||||
wxString tmp = val.Clone(); // For trailing and leading white space tests.
|
||||
|
||||
// Allow empty string if empty filter not set to allow clearing the LIB_ID.
|
||||
if( !(GetStyle() & wxFILTER_EMPTY) && val.IsEmpty() )
|
||||
return true;
|
||||
|
||||
if( tmp.Trim() != val ) // Trailing white space.
|
||||
{
|
||||
msg = _( "Entry contains trailing white space." );
|
||||
}
|
||||
else if( tmp.Trim( false ) != val ) // Leading white space.
|
||||
{
|
||||
msg = _( "Entry contains leading white space." );
|
||||
}
|
||||
else if( dummy.Parse( val, m_idType ) != -1 || !dummy.IsValid() ) // Is valid LIB_ID.
|
||||
{
|
||||
msg.Printf( _( "\"%s\" is not a valid library identifier format." ), val );
|
||||
}
|
||||
|
||||
if( !msg.empty() )
|
||||
{
|
||||
m_validatorWindow->SetFocus();
|
||||
|
||||
wxMessageBox( msg, _( "Library Identifier Validation Error" ),
|
||||
wxOK | wxICON_EXCLAMATION, aParent );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void KIUI::ValidatorTransferToWindowWithoutEvents( wxValidator& aValidator )
|
||||
{
|
||||
wxWindow* ctrl = aValidator.GetWindow();
|
||||
@@ -228,4 +330,4 @@ void KIUI::ValidatorTransferToWindowWithoutEvents( wxValidator& aValidator )
|
||||
|
||||
wxEventBlocker orient_update_blocker( ctrl, wxEVT_ANY );
|
||||
aValidator.TransferToWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,8 +147,6 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
|
||||
|
||||
void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
|
||||
{
|
||||
const double wheelPanSpeed = 0.001;
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
if( aEvent.GetTimestamp() == m_lastTimestamp )
|
||||
{
|
||||
@@ -159,6 +157,9 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
|
||||
m_lastTimestamp = aEvent.GetTimestamp();
|
||||
#endif
|
||||
|
||||
const double wheelPanSpeed = 0.001;
|
||||
const int axis = aEvent.GetWheelAxis();
|
||||
|
||||
// mousewheelpan disabled:
|
||||
// wheel + ctrl -> horizontal scrolling;
|
||||
// wheel + shift -> vertical scrolling;
|
||||
@@ -174,7 +175,6 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
|
||||
// Scrolling
|
||||
VECTOR2D scrollVec = m_view->ToWorld( m_view->GetScreenPixelSize(), false ) *
|
||||
( (double) aEvent.GetWheelRotation() * wheelPanSpeed );
|
||||
int axis = aEvent.GetWheelAxis();
|
||||
double scrollX = 0.0;
|
||||
double scrollY = 0.0;
|
||||
|
||||
@@ -200,18 +200,24 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
int rotation = aEvent.GetWheelRotation();
|
||||
double zoomScale = m_zoomController->GetScaleForRotation( rotation );
|
||||
// Restrict zoom handling to the vertical axis, otherwise horizontal
|
||||
// scrolling events (e.g. touchpads and some mice) end up interpreted
|
||||
// as vertical scroll events and confuse the user.
|
||||
if( axis == wxMOUSE_WHEEL_VERTICAL )
|
||||
{
|
||||
const int rotation = aEvent.GetWheelRotation();
|
||||
const double zoomScale = m_zoomController->GetScaleForRotation( rotation );
|
||||
|
||||
if( IsCursorWarpingEnabled() )
|
||||
{
|
||||
CenterOnCursor();
|
||||
m_view->SetScale( m_view->GetScale() * zoomScale );
|
||||
}
|
||||
else
|
||||
{
|
||||
VECTOR2D anchor = m_view->ToWorld( VECTOR2D( aEvent.GetX(), aEvent.GetY() ) );
|
||||
m_view->SetScale( m_view->GetScale() * zoomScale, anchor );
|
||||
if( IsCursorWarpingEnabled() )
|
||||
{
|
||||
CenterOnCursor();
|
||||
m_view->SetScale( m_view->GetScale() * zoomScale );
|
||||
}
|
||||
else
|
||||
{
|
||||
const VECTOR2D anchor = m_view->ToWorld( VECTOR2D( aEvent.GetX(), aEvent.GetY() ) );
|
||||
m_view->SetScale( m_view->GetScale() * zoomScale, anchor );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -22,11 +22,16 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/stattext.h>
|
||||
|
||||
#include <widgets/gal_options_panel.h>
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#include <incremental_text_ctrl.h>
|
||||
#include <config_map.h>
|
||||
|
||||
/*
|
||||
@@ -34,7 +39,7 @@
|
||||
*/
|
||||
static const double gridThicknessMin = 1.0;
|
||||
static const double gridThicknessMax = 10.0;
|
||||
static const double gridThicknessStep = 1.0;
|
||||
static const double gridThicknessStep = 0.5;
|
||||
|
||||
static const double gridMinSpacingMin = 5;
|
||||
static const double gridMinSpacingMax = 200;
|
||||
@@ -85,7 +90,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
|
||||
sGridSettings->Add( m_gridStyle, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxFlexGridSizer* sGridSettingsGrid;
|
||||
sGridSettingsGrid = new wxFlexGridSizer( 0, 4, 0, 0 );
|
||||
sGridSettingsGrid = new wxFlexGridSizer( 0, 3, 0, 0 );
|
||||
sGridSettingsGrid->AddGrowableCol( 1 );
|
||||
sGridSettingsGrid->SetFlexibleDirection( wxBOTH );
|
||||
sGridSettingsGrid->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
@@ -95,53 +100,36 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
|
||||
l_gridLineWidth->Wrap( -1 );
|
||||
sGridSettingsGrid->Add( l_gridLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_gridLineWidth = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY );
|
||||
m_gridLineWidth = new wxSpinCtrlDouble( sGridSettings->GetStaticBox(), wxID_ANY );
|
||||
m_gridLineWidth->SetRange( gridThicknessMin, gridThicknessMax );
|
||||
m_gridLineWidth->SetIncrement( gridThicknessStep );
|
||||
m_gridLineWidth->SetDigits( 1 );
|
||||
sGridSettingsGrid->Add( m_gridLineWidth, 0, wxEXPAND | wxTOP | wxBOTTOM, 5 );
|
||||
|
||||
m_gridLineWidthSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(),
|
||||
wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
|
||||
sGridSettingsGrid->Add( m_gridLineWidthSpinBtn, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0 );
|
||||
|
||||
l_gridLineWidthUnits = new wxStaticText( sGridSettings->GetStaticBox(),
|
||||
wxID_ANY, _( "px" ) );
|
||||
l_gridLineWidthUnits->Wrap( -1 );
|
||||
sGridSettingsGrid->Add( l_gridLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
sGridSettingsGrid->Add( l_gridLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||
|
||||
l_gridMinSpacing = new wxStaticText( sGridSettings->GetStaticBox(),
|
||||
wxID_ANY, _( "Min grid spacing:" ) );
|
||||
l_gridMinSpacing->Wrap( -1 );
|
||||
sGridSettingsGrid->Add( l_gridMinSpacing, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_gridMinSpacing = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY);
|
||||
m_gridMinSpacing = new wxSpinCtrlDouble( sGridSettings->GetStaticBox(), wxID_ANY);
|
||||
m_gridMinSpacing->SetRange( gridMinSpacingMin, gridMinSpacingMax );
|
||||
m_gridMinSpacing->SetIncrement( gridMinSpacingStep );
|
||||
m_gridMinSpacing->SetDigits( 0 );
|
||||
sGridSettingsGrid->Add( m_gridMinSpacing, 0, wxEXPAND | wxTOP | wxBOTTOM, 5 );
|
||||
|
||||
m_gridMinSpacingSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(),
|
||||
wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
|
||||
sGridSettingsGrid->Add( m_gridMinSpacingSpinBtn, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0 );
|
||||
|
||||
l_gridMinSpacingUnits = new wxStaticText( sGridSettings->GetStaticBox(),
|
||||
wxID_ANY, _( "px" ) );
|
||||
l_gridMinSpacingUnits->Wrap( -1 );
|
||||
sGridSettingsGrid->Add( l_gridMinSpacingUnits, 0, wxALL, 5 );
|
||||
sGridSettingsGrid->Add( l_gridMinSpacingUnits, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||
|
||||
sGridSettings->Add( sGridSettingsGrid, 1, wxALL|wxEXPAND, 5 );
|
||||
sGridSettings->Add( sGridSettingsGrid, 1, wxALL | wxEXPAND, 5 );
|
||||
|
||||
sLeftSizer->Add( sGridSettings, 0, wxTOP | wxBOTTOM | wxRIGHT | wxEXPAND, 5 );
|
||||
|
||||
// bind the spin buttons and text boxes
|
||||
m_gridSizeIncrementer = std::make_unique<SPIN_INCREMENTAL_TEXT_CTRL>(
|
||||
*m_gridLineWidthSpinBtn, *m_gridLineWidth );
|
||||
|
||||
m_gridSizeIncrementer->SetStep( gridThicknessMin, gridThicknessMax,
|
||||
gridThicknessStep );
|
||||
m_gridSizeIncrementer->SetPrecision( 0 );
|
||||
|
||||
m_gridMinSpacingIncrementer = std::make_unique<SPIN_INCREMENTAL_TEXT_CTRL>(
|
||||
*m_gridMinSpacingSpinBtn, *m_gridMinSpacing );
|
||||
|
||||
m_gridMinSpacingIncrementer->SetStep( gridMinSpacingMin, gridMinSpacingMax,
|
||||
gridMinSpacingStep );
|
||||
m_gridMinSpacingIncrementer->SetPrecision( 0 ); // restrict to ints
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -168,7 +156,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
|
||||
|
||||
int m_CursorShapeNChoices = sizeof( m_CursorShapeChoices ) / sizeof( wxString );
|
||||
m_cursorShape = new wxRadioBox( this, wxID_ANY,
|
||||
_( "Cursor shape:" ), wxDefaultPosition, wxDefaultSize,
|
||||
_( "Cursor Shape:" ), wxDefaultPosition, wxDefaultSize,
|
||||
m_CursorShapeNChoices, m_CursorShapeChoices, 1,
|
||||
wxRA_SPECIFY_COLS );
|
||||
|
||||
@@ -197,9 +185,9 @@ bool GAL_OPTIONS_PANEL::TransferDataToWindow()
|
||||
m_gridStyle->SetSelection( UTIL::GetConfigForVal(
|
||||
gridStyleSelectMap, m_galOptions.m_gridStyle ) );
|
||||
|
||||
m_gridSizeIncrementer->SetValue( m_galOptions.m_gridLineWidth );
|
||||
m_gridLineWidth->SetValue( m_galOptions.m_gridLineWidth );
|
||||
|
||||
m_gridMinSpacingIncrementer->SetValue( m_galOptions.m_gridMinSpacing );
|
||||
m_gridMinSpacing->SetValue( m_galOptions.m_gridMinSpacing );
|
||||
|
||||
m_cursorShape->SetSelection( m_galOptions.m_fullscreenCursor );
|
||||
|
||||
@@ -214,9 +202,9 @@ bool GAL_OPTIONS_PANEL::TransferDataFromWindow()
|
||||
m_galOptions.m_gridStyle = UTIL::GetValFromConfig(
|
||||
gridStyleSelectMap, m_gridStyle->GetSelection() );
|
||||
|
||||
m_galOptions.m_gridLineWidth = std::floor( m_gridSizeIncrementer->GetValue() + 0.5 );
|
||||
m_galOptions.m_gridLineWidth = m_gridLineWidth->GetValue();
|
||||
|
||||
m_galOptions.m_gridMinSpacing = m_gridMinSpacingIncrementer->GetValue();
|
||||
m_galOptions.m_gridMinSpacing = m_gridMinSpacing->GetValue();
|
||||
|
||||
m_galOptions.m_fullscreenCursor = m_cursorShape->GetSelection();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -47,6 +47,7 @@ wxString GRID_CELL_TEXT_BUTTON::GetValue() const
|
||||
return Combo()->GetValue();
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect )
|
||||
{
|
||||
wxRect rect( aRect );
|
||||
@@ -76,7 +77,8 @@ void GRID_CELL_TEXT_BUTTON::StartingKey( wxKeyEvent& event )
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
ch = event.GetUnicodeKey();
|
||||
if ( ch != WXK_NONE )
|
||||
|
||||
if( ch != WXK_NONE )
|
||||
isPrintable = true;
|
||||
else
|
||||
#endif // wxUSE_UNICODE
|
||||
@@ -85,24 +87,24 @@ void GRID_CELL_TEXT_BUTTON::StartingKey( wxKeyEvent& event )
|
||||
isPrintable = ch >= WXK_SPACE && ch < WXK_START;
|
||||
}
|
||||
|
||||
switch (ch)
|
||||
switch( ch )
|
||||
{
|
||||
case WXK_DELETE:
|
||||
// Delete the initial character when starting to edit with DELETE.
|
||||
textEntry->Remove(0, 1);
|
||||
textEntry->Remove( 0, 1 );
|
||||
break;
|
||||
|
||||
case WXK_BACK:
|
||||
// Delete the last character when starting to edit with BACKSPACE.
|
||||
{
|
||||
const long pos = textEntry->GetLastPosition();
|
||||
textEntry->Remove(pos - 1, pos);
|
||||
textEntry->Remove( pos - 1, pos );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( isPrintable )
|
||||
textEntry->WriteText(static_cast<wxChar>(ch));
|
||||
if( isPrintable )
|
||||
textEntry->WriteText( static_cast<wxChar>( ch ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +112,7 @@ void GRID_CELL_TEXT_BUTTON::StartingKey( wxKeyEvent& event )
|
||||
|
||||
void GRID_CELL_TEXT_BUTTON::BeginEdit( int aRow, int aCol, wxGrid* aGrid )
|
||||
{
|
||||
auto evtHandler = static_cast<wxGridCellEditorEvtHandler*>( m_control->GetEventHandler() );
|
||||
auto evtHandler = static_cast< wxGridCellEditorEvtHandler* >( m_control->GetEventHandler() );
|
||||
|
||||
// Don't immediately end if we get a kill focus event within BeginEdit
|
||||
evtHandler->SetInSetFocus( true );
|
||||
@@ -122,7 +124,7 @@ void GRID_CELL_TEXT_BUTTON::BeginEdit( int aRow, int aCol, wxGrid* aGrid )
|
||||
}
|
||||
|
||||
|
||||
bool GRID_CELL_TEXT_BUTTON::EndEdit( int , int , const wxGrid* , const wxString& , wxString *aNewVal )
|
||||
bool GRID_CELL_TEXT_BUTTON::EndEdit( int, int, const wxGrid*, const wxString&, wxString *aNewVal )
|
||||
{
|
||||
const wxString value = Combo()->GetValue();
|
||||
|
||||
@@ -150,9 +152,13 @@ void GRID_CELL_TEXT_BUTTON::Reset()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Symbol Picker
|
||||
*/
|
||||
#if wxUSE_VALIDATORS
|
||||
void GRID_CELL_TEXT_BUTTON::SetValidator( const wxValidator& validator )
|
||||
{
|
||||
m_validator.reset( static_cast< wxValidator* >( validator.Clone() ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
class TEXT_BUTTON_SYMBOL_CHOOSER : public wxComboCtrl
|
||||
{
|
||||
@@ -198,14 +204,10 @@ void GRID_CELL_SYMBOL_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
{
|
||||
m_control = new TEXT_BUTTON_SYMBOL_CHOOSER( aParent, m_dlg, m_preselect );
|
||||
|
||||
wxGridCellEditor::Create(aParent, aId, aEventHandler);
|
||||
wxGridCellEditor::Create( aParent, aId, aEventHandler );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Footprint Picker
|
||||
*/
|
||||
|
||||
class TEXT_BUTTON_FP_CHOOSER : public wxComboCtrl
|
||||
{
|
||||
public:
|
||||
@@ -250,14 +252,18 @@ void GRID_CELL_FOOTPRINT_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
{
|
||||
m_control = new TEXT_BUTTON_FP_CHOOSER( aParent, m_dlg, m_preselect );
|
||||
|
||||
wxGridCellEditor::Create(aParent, aId, aEventHandler);
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
if ( m_validator )
|
||||
{
|
||||
Combo()->SetValidator( *m_validator );
|
||||
}
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::Create( aParent, aId, aEventHandler );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* URL Viewer
|
||||
*/
|
||||
|
||||
class TEXT_BUTTON_URL : public wxComboCtrl
|
||||
{
|
||||
public:
|
||||
@@ -291,14 +297,18 @@ void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
{
|
||||
m_control = new TEXT_BUTTON_URL( aParent, m_dlg );
|
||||
|
||||
wxGridCellEditor::Create(aParent, aId, aEventHandler);
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
if ( m_validator )
|
||||
{
|
||||
Combo()->SetValidator( *m_validator );
|
||||
}
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::Create( aParent, aId, aEventHandler );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Path Picker
|
||||
*/
|
||||
|
||||
class TEXT_BUTTON_FILE_BROWSER : public wxComboCtrl
|
||||
{
|
||||
public:
|
||||
@@ -341,7 +351,7 @@ protected:
|
||||
else
|
||||
{
|
||||
wxDirDialog dlg( nullptr, _( "Select Path" ), path,
|
||||
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
|
||||
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
|
||||
|
||||
if( dlg.ShowModal() == wxID_OK )
|
||||
{
|
||||
@@ -362,16 +372,32 @@ void GRID_CELL_PATH_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
{
|
||||
m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_currentDir );
|
||||
|
||||
wxGridCellEditor::Create(aParent, aId, aEventHandler);
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
if ( m_validator )
|
||||
{
|
||||
Combo()->SetValidator( *m_validator );
|
||||
}
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::Create( aParent, aId, aEventHandler );
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_SYMLIB_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_currentDir, &m_ext );
|
||||
|
||||
wxGridCellEditor::Create(aParent, aId, aEventHandler);
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
if ( m_validator )
|
||||
{
|
||||
Combo()->SetValidator( *m_validator );
|
||||
}
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::Create( aParent, aId, aEventHandler );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3053,7 +3053,8 @@ bool mpWindow::SaveScreenshot( const wxString& filename, wxBitmapType type,
|
||||
wxBitmap screenBuffer( sizeX, sizeY );
|
||||
wxMemoryDC screenDC;
|
||||
screenDC.SelectObject( screenBuffer );
|
||||
screenDC.SetPen( *wxTRANSPARENT_PEN );
|
||||
screenDC.SetPen( *wxWHITE_PEN );
|
||||
screenDC.SetTextForeground( m_fgColour );
|
||||
wxBrush brush( GetBackgroundColour() );
|
||||
screenDC.SetBrush( brush );
|
||||
screenDC.DrawRectangle( 0, 0, sizeX, sizeY );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Chris Pavlina <pavlina.chris@gmail.com>
|
||||
* Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -28,8 +28,12 @@
|
||||
|
||||
#include <wx/statline.h>
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <bitmaps.h>
|
||||
#include <confirm.h>
|
||||
#include <dialog_shim.h>
|
||||
#include <draw_frame.h>
|
||||
|
||||
#include <panel_hotkeys_editor.h>
|
||||
|
||||
|
||||
/**
|
||||
@@ -80,13 +84,17 @@ class HK_PROMPT_DIALOG : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
HK_PROMPT_DIALOG( wxWindow* aParent, wxWindowID aId, const wxString& aTitle,
|
||||
const wxString& aName, const wxString& aCurrentKey )
|
||||
: DIALOG_SHIM( aParent, aId, aTitle, wxDefaultPosition, wxDefaultSize )
|
||||
const wxString& aName, const wxString& aCurrentKey, const bool aValidKey,
|
||||
const wxString& aValidMessage )
|
||||
: DIALOG_SHIM( aParent, aId, aTitle, wxDefaultPosition, wxDefaultSize )
|
||||
{
|
||||
wxPanel* panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize );
|
||||
wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
/* Dialog layout:
|
||||
*
|
||||
* valid_img valid_label...........
|
||||
* ----------------------------------
|
||||
*
|
||||
* inst_label........................
|
||||
* ----------------------------------
|
||||
@@ -96,6 +104,25 @@ public:
|
||||
* key_label_0 key_label_1 /
|
||||
*/
|
||||
|
||||
// If there is a validity error, display the error message to the user
|
||||
wxBoxSizer* valid_sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
if( !aValidKey )
|
||||
{
|
||||
wxStaticBitmap* valid_img = new wxStaticBitmap(
|
||||
panel, wxID_ANY, KiBitmap( cancel_xpm ), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
valid_sizer->Add( valid_img, 0, wxALL, 5 );
|
||||
|
||||
wxStaticText* valid_label = new wxStaticText( panel, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
|
||||
|
||||
valid_label->SetLabelText( aValidMessage );
|
||||
valid_sizer->Add( valid_label, 0, wxALL, 5 );
|
||||
|
||||
// Add the validity text to the main sizer
|
||||
sizer->Add( valid_sizer, 0, wxALL, 5 );
|
||||
sizer->Add( new wxStaticLine( panel ), 0, wxALL | wxEXPAND, 2 );
|
||||
}
|
||||
|
||||
wxStaticText* inst_label = new wxStaticText( panel, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL );
|
||||
|
||||
@@ -188,8 +215,21 @@ public:
|
||||
|
||||
void OnChar( wxKeyEvent& aEvent )
|
||||
{
|
||||
m_event = aEvent;
|
||||
EndFlexible( wxID_OK );
|
||||
int keyCode = WIDGET_HOTKEY_LIST::MapKeypressToKeycode( aEvent );
|
||||
|
||||
// Test for if the key is valid
|
||||
wxString validMsg;
|
||||
if( HOTKEY_STORE::CheckKeyValidity( keyCode, validMsg ) )
|
||||
{
|
||||
// Valid key, close the window and return
|
||||
m_event = aEvent;
|
||||
EndFlexible( wxID_OK );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Invalid key, tell the user
|
||||
DisplayErrorMessage( this, validMsg, wxEmptyString );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,9 +246,10 @@ public:
|
||||
|
||||
|
||||
static wxKeyEvent PromptForKey( wxWindow* aParent, const wxString& aName,
|
||||
const wxString& aCurrentKey )
|
||||
const wxString& aCurrentKey, const wxString& aValidMessage, const bool aValidKey )
|
||||
{
|
||||
HK_PROMPT_DIALOG dialog( aParent, wxID_ANY, _( "Set Hotkey" ), aName, aCurrentKey );
|
||||
HK_PROMPT_DIALOG dialog( aParent, wxID_ANY, _( "Set Hotkey" ), aName, aCurrentKey,
|
||||
aValidKey, aValidMessage );
|
||||
|
||||
if( dialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
@@ -311,6 +352,9 @@ WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::getExpectedHkClientData( wxTreeLi
|
||||
|
||||
void WIDGET_HOTKEY_LIST::UpdateFromClientData()
|
||||
{
|
||||
// Run a validity check on the hotkey store before updating
|
||||
m_hk_store.TestStoreValidity();
|
||||
|
||||
for( wxTreeListItem i = GetFirstItem(); i.IsOk(); i = GetNextItem( i ) )
|
||||
{
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( i );
|
||||
@@ -328,12 +372,22 @@ void WIDGET_HOTKEY_LIST::UpdateFromClientData()
|
||||
|
||||
SetItemText( i, 0, wxGetTranslation( hk.m_InfoMsg ) );
|
||||
SetItemText( i, 1, key_text);
|
||||
|
||||
// Add the image to the column if the item is invalid
|
||||
if( changed_hk.IsValid() )
|
||||
SetItemImage( i, NO_IMAGE, NO_IMAGE );
|
||||
else
|
||||
SetItemImage( i, 0, NO_IMAGE );
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger a resize in case column widths have changed
|
||||
wxSizeEvent dummy_evt;
|
||||
TWO_COLUMN_TREE_LIST::OnSize( dummy_evt );
|
||||
|
||||
// Update the panel's error message if it exists
|
||||
if( m_parentPanel )
|
||||
m_parentPanel->UpdateErrorMessage();
|
||||
}
|
||||
|
||||
|
||||
@@ -367,8 +421,11 @@ void WIDGET_HOTKEY_LIST::EditItem( wxTreeListItem aItem )
|
||||
|
||||
wxString name = GetItemText( aItem, 0 );
|
||||
wxString current_key = GetItemText( aItem, 1 );
|
||||
wxString valid_msg;
|
||||
|
||||
wxKeyEvent key_event = HK_PROMPT_DIALOG::PromptForKey( GetParent(), name, current_key );
|
||||
bool valid_key = hkdata->GetChangedHotkey().IsValid( valid_msg );
|
||||
wxKeyEvent key_event =
|
||||
HK_PROMPT_DIALOG::PromptForKey( GetParent(), name, current_key, valid_msg, valid_key );
|
||||
long key = MapKeypressToKeycode( key_event );
|
||||
|
||||
if( key )
|
||||
@@ -506,11 +563,29 @@ bool WIDGET_HOTKEY_LIST::ResolveKeyConflicts( long aKey, const wxString& aSectio
|
||||
}
|
||||
|
||||
|
||||
WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkeyStore,
|
||||
bool aReadOnly )
|
||||
: TWO_COLUMN_TREE_LIST( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTL_SINGLE ),
|
||||
m_hk_store( aHotkeyStore ),
|
||||
m_readOnly( aReadOnly )
|
||||
WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST(
|
||||
PANEL_HOTKEYS_EDITOR* aParent, HOTKEY_STORE& aHotkeyStore, bool aReadOnly )
|
||||
: TWO_COLUMN_TREE_LIST( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTL_SINGLE ),
|
||||
m_hk_store( aHotkeyStore ),
|
||||
m_readOnly( aReadOnly ),
|
||||
m_parentPanel( aParent )
|
||||
{
|
||||
initializeElements();
|
||||
}
|
||||
|
||||
|
||||
WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST(
|
||||
wxWindow* aParent, HOTKEY_STORE& aHotkeyStore, bool aReadOnly )
|
||||
: TWO_COLUMN_TREE_LIST( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTL_SINGLE ),
|
||||
m_hk_store( aHotkeyStore ),
|
||||
m_readOnly( aReadOnly ),
|
||||
m_parentPanel( nullptr )
|
||||
{
|
||||
initializeElements();
|
||||
}
|
||||
|
||||
|
||||
void WIDGET_HOTKEY_LIST::initializeElements()
|
||||
{
|
||||
wxString command_header = _( "Command" );
|
||||
|
||||
@@ -522,6 +597,16 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey
|
||||
SetRubberBandColumn( 0 );
|
||||
SetClampedMinWidth( HOTKEY_MIN_WIDTH );
|
||||
|
||||
// Add the bitmap image for invalid hotkey warning
|
||||
// bitmap size is not know (depending on it is built). So get it:
|
||||
wxSize iconsize;
|
||||
wxBitmap bm_invalid = KiBitmap( cancel_xpm );
|
||||
iconsize.x = bm_invalid.GetWidth();
|
||||
iconsize.y = bm_invalid.GetHeight();
|
||||
m_imgList = new wxImageList( iconsize.x, iconsize.y, true, 1);
|
||||
m_imgList->Add( bm_invalid );
|
||||
AssignImageList( m_imgList );
|
||||
|
||||
if( !m_readOnly )
|
||||
{
|
||||
// The event only apply if the widget is in editable mode
|
||||
@@ -531,7 +616,6 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WIDGET_HOTKEY_LIST::ApplyFilterString( const wxString& aFilterStr )
|
||||
{
|
||||
updateShownItems( aFilterStr );
|
||||
@@ -556,6 +640,12 @@ void WIDGET_HOTKEY_LIST::ResetAllHotkeys( bool aResetToDefault )
|
||||
|
||||
UpdateFromClientData();
|
||||
Thaw();
|
||||
|
||||
// Update the panel's error message if it exists
|
||||
// Call here again since the freeze/thaw seems to disrupt the update
|
||||
// inside UpdateFromClientData
|
||||
if( m_parentPanel )
|
||||
m_parentPanel->UpdateErrorMessage();
|
||||
}
|
||||
|
||||
|
||||
@@ -592,6 +682,12 @@ void WIDGET_HOTKEY_LIST::updateShownItems( const wxString& aFilterStr )
|
||||
|
||||
UpdateFromClientData();
|
||||
Thaw();
|
||||
|
||||
// Update the panel's error message if it exists
|
||||
// Call here again since the freeze/thaw seems to disrupt the update
|
||||
// inside UpdateFromClientData
|
||||
if( m_parentPanel )
|
||||
m_parentPanel->UpdateErrorMessage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,25 +29,8 @@
|
||||
*/
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
/**
|
||||
* Format wildcard extension to support case sensitive file dialogs.
|
||||
*
|
||||
* The file extension wildcards of the GTK+ file dialog are case sensitive so using all lower
|
||||
* case characters means that only file extensions that are all lower case will show up in the
|
||||
* file dialog. The GTK+ file dialog does support regular expressions so the file extension
|
||||
* is converted to a regular expression ( sch -> [sS][cC][hH] ) when wxWidgets is built against
|
||||
* GTK+. Please make sure you call this function when adding new file wildcards.
|
||||
*
|
||||
* @note When calling wxFileDialog with a default file defined, make sure you include the
|
||||
* file extension along with the file name. Otherwise, on GTK+ builds, the file
|
||||
* dialog will append the wildcard regular expression as the file extension which is
|
||||
* surely not what you want.
|
||||
*
|
||||
* @param aWildcard is the extension part of the wild card.
|
||||
*
|
||||
* @return the build appropriate file dialog wildcard filter.
|
||||
*/
|
||||
static wxString formatWildcardExt( const wxString& aWildcard )
|
||||
|
||||
wxString formatWildcardExt( const wxString& aWildcard )
|
||||
{
|
||||
wxString wc;
|
||||
#if defined( __WXGTK__ )
|
||||
@@ -68,6 +51,7 @@ static wxString formatWildcardExt( const wxString& aWildcard )
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
wxString AddFileExtListToFilter( const std::vector<std::string>& aExts )
|
||||
{
|
||||
if( aExts.size() == 0 )
|
||||
@@ -107,7 +91,6 @@ wxString AddFileExtListToFilter( const std::vector<std::string>& aExts )
|
||||
|
||||
const std::string SchematicSymbolFileExtension( "sym" );
|
||||
const std::string SchematicLibraryFileExtension( "lib" );
|
||||
const std::string SchematicBackupFileExtension( "bak" );
|
||||
|
||||
const std::string VrmlFileExtension( "wrl" );
|
||||
|
||||
|
||||
@@ -96,6 +96,9 @@ if( false ) # no CVPCB exe any more, only the *.kiface
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
|
||||
|
||||
set_target_properties( cvpcb PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
|
||||
)
|
||||
|
||||
@@ -31,17 +31,17 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string></string>
|
||||
<string>@KICAD_VERSION_FULL@</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>CvPcb</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<string>@KICAD_VERSION@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string></string>
|
||||
<string>@KICAD_VERSION_FULL@</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>LSRequiresCarbon</key>
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -113,6 +113,8 @@ void COMPONENTS_LISTBOX::OnChar( wxKeyEvent& event )
|
||||
{
|
||||
int key = event.GetKeyCode();
|
||||
|
||||
wxCommandEvent dummy;
|
||||
|
||||
switch( key )
|
||||
{
|
||||
case WXK_TAB:
|
||||
@@ -135,6 +137,21 @@ void COMPONENTS_LISTBOX::OnChar( wxKeyEvent& event )
|
||||
event.Skip();
|
||||
return;
|
||||
|
||||
case WXK_DELETE:
|
||||
GetParent()->DelAssociation( dummy );
|
||||
return;
|
||||
|
||||
case WXK_CONTROL_X:
|
||||
GetParent()->CutAssociation( dummy );
|
||||
return;
|
||||
|
||||
case WXK_CONTROL_C:
|
||||
GetParent()->CopyAssociation( dummy );
|
||||
return;
|
||||
|
||||
case WXK_CONTROL_V:
|
||||
GetParent()->PasteAssociation( dummy );
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
+7
-2
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2014-2019 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -42,7 +42,11 @@ enum id_cvpcb_frm
|
||||
ID_CVPCB_CREATE_SCREENCMP = ID_END_LIST,
|
||||
ID_CVPCB_GOTO_FIRSTNA,
|
||||
ID_CVPCB_GOTO_PREVIOUSNA,
|
||||
ID_CVPCB_DEL_ASSOCIATIONS,
|
||||
ID_CVPCB_DEL_ALL_ASSOCIATIONS,
|
||||
ID_CVPCB_DEL_ASSOCIATION,
|
||||
ID_CVPCB_CUT_ASSOCIATION,
|
||||
ID_CVPCB_COPY_ASSOCIATION,
|
||||
ID_CVPCB_PASTE_ASSOCIATION,
|
||||
ID_CVPCB_AUTO_ASSOCIE,
|
||||
ID_CVPCB_COMPONENT_LIST,
|
||||
ID_CVPCB_FOOTPRINT_LIST,
|
||||
@@ -56,5 +60,6 @@ enum id_cvpcb_frm
|
||||
ID_CVPCB_EQUFILES_LIST_EDIT,
|
||||
ID_CVPCB_LIB_TABLE_EDIT,
|
||||
ID_CVPCB_FILTER_TEXT_EDIT,
|
||||
ID_CVPCB_ESCAPE_KEY,
|
||||
ID_TB_MEASUREMENT_TOOL
|
||||
};
|
||||
|
||||
+166
-23
@@ -2,8 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -75,7 +75,11 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER )
|
||||
EVT_TOOL( ID_CVPCB_CREATE_SCREENCMP, CVPCB_MAINFRAME::DisplayModule )
|
||||
EVT_TOOL( ID_CVPCB_GOTO_FIRSTNA, CVPCB_MAINFRAME::ToFirstNA )
|
||||
EVT_TOOL( ID_CVPCB_GOTO_PREVIOUSNA, CVPCB_MAINFRAME::ToPreviousNA )
|
||||
EVT_TOOL( ID_CVPCB_DEL_ASSOCIATIONS, CVPCB_MAINFRAME::DelAssociations )
|
||||
EVT_TOOL( ID_CVPCB_DEL_ALL_ASSOCIATIONS, CVPCB_MAINFRAME::DelAllAssociations )
|
||||
EVT_TOOL( ID_CVPCB_DEL_ASSOCIATION, CVPCB_MAINFRAME::DelAssociation )
|
||||
EVT_TOOL( ID_CVPCB_CUT_ASSOCIATION, CVPCB_MAINFRAME::CutAssociation )
|
||||
EVT_TOOL( ID_CVPCB_COPY_ASSOCIATION, CVPCB_MAINFRAME::CopyAssociation )
|
||||
EVT_TOOL( ID_CVPCB_PASTE_ASSOCIATION, CVPCB_MAINFRAME::PasteAssociation )
|
||||
EVT_TOOL( ID_CVPCB_AUTO_ASSOCIE, CVPCB_MAINFRAME::AutomaticFootprintMatching )
|
||||
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
|
||||
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
|
||||
@@ -95,10 +99,15 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER )
|
||||
EVT_CLOSE( CVPCB_MAINFRAME::OnCloseWindow )
|
||||
EVT_SIZE( CVPCB_MAINFRAME::OnSize )
|
||||
|
||||
// Handle the escape key
|
||||
EVT_TOOL( ID_CVPCB_ESCAPE_KEY, CVPCB_MAINFRAME::OnEscapeKey )
|
||||
|
||||
// UI event handlers
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, CVPCB_MAINFRAME::OnFilterFPbyKeywords)
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, CVPCB_MAINFRAME::OnFilterFPbyPinCount )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, CVPCB_MAINFRAME::OnFilterFPbyLibrary )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, CVPCB_MAINFRAME::OnFilterFPbyKeywords )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
|
||||
CVPCB_MAINFRAME::OnFilterFPbyPinCount )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
|
||||
CVPCB_MAINFRAME::OnFilterFPbyLibrary )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME, CVPCB_MAINFRAME::OnFilterFPbyKeyName )
|
||||
|
||||
END_EVENT_TABLE()
|
||||
@@ -165,7 +174,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
auto bottomPanel = new wxPanel( this );
|
||||
auto panelSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizerStatus = new wxFlexGridSizer( 2, 1, 0, 0 );
|
||||
wxFlexGridSizer* fgSizerStatus = new wxFlexGridSizer( 3, 1, 0, 0 );
|
||||
fgSizerStatus->SetFlexibleDirection( wxBOTH );
|
||||
fgSizerStatus->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
@@ -173,7 +182,10 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
fgSizerStatus->Add( m_statusLine1, 0, 0, 5 );
|
||||
|
||||
m_statusLine2 = new wxStaticText( bottomPanel, wxID_ANY, wxEmptyString );
|
||||
fgSizerStatus->Add( m_statusLine2, 0, wxBOTTOM, 3 );
|
||||
fgSizerStatus->Add( m_statusLine2, 0, 0, 5 );
|
||||
|
||||
m_statusLine3 = new wxStaticText( bottomPanel, wxID_ANY, wxEmptyString );
|
||||
fgSizerStatus->Add( m_statusLine3, 0, wxBOTTOM, 3 );
|
||||
|
||||
panelSizer->Add( fgSizerStatus, 1, wxEXPAND|wxLEFT, 2 );
|
||||
|
||||
@@ -184,6 +196,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
statusFont.SetSymbolicSize( wxFONTSIZE_SMALL );
|
||||
m_statusLine1->SetFont( statusFont );
|
||||
m_statusLine2->SetFont( statusFont );
|
||||
m_statusLine3->SetFont( statusFont );
|
||||
|
||||
// Add buttons:
|
||||
auto buttonsSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -213,17 +226,33 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
m_initialized = true;
|
||||
|
||||
// Connect Events
|
||||
m_saveAndContinue->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this );
|
||||
m_footprintListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ), NULL, this );
|
||||
m_compListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnComponentRightClick ), NULL, this );
|
||||
m_saveAndContinue->Connect( wxEVT_COMMAND_BUTTON_CLICKED,
|
||||
wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ),
|
||||
NULL, this );
|
||||
m_footprintListBox->Connect( wxEVT_RIGHT_DOWN,
|
||||
wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ),
|
||||
NULL, this );
|
||||
m_compListBox->Connect( wxEVT_RIGHT_DOWN,
|
||||
wxMouseEventHandler( CVPCB_MAINFRAME::OnComponentRightClick ),
|
||||
NULL, this );
|
||||
|
||||
// Add an accelerator to make escape close the window
|
||||
wxAcceleratorEntry entries[1];
|
||||
entries[0].Set( wxACCEL_NORMAL, WXK_ESCAPE, ID_CVPCB_ESCAPE_KEY );
|
||||
wxAcceleratorTable accel( 1, entries );
|
||||
SetAcceleratorTable( accel );
|
||||
}
|
||||
|
||||
|
||||
CVPCB_MAINFRAME::~CVPCB_MAINFRAME()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_saveAndContinue->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this );
|
||||
m_footprintListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ), NULL, this );
|
||||
m_saveAndContinue->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED,
|
||||
wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ),
|
||||
NULL, this );
|
||||
m_footprintListBox->Disconnect( wxEVT_RIGHT_DOWN,
|
||||
wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ),
|
||||
NULL, this );
|
||||
|
||||
m_auimgr.UnInit();
|
||||
}
|
||||
@@ -260,7 +289,8 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
{
|
||||
if( m_modified )
|
||||
{
|
||||
if( !HandleUnsavedChanges( this, _( "Symbol to Footprint links have been modified.\nSave before exit?" ),
|
||||
if( !HandleUnsavedChanges( this, _( "Symbol to Footprint links have been modified. "
|
||||
"Save before exit?" ),
|
||||
[&]()->bool { return SaveFootprintAssociation( false ); } ) )
|
||||
{
|
||||
Event.Veto();
|
||||
@@ -367,6 +397,12 @@ void CVPCB_MAINFRAME::ToPreviousNA( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnEscapeKey( wxCommandEvent& aEvent )
|
||||
{
|
||||
Close( false );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnOK( wxCommandEvent& aEvent )
|
||||
{
|
||||
SaveFootprintAssociation( false );
|
||||
@@ -400,9 +436,81 @@ void CVPCB_MAINFRAME::OnQuit( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
|
||||
void CVPCB_MAINFRAME::CutAssociation( wxCommandEvent& event )
|
||||
{
|
||||
if( IsOK( this, _( "Delete selections" ) ) )
|
||||
int itmIdx = m_compListBox->GetFirstSelected();
|
||||
|
||||
if( itmIdx == -1 )
|
||||
return;
|
||||
|
||||
if( m_netlist.IsEmpty() )
|
||||
return;
|
||||
|
||||
COMPONENT* component = m_netlist.GetComponent( itmIdx );
|
||||
|
||||
if( component && component->GetFPID().IsValid() )
|
||||
{
|
||||
m_clipboardBuffer = component->GetFPID().Format().wx_str();
|
||||
|
||||
SetNewPkg( wxEmptyString, itmIdx );
|
||||
m_compListBox->RefreshItem( itmIdx );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::CopyAssociation( wxCommandEvent& event )
|
||||
{
|
||||
int itmIdx = m_compListBox->GetFirstSelected();
|
||||
|
||||
if( itmIdx == -1 )
|
||||
return;
|
||||
|
||||
if( m_netlist.IsEmpty() )
|
||||
return;
|
||||
|
||||
COMPONENT* component = m_netlist.GetComponent( itmIdx );
|
||||
|
||||
if( component && component->GetFPID().IsValid() )
|
||||
m_clipboardBuffer = component->GetFPID().Format().wx_str();
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::PasteAssociation( wxCommandEvent& event )
|
||||
{
|
||||
if( m_clipboardBuffer.IsEmpty() )
|
||||
return;
|
||||
|
||||
int itmIdx = m_compListBox->GetFirstSelected();
|
||||
|
||||
while( itmIdx != -1 )
|
||||
{
|
||||
SetNewPkg( m_clipboardBuffer, itmIdx );
|
||||
m_compListBox->RefreshItem( itmIdx );
|
||||
|
||||
itmIdx = m_compListBox->GetNextSelected( itmIdx );
|
||||
}
|
||||
|
||||
DisplayStatus();
|
||||
}
|
||||
|
||||
void CVPCB_MAINFRAME::DelAssociation( wxCommandEvent& event )
|
||||
{
|
||||
int itmIdx = m_compListBox->GetFirstSelected();
|
||||
|
||||
while( itmIdx != -1 )
|
||||
{
|
||||
SetNewPkg( wxEmptyString, itmIdx );
|
||||
m_compListBox->RefreshItem( itmIdx );
|
||||
|
||||
itmIdx = m_compListBox->GetNextSelected( itmIdx );
|
||||
}
|
||||
|
||||
DisplayStatus();
|
||||
}
|
||||
|
||||
void CVPCB_MAINFRAME::DelAllAssociations( wxCommandEvent& event )
|
||||
{
|
||||
if( IsOK( this, _( "Delete all footprint assocations?" ) ) )
|
||||
{
|
||||
m_skipComponentSelect = true;
|
||||
|
||||
@@ -456,7 +564,18 @@ void CVPCB_MAINFRAME::OnComponentRightClick( wxMouseEvent& event )
|
||||
{
|
||||
wxMenu menu;
|
||||
|
||||
menu.Append( ID_CVPCB_CREATE_SCREENCMP, _( "View Footprint" ), _( "Show the assigned footprint in the footprint viewer" ) );
|
||||
menu.Append( ID_CVPCB_CREATE_SCREENCMP, _( "View Footprint" ),
|
||||
_( "Show the assigned footprint in the footprint viewer" ) );
|
||||
|
||||
menu.Append( ID_CVPCB_CUT_ASSOCIATION, _( "Cut Footprint Association" ),
|
||||
_( "Cut the assigned footprint" ) );
|
||||
menu.Append( ID_CVPCB_COPY_ASSOCIATION, _( "Copy Footprint Association" ),
|
||||
_( "Copy the assigned footprint" ) );
|
||||
menu.Append( ID_CVPCB_PASTE_ASSOCIATION, _( "Paste Footprint Association" ),
|
||||
_( "Paste a footprint assignment" ) );
|
||||
|
||||
menu.Append( ID_CVPCB_DEL_ASSOCIATION, _( "Delete Footprint Association" ),
|
||||
_( "Delete the assigned footprint" ) );
|
||||
|
||||
PopupMenu( &menu );
|
||||
}
|
||||
@@ -466,7 +585,8 @@ void CVPCB_MAINFRAME::OnFootprintRightClick( wxMouseEvent& event )
|
||||
{
|
||||
wxMenu menu;
|
||||
|
||||
menu.Append( ID_CVPCB_CREATE_SCREENCMP, _( "View Footprint" ), _( "Show the current footprint in the footprint viewer" ) );
|
||||
menu.Append( ID_CVPCB_CREATE_SCREENCMP, _( "View Footprint" ),
|
||||
_( "Show the current footprint in the footprint viewer" ) );
|
||||
|
||||
PopupMenu( &menu );
|
||||
}
|
||||
@@ -540,6 +660,7 @@ void CVPCB_MAINFRAME::refreshAfterComponentSearch( COMPONENT* component )
|
||||
DisplayStatus();
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnSelectFilteringFootprint( wxCommandEvent& event )
|
||||
{
|
||||
int option = 0;
|
||||
@@ -693,6 +814,24 @@ void CVPCB_MAINFRAME::DisplayStatus()
|
||||
}
|
||||
|
||||
SetStatusText( msg, 1 );
|
||||
|
||||
|
||||
msg.Empty();
|
||||
|
||||
if( module ) // can be NULL if no netlist loaded
|
||||
{
|
||||
FP_LIB_TABLE* fptbl = Prj().PcbFootprintLibs( Kiway() );
|
||||
|
||||
wxString modLib = module->GetLibNickname();
|
||||
|
||||
if( fptbl->HasLibrary( modLib ) )
|
||||
{
|
||||
msg = wxString::Format( _( "Library location: %s" ),
|
||||
fptbl->GetFullURI( modLib ) );
|
||||
}
|
||||
}
|
||||
|
||||
SetStatusText( msg, 2 );
|
||||
}
|
||||
|
||||
|
||||
@@ -771,7 +910,8 @@ int CVPCB_MAINFRAME::ReadSchematicNetlist( const std::string& aNetlist )
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Error loading schematic.\n%s" ), ioe.What().GetData() );
|
||||
wxString msg = wxString::Format( _( "Error loading schematic.\n%s" ),
|
||||
ioe.What().GetData() );
|
||||
wxMessageBox( msg, _( "Load Error" ), wxOK | wxICON_ERROR );
|
||||
return 1;
|
||||
}
|
||||
@@ -816,7 +956,8 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
|
||||
fpframe->Raise(); // Make sure that is visible.
|
||||
Raise(); // .. but still we want the focus.
|
||||
|
||||
focus->SetFocus();
|
||||
if( focus )
|
||||
focus->SetFocus();
|
||||
}
|
||||
|
||||
fpframe->InitDisplay();
|
||||
@@ -838,7 +979,7 @@ void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX()
|
||||
}
|
||||
|
||||
m_footprintListBox->SetFootprints( *m_FootprintsList, wxEmptyString, NULL,
|
||||
wxEmptyString, FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST );
|
||||
wxEmptyString, FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST );
|
||||
DisplayStatus();
|
||||
}
|
||||
|
||||
@@ -941,9 +1082,11 @@ wxString CVPCB_MAINFRAME::GetSelectedFootprint()
|
||||
|
||||
void CVPCB_MAINFRAME::SetStatusText( const wxString& aText, int aNumber )
|
||||
{
|
||||
wxASSERT( aNumber < 2 );
|
||||
wxASSERT( aNumber < 3 );
|
||||
|
||||
if( aNumber == 1 )
|
||||
if( aNumber == 2 )
|
||||
m_statusLine3->SetLabel( aText );
|
||||
else if( aNumber == 1 )
|
||||
m_statusLine2->SetLabel( aText );
|
||||
else
|
||||
m_statusLine1->SetLabel( aText );
|
||||
|
||||
+31
-4
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -68,7 +68,9 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER
|
||||
wxTextCtrl* m_tcFilterString;
|
||||
wxStaticText* m_statusLine1;
|
||||
wxStaticText* m_statusLine2;
|
||||
wxStaticText* m_statusLine3;
|
||||
wxButton* m_saveAndContinue;
|
||||
wxString m_clipboardBuffer;
|
||||
|
||||
public:
|
||||
wxArrayString m_ModuleLibNames;
|
||||
@@ -121,6 +123,7 @@ public:
|
||||
void OnCloseWindow( wxCloseEvent& Event );
|
||||
void OnSize( wxSizeEvent& SizeEvent );
|
||||
void OnKeyDown( wxKeyEvent& aEvent );
|
||||
void OnEscapeKey( wxCommandEvent& aEvent );
|
||||
void ReCreateHToolbar();
|
||||
virtual void ReCreateMenuBar() override;
|
||||
void ShowChangedLanguage() override;
|
||||
@@ -131,10 +134,34 @@ public:
|
||||
void ToPreviousNA( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function DelAssociations
|
||||
* removes all component footprint associations already made
|
||||
* Function DelAllAssociations
|
||||
* Removes all component footprint associations already made
|
||||
*/
|
||||
void DelAssociations( wxCommandEvent& event );
|
||||
void DelAllAssociations( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function DelAssociation
|
||||
* Removes association from selected footprints
|
||||
*/
|
||||
void DelAssociation( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function CutAssociation
|
||||
* Cuts the footprint name for the 1st selected component to the clipboard
|
||||
*/
|
||||
void CutAssociation( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function CopyAssociation
|
||||
* Copies the footprint name for the 1st selected component to the clipboard
|
||||
*/
|
||||
void CopyAssociation( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function PasteAssociation
|
||||
* Paste the footprint from the clipboard onto the selected components
|
||||
*/
|
||||
void PasteAssociation( wxCommandEvent& event );
|
||||
|
||||
void OnConfigurePaths( wxCommandEvent& aEvent );
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
||||
KiScaledBitmap( auto_associe_xpm, this ),
|
||||
_( "Perform automatic footprint association" ) );
|
||||
|
||||
m_mainToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
|
||||
m_mainToolBar->AddTool( ID_CVPCB_DEL_ALL_ASSOCIATIONS, wxEmptyString,
|
||||
KiScaledBitmap( delete_association_xpm, this ),
|
||||
_( "Delete all footprint associations" ) );
|
||||
|
||||
|
||||
+6
-21
@@ -394,6 +394,9 @@ endif()
|
||||
|
||||
# these 2 binaries are a matched set, keep them together:
|
||||
if( APPLE )
|
||||
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
|
||||
|
||||
set_target_properties( eeschema PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
|
||||
)
|
||||
@@ -449,22 +452,17 @@ endif()
|
||||
# auto-generate cmp_library_lexer.h and cmp_library_keywords.cpp for the component
|
||||
# library format.
|
||||
make_lexer(
|
||||
cmp_library_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmp_library.keywords
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_keywords.cpp
|
||||
TLIB_T
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
cmp_library_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_keywords.cpp
|
||||
)
|
||||
|
||||
add_dependencies( eeschema_kiface cmp_library_lexer_source_files )
|
||||
|
||||
make_lexer(
|
||||
field_template_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames.keywords
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_keywords.cpp
|
||||
@@ -474,16 +472,10 @@ make_lexer(
|
||||
template_fieldnames.h
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
field_template_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_keywords.cpp
|
||||
)
|
||||
|
||||
add_dependencies( eeschema_kiface field_template_lexer_source_files )
|
||||
|
||||
make_lexer(
|
||||
dialog_bom_cfg_lexer_source_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg.keywords
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_keywords.cpp
|
||||
@@ -493,13 +485,6 @@ make_lexer(
|
||||
dialogs/dialog_bom_cfg.h
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
dialog_bom_cfg_lexer_source_files ALL
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_lexer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_keywords.cpp
|
||||
)
|
||||
|
||||
add_dependencies( eeschema_kiface dialog_bom_cfg_lexer_source_files )
|
||||
|
||||
add_subdirectory( plugins )
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
<key>CFBundleIconFile</key> <string>eeschema.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.eeschema</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key> <string></string>
|
||||
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
|
||||
<key>CFBundleName</key> <string>Eeschema</string>
|
||||
<key>CFBundlePackageType</key> <string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key> <string></string>
|
||||
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
|
||||
<key>CFBundleSignature</key> <string>????</string>
|
||||
<key>CFBundleVersion</key> <string></string>
|
||||
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
|
||||
<key>CSResourcesFileMapped</key> <true/>
|
||||
<key>LSRequiresCarbon</key> <true/>
|
||||
<key>NSRequiresAquaSystemAppearance</key> <true/>
|
||||
@@ -293,7 +293,6 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* aDC )
|
||||
case BLOCK_CUT:
|
||||
case BLOCK_DELETE:
|
||||
GetScreen()->UpdatePickList();
|
||||
DrawAndSizingBlockOutlines( m_canvas, aDC, wxDefaultPosition, false );
|
||||
|
||||
// The CUT variant needs to copy the items from their originial position
|
||||
if( ( block->GetCommand() == BLOCK_CUT ) && block->GetCount() )
|
||||
@@ -319,7 +318,6 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* aDC )
|
||||
|
||||
case BLOCK_COPY: // Save a copy of items in paste buffer
|
||||
GetScreen()->UpdatePickList();
|
||||
DrawAndSizingBlockOutlines( m_canvas, aDC, wxDefaultPosition, false );
|
||||
|
||||
if( block->GetCount() )
|
||||
{
|
||||
|
||||
@@ -898,11 +898,18 @@ void SCH_EDIT_FRAME::RepeatDrawItem()
|
||||
( (SCH_TEXT*) my_clone )->IncrementLabel( GetRepeatDeltaLabel() );
|
||||
|
||||
AddToScreen( my_clone );
|
||||
SaveCopyInUndoList( my_clone, UR_NEW );
|
||||
|
||||
if( my_clone->IsConnectable() )
|
||||
TestDanglingEnds();
|
||||
{
|
||||
PICKED_ITEMS_LIST list;
|
||||
|
||||
list.PushItem( ITEM_PICKER( my_clone ) );
|
||||
CheckListConnections( list, true );
|
||||
SchematicCleanUp( true );
|
||||
TestDanglingEnds();
|
||||
}
|
||||
|
||||
SaveCopyInUndoList( my_clone, UR_NEW );
|
||||
my_clone->ClearFlags();
|
||||
}
|
||||
|
||||
|
||||
@@ -626,7 +626,8 @@ void LIB_PART::RemoveDrawItem( LIB_ITEM* aItem, EDA_DRAW_PANEL* aPanel, wxDC* aD
|
||||
|
||||
void LIB_PART::AddDrawItem( LIB_ITEM* aItem )
|
||||
{
|
||||
wxASSERT( aItem != NULL );
|
||||
if( !aItem )
|
||||
return;
|
||||
|
||||
m_drawings.push_back( aItem );
|
||||
}
|
||||
|
||||
@@ -281,11 +281,11 @@ bool SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KE
|
||||
|
||||
if( aHotKey )
|
||||
{
|
||||
if( m_movingCursorWithKeyboard ) // The hotkey was a move crossahir cursor command
|
||||
if( m_movingCursorWithKeyboard )
|
||||
{
|
||||
// The crossair was moved. move the mouse cursor to the new crosshair position:
|
||||
GetGalCanvas()->GetViewControls()->WarpCursor( GetCrossHairPosition(), true );
|
||||
m_movingCursorWithKeyboard = 0;
|
||||
// The hotkey was a move crosshair cursor command. We've already done the work;
|
||||
// just eat the event and reset the flag.
|
||||
m_movingCursorWithKeyboard = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -179,8 +179,18 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow()
|
||||
// Push a copy of each field into m_fields
|
||||
m_libEntry->GetFields( *m_fields );
|
||||
|
||||
// Datasheet field is special; grab its value from the docfilename
|
||||
m_fields->at( DATASHEET ).SetText( rootAlias->GetDocFileName() );
|
||||
// The datasheet field is special. Grab its value from the LIB_ALIAS document file
|
||||
// member except for old libraries that saved the root alias document file in the
|
||||
// datasheet field in the LIB_PART object.
|
||||
if( rootAlias->GetDocFileName().IsEmpty() )
|
||||
{
|
||||
m_fields->at( DATASHEET ).SetText( m_libEntry->GetField( DATASHEET )->GetText() );
|
||||
rootAlias->SetDocFileName( m_libEntry->GetField( DATASHEET )->GetText() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fields->at( DATASHEET ).SetText( rootAlias->GetDocFileName() );
|
||||
}
|
||||
|
||||
// The Y axis for components in lib is from bottom to top while the screen axis is top
|
||||
// to bottom: we must change the y coord sign for editing
|
||||
@@ -940,8 +950,10 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSizeGrid( wxSizeEvent& event )
|
||||
if( new_size != m_width )
|
||||
{
|
||||
adjustGridColumns( event.GetSize().GetX() );
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// Always propagate a wxSizeEvent:
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Mar 20 2019)
|
||||
// C++ code generated with wxFormBuilder (version Dec 1 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -77,7 +77,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
m_grid->SetMinSize( wxSize( -1,180 ) );
|
||||
|
||||
sbSizer4->Add( m_grid, 0, wxTOP|wxBOTTOM|wxEXPAND, 5 );
|
||||
sbSizer4->Add( m_grid, 1, wxTOP|wxBOTTOM|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bButtonSize;
|
||||
bButtonSize = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -110,7 +110,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
bButtonSize->Add( m_bpDelete, 0, wxRIGHT|wxLEFT, 10 );
|
||||
|
||||
|
||||
sbSizer4->Add( bButtonSize, 1, wxEXPAND|wxBOTTOM, 5 );
|
||||
sbSizer4->Add( bButtonSize, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
bSizerBasicPanel->Add( sbSizer4, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
@@ -470,7 +470,6 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
bMainSizer->Fit( this );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnUpdateUI ) );
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<property name="file">dialog_edit_component_in_lib_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">DIALOG_EDIT_COMPONENT_IN_LIBRARY_FBP</property>
|
||||
@@ -26,7 +25,6 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@@ -47,7 +45,7 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="size">855,579</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Library Symbol Properties</property>
|
||||
@@ -202,7 +200,7 @@
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
@@ -291,7 +289,7 @@
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bButtonSize</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Mar 20 2019)
|
||||
// C++ code generated with wxFormBuilder (version Dec 1 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -115,7 +115,7 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Library Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Library Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 855,579 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE();
|
||||
|
||||
};
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <sch_draw_panel.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <sch_reference_list.h>
|
||||
#include <sch_validators.h>
|
||||
#include <symbol_lib_table.h>
|
||||
|
||||
#ifdef KICAD_SPICE
|
||||
@@ -97,7 +98,9 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( SCH_EDIT
|
||||
m_bpMoveDown->SetBitmap( KiBitmap( small_down_xpm ) );
|
||||
|
||||
// wxFormBuilder doesn't include this event...
|
||||
m_grid->Connect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnGridCellChanging ), NULL, this );
|
||||
m_grid->Connect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnGridCellChanging ),
|
||||
NULL, this );
|
||||
|
||||
FinishDialogSettings();
|
||||
}
|
||||
@@ -110,7 +113,9 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC()
|
||||
// Prevents crash bug in wxGrid's d'tor
|
||||
m_grid->DestroyTable( m_fields );
|
||||
|
||||
m_grid->Disconnect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnGridCellChanging ), NULL, this );
|
||||
m_grid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnGridCellChanging ),
|
||||
NULL, this );
|
||||
|
||||
// Delete the GRID_TRICKS.
|
||||
m_grid->PopEventHandler( true );
|
||||
@@ -316,7 +321,7 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate()
|
||||
wxString msg;
|
||||
LIB_ID id;
|
||||
|
||||
if( !m_grid->CommitPendingChanges() )
|
||||
if( !m_grid->CommitPendingChanges() || !m_grid->Validate() )
|
||||
return false;
|
||||
|
||||
if( !SCH_COMPONENT::IsReferenceStringValid( m_fields->at( REFERENCE ).GetText() ) )
|
||||
@@ -388,7 +393,7 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate()
|
||||
|
||||
bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow()
|
||||
{
|
||||
if( !Validate() )
|
||||
if( !wxDialog::TransferDataFromWindow() ) // Calls our Validate() method.
|
||||
return false;
|
||||
|
||||
// save old cmp in undo list if not already in edit, or moving ...
|
||||
@@ -485,9 +490,11 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow()
|
||||
|
||||
SCH_REFERENCE_LIST components;
|
||||
GetParent()->GetCurrentSheet().GetComponents( components );
|
||||
|
||||
for( unsigned i = 0; i < components.GetCount(); i++ )
|
||||
{
|
||||
SCH_REFERENCE component = components[i];
|
||||
|
||||
if( component.GetLibPart()->GetLibId() == thisLibId
|
||||
&& component.GetRef() == thisRef
|
||||
&& component.GetUnit() != thisUnit )
|
||||
@@ -633,6 +640,10 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary( wxCommandEvent
|
||||
SCH_COMPONENT copy( *m_cmp );
|
||||
copy.SetFields( *m_fields );
|
||||
|
||||
LIB_ID id;
|
||||
id.Parse( m_libraryNameTextCtrl->GetValue(), LIB_ID::ID_SCH, true );
|
||||
copy.SetLibId( id, Prj().SchSymbolLibTable(), Prj().SchLibs()->GetCacheLibrary() );
|
||||
|
||||
// Update the requested fields in the component copy
|
||||
std::list<SCH_COMPONENT*> components;
|
||||
components.push_back( © );
|
||||
@@ -722,8 +733,10 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnSizeGrid( wxSizeEvent& event )
|
||||
if( m_width != new_size )
|
||||
{
|
||||
AdjustGridColumns( new_size );
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// Always propagate for a grid repaint (needed if the height changes, as well as width)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -151,6 +151,11 @@ void DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick( wxCommandEvent& aEvent
|
||||
|
||||
void DIALOG_EDIT_ONE_FIELD::OnSetFocusText( wxFocusEvent& event )
|
||||
{
|
||||
|
||||
// Force an update of the text control before setting the text selection
|
||||
// This is needed because GTK seems to ignore the selection on first update
|
||||
m_TextValue->Update();
|
||||
|
||||
if( m_fieldId == REFERENCE )
|
||||
SelectReferenceNumber( static_cast<wxTextEntry*>( m_TextValue ) );
|
||||
else
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Oliver Walters
|
||||
* Copyright (C) 2017-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -67,12 +67,14 @@ protected:
|
||||
{
|
||||
if( m_grid->GetGridCursorCol() == FOOTPRINT )
|
||||
{
|
||||
menu.Append( MYID_SELECT_FOOTPRINT, _( "Select Footprint..." ), _( "Browse for footprint" ) );
|
||||
menu.Append( MYID_SELECT_FOOTPRINT, _( "Select Footprint..." ),
|
||||
_( "Browse for footprint" ) );
|
||||
menu.AppendSeparator();
|
||||
}
|
||||
else if( m_grid->GetGridCursorCol() == DATASHEET )
|
||||
{
|
||||
menu.Append( MYID_SHOW_DATASHEET, _( "Show Datasheet" ), _( "Show datasheet in browser" ) );
|
||||
menu.Append( MYID_SHOW_DATASHEET, _( "Show Datasheet" ),
|
||||
_( "Show datasheet in browser" ) );
|
||||
menu.AppendSeparator();
|
||||
}
|
||||
|
||||
@@ -85,7 +87,8 @@ protected:
|
||||
{
|
||||
// pick a footprint using the footprint picker.
|
||||
wxString fpid = m_grid->GetCellValue( m_grid->GetGridCursorRow(), FOOTPRINT );
|
||||
KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true, m_dlg );
|
||||
KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_PCB_MODULE_VIEWER_MODAL, true,
|
||||
m_dlg );
|
||||
|
||||
if( frame->ShowModal( &fpid, m_dlg ) )
|
||||
m_grid->SetCellValue( m_grid->GetGridCursorRow(), FOOTPRINT, fpid );
|
||||
@@ -131,6 +134,7 @@ enum GROUP_TYPE
|
||||
CHILD_ITEM
|
||||
};
|
||||
|
||||
|
||||
struct DATA_MODEL_ROW
|
||||
{
|
||||
DATA_MODEL_ROW( SCH_REFERENCE aFirstReference, GROUP_TYPE aType )
|
||||
@@ -609,10 +613,18 @@ public:
|
||||
destField = comp.AddField( SCH_FIELD( compOrigin, -1, &comp, srcName ) );
|
||||
}
|
||||
|
||||
if( destField && !srcValue.IsEmpty() )
|
||||
destField->SetText( srcValue );
|
||||
else
|
||||
if( !destField )
|
||||
{
|
||||
comp.RemoveField( srcName );
|
||||
continue;
|
||||
}
|
||||
|
||||
// Reference and value fields cannot be empty. All other fields can.
|
||||
if( srcValue.IsEmpty()
|
||||
&& (destField->GetId() == REFERENCE || destField->GetId() == VALUE))
|
||||
continue;
|
||||
|
||||
destField->SetText( srcValue );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,9 +679,11 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent
|
||||
|
||||
m_bRefresh->SetBitmap( KiBitmap( refresh_xpm ) );
|
||||
|
||||
m_fieldsCtrl->AppendTextColumn( _( "Field" ), wxDATAVIEW_CELL_INERT, 0, wxALIGN_LEFT, 0 );
|
||||
m_fieldsCtrl->AppendToggleColumn( _( "Show" ), wxDATAVIEW_CELL_ACTIVATABLE, 0, wxALIGN_CENTER, 0 );
|
||||
m_fieldsCtrl->AppendToggleColumn( _( "Group By" ), wxDATAVIEW_CELL_ACTIVATABLE, 0, wxALIGN_CENTER, 0 );
|
||||
m_fieldsCtrl->AppendTextColumn( _( "Field" ), wxDATAVIEW_CELL_INERT, 0, wxALIGN_LEFT, 0 );
|
||||
m_fieldsCtrl->AppendToggleColumn( _( "Show" ), wxDATAVIEW_CELL_ACTIVATABLE, 0, wxALIGN_CENTER,
|
||||
0 );
|
||||
m_fieldsCtrl->AppendToggleColumn( _( "Group By" ), wxDATAVIEW_CELL_ACTIVATABLE, 0,
|
||||
wxALIGN_CENTER, 0 );
|
||||
|
||||
// SetWidth( wxCOL_WIDTH_AUTOSIZE ) fails here on GTK, so we calculate the title sizes and
|
||||
// set the column widths ourselves.
|
||||
@@ -710,7 +724,7 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent
|
||||
m_grid->UseNativeColHeader( false );
|
||||
m_grid->SetTable( m_dataModel, true );
|
||||
|
||||
// sync m_grid's column visiblities to Show checkboxes in m_fieldsCtrl
|
||||
// sync m_grid's column visibilities to Show checkboxes in m_fieldsCtrl
|
||||
for( int i = 0; i < m_fieldsCtrl->GetItemCount(); ++i )
|
||||
{
|
||||
if( m_fieldsCtrl->GetToggleValue( i, 1 ) )
|
||||
@@ -745,8 +759,8 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent
|
||||
attr->SetReadOnly();
|
||||
m_grid->SetColAttr( m_dataModel->GetColsCount() - 1, attr );
|
||||
m_grid->SetColFormatNumber( m_dataModel->GetColsCount() - 1 );
|
||||
|
||||
m_grid->AutoSizeColumns( false );
|
||||
|
||||
for( int col = 0; col < m_grid->GetNumberCols(); ++ col )
|
||||
{
|
||||
// Columns are hidden by setting their width to 0 so if we resize them they will
|
||||
@@ -773,21 +787,23 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent
|
||||
Center();
|
||||
|
||||
// Connect Events
|
||||
m_grid->Connect( wxEVT_GRID_COL_SORT, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL::OnColSort ), NULL, this );
|
||||
m_grid->Connect( wxEVT_GRID_COL_SORT,
|
||||
wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL::OnColSort ), NULL, this );
|
||||
}
|
||||
|
||||
|
||||
DIALOG_FIELDS_EDITOR_GLOBAL::~DIALOG_FIELDS_EDITOR_GLOBAL()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_grid->Disconnect( wxEVT_GRID_COL_SORT, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL::OnColSort ), NULL, this );
|
||||
m_grid->Disconnect( wxEVT_GRID_COL_SORT,
|
||||
wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL::OnColSort ), NULL, this );
|
||||
|
||||
// Delete the GRID_TRICKS.
|
||||
m_grid->PopEventHandler( true );
|
||||
|
||||
// we gave ownership of m_dataModel to the wxGrid...
|
||||
|
||||
// Clear highligted symbols, if any
|
||||
// Clear highlighted symbols, if any
|
||||
m_parent->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr );
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
}
|
||||
@@ -891,7 +907,8 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnAddField( wxCommandEvent& event )
|
||||
{
|
||||
if( fieldName == m_dataModel->GetColLabelValue( i ) )
|
||||
{
|
||||
DisplayError( this, wxString::Format( _( "Field name \"%s\" already in use." ), fieldName ) );
|
||||
DisplayError( this, wxString::Format( _( "Field name \"%s\" already in use." ),
|
||||
fieldName ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -900,7 +917,8 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnAddField( wxCommandEvent& event )
|
||||
|
||||
AddField( fieldName, true, false );
|
||||
|
||||
wxGridTableMessage msg( m_dataModel, wxGRIDTABLE_NOTIFY_COLS_INSERTED, m_fieldsCtrl->GetItemCount(), 1 );
|
||||
wxGridTableMessage msg( m_dataModel, wxGRIDTABLE_NOTIFY_COLS_INSERTED,
|
||||
m_fieldsCtrl->GetItemCount(), 1 );
|
||||
m_grid->ProcessTableMessage( msg );
|
||||
|
||||
// set up attributes on the new quantities column
|
||||
@@ -1007,14 +1025,14 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick( wxGridEvent& event )
|
||||
m_grid->ClearSelection();
|
||||
m_grid->SetGridCursor( event.GetRow(), event.GetCol() );
|
||||
|
||||
// Clear highligted symbols, if any
|
||||
// Clear highlighted symbols, if any
|
||||
m_parent->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr );
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
|
||||
m_dataModel->ExpandCollapseRow( event.GetRow() );
|
||||
std::vector<SCH_REFERENCE> refs = m_dataModel->GetRowReferences( event.GetRow() );
|
||||
|
||||
// Focus eeschema view on the component selected in the dialog
|
||||
// Focus Eeschema view on the component selected in the dialog
|
||||
if( refs.size() == 1 )
|
||||
{
|
||||
m_parent->FindComponentAndItem( refs[0].GetRef() + refs[0].GetRefNumber(),
|
||||
|
||||
@@ -628,8 +628,10 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnSize( wxSizeEvent& event )
|
||||
if( m_initialized && m_width != new_size )
|
||||
{
|
||||
adjustGridColumns( new_size );
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// Always propagate for a grid repaint (needed if the height changes, as well as width)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2013-2017 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -121,7 +121,7 @@ class NETLIST_DIALOG : public NETLIST_DIALOG_BASE
|
||||
|
||||
public:
|
||||
SCH_EDIT_FRAME* m_Parent;
|
||||
wxString m_NetFmtName;
|
||||
wxString m_DefaultNetFmtName;
|
||||
NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX];
|
||||
|
||||
protected:
|
||||
@@ -268,7 +268,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
|
||||
m_SpiceAjustPassiveValues = NULL;
|
||||
m_ButtonCancel = NULL;
|
||||
|
||||
wxString netfmtName = ((NETLIST_DIALOG*)parent->GetParent())->m_NetFmtName;
|
||||
wxString netfmtName = ((NETLIST_DIALOG*)parent->GetParent())->m_DefaultNetFmtName;
|
||||
|
||||
bool selected = m_pageNetFmtName == netfmtName;
|
||||
|
||||
@@ -309,7 +309,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
|
||||
|
||||
long tmp;
|
||||
m_config->Read( NETLIST_USE_DEFAULT_NETNAME, &tmp, 0l );
|
||||
m_NetFmtName = m_Parent->GetNetListFormatName();
|
||||
m_DefaultNetFmtName = m_Parent->GetNetListFormatName();
|
||||
|
||||
for( int ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
|
||||
{
|
||||
@@ -345,6 +345,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
|
||||
{
|
||||
m_PanelNetType[PANELPCBNEW]->m_IsCurrentFormat->SetValue( true );
|
||||
m_NoteBook->SetSelection( PANELPCBNEW );
|
||||
m_DefaultNetFmtName = m_PanelNetType[PANELPCBNEW]->GetPageNetFmtName();
|
||||
// call OnNetlistTypeSelection to update some widgets.
|
||||
// SetSelection() do nothing if the current page is already PANELPCBNEW
|
||||
wxNotebookEvent event;
|
||||
@@ -489,7 +490,8 @@ void NETLIST_DIALOG::SelectDefaultNetlistType( wxCommandEvent& event )
|
||||
if( currPage == NULL )
|
||||
return;
|
||||
|
||||
m_Parent->SetNetListFormatName( currPage->GetPageNetFmtName() );
|
||||
m_DefaultNetFmtName = currPage->GetPageNetFmtName();
|
||||
m_Parent->SetNetListFormatName( m_DefaultNetFmtName );
|
||||
currPage->m_IsCurrentFormat->SetValue( true );
|
||||
}
|
||||
|
||||
@@ -859,5 +861,16 @@ int InvokeDialogNetList( SCH_EDIT_FRAME* aCaller )
|
||||
{
|
||||
NETLIST_DIALOG dlg( aCaller );
|
||||
|
||||
return dlg.ShowModal();
|
||||
wxString curr_default_netformat = aCaller->GetNetListFormatName();
|
||||
|
||||
int ret = dlg.ShowModal();
|
||||
|
||||
// Ensure the default netlist is up to date, and store it in prj config
|
||||
// if its was explicitely changed.
|
||||
aCaller->SetNetListFormatName( dlg.m_DefaultNetFmtName ); // can have temporary changed
|
||||
|
||||
if( curr_default_netformat != dlg.m_DefaultNetFmtName )
|
||||
aCaller->SaveProjectSettings( false );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -430,19 +430,26 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
|
||||
|
||||
GRResetPenAndBrush( dc );
|
||||
|
||||
if( m_parent->GetPrintMonochrome() )
|
||||
GRForceBlackPen( true );
|
||||
|
||||
aScreen->m_IsPrinting = true;
|
||||
|
||||
COLOR4D bgColor = m_parent->GetDrawBgColor();
|
||||
m_parent->SetDrawBgColor( COLOR4D::WHITE );
|
||||
|
||||
aScreen->Draw( panel, dc, (GR_DRAWMODE) 0 );
|
||||
GRSetDrawMode( dc, GR_COPY );
|
||||
GRSFilledRect( nullptr, dc, fitRect.GetX(), fitRect.GetY(),
|
||||
fitRect.GetRight(), fitRect.GetBottom(),
|
||||
0, COLOR4D::WHITE, COLOR4D::WHITE );
|
||||
|
||||
if( m_parent->GetPrintMonochrome() )
|
||||
GRForceBlackPen( true );
|
||||
|
||||
if( printReference )
|
||||
m_parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(),
|
||||
IU_PER_MILS, aScreen->GetFileName() );
|
||||
IU_PER_MILS, aScreen->GetFileName(), wxEmptyString,
|
||||
GetLayerColor( ( SCH_LAYER_ID )LAYER_WORKSHEET ) );
|
||||
|
||||
|
||||
aScreen->Draw( panel, dc, (GR_DRAWMODE) 0 );
|
||||
m_parent->SetDrawBgColor( bgColor );
|
||||
aScreen->m_IsPrinting = false;
|
||||
panel->SetClipBox( oldClipBox );
|
||||
|
||||
@@ -158,6 +158,12 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_dcEnable1->IsChecked() && m_dcSource1->GetValue() == m_dcSource2->GetValue() )
|
||||
{
|
||||
DisplayError( this, _( "Source 1 and Source 2 must be different" ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
/// @todo for some reason it does not trigger the assigned SPICE_VALIDATOR,
|
||||
// hence try..catch below
|
||||
if( !m_dcStart2->Validate() || !m_dcStop2->Validate() || !m_dcIncr2->Validate() )
|
||||
|
||||
@@ -35,7 +35,10 @@
|
||||
PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame,
|
||||
wxWindow* aWindow ) :
|
||||
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( aWindow ),
|
||||
m_frame( aFrame )
|
||||
m_frame( aFrame ),
|
||||
m_busWidth( aFrame, m_busWidthLabel, m_busWidthCtrl, m_busWidthUnits, true ),
|
||||
m_wireWidth( aFrame, m_wireWidthLabel, m_wireWidthCtrl, m_wireWidthUnits, true ),
|
||||
m_junctionSize( aFrame, m_jctSizeLabel, m_jctSizeCtrl, m_jctSizeUnits, true )
|
||||
{
|
||||
KIGFX::GAL_DISPLAY_OPTIONS& galOptions = m_frame->GetGalDisplayOptions();
|
||||
m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
|
||||
@@ -60,9 +63,13 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||
|
||||
m_choiceSeparatorRefId->SetSelection( refStyleSelection );
|
||||
|
||||
m_busWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultBusThickness(), false, true ) );
|
||||
m_lineWidthCtrl->SetValue( StringFromValue( INCHES, GetDefaultLineThickness(), false, true ) );
|
||||
m_jctSizeCtrl->SetValue( StringFromValue( INCHES, SCH_JUNCTION::GetSymbolSize(), false, true ) );
|
||||
m_busWidth.SetUnits( INCHES, true );
|
||||
m_wireWidth.SetUnits( INCHES, true );
|
||||
m_junctionSize.SetUnits( INCHES, true );
|
||||
|
||||
m_busWidth.SetValue( GetDefaultBusThickness() );
|
||||
m_wireWidth.SetValue( GetDefaultWireThickness() );
|
||||
m_junctionSize.SetValue( SCH_JUNCTION::GetSymbolSize() );
|
||||
m_checkShowHiddenPins->SetValue( m_frame->GetShowAllPins() );
|
||||
m_checkPageLimits->SetValue( m_frame->ShowPageLimits() );
|
||||
|
||||
@@ -96,9 +103,9 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||
m_frame->SaveProjectSettings( false );
|
||||
}
|
||||
|
||||
SetDefaultBusThickness( ValueFromString( INCHES, m_busWidthCtrl->GetValue(), true ) );
|
||||
SetDefaultLineThickness( ValueFromString( INCHES, m_lineWidthCtrl->GetValue(), true ) );
|
||||
SCH_JUNCTION::SetSymbolSize( ValueFromString( INCHES, m_jctSizeCtrl->GetValue(), true ) );
|
||||
SetDefaultBusThickness( m_busWidth.GetValue() );
|
||||
SetDefaultWireThickness( m_wireWidth.GetValue() );
|
||||
SCH_JUNCTION::SetSymbolSize( m_junctionSize.GetValue() );
|
||||
m_frame->SetShowAllPins( m_checkShowHiddenPins->GetValue() );
|
||||
m_frame->SetShowPageLimits( m_checkPageLimits->GetValue() );
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#ifndef KICAD_PANEL_EESCHEMA_DISPLAY_OPTIONS_H
|
||||
#define KICAD_PANEL_EESCHEMA_DISPLAY_OPTIONS_H
|
||||
|
||||
#include <widgets/unit_binder.h>
|
||||
#include "panel_eeschema_display_options_base.h"
|
||||
|
||||
class SCH_EDIT_FRAME;
|
||||
@@ -32,6 +33,10 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS : public PANEL_EESCHEMA_DISPLAY_OPTIONS_BAS
|
||||
|
||||
GAL_OPTIONS_PANEL* m_galOptsPanel;
|
||||
|
||||
UNIT_BINDER m_busWidth;
|
||||
UNIT_BINDER m_wireWidth;
|
||||
UNIT_BINDER m_junctionSize;
|
||||
|
||||
public:
|
||||
PANEL_EESCHEMA_DISPLAY_OPTIONS( SCH_EDIT_FRAME* aFrame, wxWindow* aWindow );
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user