Sync with main branch r6421

This commit is contained in:
Cirilo Bernardo 2016-01-05 16:37:52 +11:00
commit 43c2c7223b
42 changed files with 968 additions and 2018 deletions

View File

@ -54,14 +54,6 @@ option( KICAD_SCRIPTING_WXPYTHON
"Build wxPython implementation for wx interface building in Python and py.shell (default OFF)."
)
# WARNING: KiCad developers strongly advise you to build Boost with supplied patches,
# as it is known to work with KiCad. Other versions may contain bugs that may result
# in KiCad errors.
option( KICAD_SKIP_BOOST
"Skip building downloaded Boost library components, use Boost from your system."
)
mark_as_advanced( KICAD_SKIP_BOOST ) # Normal builders should build Boost.
# 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 )
@ -103,13 +95,6 @@ else()
endif()
# All CMake downloads go here. Suggested is up in the source tree, not in the build dir where they
# would have to be downloaded over and over again. The default is to choose a directory that is
# hidden on linux (starts with a '.') because there is a way to exclude this directory when grepping
# the source tree.
set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake
CACHE PATH "Location of KiCad downloads, suggested is a dir common to all builds, i.e. global." )
# Add option to add user directories for linker, if any
LINK_DIRECTORIES( ${LINK_DIRECTORIES_PATH} )
@ -269,7 +254,7 @@ if( KICAD_SCRIPTING_WXPYTHON )
add_definitions( -DKICAD_SCRIPTING_WXPYTHON )
endif()
if( USE_WX_GRAPHICS_CONTEXT )
if( USE_WX_GRAPHICS_CONTEXT OR APPLE )
add_definitions( -DUSE_WX_GRAPHICS_CONTEXT )
endif()
@ -282,7 +267,6 @@ else()
endif()
# KIFACE_SUFFIX is the file extension used for top level program modules which
# implement the KIFACE interface. A valid suffix starts with a period '.'.
@ -417,9 +401,9 @@ include( ExternalProject )
#================================================
include( CheckFindPackageResult )
#################################
# Find OpenMP support, optional #
#################################
#
# Find OpenMP support, optional
#
find_package( OpenMP )
@ -435,9 +419,10 @@ if( OPENMP_FOUND )
endif()
endif()
##########################
# Find wxWidgets library #
##########################
#
# Find wxWidgets library, required
#
# Here you can define what libraries of wxWidgets you need for your
# application. You can figure out what libraries you need here;
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
@ -453,11 +438,10 @@ find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc R
# Include wxWidgets macros.
include( ${wxWidgets_USE_FILE} )
#######################
# Find OpenGL library #
#######################
find_package( OpenGL QUIET )
check_find_package_result( OPENGL_FOUND "OpenGL" )
#
# Find OpenGL library, required
#
find_package( OpenGL REQUIRED )
# Dick 5-Feb-2014:
# Marco: We cannot use both ExternalProject_Add() add and find_package()
@ -469,47 +453,37 @@ check_find_package_result( OPENGL_FOUND "OpenGL" )
# Always defined, empty if no libraries are to be built
add_custom_target( lib-dependencies )
# Find GLEW library
#
# Find GLEW library, required
#
if( NOT GLEW_FOUND )
find_package( GLEW )
find_package( GLEW REQUIRED )
check_find_package_result( GLEW_FOUND "GLEW" )
endif()
# Find GLM library
find_package( GLM 0.9.5.4 REQUIRED )
#
# Find GLM library, required
#
find_package( GLM 0.9.5.1 REQUIRED )
# Find CURL library
#
# Find CURL library, required for github plugin
#
find_package( CURL REQUIRED )
# Find Cairo library
if( NOT CAIRO_FOUND )
find_package( Cairo 1.8.1 QUIET )
check_find_package_result( CAIRO_FOUND "Cairo" )
endif()
#
# Find Cairo library, required
#
find_package( Cairo 1.8.8 REQUIRED )
# Download boost and possibly build parts of it
#################################################
if( KICAD_SKIP_BOOST )
find_package( Boost 1.54.0 REQUIRED COMPONENTS context date_time filesystem iostreams locale
#
# Find Boost library, required.
#
# Note: Prior to Boost 1.59, the Boost context library is not built when compiling on windows
# with GCC. You must patch the Boost sources.
find_package( Boost 1.54.0 REQUIRED COMPONENTS context date_time filesystem iostreams locale
program_options regex system thread )
if( NOT Boost_FOUND )
message( FATAL_ERROR "Boost 1.54+ libraries are required." )
endif()
# Keeps CMake from complaining about undefined boost dependencies even though Boost was
# found. Sigh!!!!!
add_custom_target( boost )
message( WARNING "
WARNING: You decided to skip building boost library.
KiCad developers strongly advise you to build the bundled boost library, as it is known to work with KiCad.
Other versions may contain bugs that may result in KiCad errors." )
else()
add_dependencies( lib-dependencies boost )
include( download_boost )
endif()
# Include MinGW resource compiler.
include( MinGWResourceCompiler )
@ -686,38 +660,6 @@ add_subdirectory( qa )
#add_subdirectory( new )
# Make all libs and executables depend on ExternalProject_Add( boost ),
# except perhaps bitmap lib. This allows a multi-threaded build to succeed.
add_dependencies( pcbnew boost )
add_dependencies( eeschema boost )
add_dependencies( cvpcb_kiface boost )
add_dependencies( gal boost )
add_dependencies( common boost )
add_dependencies( pcbcommon boost )
add_dependencies( 3d-viewer boost )
add_dependencies( pcad2kicadpcb boost )
add_dependencies( polygon boost )
add_dependencies( pl_editor boost )
add_dependencies( pnsrouter boost )
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_dependencies( pcbnew lib-dependencies )
add_dependencies( eeschema lib-dependencies )
add_dependencies( cvpcb_kiface lib-dependencies )
add_dependencies( common lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( pcbcommon lib-dependencies )
add_dependencies( 3d-viewer lib-dependencies )
add_dependencies( pcad2kicadpcb lib-dependencies )
add_dependencies( pl_editor lib-dependencies )
add_dependencies( pnsrouter lib-dependencies )
endif()
if( KICAD_BUILD_DYNAMIC )
endif()
#############
# Resources #
#############

View File

@ -22,12 +22,11 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if (UNIX)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_CAIRO cairo)
endif (PKG_CONFIG_FOUND)
endif (UNIX)
endif (PKG_CONFIG_FOUND)
SET(_CAIRO_ROOT_HINTS
$ENV{CAIRO}
@ -54,7 +53,7 @@ FIND_PATH(CAIRO_INCLUDE_DIR
"include/cairo"
)
IF(WIN32 AND NOT CYGWIN)
IF(NOT PKGCONFIG_FOUND AND WIN32 AND NOT CYGWIN)
# MINGW should go here too
IF(MSVC)
# Implementation details:
@ -118,7 +117,7 @@ IF(WIN32 AND NOT CYGWIN)
MARK_AS_ADVANCED(CAIRO)
set( CAIRO_LIBRARIES ${CAIRO} )
ENDIF(MSVC)
ELSE(WIN32 AND NOT CYGWIN)
ELSE()
FIND_LIBRARY(CAIRO_LIBRARY
NAMES
@ -136,33 +135,32 @@ ELSE(WIN32 AND NOT CYGWIN)
# compat defines
SET(CAIRO_LIBRARIES ${CAIRO_LIBRARY})
ENDIF(WIN32 AND NOT CYGWIN)
ENDIF()
# if (CAIRO_INCLUDE_DIR)
# file(READ "${CAIRO_INCLUDE_DIR}/gcore/gdal_version.h" _wxgisgdal_VERSION_H_CONTENTS)
# string(REGEX REPLACE ".*# define[ \t]+GDAL_RELEASE_NAME[ \t]+\"([0-9A-Za-z.]+)\".*"
# "\\1" CAIRO_VERSION ${_wxgisgdal_VERSION_H_CONTENTS})
# set(CAIRO_VERSION ${CAIRO_VERSION} CACHE INTERNAL "The version number for wxgisgdal libraries")
# endif (CAIRO_INCLUDE_DIR)
#message( STATUS "Cairo_FIND_VERSION=${Cairo_FIND_VERSION}.")
#message( STATUS "CAIRO_INCLUDE_DIR=${CAIRO_INCLUDE_DIR}.")
# Fetch version from cairo-version.h if a version was requested by find_package()
if(CAIRO_INCLUDE_DIR AND Cairo_FIND_VERSION)
file(READ "${CAIRO_INCLUDE_DIR}/cairo-version.h" _CAIRO_VERSION_H_CONTENTS)
string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MAJOR[ \t]+([0-9]+).*"
"\\2" CAIRO_VERSION_MAJOR ${_CAIRO_VERSION_H_CONTENTS})
string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MINOR[ \t]+([0-9]+).*"
"\\2" CAIRO_VERSION_MINOR ${_CAIRO_VERSION_H_CONTENTS})
string(REGEX REPLACE "^(.*\n)?#define[ \t]+CAIRO_VERSION_MICRO[ \t]+([0-9]+).*"
"\\2" CAIRO_VERSION_MICRO ${_CAIRO_VERSION_H_CONTENTS})
set(CAIRO_VERSION ${CAIRO_VERSION_MAJOR}.${CAIRO_VERSION_MINOR}.${CAIRO_VERSION_MICRO}
CACHE INTERNAL "The version number for Cairo libraries")
endif()
include(FindPackageHandleStandardArgs)
# if (CAIRO_VERSION)
# find_package_handle_standard_args(CAIRO
# REQUIRED_VARS
# CAIRO_LIBRARIES
# CAIRO_INCLUDE_DIR
# VERSION_VAR
# CAIRO_VERSION
# FAIL_MESSAGE
# "Could NOT find CAIRO, try to set the path to CAIRO root folder in the system variable CAIRO_ROOT_DIR"
# )
# else (CAIRO_VERSION)
find_package_handle_standard_args(CAIRO "Could NOT find CAIRO, try to set the path to CAIRO root folder in the system variable CAIRO"
find_package_handle_standard_args(Cairo
REQUIRED_VARS
CAIRO_LIBRARIES
CAIRO_INCLUDE_DIR
)
# endif (CAIRO_VERSION)
VERSION_VAR
CAIRO_VERSION
)
MARK_AS_ADVANCED(CAIRO_INCLUDE_DIR CAIRO_LIBRARIES)

View File

@ -1,65 +0,0 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
# Copyright (C) 2013 Kicad Developers, see 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
# Download av_http and install into ${PREFIX}, typically in our KiCad source tree.
# Assumes include( ExternalProject ) was done inline previous to this file
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
#-----<configure>-------------------------------------------------------------------------------------
# soon cmake will have https support, switch to a true download then:
#set( AVHTTP_RELEASE ??? )
#set( AVHTTP_MD5 ???? ) # re-calc this on every RELEASE change
#-----</configure>-----------------------------------------------------------------------------------
# Where the library is to be installed.
set( PREFIX ${DOWNLOAD_DIR}/avhttp )
if( KICAD_SKIP_BOOST )
set( AVHTTP_DEPEND "" )
else()
set( AVHTTP_DEPEND "boost" )
endif()
# Install the AVHTTP header only library ${PREFIX}
ExternalProject_Add( avhttp
PREFIX ${PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_DIR} # no true download yet
# grab it from a local zip file for now, cmake caller's source dir
URL ${CMAKE_CURRENT_SOURCE_DIR}/avhttp-master.zip
DEPENDS ${AVHTTP_DEPEND}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> <INSTALL_DIR>
)
set( AVHTTP_INCLUDE_DIR "${PREFIX}/include" CACHE FILEPATH "AVHTTP include directory" )
mark_as_advanced( AVHTTP_INCLUDE_DIR )

View File

@ -1,320 +0,0 @@
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
# Copyright (C) 2013 Kicad Developers, see 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
# Download a particular boost version, and patch it [and build it if BUILD_GITHUB_PLUGIN].
# Assumes include( ExternalProject ) was done inline previous to this file
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
#-----<configure>----------------------------------------------------------------
set( BOOST_RELEASE 1.54.0 )
set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
# The boost headers [and static libs if built] go here, at the top of KiCad
# source tree in boost_root.
set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )
# Space separated list which indicates the subset of boost libraries to compile.
# Chosen libraries are based on AVHTTP requirements, and possibly
# unit_test_framework for its own worth.
# tool_manager.cpp -> coroutine -> context (_jump_fcontext) (on OSX)
set( BOOST_LIBS_BUILT
context
#coroutine
date_time
#exception
filesystem
iostreams
locale
program_options
regex
#signals
system
thread
#unit_test_framework
)
#-----</configure>---------------------------------------------------------------
if( NOT BZIP2_FOUND )
find_package( BZip2 REQUIRED )
endif()
string( REGEX REPLACE "\\." "_" BOOST_VERS "${BOOST_RELEASE}" )
set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} )
# <SOURCE_DIR> = ${PREFIX}/src/boost
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
# download, the patch is applied. This lets you regenerate a new patch at any time
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
# path to the boost headers in the repo.
# repo = "${headers_src}/../.bzr" = "<SOURCE_DIR>/.bzr"
set( headers_src "${PREFIX}/src/boost/boost" )
function( set_boost_lib_names libs output )
foreach( lib ${libs} )
set( fullpath_lib "${BOOST_ROOT}/lib/libboost_${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}" )
list( APPEND results ${fullpath_lib} )
endforeach()
# set the results into variable represented by output into caller's scope
set( ${output} ${results} PARENT_SCOPE )
endfunction()
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.sh ).
#message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT}" )
#message( STATUS "REPLACE libs_csv:${boost_libs_list}" )
# Default Toolset
set( BOOST_TOOLSET "toolset=gcc" )
if( KICAD_BUILD_STATIC OR APPLE )
set( BOOST_LINKTYPE "link=static" )
else()
unset( BOOST_LINKTYPE )
endif()
find_program(patch_bin NAMES patch patch.exe)
if( "${patch_bin}" STREQUAL "patch_bin-NOTFOUND" )
set( PATCH_STR_CMD ${PATCH_STR_CMD} )
else()
set( PATCH_STR_CMD ${patch_bin} -p0 -i )
endif()
if( MINGW AND NOT CMAKE_HOST_UNIX ) # building for MINGW on windows not UNIX
if( MSYS )
# The Boost system does not build properly on MSYS using bootstrap.sh. Running
# bootstrap.bat with cmd.exe does. It's ugly but it works. At least for Boost
# version 1.54.
set( bootstrap cmd.exe /c "bootstrap.bat mingw" )
else()
set( bootstrap ./bootstrap.bat mingw )
endif()
foreach( lib ${boost_libs_list} )
set( b2_libs ${b2_libs} --with-${lib} )
endforeach()
unset( BOOST_CFLAGS )
else()
string( REGEX REPLACE "\\;" "," libs_csv "${boost_libs_list}" )
#message( STATUS "libs_csv:${libs_csv}" )
set( bootstrap ./bootstrap.sh --with-libraries=${libs_csv} )
# pass to *both* C and C++ compilers
set( BOOST_INCLUDE "${BOOST_ROOT}/include" )
unset( b2_libs )
endif()
if( APPLE )
set( BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
set( BOOST_TOOLSET "toolset=darwin" )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set(BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -fno-lto" )
set(BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -fno-lto" )
endif()
if( CMAKE_OSX_ARCHITECTURES )
if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND
(CMAKE_OSX_ARCHITECTURES MATCHES "64"))
message( "-- BOOST found 32/64 Address Model" )
set( BOOST_ADDRESSMODEL "address-model=32_64" )
endif()
if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND
(CMAKE_OSX_ARCHITECTURES MATCHES "ppc"))
message("-- BOOST found ppc/x86 Architecture")
set(BOOST_ARCHITECTURE "architecture=combined")
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
message("-- BOOST found x86 Architecture")
set(BOOST_ARCHITECTURE "architecture=x86")
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "ppc64" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc") )
message("-- BOOST found ppc Architecture")
set(BOOST_ARCHITECTURE "architecture=ppc")
endif()
set( BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
set( BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
set( BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
endif()
endif()
ExternalProject_Add( boost
PREFIX "${PREFIX}"
URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
TIMEOUT 1200 # 20 minutes
URL_MD5 ${BOOST_MD5}
# If download fails, then enable "LOG_DOWNLOAD ON" and try again.
# Upon a second failure with logging enabled, then look at these logs:
# <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
# <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
# If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
# into <src>/.downloads-by-cmake/ dir.
# LOG_DOWNLOAD ON
INSTALL_DIR "${BOOST_ROOT}"
# The patch command executes with the working directory set to <SOURCE_DIR>
# Revert the branch to pristine before applying patch sets as bzr patch
# fails when applying a patch to the branch twice and doesn't have a switch
# to ignore previously applied patches
PATCH_COMMAND bzr revert
# bzr revert is insufficient to remove "added" files:
COMMAND bzr clean-tree -q --force
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266
# tell bzr about "added" files by last patch:
COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S
COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
# tell bzr about "added" files by last patch:
COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
COMMAND bzr add libs/context/build/Jamfile.v2
COMMAND bzr add libs/context/build/architecture.jam
COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
# [Mis-]use this step to erase all the boost headers and libraries before
# replacing them below.
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
BINARY_DIR "${PREFIX}/src/boost/"
CONFIGURE_COMMAND ${bootstrap}
BUILD_COMMAND ./b2
variant=release
threading=multi
${BOOST_CFLAGS}
${BOOST_TOOLSET}
${BOOST_CXXFLAGS}
${BOOST_LINKFLAGS}
${BOOST_ADDRESSMODEL}
${BOOST_ARCHITECTURE}
${b2_libs}
${BOOST_LINKTYPE}
--prefix=<INSTALL_DIR>
install
INSTALL_COMMAND ""
)
if( MINGW )
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.[0-9]+.*" "\\1\\2" BOOST_GCC_VERSION ${GCC_VERSION} )
#message( STATUS "BOOST_GCC_VERSION: ${BOOST_GCC_VERSION}" )
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9])" "\\1_\\2" BOOST_LIB_VERSION ${BOOST_RELEASE} )
#message( STATUS "BOOST_LIB_VERSION: ${BOOST_LIB_VERSION}" )
# adjust the names of the libraries to suit the build. There's no
# symbolic links provided on the MinGW build to allow us to use
# generic names for the libs
foreach( lib ${BOOST_LIBS_BUILT} )
set( mingw_boost_libs ${mingw_boost_libs} ${lib}-mgw${BOOST_GCC_VERSION}-mt-${BOOST_LIB_VERSION} )
endforeach()
set( BOOST_LIBS_BUILT ${mingw_boost_libs} )
set( BOOST_INCLUDE "${BOOST_ROOT}/include/boost-${BOOST_LIB_VERSION}" )
unset( mingw_boost_libs )
endif()
set( boost_libs "" )
set_boost_lib_names( "${BOOST_LIBS_BUILT}" boost_libs )
set( Boost_LIBRARIES ${boost_libs} )
set( Boost_INCLUDE_DIR "${BOOST_INCLUDE}" )
mark_as_advanced( Boost_LIBRARIES Boost_INCLUDE_DIR )
#message( STATUS "BOOST_ROOT:${BOOST_ROOT} BOOST_LIBRARIES:${BOOST_LIBRARIES}" )
#message( STATUS "Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}" )
ExternalProject_Add_Step( boost bzr_commit_boost
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
COMMENT "committing pristine boost files to 'boost scratch repo'"
DEPENDERS patch
)
ExternalProject_Add_Step( boost bzr_add_boost
# add only the headers to the scratch repo, repo = "../.bzr" from ${headers_src}
COMMAND bzr add -q ${PREFIX}/src/boost
COMMENT "adding pristine boost files to 'boost scratch repo'"
DEPENDERS bzr_commit_boost
)
ExternalProject_Add_Step( boost bzr_init_boost
COMMAND bzr init -q <SOURCE_DIR>
#creates a .bzrignore file in boost root dir, to avoid copying useless files
#moreover these files have a very very long name, and sometimes
#have a too long full file name to be handled by DOS commands
COMMAND echo "*.htm*" > ${PREFIX}/src/boost/.bzrignore
COMMENT "creating 'boost scratch repo' specifically for boost to track boost patches"
DEPENDERS bzr_add_boost
DEPENDEES download
)

View File

@ -32,9 +32,9 @@ going to build a stable version of KiCad from a source archive.
## GIT Version Control System ## {#git}
If you prefer to use [GIT][] for version control, there is a mirror of the official KiCad
repository on [Github][]. GIT is not required if you are going to build a stable version of
KiCad from a source archive. Please note that the Github mirror is read only. Do not submit
pull requests to Github. Changes should be sent to the KiCad developer's [mailing list][] as
repository on [GitHub][]. GIT is not required if you are going to build a stable version of
KiCad from a source archive. Please note that the GitHub mirror is read only. Do not submit
pull requests to GitHub. Changes should be sent to the KiCad developer's [mailing list][] as
an attached patch with [PATCH] at the beginning of the subject.
## Doxygen Code Documentation Generator ## {#doxygen_section}
@ -111,6 +111,12 @@ When building KiCad with wxPython support, make sure the version of the wxWidget
the version of wxPython installed on your system are the same. Mismatched versions have been
known to cause runtime issues.
## Curl Multi-Protocol File Transfer Library ## {#curl}
The [Curl Multi-Protocol File Transfer Library][libcurl] is used to provide secure internet
file transfer access for the [GitHub][] plug in. This library only needs to be installed if
the GitHub plug build option is enabled.
# KiCad Build Configuration Options # {#build_opts}
KiCad has many build options that can be configured to build different options depending on
@ -148,33 +154,9 @@ supplied by KiCad. This option is disabled by default.
The KICAD_SCRIPTING_WXPYTHON option is used to enable building the wxPython interface into
Pcbnew including the wxPython console. This option is disabled by default.
## Build with Static Libraries ## {#static_lib_opt}
## GitHub Plugin ## {#github_opt}
The KICAD_BUILD_STATIC option is used to build KiCad with static libraries. This option is
used for OSX builds only and is disabled by default.
## Build with Dynamic Libraries ## {#dynamic_lib_opt}
The KICAD_BUILD_DYNAMIC option is used to build KiCad with dynamic libraries. This option is
used for OSX only and is disabled by default.
## Build with System Boost ## {#boost_opt}
The KICAD_SKIP_BOOST option allow you to use the Boost libraries installed on your system to
be used instead of downloading Boost 1.54 and building a custom version specifically for
building KiCad. It is high recommended that you enable this option on Linux and use Boost
version 1.56 or greater. On other platforms you mileage may vary. This option is disabled
by default.
## OSX Dependency Builder ## {#osx_deps_opt}
The USE_OSX_DEPS_BUILDER option forces the build configuration to download and build the
required dependencies to build KiCad on OSX. This option is not longer maintained and most
likely is broken. Use it at your own peril.
## Github Plugin ## {#github_opt}
The BUILD_GITHUB_PLUGIN option is used to control if the Github plugin is built. This option is
The BUILD_GITHUB_PLUGIN option is used to control if the GitHub plug in is built. This option is
enabled by default.
# Getting the KiCad Source Code ## {#getting_src}
@ -192,7 +174,7 @@ branch on your machine by using the following command:
bzr branch https://code.launchpad.net/~kicad-product-committers/kicad/product kicad_source
If you prefer to use [GIT][] as you version control system, you can clone the KiCad mirror on
Github using the following command:
GitHub using the following command:
git clone https://github.com/KiCad/kicad-source-mirror
@ -202,7 +184,7 @@ Stable release archive: https://launchpad.net/kicad/4.0/4.0.1/+download/kicad-4.
Development branch: https://code.launchpad.net/~kicad-product-committers/kicad/product
Github mirror: https://github.com/KiCad/kicad-source-mirror
GitHub mirror: https://github.com/KiCad/kicad-source-mirror
# Building KiCad on Linux # {#build_linux}
@ -251,7 +233,7 @@ MSYS2 install path and run the following commands:
makepkg-mingw -is
This will download and install all of the build dependencies, clone the KiCad source mirror
from Github, create both 32-bit and 64-bit KiCad packages depending on your MSYS setup, and
from GitHub, create both 32-bit and 64-bit KiCad packages depending on your MSYS setup, and
install the newly built KiCad packages. Please note that this build process takes a very
long time to build even on a fast system.
@ -284,7 +266,6 @@ the following commands:
-DCMAKE_PREFIX_PATH=/mingw64 \
-DCMAKE_INSTALL_PREFIX=/mingw64 \
-DDEFAULT_INSTALL_PATH=/mingw64 \
-DKICAD_SKIP_BOOST=ON \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
@ -399,7 +380,7 @@ Boost patches in the KiCad source [patches folder][].
[Launchpad]: https://code.launchpad.net/~kicad-product-committers/kicad/product
[Bazaar]: http://bazaar.canonical.com/en/
[GIT]: https://git-scm.com/
[Github]: https://github.com/KiCad/kicad-source-mirror
[GitHub]: https://github.com/KiCad/kicad-source-mirror
[Doxygen]: http://www.stack.nl/~dimitri/doxygen/
[mailing list]: https://launchpad.net/~kicad-developers
[SWIG]: http://www.swig.org/
@ -419,3 +400,5 @@ Boost patches in the KiCad source [patches folder][].
[MinGW]: http://mingw.org/
[build Boost]: http://www.boost.org/doc/libs/1_59_0/more/getting_started/index.html
[MSYS2 64-bit SourceForge repo]: http://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/
[libcurl]: http://curl.haxx.se/libcurl/
[GLM]: http://glm.g-truc.net/

View File

@ -46,7 +46,7 @@ developers.
- None
**Status:**
- Initial planning stages.
- Completed. See the [KiCad Stable Release Policy]() for mor information.
## Website Improvements ## {#website_improvements}
@ -64,7 +64,8 @@ of the many separate websites currently in used.
- None
**Status:**
- No progress.
- Completed. See the [KiCad Website source repository](https://github.com/KiCad/kicad-website)
for the new website [Asciidoc](http://www.methods.co.nz/asciidoc/) source.
# General # {#general}
@ -92,8 +93,7 @@ Eeschema and Pcbnew to run under a single process.
- None
**Status:**
- Stage 1 code released.
- Stage 2 in process.
- Completed.
## User Interface Modernization ## {#wxaui}
**Goal:**
@ -149,7 +149,7 @@ to reduce the build footprint.
- None
**Status:**
- Initial concept discussions.
- In progress.
## Platform Binary Installers ## {#installers}
**Goal:**
@ -165,7 +165,9 @@ Provide quality installers for all supported platforms.
- None
**Status**
- No progress
- Completed for both stable release and nightly builds. See the [package
download page](http://kicad-pcb.org/download/) at the [KiCad Website][
kicad-website].
# Common Library # {#common_lib}
@ -203,7 +205,8 @@ clean up code base.
- Remove any unused geometry library code.
**Dependencies:**
- None
- Completed. The Boost polygon library was dropped in favor of the [Clipper
polygon library](http://www.angusj.com/delphi/clipper.php)
**Status:**
- In progress as part of push and shove router.
@ -222,7 +225,7 @@ provided by version 3 can be utilized.
- wxWidgets 3 is widely available on Linux distributions.
**Status:**
- Build now requires 3.0.0 or greater.
- Completed. Build now requires 3.0.0 or greater.
## Linux Printing Improvements ## {#linux_print}
**Goal:**
@ -301,7 +304,7 @@ managing and manipulating the schematic.
- None
**Status:**
- No progress.
- In progress.
## Hierarchical Sheet Design ## {#hierarchy_fix}
**Goal:**
@ -317,7 +320,7 @@ fly every time sheet information is required.
- None
**Status:**
- No progress.
- In progress.
## Schematic and Component Library Plugin ## {#sch_plugin}
**Goal:**
@ -463,7 +466,8 @@ to launch an separate program.
- [Convert to a single process application](#kiway).
**Status:**
- Initial library conversion committed to product branch.
- Completed. CvPcb is now launched as a child window of Eeschema and the
intermediate component assignment file (*.cmp) has been eliminated.
# Pcbnew: Circuit Board Editor # {#pcbnew}
@ -480,7 +484,7 @@ Unify all board editing tools under a single framework.
- Remove all duplicate legacy editing tools.
**Dependencies:**
- None
- In progress.
**Status:**
- Initial porting work in progress.
@ -521,7 +525,10 @@ available in OpenCascade.
- [Dynamic library plugin](#plugin_base).
**Status:**
- No progress.
- 3D Viewer work in progress. There is also now and external tool [KiCadStepUp]
(http://sourceforge.net/projects/kicadstepup/) which allows [FreeCAD]
(http://www.freecadweb.org/) to create parametric models from KiCad board
files.
## Push and Shove Router Improvements ## {#ps_router_improvements}
**Goal:**
@ -536,7 +543,7 @@ Add features such as matched length and microwave tools to the P&S router.
- None
**Status:**
- Match trace length work in progress.
- Match trace length implemented.
## Layer Improvements ## {#pcb_layers}
**Goal:**
@ -743,7 +750,9 @@ formatting for more uniform formatting across all user documentation.
- None
**Status:**
- Started with this document.
- Completed. The documentation has been converted from ODT to [Asciidoc]
[asciidoc]. The [documentation](http://kicad-pcb.org/help/documentation/)
can be found on the [KiCad website][kicad-website].
## Grammar Check ## {#doc_grammar}
**Goal:**
@ -787,7 +796,10 @@ involved with the project.
- None.
**Status:**
- No progress.
- In progress. Most of the developer documentation has been convert to
[Doxygen markdown](http://www.stack.nl/~dimitri/doxygen/manual/markdown.html)
and the [output][kicad-docs] is rebuilt automatically when a commit is
made to the KiCad repo.
# Unit Testing # {#unittest}
@ -832,3 +844,6 @@ Provide quality circuit simulation capabilities similar to commercial products.
**Status:**
- No progress.
[kicad-website]:http://kicad-pcb.org/
[kicad-docs]:http://ci.kicad-pcb.org/job/kicad-doxygen/ws/Documentation/doxygen/html/index.html

View File

@ -15,6 +15,53 @@ Capitalization:
idea use this capitalization in source code comments as well to prevent
confusion of new contributors.
Two styles of capitalization are used in GNOME user interface elements:
Header capitalization
Capitalize all words in the element, with the following exceptions:
Articles: a, an, the.
Conjunctions: and, but, for, not, so, yet ...
Prepositions of three or fewer letters: at, for, by, in, to ...
Sentence capitalization
Capitalize the first letter of the first word, and any other words
normally capitalized in sentences,such as application names.
The following table indicates the capitalization style to use for each
type of user interface element.
Table 8-3 Capitalization Style Guidelines for User Interface Elements
Element Style
Check box labels Sentence
Command button labels Header
Column heading labels Header
Desktop background object labels Header
Dialog messages Sentence
Drop-down combination box labels Sentence
Drop-down list box labels Sentence
Field labels Sentence
Filenames Sentence
Graphic equivalent text:
for example, Alt text on web pages Sentence
Group box or frame labels Header
Items in drop-down combination boxes,
drop-down list boxes, and list boxes Sentence
List box labels Sentence
Menu items Header
Menu items in applications Header
Menu titles in applications Header
Radio button labels Sentence
Slider labels Sentence
Spin box labels Sentence
Tabbed section titles Header
Text box labels Sentence
Titlebar labels Header
Toolbar button labels Header
Tooltips Sentence
Webpage titles and navigational elements Header
Dialogs:
@ -73,6 +120,7 @@ Dialogs:
within the dialog, but for testing purposes please do not exceed this dialog
size should the user have selected a font size of 13 points.
Quoting:
Filenames, paths or other text should be with single quotes ''. e.g.:
'filename.kicad_pcb'

View File

@ -1,5 +0,0 @@
#!/bin/bash
pandoc -f markdown_mmd -t html interactive_router.mmd > interactive_router.html
pandoc -f markdown_mmd -t latex interactive_router.mmd > tmp.tex
pdflatex interactive_router.tex

View File

@ -1,73 +0,0 @@
# Interactive Router #
The Interactive Router lets you quickly and efficient route your PCBs by shoving off or walking around items on the PCB that collide with the trace you are currently drawing.
Following modes are supported:
- **Shove**, attempting to push and shove all items colliding with the currently routed track.
- **Walk around**, trying to avoid obstacles by hugging/walking around them.
- **Highlight collisions** which highlights all violating objects with a nice, shiny green color and shows violating clearance regions.
## Setting up ##
Before using the Interactive Router, please set up these two things:
- Clearance settings. To set the clearances, open the *Design Rules* dialog and make sure at least the default clearance
value looks sensible.
- Enable OpenGL mode by selecting *View->Switch canvas to OpenGL* menu option or pressing **F11**.
![Screenshot](pictures/opengl_menu.png)
## Laying out tracks ##
To activate the router tool press the *Interactive Router* button ![Interactive Router Button](pictures/route_icon.png) or the **X** key.
The cursor will turn into a cross and the tool name, will appear in the status bar.
To start a track, click on any item (a pad, track or a via) or press the **X** key again hovering the mouse over that item.
The new track will use the net of the starting item. Clicking or pressing **X** on empty PCB space starts a track with no net assigned.
Move the mouse to define shape of the track. The router will try to follow mouse trail, hugging unmovable obstacles
(such as pads) and shoving colliding traces/vias, depending on the mode. Retreating mouse cursor will cause the shoved items to spring back
to their former locations.
Clicking on a pad/track/via in the same net finishes routing. Clicking in empty space fixes the segments routed so far and continues routing the trace.
In order to stop routing and undo all changes (shoved items, etc.), simply press **Esc**.
Pressing **V** or selecting *Place Through Via* from the context menu while routing a track attaches a via at the end of the trace being routed.
Pressing **V** again disables via placement. Clicking in any spot establishes the via and continues routing.
Pressing **/** or selecting *Switch Track Posture* from the context menu toggles the direction of the initial track segment between straight or diagonal.
**Note**: By default, the router snaps to centers/axes of the items. Snapping can be disabled by holding **Shift** while routing or selecting items.
## Setting track widths and via sizes ##
There are several ways to pre-select a track width/via size or to change it during routing:
- Use standard Kicad shortcuts.
- Press **W** or select *Custom Track Width* from the context menu to type in a custom width/via size.
- Pick a predefined width from the *Select Track Width* sub-menu of the context menu.
- Select *Use the starting track width* in the *Select Track Width* menu to pick the width from the start item (or the traces already connected to it).
## Dragging ##
The router can drag track segments, corners and vias. To drag an item, click on it with **Ctrl** key pressed, hover the mouse and press **G** or select *Drag Track/Via* from the context menu.
Finish dragging by clicking again or abort by pressing *Esc*.
## Options ##
The router behavior be configured by pressing *E* or selecting *Routing Options* from the context menu. It opens a window like the one below:
![Screenshot](pictures/router_options.png)
The options are:
- **Mode** - select how the router handles DRC violation (shoving, walking around, etc.)
- **Shove vias** - when disabled, vias are treated as un-movable objects and hugged instead of shoved.
- **Jump over obstacles** - when enabled, the router tries to move colliding traces behind solid obstacles (e.g. pads) instead of "reflecting" back the collision
- **Remove redundant tracks** - removes loops while routing (e.g. if the new track ensures same connectivity as an already existing one, the old track is removed). Loop removal works locally (only between the start and end of the currently routed trace).
- **Automatic neckdown** - when enabled, the router tries to break out pads/vias in a clean way, avoiding acute angles and jagged breakout traces.
- **Smooth dragged segments** - when enabled, the router attempts to merge several jagged segments into a single straight one (dragging mode).
- **Allow DRC violations** (*Highlight collisions* mode only) - allows to establish a track even if is violating the DRC rules.
- **Optimizer effort** - defines how much time the router shall spend optimizing the routed/shoved traces. More effort means cleaner routing (but slower), less effort means faster routing but somewhat jagged traces.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View File

@ -1,48 +0,0 @@
Gnome rules, used in Kicad:
8.3.2. Capitalization
Two styles of capitalization are used in GNOME user interface elements:
Header capitalization
Capitalize all words in the element, with the following exceptions:
Articles: a, an, the.
Conjunctions: and, but, for, not, so, yet ...
Prepositions of three or fewer letters: at, for, by, in, to ...
Sentence capitalization
Capitalize the first letter of the first word, and any other words normally capitalized in sentences,
such as application names.
The following table indicates the capitalization style to use for each type of user interface element.
Table 8-3 Capitalization Style Guidelines for User Interface Elements
Element Style
Check box labels Sentence
Command button labels Header
Column heading labels Header
Desktop background object labels Header
Dialog messages Sentence
Drop-down combination box labels Sentence
Drop-down list box labels Sentence
Field labels Sentence
Filenames Sentence
Graphic equivalent text:
for example, Alt text on web pages Sentence
Group box or frame labels Header
Items in drop-down combination boxes,
drop-down list boxes, and list boxes Sentence
List box labels Sentence
Menu items Header
Menu items in applications Header
Menu titles in applications Header
Radio button labels Sentence
Slider labels Sentence
Spin box labels Sentence
Tabbed section titles Header
Text box labels Sentence
Titlebar labels Header
Toolbar button labels Header
Tooltips Sentence
Webpage titles and navigational elements Header

View File

@ -100,6 +100,8 @@ DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent ) :
m_localPrjConfigChanged = false;
m_pagelayout = NULL;
m_PickDate->SetValue( wxDateTime::Now() );
initDialog();
GetSizer()->SetSizeHints( this );

View File

@ -728,17 +728,43 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
// high and grid is slowly drawn on some platforms. An other way using blit transfert was used,
// a long time ago, but it did not give very good results.
// The better way is highly dependent on the platform and the graphic card.
#ifndef __WXMAC__
GRSetColorPen( aDC, GetParent()->GetGridColor() );
#else
// On mac (Cocoa), a point isn't a pixel and being of size 1 don't survive to antialiasing
GRSetColorPen( aDC, GetParent()->GetGridColor(), aDC->DeviceToLogicalXRel(2) );
#endif
int xpos;
double right = ( double ) m_ClipBox.GetRight();
double bottom = ( double ) m_ClipBox.GetBottom();
#if defined( __WXMAC__ ) && defined( USE_WX_GRAPHICS_CONTEXT )
wxGCDC *gcdc = wxDynamicCast( aDC, wxGCDC );
if( gcdc )
{
wxGraphicsContext *gc = gcdc->GetGraphicsContext();
// Grid point size
const int gsz = 1;
const double w = aDC->DeviceToLogicalXRel( gsz );
const double h = aDC->DeviceToLogicalYRel( gsz );
// Use our own pen
wxPen pen( MakeColour( GetParent()->GetGridColor() ), h );
pen.SetCap( wxCAP_BUTT );
gc->SetPen( pen );
// draw grid
wxGraphicsPath path = gc->CreatePath();
for( double x = (double) org.x - w/2.0; x <= right - w/2.0; x += gridSize.x )
{
for( double y = (double) org.y; y <= bottom; y += gridSize.y )
{
path.MoveToPoint( x, y );
path.AddLineToPoint( x+w, y );
}
}
gc->StrokePath( path );
}
else
#endif
{
GRSetColorPen( aDC, GetParent()->GetGridColor() );
for( double x = (double) org.x; x <= right; x += gridSize.x )
{
xpos = KiROUND( x );
@ -748,6 +774,7 @@ void EDA_DRAW_PANEL::DrawGrid( wxDC* aDC )
aDC->DrawPoint( xpos, KiROUND( y ) );
}
}
}
}
// Set to 1 to draw auxirilary axis as lines, 0 to draw as target (circle with cross)

View File

@ -28,33 +28,26 @@
* @brief Functions for file management
*/
// For compilers that support precompilation, includes "wx.h".
#include <fctsys.h>
#include <pgm_base.h>
#include <confirm.h>
#include <common.h>
#include <macros.h>
#include <gestfich.h>
#include <wx/mimetype.h>
#include <wx/filename.h>
#include <wx/dir.h>
// For compilers that support precompilation, includes "wx.h".
#include <fctsys.h>
#include <pgm_base.h>
#include <confirm.h>
#include <common.h>
#include <macros.h>
#include <gestfich.h>
void AddDelimiterString( wxString& string )
{
wxString text;
if( !string.StartsWith( wxT( "\"" ) ) )
text = wxT( "\"" );
text += string;
if( (text.Last() != '"' ) || (text.length() <= 1) )
text += wxT( "\"" );
string = text;
{
string.Prepend ( wxT( "\"" ) );
string.Append ( wxT( "\"" ) );
}
}
@ -227,6 +220,8 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para
#ifdef __WXMAC__
else
{
AddDelimiterString( fullFileName );
if( !param.IsEmpty() )
fullFileName += wxT( " " ) + param;
@ -351,8 +346,6 @@ bool OpenPDF( const wxString& file )
{
wxString command;
wxString filename = file;
wxString type;
bool success = false;
Pgm().ReadPdfBrowserInfos();
@ -363,71 +356,21 @@ bool OpenPDF( const wxString& file )
}
else
{
wxFileType* filetype = NULL;
wxFileType::MessageParameters params( filename, type );
filetype = wxTheMimeTypesManager->GetFileTypeFromExtension( wxT( "pdf" ) );
wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension( wxT( "pdf" ) );
if( filetype )
success = filetype->GetOpenCommand( &command, params );
command = filetype->GetOpenCommand( filename );
delete filetype;
#ifndef __WINDOWS__
// Bug ? under linux wxWidgets returns acroread as PDF viewer, even if
// it does not exist.
if( command.StartsWith( wxT( "acroread" ) ) ) // Workaround
success = false;
#endif
if( success && !command.IsEmpty() )
{
success = ProcessExecute( command );
if( success )
return success;
}
success = false;
command.clear();
if( !success )
{
#if !defined(__WINDOWS__)
AddDelimiterString( filename );
// here is a list of PDF viewers candidates
static const wxChar* tries[] =
{
wxT( "/usr/bin/evince" ),
wxT( "/usr/bin/okular" ),
wxT( "/usr/bin/gpdf" ),
wxT( "/usr/bin/konqueror" ),
wxT( "/usr/bin/kpdf" ),
wxT( "/usr/bin/xpdf" ),
wxT( "/usr/bin/open" ), // BSD and OSX file & dir opener
wxT( "/usr/bin/xdg-open" ), // Freedesktop file & dir opener
};
for( unsigned ii = 0; ii<DIM(tries); ii++ )
{
if( wxFileExists( tries[ii] ) )
{
command = tries[ii];
command += wxT( ' ' );
command += filename;
break;
}
}
#endif
}
}
if( !command.IsEmpty() )
{
success = ProcessExecute( command );
if( !success )
if( ProcessExecute( command ) )
{
return true;
}
else
{
wxString msg;
msg.Printf( _( "Problem while running the PDF viewer\nCommand is '%s'" ),
@ -440,10 +383,9 @@ bool OpenPDF( const wxString& file )
wxString msg;
msg.Printf( _( "Unable to find a PDF viewer for <%s>" ), GetChars( filename ) );
DisplayError( NULL, msg );
success = false;
}
return success;
return false;
}

View File

@ -13,6 +13,9 @@
#include <bezier_curves.h>
#include <math_for_graphics.h>
#include <wx/graphics.h>
#if defined(__WXMAC__) && defined(USE_WX_GRAPHICS_CONTEXT)
#include <wx/dcgraph.h>
#endif
static const bool FILLED = true;
static const bool NOT_FILLED = false;
@ -429,17 +432,45 @@ void GRLineArray( EDA_RECT* aClipBox, wxDC* aDC, std::vector<wxPoint>& aLines,
if( aClipBox )
aClipBox->Inflate(aWidth/2);
for( unsigned i = 0; i < aLines.size(); i += 2)
#if defined( __WXMAC__ ) && defined( USE_WX_GRAPHICS_CONTEXT )
wxGCDC *gcdc = wxDynamicCast( aDC, wxGCDC );
if( gcdc )
{
wxGraphicsContext *gc = gcdc->GetGraphicsContext();
// create path
wxGraphicsPath path = gc->CreatePath();
for( unsigned i = 0; i < aLines.size(); i += 2 )
{
int x1 = aLines[i].x;
int y1 = aLines[i].y;
int x2 = aLines[i+1].x;
int y2 = aLines[i+1].y;
if( ( aClipBox == NULL ) || !clipLine( aClipBox, x1, y1, x2, y2 ) )
{
path.MoveToPoint( x1, y1 );
path.AddLineToPoint( x2, y2 );
}
}
// draw path
gc->StrokePath( path );
}
else
#endif
{
for( unsigned i = 0; i < aLines.size(); i += 2 )
{
int x1 = aLines[i].x;
int y1 = aLines[i].y;
int x2 = aLines[i+1].x;
int y2 = aLines[i+1].y;
GRLastMoveToX = x2;
GRLastMoveToY = y2;
if( ( aClipBox == NULL ) || !clipLine( aClipBox, x1, y1, x2, y2 ) )
aDC->DrawLine( x1, y1, x2, y2 );
}
}
GRMoveTo( aLines[aLines.size() - 1].x, aLines[aLines.size() - 1].y );
if( aClipBox )
aClipBox->Inflate(-aWidth/2);
}
@ -625,6 +656,31 @@ static void GRSPoly( EDA_RECT* ClipBox, wxDC* DC, int n, wxPoint Points[],
ClipAndDrawPoly( ClipBox, DC, Points, n );
}
else
{
#if defined( __WXMAC__ ) && defined( USE_WX_GRAPHICS_CONTEXT )
wxGCDC *gcdc = wxDynamicCast( DC, wxGCDC );
if( gcdc )
{
wxGraphicsContext *gc = gcdc->GetGraphicsContext();
// set pen
GRSetColorPen( DC, Color, width );
// create path
wxGraphicsPath path = gc->CreatePath();
path.MoveToPoint( Points[0].x, Points[0].y );
for( int i = 1; i < n; ++i )
{
path.AddLineToPoint( Points[i].x, Points[i].y );
}
// draw path
gc->StrokePath( path );
// correctly update last position
GRMoveTo( Points[n - 1].x, Points[n - 1].y );
}
else
#endif
{
GRMoveTo( Points[0].x, Points[0].y );
for( int i = 1; i < n; ++i )
@ -632,6 +688,7 @@ static void GRSPoly( EDA_RECT* ClipBox, wxDC* DC, int n, wxPoint Points[],
GRLineTo( ClipBox, DC, Points[i].x, Points[i].y, width, Color );
}
}
}
}
@ -656,6 +713,33 @@ static void GRSClosedPoly( EDA_RECT* aClipBox, wxDC* aDC,
ClipAndDrawPoly( aClipBox, aDC, aPoints, aPointCount );
}
else
{
#if defined( __WXMAC__ ) && defined( USE_WX_GRAPHICS_CONTEXT )
wxGCDC *gcdc = wxDynamicCast( aDC, wxGCDC );
if( gcdc )
{
wxGraphicsContext *gc = gcdc->GetGraphicsContext();
// set pen
GRSetColorPen( aDC, aColor, aWidth );
// create path
wxGraphicsPath path = gc->CreatePath();
path.MoveToPoint( aPoints[0].x, aPoints[0].y );
for( int i = 1; i < aPointCount; ++i )
{
path.AddLineToPoint( aPoints[i].x, aPoints[i].y );
}
if( aPoints[aPointCount - 1] != aPoints[0] )
path.AddLineToPoint( aPoints[0].x, aPoints[0].y );
// draw path
gc->StrokePath( path );
// correctly update last position
GRMoveTo( aPoints[aPointCount - 1].x, aPoints[aPointCount - 1].y );
}
else
#endif
{
GRMoveTo( aPoints[0].x, aPoints[0].y );
for( int i = 1; i < aPointCount; ++i )
@ -671,6 +755,7 @@ static void GRSClosedPoly( EDA_RECT* aClipBox, wxDC* aDC,
GRLineTo( aClipBox, aDC, aPoints[0].x, aPoints[0].y, aWidth, aColor );
}
}
}
}

View File

@ -710,7 +710,7 @@ SCH_REFERENCE::SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_PART* aLibComp
m_SheetNum = 0;
if( aComponent->GetRef( &aSheetPath ).IsEmpty() )
aComponent->SetRef( &aSheetPath, wxT( "DefRef?" ) );
aComponent->SetRef( aSheetPath.Last(), wxT( "DefRef?" ) );
SetRef( aComponent->GetRef( &aSheetPath ) );
@ -730,7 +730,7 @@ void SCH_REFERENCE::Annotate()
else
m_Ref = TO_UTF8( GetRef() << m_NumRef );
m_RootCmp->SetRef( &m_SheetPath, FROM_UTF8( m_Ref.c_str() ) );
m_RootCmp->SetRef( m_SheetPath.Last(), FROM_UTF8( m_Ref.c_str() ) );
m_RootCmp->SetUnit( m_Unit );
m_RootCmp->SetUnitSelection( &m_SheetPath, m_Unit );
}

View File

@ -42,6 +42,7 @@
#include <sch_base_frame.h>
#include <class_library.h>
#include <sch_component.h>
#include <sch_sheet_path.h>
#include <dialog_helpers.h>
#include <dialog_edit_component_in_schematic_fbp.h>
@ -458,7 +459,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
// Reference has a specific initialization, depending on the current active sheet
// because for a given component, in a complex hierarchy, there are more than one
// reference.
m_cmp->SetRef( &m_parent->GetCurrentSheet(), m_FieldsBuf[REFERENCE].GetText() );
m_cmp->SetRef( m_parent->GetCurrentSheet().Last(), m_FieldsBuf[REFERENCE].GetText() );
m_parent->OnModify();
m_parent->GetScreen()->TestDanglingEnds();

View File

@ -42,40 +42,17 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) :
// Dialog should not shrink beyond it's minimal size.
GetSizer()->SetSizeHints( this );
wxListItem col0;
col0.SetId( 0 );
col0.SetText( _( "Field Name" ) );
wxListItem col1;
col1.SetId( 1 );
col1.SetText( _( "Default Value" ) );
wxListItem col2;
col2.SetId( 2 );
col2.SetText( _( "Visible" ) );
templateFieldListCtrl->InsertColumn( 0, col0 );
templateFieldListCtrl->InsertColumn( 1, col1 );
templateFieldListCtrl->InsertColumn( 2, col2 );
templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
// Invalid field selected
selectedField = -1;
// wxformbuilder doesn't seem to let us set minimal sizes. Copy the default
// sizes into the minimal sizes, then, and autosize:
for( int i = 0; i < m_fieldGrid->GetNumberCols(); ++i )
{
m_fieldGrid->SetColMinimalWidth( i, m_fieldGrid->GetColSize( i ) );
m_fieldGrid->AutoSizeColLabelSize( i );
}
// Make sure we select the first tab of the options tab page
m_notebook->SetSelection( 0 );
// Connect the edit controls for the template field names to the kill focus event which
// doesn't propogate, hence the need to connect it here.
fieldNameTextCtrl->Connect( wxEVT_KILL_FOCUS,
wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this );
fieldDefaultValueTextCtrl->Connect( wxEVT_KILL_FOCUS,
wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this );
}
@ -161,86 +138,42 @@ void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& aGridSizes, int aGridId
}
void DIALOG_EESCHEMA_OPTIONS::RefreshTemplateFieldView( void )
{
// Loop through the template fieldnames and add them to the list control
// or just change texts if room exists
long itemindex = 0;
wxString tmp;
for( TEMPLATE_FIELDNAMES::iterator fld = templateFields.begin();
fld != templateFields.end(); ++fld, itemindex++ )
{
if( templateFieldListCtrl->GetItemCount() <= itemindex )
{
templateFieldListCtrl->InsertItem(
templateFieldListCtrl->GetItemCount(), fld->m_Name );
}
wxListItem litem;
litem.SetId( itemindex );
templateFieldListCtrl->GetItem( litem );
litem.SetColumn( 0 );
if( litem.GetText() != fld->m_Name )
templateFieldListCtrl->SetItem( itemindex, 0, fld->m_Name );
litem.SetColumn( 1 );
if( litem.GetText() != fld->m_Value )
templateFieldListCtrl->SetItem( itemindex, 1, fld->m_Value );
tmp = ( fld->m_Visible == true ) ? _( "Visible" ) : _( "Hidden" );
litem.SetColumn( 2 );
if( litem.GetText() != tmp )
templateFieldListCtrl->SetItem( itemindex, 2, tmp );
}
// Remove extra items:
while( templateFieldListCtrl->GetItemCount() > itemindex )
{
templateFieldListCtrl->DeleteItem( itemindex );
}
}
void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int aItem )
{
// Only select valid items!
if( ( aItem < 0 ) || ( aItem >= templateFieldListCtrl->GetItemCount() ) )
return;
// Make sure we select the new item in list control
if( templateFieldListCtrl->GetFirstSelected() != aItem )
templateFieldListCtrl->Select( aItem, true );
}
void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event )
{
// If there is currently a valid selection, copy the edit panel to the
// selected field so as not to lose the data
if( fieldSelectionValid( selectedField ) )
copyPanelToSelected();
// If a single row is selected, insert after that row.
int selected_row = -1;
int n_found = 0;
for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row )
{
bool this_row_selected = false;
for( int col = 0; col < m_fieldGrid->GetNumberCols(); ++col )
{
if( m_fieldGrid->IsInSelection( row, col ) )
this_row_selected = true;
}
if( this_row_selected )
{
selected_row = row;
++n_found;
}
}
TransferDataFromWindow();
TEMPLATE_FIELDNAMES::iterator pos;
if( n_found == 1 )
pos = templateFields.begin() + selected_row + 1;
else
pos = templateFields.end();
// Add a new fieldname to the fieldname list
TEMPLATE_FIELDNAME newFieldname = TEMPLATE_FIELDNAME( "Fieldname" );
newFieldname.m_Value = wxT( "Value" );
newFieldname.m_Visible = false;
templateFields.push_back( newFieldname );
// Select the newly added field and then copy that data to the edit panel.
// Make sure any previously selected state is cleared and then select the
// new field
selectedField = templateFields.size() - 1;
// Update the display to reflect the new data
RefreshTemplateFieldView();
copySelectedToPanel();
// Make sure we select the new item
SelectTemplateField( selectedField );
templateFields.insert( pos, newFieldname );
TransferDataToWindow();
event.Skip();
}
@ -248,97 +181,79 @@ void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event )
void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event )
{
// If there is currently a valid selection, delete the template field from
// the template field list
if( fieldSelectionValid( selectedField ) )
// wxGrid has a somewhat complex way of detemining selection.
// This is pretty much the easiest way to do it, here.
std::vector<bool> rows_to_delete( templateFields.size(), false );
for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row )
{
// Delete the fieldname from the fieldname list
templateFields.erase( templateFields.begin() + selectedField );
// If the selectedField is still not in the templateField range now,
// make sure we stay in range and when there are no fields present
// move to -1
if( selectedField >= int( templateFields.size() ) )
selectedField = templateFields.size() - 1;
// Update the display to reflect the new data
RefreshTemplateFieldView();
copySelectedToPanel();
// Make sure after the refresh that the selected item is correct
SelectTemplateField( selectedField );
for( int col = 0; col < m_fieldGrid->GetNumberCols(); ++col )
{
if( m_fieldGrid->IsInSelection( row, col ) )
rows_to_delete[row] = true;
}
}
TransferDataFromWindow();
int n_rows = m_fieldGrid->GetNumberRows();
for( int count = 0; count < n_rows; ++count )
{
// Iterate backwards, unsigned-friendly way for future
int row = n_rows - count - 1;
if( rows_to_delete[row] )
{
templateFields.erase( templateFields.begin() + row );
}
}
TransferDataToWindow();
}
void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void )
bool DIALOG_EESCHEMA_OPTIONS::TransferDataToWindow()
{
if( !fieldSelectionValid( selectedField ) )
return;
if( !wxDialog::TransferDataToWindow() )
return false;
// Update the template field from the edit panel
templateFields[selectedField].m_Name = fieldNameTextCtrl->GetValue();
templateFields[selectedField].m_Value = fieldDefaultValueTextCtrl->GetValue();
templateFields[selectedField].m_Visible = fieldVisibleCheckbox->GetValue();
m_fieldGrid->Freeze();
if( m_fieldGrid->GetNumberRows() )
m_fieldGrid->DeleteRows( 0, m_fieldGrid->GetNumberRows() );
m_fieldGrid->AppendRows( templateFields.size() );
for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row )
{
m_fieldGrid->SetCellValue( row, 0, templateFields[row].m_Name );
m_fieldGrid->SetCellValue( row, 1, templateFields[row].m_Value );
m_fieldGrid->SetCellValue( row, 2,
templateFields[row].m_Visible ? wxT( "1" ) : wxEmptyString );
// Set cell properties
m_fieldGrid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
m_fieldGrid->SetCellAlignment( row, 1, wxALIGN_LEFT, wxALIGN_CENTRE );
// Render the Visible column as a check box
m_fieldGrid->SetCellEditor( row, 2, new wxGridCellBoolEditor() );
m_fieldGrid->SetCellRenderer( row, 2, new wxGridCellBoolRenderer() );
m_fieldGrid->SetCellAlignment( row, 2, wxALIGN_CENTRE, wxALIGN_CENTRE );
}
m_fieldGrid->AutoSizeRows();
m_fieldGrid->Thaw();
return true;
}
void DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus( wxFocusEvent& event )
bool DIALOG_EESCHEMA_OPTIONS::TransferDataFromWindow()
{
// Update the data + UI
copyPanelToSelected();
RefreshTemplateFieldView();
SelectTemplateField( selectedField );
event.Skip();
}
void DIALOG_EESCHEMA_OPTIONS::OnEnterKey( wxCommandEvent& event )
{
// Process the event produced when the user presses enter key
// in template fieldname text control or template fieldvalue text control
// Validate the current name or value, and switch focus to the other param
// (value or name)
copyPanelToSelected();
RefreshTemplateFieldView();
if( fieldNameTextCtrl->HasFocus() )
fieldDefaultValueTextCtrl->SetFocus();
else
fieldNameTextCtrl->SetFocus();
}
void DIALOG_EESCHEMA_OPTIONS::OnVisibleFieldClick( wxCommandEvent& event )
{
// Process the event produced when the user click on
// the check box which controls the field visibility
copyPanelToSelected();
RefreshTemplateFieldView();
}
void DIALOG_EESCHEMA_OPTIONS::copySelectedToPanel( void )
{
if( !fieldSelectionValid( selectedField ) )
return;
// Update the panel data from the selected template field
fieldNameTextCtrl->SetValue( templateFields[selectedField].m_Name );
fieldDefaultValueTextCtrl->SetValue( templateFields[selectedField].m_Value );
fieldVisibleCheckbox->SetValue( templateFields[selectedField].m_Visible );
}
void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event )
{
// Before getting the new field data, make sure we save the old!
copyPanelToSelected();
// Now update the selected field and copy the data from the field to the
// edit panel
selectedField = event.GetIndex();
copySelectedToPanel();
for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row )
{
templateFields[row].m_Name = m_fieldGrid->GetCellValue( row, 0 );
templateFields[row].m_Value = m_fieldGrid->GetCellValue( row, 1 );
templateFields[row].m_Visible = ( m_fieldGrid->GetCellValue( row, 2 ) != wxEmptyString );
}
return true;
}
@ -347,18 +262,8 @@ void DIALOG_EESCHEMA_OPTIONS::SetTemplateFields( const TEMPLATE_FIELDNAMES& aFie
// Set the template fields object
templateFields = aFields;
// select the last field ( will set selectedField to -1 if no field ):
selectedField = templateFields.size()-1;
// Build and refresh the view
RefreshTemplateFieldView();
if( selectedField >= 0 )
{
copySelectedToPanel();
SelectTemplateField( selectedField );
}
TransferDataToWindow();
}

View File

@ -40,33 +40,6 @@ protected:
/** @brief The template fieldnames for this dialog */
TEMPLATE_FIELDNAMES templateFields;
/** @brief The current row selected in the template fieldname wxListCtrl which is also in the
* edit panel
* selectedField = -1 when no valid item selected
*/
int selectedField;
/** @brief return true if aFieldId is a valid field selection
*/
bool fieldSelectionValid( int aFieldId )
{
return ( aFieldId >= 0 ) && ( aFieldId < int( templateFields.size() ) );
}
/**
* Function OnEnterKey (virtual)
* Process the wxWidgets @a event produced when the user presses enter key
* in template fieldname text control or template fieldvalue text control
*/
void OnEnterKey( wxCommandEvent& event );
/**
* Function OnVisibleFieldClick (virtual)
* Process the wxWidgets @a event produced when the user click on
* the check box which controls the field visibility
*/
void OnVisibleFieldClick( wxCommandEvent& event );
/**
* Function OnAddButtonClick
* Process the wxWidgets @a event produced when the user presses the Add buton for the
@ -90,65 +63,16 @@ protected:
void OnDeleteButtonClick( wxCommandEvent& event );
/**
* Function OnEditControlKillFocus
* This Focus Event Handler should be connected to any controls in the template field edit box
* so that any loss of focus results in the data being saved to the currently selected template
* field
*
* @param event The wxWidgets produced event information
*
* Copies data from the edit box to the selected field template
* Function TransferDataToWindow
* Transfer data into the GUI.
*/
void OnEditControlKillFocus( wxFocusEvent& event );
bool TransferDataToWindow();
/**
* Function copyPanelToSelected
* Copies the data from the edit panel to the selected template fieldname
* Function TransferDataFromWindow
* Transfer data out of the GUI.
*/
void copyPanelToSelected( void );
/**
* Function copySelectedToPanel
* Copies the data from the selected template fieldname and fills in the edit panel
*/
void copySelectedToPanel( void );
/**
* Function OnTemplateFieldSelected
* Event handler for the wxListCtrl containing the template fieldnames
*
* @param event The event information provided by wxWidgets
*
* Processes data exchange between the edit panel and the selected template fieldname
*/
void OnTemplateFieldSelected( wxListEvent& event );
/**
* Function RefreshTemplateFieldView
* Refresh the template fieldname wxListCtrl
*
* Deletes all data from the wxListCtrl and then re-polpulates the control with the data in
* the template fieldnames.
*
* Use any time the template field data has changed
*/
void RefreshTemplateFieldView( void );
/**
* Function SelectTemplateField
* Selects @a aItem from the wxListCtrl populated with the template fieldnames
*
* @param aItem The item index of the row to be selected
*
* When RefreshTemplateFieldView() is used the selection is lost because all of the items are
* removed from the wxListCtrl and then the control is re-populated. This function can be used
* to re-select an item that was previously selected so that the selection is not lost.
*
* <b>NOTE:</b> This function first sets the ignoreSelection flag before making the selection.
* This means the class can select something in the wxListCtrl without causing further
* selection events.
*/
void SelectTemplateField( int aItem );
bool TransferDataFromWindow();
public:
/**

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 19 2015)
// C++ code generated with wxFormBuilder (version Dec 28 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -13,11 +13,6 @@ BEGIN_EVENT_TABLE( DIALOG_EESCHEMA_OPTIONS_BASE, DIALOG_SHIM )
EVT_SIZE( DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnSize )
EVT_CHOICE( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnChooseUnits )
EVT_CHECKBOX( xwID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnMiddleBtnPanEnbl )
EVT_LIST_ITEM_DESELECTED( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnTemplateFieldDeselected )
EVT_LIST_ITEM_SELECTED( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnTemplateFieldSelected )
EVT_TEXT_ENTER( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnEnterKey )
EVT_TEXT_ENTER( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnEnterKey )
EVT_CHECKBOX( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnVisibleFieldClick )
EVT_BUTTON( wxID_ADD_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnAddButtonClick )
EVT_BUTTON( wxID_DELETE_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnDeleteButtonClick )
END_EVENT_TABLE()
@ -33,8 +28,6 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
bOptionsSizer = new wxBoxSizer( wxVERTICAL );
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_notebook->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_panel5 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer82;
bSizer82 = new wxBoxSizer( wxVERTICAL );
@ -49,7 +42,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText3 = new wxStaticText( m_panel5, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizer32->Add( m_staticText3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
wxArrayString m_choiceGridSizeChoices;
m_choiceGridSize = new wxChoice( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 );
@ -73,7 +66,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText5 = new wxStaticText( m_panel5, wxID_ANY, _("&Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
fgSizer32->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer32->Add( m_staticText5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinLineWidth = new wxSpinCtrl( m_panel5, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
fgSizer32->Add( m_spinLineWidth, 0, wxALL|wxEXPAND, 3 );
@ -95,17 +88,6 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticText221 = new wxStaticText( m_panel5, wxID_ANY, _("&Auto-save time interval"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText221->Wrap( -1 );
fgSizer32->Add( m_staticText221, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinAutoSaveInterval = new wxSpinCtrl( m_panel5, ID_M_SPINAUTOSAVEINTERVAL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000, 10 );
fgSizer32->Add( m_spinAutoSaveInterval, 0, wxALL|wxEXPAND, 3 );
m_staticText23 = new wxStaticText( m_panel5, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
fgSizer32->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
bSizer82->Add( fgSizer32, 0, wxALL|wxEXPAND, 5 );
@ -124,7 +106,8 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_checkShowHiddenPins = new wxCheckBox( m_panel5, wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer92->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkPageLimits = new wxCheckBox( m_panel5, wxID_ANY, _("Sho&w page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkPageLimits = new wxCheckBox( m_panel5, wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkPageLimits->SetValue(true);
bSizer92->Add( m_checkPageLimits, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
@ -134,7 +117,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_panel5->SetSizer( bSizer82 );
m_panel5->Layout();
bSizer82->Fit( m_panel5 );
m_notebook->AddPage( m_panel5, _("&Display"), false );
m_notebook->AddPage( m_panel5, _("Display"), true );
m_panel3 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );
@ -149,7 +132,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText2 = new wxStaticText( m_panel3, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
fgSizer3->Add( m_staticText2, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer3->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
wxArrayString m_choiceUnitsChoices;
m_choiceUnits = new wxChoice( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsChoices, 0 );
@ -161,7 +144,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText9 = new wxStaticText( m_panel3, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizer3->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer3->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatHorizontal = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 0 );
fgSizer3->Add( m_spinRepeatHorizontal, 0, wxALL|wxEXPAND, 3 );
@ -172,7 +155,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText12 = new wxStaticText( m_panel3, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
fgSizer3->Add( m_staticText12, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer3->Add( m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatVertical = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 100 );
fgSizer3->Add( m_spinRepeatVertical, 0, wxALL|wxEXPAND, 3 );
@ -183,7 +166,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText16 = new wxStaticText( m_panel3, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText16->Wrap( -1 );
fgSizer3->Add( m_staticText16, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer3->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinRepeatLabel = new wxSpinCtrl( m_panel3, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 );
fgSizer3->Add( m_spinRepeatLabel, 0, wxALL|wxEXPAND, 3 );
@ -193,7 +176,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText7 = new wxStaticText( m_panel3, wxID_ANY, _("Def&ault text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
fgSizer3->Add( m_staticText7, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
fgSizer3->Add( m_staticText7, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinTextSize = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 1000, 0 );
fgSizer3->Add( m_spinTextSize, 0, wxALL|wxEXPAND, 3 );
@ -213,6 +196,17 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_staticText22->Wrap( -1 );
fgSizer3->Add( m_staticText22, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 );
m_staticText221 = new wxStaticText( m_panel3, wxID_ANY, _("&Auto-save time interval"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText221->Wrap( -1 );
fgSizer3->Add( m_staticText221, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
m_spinAutoSaveInterval = new wxSpinCtrl( m_panel3, ID_M_SPINAUTOSAVEINTERVAL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000, 10 );
fgSizer3->Add( m_spinAutoSaveInterval, 0, wxALL|wxEXPAND, 3 );
m_staticText23 = new wxStaticText( m_panel3, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
fgSizer3->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
bSizer8->Add( fgSizer3, 0, wxALL|wxEXPAND, 5 );
@ -238,7 +232,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_panel3->SetSizer( bSizer8 );
m_panel3->Layout();
bSizer8->Fit( m_panel3 );
m_notebook->AddPage( m_panel3, _("&Editing"), false );
m_notebook->AddPage( m_panel3, _("Editing"), false );
m_panel4 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer81;
bSizer81 = new wxBoxSizer( wxVERTICAL );
@ -272,7 +266,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
bSizer91->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
m_checkAutoPan = new wxCheckBox( m_panel4, wxID_ANY, _("&Pan while moving ob&ject"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkAutoPan = new wxCheckBox( m_panel4, wxID_ANY, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer91->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
@ -292,39 +286,39 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer( wxVERTICAL );
templateFieldListCtrl = new wxListView( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
templateFieldListCtrl->SetMinSize( wxSize( 500,-1 ) );
m_fieldGrid = new wxGrid( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizer11->Add( templateFieldListCtrl, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 );
// Grid
m_fieldGrid->CreateGrid( 0, 3 );
m_fieldGrid->EnableEditing( true );
m_fieldGrid->EnableGridLines( true );
m_fieldGrid->EnableDragGridSize( false );
m_fieldGrid->SetMargins( 0, 0 );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer4->AddGrowableCol( 1 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
// Columns
m_fieldGrid->SetColSize( 0, 150 );
m_fieldGrid->SetColSize( 1, 150 );
m_fieldGrid->SetColSize( 2, 75 );
m_fieldGrid->EnableDragColMove( false );
m_fieldGrid->EnableDragColSize( true );
m_fieldGrid->SetColLabelSize( 30 );
m_fieldGrid->SetColLabelValue( 0, _("Name") );
m_fieldGrid->SetColLabelValue( 1, _("Default Value") );
m_fieldGrid->SetColLabelValue( 2, _("Visible") );
m_fieldGrid->SetColLabelValue( 3, _("Name") );
m_fieldGrid->SetColLabelValue( 4, wxEmptyString );
m_fieldGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
fieldNameLabel = new wxStaticText( m_panel2, wxID_ANY, _("Na&me"), wxDefaultPosition, wxDefaultSize, 0 );
fieldNameLabel->Wrap( -1 );
fgSizer4->Add( fieldNameLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
// Rows
m_fieldGrid->EnableDragRowSize( true );
m_fieldGrid->SetRowLabelSize( 80 );
m_fieldGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
fieldNameTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
fgSizer4->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
// Label Appearance
fieldDefaultValueLabel = new wxStaticText( m_panel2, wxID_ANY, _("Defa&ult Value"), wxDefaultPosition, wxDefaultSize, 0 );
fieldDefaultValueLabel->Wrap( -1 );
fgSizer4->Add( fieldDefaultValueLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
fieldDefaultValueTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
fgSizer4->Add( fieldDefaultValueTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
fieldVisibleCheckbox = new wxCheckBox( m_panel2, wxID_ANY, _("&Visible"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer4->Add( fieldVisibleCheckbox, 0, wxALL, 5 );
fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer11->Add( fgSizer4, 0, wxEXPAND, 5 );
// Cell Defaults
m_fieldGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bSizer11->Add( m_fieldGrid, 1, wxALL|wxEXPAND, 5 );
bSizer6->Add( bSizer11, 1, wxEXPAND, 5 );
@ -348,7 +342,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
m_panel2->SetSizer( bSizer6 );
m_panel2->Layout();
bSizer6->Fit( m_panel2 );
m_notebook->AddPage( m_panel2, _("Default &Fields"), true );
m_notebook->AddPage( m_panel2, _("Default &Fields"), false );
bOptionsSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 );

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 19 2015)
// C++ code generated with wxFormBuilder (version Dec 28 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -12,7 +12,6 @@
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
class wxListView;
#include "dialog_shim.h"
#include <wx/string.h>
@ -30,8 +29,7 @@ class wxListView;
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/listctrl.h>
#include <wx/textctrl.h>
#include <wx/grid.h>
#include <wx/button.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
@ -50,10 +48,6 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
void _wxFB_OnSize( wxSizeEvent& event ){ OnSize( event ); }
void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); }
void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); }
void _wxFB_OnTemplateFieldDeselected( wxListEvent& event ){ OnTemplateFieldDeselected( event ); }
void _wxFB_OnTemplateFieldSelected( wxListEvent& event ){ OnTemplateFieldSelected( event ); }
void _wxFB_OnEnterKey( wxCommandEvent& event ){ OnEnterKey( event ); }
void _wxFB_OnVisibleFieldClick( wxCommandEvent& event ){ OnVisibleFieldClick( event ); }
void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); }
void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); }
@ -80,9 +74,6 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
wxStaticText* m_staticLineWidthUnits;
wxStaticText* m_staticText26;
wxChoice* m_choiceSeparatorRefId;
wxStaticText* m_staticText221;
wxSpinCtrl* m_spinAutoSaveInterval;
wxStaticText* m_staticText23;
wxStaticLine* m_staticline3;
wxCheckBox* m_checkShowGrid;
wxCheckBox* m_checkHVOrientation;
@ -105,6 +96,9 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
wxStaticText* m_stMaxUndoItems;
wxSpinCtrl* m_spinMaxUndoItems;
wxStaticText* m_staticText22;
wxStaticText* m_staticText221;
wxSpinCtrl* m_spinAutoSaveInterval;
wxStaticText* m_staticText23;
wxStaticLine* m_staticline2;
wxCheckBox* m_checkAutoplaceFields;
wxCheckBox* m_checkAutoplaceJustify;
@ -115,12 +109,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
wxCheckBox* m_checkMiddleButtonPanLimited;
wxCheckBox* m_checkAutoPan;
wxPanel* m_panel2;
wxListView* templateFieldListCtrl;
wxStaticText* fieldNameLabel;
wxTextCtrl* fieldNameTextCtrl;
wxStaticText* fieldDefaultValueLabel;
wxTextCtrl* fieldDefaultValueTextCtrl;
wxCheckBox* fieldVisibleCheckbox;
wxGrid* m_fieldGrid;
wxButton* addFieldButton;
wxButton* deleteFieldButton;
wxStdDialogButtonSizer* m_sdbSizer;
@ -131,17 +120,13 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTemplateFieldDeselected( wxListEvent& event ) { event.Skip(); }
virtual void OnTemplateFieldSelected( wxListEvent& event ) { event.Skip(); }
virtual void OnEnterKey( wxCommandEvent& event ) { event.Skip(); }
virtual void OnVisibleFieldClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EESCHEMA_OPTIONS_BASE();
};

View File

@ -455,8 +455,8 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
m_tstUniqueGlobalLabels = m_cbTestUniqueGlbLabels->GetValue();
// Build the whole sheet list in hierarchy (sheet, not screen)
SCH_SHEET_LIST sheets;
sheets.AnnotatePowerSymbols( Prj().SchLibs() );
int refDes = 1;
g_RootSheet->AnnotatePowerSymbols( Prj().SchLibs(), &refDes );
if( m_parent->CheckAnnotate( aMessagesList, false ) )
{

View File

@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2013 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2015 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
@ -38,6 +38,7 @@
#include <general.h>
#include <class_library.h>
#include <sch_component.h>
#include <sch_sheet_path.h>
#include <dialog_edit_one_field.h>
@ -101,7 +102,7 @@ void SCH_EDIT_FRAME::EditComponentFieldText( SCH_FIELD* aField )
// Test if the reference string is valid:
if( SCH_COMPONENT::IsReferenceStringValid( newtext ) )
{
component->SetRef( m_CurrentSheet, newtext );
component->SetRef( m_CurrentSheet->Last(), newtext );
}
else
{

View File

@ -67,9 +67,9 @@ int TestDuplicateSheetNames( bool aCreateMarker );
bool SCH_EDIT_FRAME::prepareForNetlist()
{
SCH_SHEET_LIST sheets;
int refDes = 1;
sheets.AnnotatePowerSymbols( Prj().SchLibs() );
g_RootSheet->AnnotatePowerSymbols( Prj().SchLibs(), &refDes );
// Performs some controls:
if( CheckAnnotate( NULL, 0 ) )

View File

@ -184,7 +184,7 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* sheet, int unit,
// update the reference -- just the prefix for now.
msg += wxT( "?" );
SetRef( sheet, msg );
SetRef( sheet->Last(), msg );
// Use the schematic component name instead of the library value field
// name.
@ -471,7 +471,7 @@ const wxString SCH_COMPONENT::GetRef( const SCH_SHEET_PATH* sheet )
// all have the same component references, but perhaps this is best.
if( !GetField( REFERENCE )->GetText().IsEmpty() )
{
SetRef( sheet, GetField( REFERENCE )->GetText() );
SetRef( sheet->Last(), GetField( REFERENCE )->GetText() );
return GetField( REFERENCE )->GetText();
}
@ -504,9 +504,9 @@ bool SCH_COMPONENT::IsReferenceStringValid( const wxString& aReferenceString )
}
void SCH_COMPONENT::SetRef( const SCH_SHEET_PATH* sheet, const wxString& ref )
void SCH_COMPONENT::SetRef( const SCH_SHEET* aSheet, const wxString& ref )
{
wxString path = GetPath( sheet->Last() );
wxString path = GetPath( aSheet );
bool notInArray = true;

View File

@ -418,7 +418,7 @@ public:
/**
* Set the reference, for the given sheet path.
*/
void SetRef( const SCH_SHEET_PATH* sheet, const wxString& ref );
void SetRef( const SCH_SHEET* aSheet, const wxString& ref );
/**
* Function AddHierarchicalReference

View File

@ -48,6 +48,7 @@
#include <class_library.h>
#include <sch_component.h>
#include <sch_field.h>
#include <sch_sheet_path.h>
#include <kicad_string.h>
@ -447,7 +448,7 @@ bool SCH_FIELD::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
isReplaced = EDA_ITEM::Replace( aSearchData, text );
if( isReplaced )
component->SetRef( (SCH_SHEET_PATH*) aAuxData, text );
component->SetRef( ((SCH_SHEET_PATH*) aAuxData)->Last(), text );
}
else
{

View File

@ -37,6 +37,7 @@
#include <kicad_string.h>
#include <msgpanel.h>
#include <class_library.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <sch_component.h>
@ -1294,6 +1295,43 @@ void SCH_SHEET::ClearModifyStatus()
}
void SCH_SHEET::AnnotatePowerSymbols( PART_LIBS* aLibs, int* aReference )
{
int ref = 1;
if( aReference )
ref = *aReference;
for( EDA_ITEM* item = m_screen->GetDrawItems(); item; item = item->Next() )
{
if( item->Type() != SCH_COMPONENT_T )
continue;
SCH_COMPONENT* component = (SCH_COMPONENT*) item;
LIB_PART* part = aLibs->FindLibPart( component->GetPartName() );
if( !part || !part->IsPower() )
continue;
wxString refstr = component->GetPrefix();
//str will be "C?" or so after the ClearAnnotation call.
while( refstr.Last() == '?' )
refstr.RemoveLast();
if( !refstr.StartsWith( wxT( "#" ) ) )
refstr = wxT( "#" ) + refstr;
refstr << wxT( "0" ) << ref;
component->SetRef( this, refstr );
ref++;
}
if( aReference )
*aReference = ref;
}
SCH_ITEM& SCH_SHEET::operator=( const SCH_ITEM& aItem )
{
wxLogDebug( wxT( "Sheet assignment operator." ) );

View File

@ -35,6 +35,7 @@
#include <sch_text.h>
class PART_LIBS;
class LINE_READER;
class SCH_SCREEN;
class SCH_SHEET;
@ -656,6 +657,17 @@ public:
*/
bool IsAutoSaveRequired();
/**
* Function AnnotatePowerSymbols
* annotates the power symbols only starting at \a aReference in the sheet path.
* @param aLibs the library list to use
* @param aReference A pointer to the number for the reference designator of the
* first power symbol to be annotated. If the pointer is NULL
* the annotation starts at 1. The number is incremented for
* each power symbol in the sheet that is annotated.
*/
void AnnotatePowerSymbols( PART_LIBS* aLibs, int* aReference );
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const; // override
#endif

View File

@ -245,43 +245,6 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences()
}
void SCH_SHEET_PATH::AnnotatePowerSymbols( PART_LIBS* aLibs, int* aReference )
{
int ref = 1;
if( aReference )
ref = *aReference;
for( EDA_ITEM* item = LastDrawList(); item; item = item->Next() )
{
if( item->Type() != SCH_COMPONENT_T )
continue;
SCH_COMPONENT* component = (SCH_COMPONENT*) item;
LIB_PART* part = aLibs->FindLibPart( component->GetPartName() );
if( !part || !part->IsPower() )
continue;
wxString refstr = component->GetPrefix();
//str will be "C?" or so after the ClearAnnotation call.
while( refstr.Last() == '?' )
refstr.RemoveLast();
if( !refstr.StartsWith( wxT( "#" ) ) )
refstr = wxT( "#" ) + refstr;
refstr << wxT( "0" ) << ref;
component->SetRef( this, refstr );
ref++;
}
if( aReference )
*aReference = ref;
}
void SCH_SHEET_PATH::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols )
{
// Search to sheet path number:
@ -684,15 +647,6 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
}
void SCH_SHEET_LIST::AnnotatePowerSymbols( PART_LIBS* aLibs )
{
int ref = 1;
for( SCH_SHEET_PATH* path = GetFirst(); path; path = GetNext() )
path->AnnotatePowerSymbols( aLibs, &ref );
}
void SCH_SHEET_LIST::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences,
bool aIncludePowerSymbols )
{

View File

@ -226,17 +226,6 @@ public:
*/
void UpdateAllScreenReferences();
/**
* Function AnnotatePowerSymbols
* annotates the power symbols only starting at \a aReference in the sheet path.
* @param aLibs the library list to use
* @param aReference A pointer to the number for the reference designator of the
* first power symbol to be annotated. If the pointer is NULL
* the annotation starts at 1. The number is incremented for
* each power symbol annotated.
*/
void AnnotatePowerSymbols( PART_LIBS* aLibs, int* aReference );
/**
* Function GetComponents
* adds a SCH_REFERENCE() object to \a aReferences for each component in the sheet.
@ -436,13 +425,6 @@ public:
*/
SCH_SHEET_PATH* GetSheetByPath( const wxString aPath, bool aHumanReadable = true );
/**
* Function AnnotatePowerSymbols
* clear and annotates the entire hierarchy of the sheet path list.
* @param aLib the library list to use
*/
void AnnotatePowerSymbols( PART_LIBS* aLib );
/**
* Function GetComponents
* adds a SCH_REFERENCE() object to \a aReferences for each component in the list
@ -451,7 +433,8 @@ public:
* @param aReferences List of references to populate.
* @param aIncludePowerSymbols Set to false to only get normal components.
*/
void GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols = true );
void GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences,
bool aIncludePowerSymbols = true );
/**
* Function GetMultiUnitComponents

View File

@ -23,7 +23,6 @@
# These are additions to any inherited from pcbnew dir:
include_directories( . )
# Tell AVHTTP we have SSL.
set( GITHUB_PLUGIN_SRCS
github_plugin.cpp
github_getliblist.cpp
@ -43,5 +42,3 @@ if( MINGW )
)
endif()
add_dependencies( github_plugin boost )

Binary file not shown.

View File

@ -3,7 +3,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/v2
)
#add_definitions( -DDEBUG_VRML2=3 )
add_definitions( -DDEBUG_VRML1=3 )
add_library( s3d_plugin_vrml MODULE
vrml.cpp
@ -20,6 +20,9 @@ add_library( s3d_plugin_vrml MODULE
v2/vrml2_color.cpp
v2/vrml2_box.cpp
v2/vrml2_switch.cpp
v1/vrml1_node.cpp
v1/vrml1_base.cpp
v1/vrml1_separator.cpp
)
target_link_libraries( s3d_plugin_vrml kicad_3dsg ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES} )

View File

@ -214,6 +214,9 @@ std::string WRL2NODE::GetName( void )
bool WRL2NODE::SetName( const std::string& aName )
{
if( aName.empty() )
return false;
std::set< std::string >::iterator item = badNames.find( aName );
if( item != badNames.end() )

View File

@ -40,7 +40,53 @@ enum WRLVERSION
};
// VRML Node Types
// VRML1 Node Types
// These are used to look up node names and to quickly
// determine what routine to invoke to read a section of
// a file.
enum WRL1NODES
{
WRL1_BASE = 0, // not really a VRML node but we need a top level virtual node
WRL1_BEGIN,
WRL1_ASCIITEXT = WRL1_BEGIN,
WRL1_CONE,
WRL1_COORDINATE3,
WRL1_CUBE,
WRL1_CYLINDER,
WRL1_DIRECTIONALLIGHT,
WRL1_FONTSTYLE,
WRL1_INDEXEDFACESET,
WRL1_INDEXEDLINESET,
WRL1_INFO,
WRL1_LOD,
WRL1_MATERIAL,
WRL1_MATERIALBINDING,
WRL1_MATRIXTRANSFORM,
WRL1_NORMAL,
WRL1_NORMALBINDING,
WRL1_ORTHOCAMERA,
WRL1_PERSPECTIVECAMERA,
WRL1_POINTLIGHT,
WRL1_POINTSET,
WRL1_ROTATION,
WRL1_SCALE,
WRL1_SEPARATOR,
WRL1_SHAPEHINTS,
WRL1_SPHERE,
WRL1_SPOTLIGHT,
WRL1_SWITCH,
WRL1_TEXTURE2,
WRL1_TEXTURE2TRANSFORM,
WRL1_TEXTURECOORDINATE2,
WRL1_TRANSFORM,
WRL1_TRANSLATION,
WRL1_WWWANCHOR,
WRL1_WWWINLINE,
WRL1_INVALID,
WRL1_END = WRL1_INVALID
};
// VRML2 Node Types
// These are used to look up node names and to quickly
// determine what routine to invoke to read a section of
// a file.

View File

@ -18,8 +18,6 @@ add_executable( idfrect idf_rect.cpp )
add_executable( dxf2idf dxf2idfmain.cpp dxf2idf.cpp )
add_executable( idf2vrml idf2vrml.cpp )
add_dependencies( idf2vrml boost )
target_link_libraries( dxf2idf lib_dxf idf3 ${wxWidgets_LIBRARIES} )
target_link_libraries( idf2vrml idf3 ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES} )