Merge with main branch r6601
This commit is contained in:
commit
d0a2080823
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -53,6 +53,9 @@
|
|||
#include <textures/text_pcb.h>
|
||||
|
||||
|
||||
static const double DELTA_MOVE_STEP = 0.7;
|
||||
|
||||
|
||||
/*
|
||||
* EDA_3D_CANVAS implementation
|
||||
*/
|
||||
|
@ -86,7 +89,7 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) :
|
|||
m_init = false;
|
||||
m_reportWarnings = true;
|
||||
m_shadow_init = false;
|
||||
// set an invalide value to not yet initialized indexes managing
|
||||
// set an invalid value to not yet initialized indexes managing
|
||||
// textures created to enhance 3D rendering
|
||||
m_text_pcb = m_text_silk = INVALID_INDEX;
|
||||
m_text_fake_shadow_front = INVALID_INDEX;
|
||||
|
@ -144,8 +147,7 @@ void EDA_3D_CANVAS::ClearLists( int aGlList )
|
|||
m_glLists[ii] = 0;
|
||||
}
|
||||
|
||||
// When m_text_fake_shadow_??? is set to INVALID_INDEX, textures are no yet
|
||||
// created.
|
||||
// When m_text_fake_shadow_??? is set to INVALID_INDEX, textures are not yet created.
|
||||
if( m_text_fake_shadow_front != INVALID_INDEX )
|
||||
glDeleteTextures( 1, &m_text_fake_shadow_front );
|
||||
|
||||
|
@ -169,7 +171,7 @@ void EDA_3D_CANVAS::OnChar( wxKeyEvent& event )
|
|||
void EDA_3D_CANVAS::SetView3D( int keycode )
|
||||
{
|
||||
int ii;
|
||||
double delta_move = 0.7 * GetPrm3DVisu().m_Zoom;
|
||||
double delta_move = DELTA_MOVE_STEP * GetPrm3DVisu().m_Zoom;
|
||||
|
||||
switch( keycode )
|
||||
{
|
||||
|
@ -284,19 +286,27 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
|
|||
|
||||
void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event )
|
||||
{
|
||||
if( event.ShiftDown() )
|
||||
double delta = DELTA_MOVE_STEP * GetPrm3DVisu().m_Zoom;
|
||||
if ( GetPrm3DVisu().GetFlag( FL_MOUSEWHEEL_PANNING ) )
|
||||
delta *= 0.05 * event.GetWheelRotation();
|
||||
else
|
||||
if ( event.GetWheelRotation() < 0 )
|
||||
delta = -delta;
|
||||
|
||||
if( GetPrm3DVisu().GetFlag( FL_MOUSEWHEEL_PANNING ) )
|
||||
{
|
||||
if( event.GetWheelRotation() < 0 )
|
||||
SetView3D( WXK_UP ); // move up
|
||||
if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL )
|
||||
m_draw3dOffset.x -= delta;
|
||||
else
|
||||
SetView3D( WXK_DOWN ); // move down
|
||||
m_draw3dOffset.y -= delta;
|
||||
}
|
||||
else if( event.ShiftDown() )
|
||||
{
|
||||
m_draw3dOffset.y -= delta;
|
||||
}
|
||||
else if( event.ControlDown() )
|
||||
{
|
||||
if( event.GetWheelRotation() > 0 )
|
||||
SetView3D( WXK_RIGHT ); // move right
|
||||
else
|
||||
SetView3D( WXK_LEFT ); // move left
|
||||
m_draw3dOffset.x += delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -310,10 +320,10 @@ void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event )
|
|||
else
|
||||
GetPrm3DVisu().m_Zoom *= 1.4;
|
||||
|
||||
DisplayStatus();
|
||||
Refresh( false );
|
||||
}
|
||||
|
||||
DisplayStatus();
|
||||
Refresh( false );
|
||||
GetPrm3DVisu().m_Beginx = event.GetX();
|
||||
GetPrm3DVisu().m_Beginy = event.GetY();
|
||||
}
|
||||
|
@ -327,7 +337,9 @@ void EDA_3D_CANVAS::OnMagnify( wxMouseEvent& event )
|
|||
GetPrm3DVisu().m_Zoom /= magnification;
|
||||
|
||||
if( GetPrm3DVisu().m_Zoom <= 0.01 )
|
||||
{
|
||||
GetPrm3DVisu().m_Zoom = 0.01;
|
||||
}
|
||||
|
||||
DisplayStatus();
|
||||
Refresh( false );
|
||||
|
@ -376,8 +388,6 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/* Construct and display a popup menu when the right button is clicked.
|
||||
*/
|
||||
void EDA_3D_CANVAS::OnRightClick( wxMouseEvent& event )
|
||||
{
|
||||
wxPoint pos;
|
||||
|
@ -563,7 +573,7 @@ GLuint load_and_generate_texture( tsImage *image )
|
|||
return texture;
|
||||
}
|
||||
|
||||
/* Initialize broad parameters for OpenGL */
|
||||
|
||||
void EDA_3D_CANVAS::InitGL()
|
||||
{
|
||||
if( !m_init )
|
||||
|
@ -579,7 +589,7 @@ void EDA_3D_CANVAS::InitGL()
|
|||
m_ZTop = 10.0;
|
||||
|
||||
glDisable( GL_CULL_FACE ); // show back faces
|
||||
glEnable( GL_DEPTH_TEST ); // Enable z-buferring
|
||||
glEnable( GL_DEPTH_TEST ); // Enable z-buffering
|
||||
glEnable( GL_ALPHA_TEST );
|
||||
glEnable( GL_LINE_SMOOTH );
|
||||
// glEnable(GL_POLYGON_SMOOTH); // creates issues with some graphic cards
|
||||
|
@ -600,7 +610,6 @@ void EDA_3D_CANVAS::InitGL()
|
|||
}
|
||||
|
||||
|
||||
/* Initialize OpenGL light sources. */
|
||||
void EDA_3D_CANVAS::SetLights()
|
||||
{
|
||||
// activate light. the source is above the xy plane, at source_pos
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -70,6 +70,8 @@ static const wxChar keyBoardBodyColor_Red[] = wxT( "BoardBodyColor_Red" );
|
|||
static const wxChar keyBoardBodyColor_Green[] = wxT( "BoardBodyColor_Green" );
|
||||
static const wxChar keyBoardBodyColor_Blue[]= wxT( "BoardBodyColor_Blue" );
|
||||
|
||||
static const wxChar keyMousewheelPanning[] = wxT( "MousewheelPAN3D" );
|
||||
|
||||
static const wxChar keyShowRealisticMode[] = wxT( "ShowRealisticMode" );
|
||||
static const wxChar keyRenderShadows[] = wxT( "Render_Shadows" );
|
||||
static const wxChar keyRenderRemoveHoles[] = wxT( "Render_RemoveHoles" );
|
||||
|
@ -280,6 +282,9 @@ void EDA_3D_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
aCfg->Read( keyBoardBodyColor_Blue, &GetPrm3DVisu().m_BoardBodyColor.m_Blue, 22.0 /255.0 );
|
||||
|
||||
bool tmp;
|
||||
aCfg->Read( keyMousewheelPanning, &tmp, false );
|
||||
prms.SetFlag( FL_MOUSEWHEEL_PANNING, tmp );
|
||||
|
||||
aCfg->Read( keyShowRealisticMode, &tmp, false );
|
||||
prms.SetFlag( FL_USE_REALISTIC_MODE, tmp );
|
||||
|
||||
|
@ -378,6 +383,8 @@ void EDA_3D_FRAME::SaveSettings( wxConfigBase* aCfg )
|
|||
aCfg->Write( keyBoardBodyColor_Green, GetPrm3DVisu().m_BoardBodyColor.m_Green );
|
||||
aCfg->Write( keyBoardBodyColor_Blue, GetPrm3DVisu().m_BoardBodyColor.m_Blue );
|
||||
|
||||
aCfg->Write( keyMousewheelPanning, prms.GetFlag( FL_MOUSEWHEEL_PANNING ) );
|
||||
|
||||
aCfg->Write( keyShowRealisticMode, prms.GetFlag( FL_USE_REALISTIC_MODE ) );
|
||||
|
||||
aCfg->Write( keyRenderShadows, prms.GetFlag( FL_RENDER_SHADOWS ) );
|
||||
|
@ -563,6 +570,10 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
Set3DBoardBodyColorFromUser();
|
||||
break;
|
||||
|
||||
case ID_MENU3D_MOUSEWHEEL_PANNING:
|
||||
GetPrm3DVisu().SetFlag( FL_MOUSEWHEEL_PANNING, isChecked );
|
||||
return;
|
||||
|
||||
case ID_MENU3D_REALISTIC_MODE:
|
||||
GetPrm3DVisu().SetFlag( FL_USE_REALISTIC_MODE, isChecked );
|
||||
GetMenuBar()->FindItem( ID_MENU3D_COMMENTS_ONOFF )->Enable( !isChecked );
|
||||
|
@ -745,8 +756,6 @@ void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/* called to set the background color of the 3D scene
|
||||
*/
|
||||
bool EDA_3D_FRAME::Set3DColorFromUser( S3D_COLOR &aColor, const wxString& aTitle,
|
||||
wxColourData* aPredefinedColors )
|
||||
{
|
||||
|
@ -778,13 +787,12 @@ bool EDA_3D_FRAME::Set3DColorFromUser( S3D_COLOR &aColor, const wxString& aTitle
|
|||
return true;
|
||||
}
|
||||
|
||||
/* called to set the silkscreen color. Sets up a number of default colors
|
||||
*/
|
||||
|
||||
bool EDA_3D_FRAME::Set3DSilkScreenColorFromUser()
|
||||
{
|
||||
wxColourData definedColors;
|
||||
|
||||
definedColors.SetCustomColour(0, wxColour( 241, 241, 241 ) ); // White
|
||||
definedColors.SetCustomColour(0, wxColour( 241, 241, 241 ) ); // White
|
||||
definedColors.SetCustomColour(1, wxColour( 180, 180, 180 ) ); // Gray
|
||||
|
||||
bool change = Set3DColorFromUser( GetPrm3DVisu().m_SilkScreenColor,
|
||||
|
@ -798,8 +806,6 @@ bool EDA_3D_FRAME::Set3DSilkScreenColorFromUser()
|
|||
}
|
||||
|
||||
|
||||
/* called to set the soldermask color. Sets up a number of default colors
|
||||
*/
|
||||
bool EDA_3D_FRAME::Set3DSolderMaskColorFromUser()
|
||||
{
|
||||
wxColourData definedColors;
|
||||
|
@ -822,8 +828,6 @@ bool EDA_3D_FRAME::Set3DSolderMaskColorFromUser()
|
|||
}
|
||||
|
||||
|
||||
/* called to set the copper surface color. Sets up a number of default colors
|
||||
*/
|
||||
bool EDA_3D_FRAME::Set3DCopperColorFromUser()
|
||||
{
|
||||
wxColourData definedColors;
|
||||
|
@ -845,8 +849,6 @@ bool EDA_3D_FRAME::Set3DCopperColorFromUser()
|
|||
}
|
||||
|
||||
|
||||
/* called to set the board body color. Sets up a number of default colors
|
||||
*/
|
||||
bool EDA_3D_FRAME::Set3DBoardBodyColorFromUser()
|
||||
{
|
||||
wxColourData definedColors;
|
||||
|
@ -871,8 +873,6 @@ bool EDA_3D_FRAME::Set3DBoardBodyColorFromUser()
|
|||
}
|
||||
|
||||
|
||||
/* called to set the solder paste layer color. Sets up a number of default colors
|
||||
*/
|
||||
bool EDA_3D_FRAME::Set3DSolderPasteColorFromUser()
|
||||
{
|
||||
wxColourData definedColors;
|
||||
|
@ -905,6 +905,7 @@ INFO3D_VISU& EDA_3D_FRAME::GetPrm3DVisu() const
|
|||
return g_Parm_3D_Visu;
|
||||
}
|
||||
|
||||
|
||||
bool EDA_3D_FRAME::IsEnabled( DISPLAY3D_FLG aItem ) const
|
||||
{
|
||||
// return true if aItem must be displayed
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -153,6 +153,12 @@ void EDA_3D_FRAME::CreateMenuBar()
|
|||
|
||||
menuBar->Append( prefsMenu, _( "&Preferences" ) );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_MOUSEWHEEL_PANNING,
|
||||
_( "Use Touchpad to Pan" ),
|
||||
KiBitmap( tools_xpm ), wxITEM_CHECK );
|
||||
|
||||
prefsMenu->AppendSeparator();
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_REALISTIC_MODE,
|
||||
_( "Realistic Mode" ),
|
||||
KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
|
||||
|
@ -292,6 +298,7 @@ void EDA_3D_FRAME::CreateMenuBar()
|
|||
SetMenuBarOptionsState();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::SetMenuBarOptionsState()
|
||||
{
|
||||
wxMenuBar* menuBar = GetMenuBar();
|
||||
|
@ -301,6 +308,9 @@ void EDA_3D_FRAME::SetMenuBarOptionsState()
|
|||
|
||||
wxMenuItem* item;
|
||||
// Set the state of toggle menus according to the current display options
|
||||
item = menuBar->FindItem( ID_MENU3D_MOUSEWHEEL_PANNING );
|
||||
item->Check( GetPrm3DVisu().GetFlag( FL_MOUSEWHEEL_PANNING ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_REALISTIC_MODE );
|
||||
item->Check( GetPrm3DVisu().IsRealisticMode() );
|
||||
item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
|
||||
|
@ -366,6 +376,7 @@ void EDA_3D_FRAME::SetMenuBarOptionsState()
|
|||
item->Check( GetPrm3DVisu().GetFlag( FL_ECO ));
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::SetToolbars()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ enum id_3dview_frm
|
|||
ID_MENU3D_COMMENTS_ONOFF,
|
||||
ID_MENU3D_ECO_ONOFF,
|
||||
ID_MENU3D_SHOW_BOARD_BODY,
|
||||
ID_MENU3D_MOUSEWHEEL_PANNING,
|
||||
ID_MENU3D_REALISTIC_MODE,
|
||||
ID_MENU3D_FL_RENDER_SHADOWS,
|
||||
ID_MENU3D_FL_RENDER_SHOW_HOLES_IN_ZONES,
|
||||
|
|
|
@ -71,6 +71,7 @@ enum DISPLAY3D_FLG {
|
|||
FL_GRID,
|
||||
FL_USE_COPPER_THICKNESS,
|
||||
FL_SHOW_BOARD_BODY,
|
||||
FL_MOUSEWHEEL_PANNING,
|
||||
FL_USE_REALISTIC_MODE,
|
||||
FL_RENDER_SHADOWS,
|
||||
FL_RENDER_SHOW_HOLES_IN_ZONES,
|
||||
|
|
116
CMakeLists.txt
116
CMakeLists.txt
|
@ -60,6 +60,12 @@ option( KICAD_SCRIPTING_WXPYTHON
|
|||
# when not defined by user, the default is python.exe under Windows and python2 for others
|
||||
# python binary file should be is exec path.
|
||||
|
||||
# KICAD_SCRIPTING_MODULES requires KICAD_SCRIPTING enable it here if KICAD_SCRIPTING_MODULES is ON
|
||||
if ( KICAD_SCRIPTING_MODULES AND NOT KICAD_SCRIPTING )
|
||||
message(STATUS "Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_MODULES")
|
||||
set ( KICAD_SCRIPTING ON )
|
||||
endif()
|
||||
|
||||
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON )
|
||||
|
||||
|
||||
|
@ -209,27 +215,7 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
|||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" )
|
||||
|
||||
if( APPLE )
|
||||
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__ASSERTMACROS__" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ASSERTMACROS__" )
|
||||
|
||||
# Allows .dylib relocation in the future - needed by fixbundle
|
||||
set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names")
|
||||
|
||||
if( NOT CMAKE_CXX_COMPILER )
|
||||
EXEC_PROGRAM( wx-config ARGS --cc OUTPUT_VARIABLE CMAKE_C_COMPILER )
|
||||
endif()
|
||||
|
||||
if( NOT CMAKE_CXX_COMPILER )
|
||||
EXEC_PROGRAM( wx-config ARGS --cxx OUTPUT_VARIABLE CMAKE_CXX_COMPILER )
|
||||
endif()
|
||||
|
||||
# There seems to be no consistent behavior when -mmacosx-min-version is
|
||||
# not specified, so force user to set minimum OSX version to build for
|
||||
if( NOT CMAKE_OSX_DEPLOYMENT_TARGET )
|
||||
message( FATAL_ERROR "Please specify target OS X version using -DCMAKE_OSX_DEPLOYMENT_TARGET=10.x" )
|
||||
endif()
|
||||
|
||||
set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names") # needed by fixbundle
|
||||
endif()
|
||||
|
||||
endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
|
@ -302,7 +288,6 @@ if( NOT APPLE )
|
|||
|
||||
set( KICAD_USER_PLUGIN ${KICAD_BIN}/plugins
|
||||
CACHE PATH "Location of KiCad user-loaded plugins" )
|
||||
|
||||
else()
|
||||
set( KICAD_PLUGINS lib/kicad/plugins
|
||||
CACHE PATH "Location of KiCad plugins." )
|
||||
|
@ -328,7 +313,6 @@ else()
|
|||
set( KICAD_BIN ${CMAKE_INSTALL_PREFIX}
|
||||
CACHE PATH "Location of KiCad binaries." FORCE )
|
||||
|
||||
|
||||
# some paths to single app bundle
|
||||
set( OSX_BUNDLE_MAIN "kicad.app" )
|
||||
set( OSX_BUNDLE_BIN_DIR "Contents/MacOS" )
|
||||
|
@ -383,6 +367,11 @@ else()
|
|||
|
||||
set( \${default_embedded_path_var} \"\${path}\" PARENT_SCOPE )
|
||||
endfunction(gp_item_default_embedded_path_override)
|
||||
|
||||
# If `BU_CHMOD_BUNDLE_ITEMS` is not set, `install_name_tool` will fail to re-write some
|
||||
# loader paths due to lack of writable permissions if the build dependencies were installed
|
||||
# by brew (or didn't have writable permissions)
|
||||
set ( BU_CHMOD_BUNDLE_ITEMS ON )
|
||||
"
|
||||
)
|
||||
endif()
|
||||
|
@ -512,7 +501,6 @@ set( INC_BEFORE
|
|||
|
||||
set( INC_AFTER
|
||||
${Boost_INCLUDE_DIR}
|
||||
#include <config.h>
|
||||
${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
|
@ -615,12 +603,6 @@ if( EXISTS ${CMAKE_SOURCE_DIR}/include/config.h )
|
|||
add_definitions( -DHAVE_SVN_REVISION )
|
||||
endif()
|
||||
|
||||
|
||||
#================================================
|
||||
# Let CMake look in these directories for nested
|
||||
# 'CMakeLists.txt' files to process
|
||||
#================================================
|
||||
|
||||
if( APPLE )
|
||||
# Remove app bundles in ${KICAD_BIN} before installing anything new.
|
||||
# Must be defined before all includes so that it is executed first.
|
||||
|
@ -639,40 +621,10 @@ if( APPLE )
|
|||
)
|
||||
endif()
|
||||
|
||||
############################
|
||||
# Binaries ( CMake targets ) #
|
||||
############################
|
||||
|
||||
add_subdirectory( bitmaps_png )
|
||||
add_subdirectory( common )
|
||||
add_subdirectory( 3d-viewer )
|
||||
add_subdirectory( cvpcb )
|
||||
add_subdirectory( eeschema )
|
||||
add_subdirectory( gerbview )
|
||||
add_subdirectory( lib_dxf )
|
||||
add_subdirectory( pcbnew )
|
||||
add_subdirectory( polygon )
|
||||
add_subdirectory( pagelayout_editor )
|
||||
add_subdirectory( potrace )
|
||||
add_subdirectory( bitmap2component )
|
||||
add_subdirectory( pcb_calculator )
|
||||
add_subdirectory( plugins ) # 3D plugins must be built before kicad
|
||||
add_subdirectory( kicad ) # should follow pcbnew, eeschema
|
||||
add_subdirectory( tools )
|
||||
add_subdirectory( utils )
|
||||
add_subdirectory( qa )
|
||||
|
||||
#add_subdirectory( new )
|
||||
|
||||
#############
|
||||
# Resources #
|
||||
#############
|
||||
add_subdirectory( demos )
|
||||
add_subdirectory( template )
|
||||
|
||||
#================================================
|
||||
# Doxygen Output
|
||||
#================================================
|
||||
|
||||
find_package( Doxygen )
|
||||
if( DOXYGEN_FOUND )
|
||||
add_custom_target( doxygen-docs
|
||||
|
@ -697,6 +649,18 @@ endif()
|
|||
configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
|
||||
${CMAKE_BINARY_DIR}/config.h )
|
||||
|
||||
###
|
||||
# Generate Map file
|
||||
###
|
||||
if( KICAD_MAKE_LINK_MAPS )
|
||||
# Currently only works on linux/gcc
|
||||
if( UNIX AND NOT APPLE )
|
||||
set( MAKE_LINK_MAPS true )
|
||||
else()
|
||||
set( MAKE_LINK_MAPS false )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#================================================
|
||||
# "make uninstall" rules
|
||||
#================================================
|
||||
|
@ -766,7 +730,6 @@ endif()
|
|||
|
||||
#include( CTest )
|
||||
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
|
||||
# Create a *.deb file:
|
||||
|
@ -782,3 +745,32 @@ if( UNIX AND NOT APPLE )
|
|||
include( CPack )
|
||||
|
||||
endif()
|
||||
|
||||
#================================================
|
||||
# Let CMake look in these directories for nested
|
||||
# 'CMakeLists.txt' files to process
|
||||
#================================================
|
||||
|
||||
# Binaries ( CMake targets )
|
||||
add_subdirectory( bitmaps_png )
|
||||
add_subdirectory( common )
|
||||
add_subdirectory( 3d-viewer )
|
||||
add_subdirectory( cvpcb )
|
||||
add_subdirectory( eeschema )
|
||||
add_subdirectory( gerbview )
|
||||
add_subdirectory( lib_dxf )
|
||||
add_subdirectory( pcbnew )
|
||||
add_subdirectory( polygon )
|
||||
add_subdirectory( pagelayout_editor )
|
||||
add_subdirectory( potrace )
|
||||
add_subdirectory( bitmap2component )
|
||||
add_subdirectory( pcb_calculator )
|
||||
add_subdirectory( plugins ) # 3D plugins must be built before kicad
|
||||
add_subdirectory( kicad ) # should follow pcbnew, eeschema
|
||||
add_subdirectory( tools )
|
||||
add_subdirectory( utils )
|
||||
add_subdirectory( qa )
|
||||
|
||||
# Resources
|
||||
add_subdirectory( demos )
|
||||
add_subdirectory( template )
|
||||
|
|
|
@ -362,6 +362,7 @@ set( BMAPS_MID
|
|||
module_options
|
||||
module_pin_filtered_list
|
||||
module_library_list
|
||||
module_name_filtered_list
|
||||
module_ratsnest
|
||||
module
|
||||
modview_icon
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
|
||||
/* Do not modify this file, it was automatically generated by the
|
||||
* PNG2cpp CMake script, using a *.png file as input.
|
||||
*/
|
||||
|
||||
#include <bitmaps.h>
|
||||
|
||||
static const unsigned char png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x19, 0x08, 0x06, 0x00, 0x00, 0x00, 0x2f, 0xde, 0x3e,
|
||||
0x60, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
|
||||
0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0x58, 0x00, 0x00, 0x0e,
|
||||
0x58, 0x01, 0x22, 0x7b, 0x1d, 0x35, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
|
||||
0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
|
||||
0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x04, 0x38, 0x49,
|
||||
0x44, 0x41, 0x54, 0x48, 0x89, 0xbd, 0x95, 0x5f, 0x4c, 0x53, 0x57, 0x1c, 0xc7, 0x3f, 0xe7, 0xde,
|
||||
0xde, 0x0b, 0x6d, 0x57, 0xdb, 0x2e, 0x13, 0x44, 0x4c, 0x24, 0x1d, 0x4b, 0xb6, 0x21, 0x13, 0xa4,
|
||||
0x31, 0x46, 0x13, 0x33, 0x5d, 0x56, 0x31, 0xd3, 0xac, 0x14, 0x16, 0x12, 0x35, 0xa9, 0x6f, 0x26,
|
||||
0x8b, 0x02, 0x99, 0x1b, 0x0f, 0x92, 0x35, 0x3e, 0x62, 0x5c, 0x96, 0x90, 0xb9, 0x3d, 0x90, 0x91,
|
||||
0xb0, 0x34, 0x12, 0x1e, 0x8c, 0xe8, 0x83, 0x66, 0xc9, 0x42, 0x48, 0x36, 0x79, 0xd0, 0x64, 0x20,
|
||||
0xe9, 0x9e, 0x26, 0x42, 0x06, 0x06, 0xd7, 0x48, 0xa9, 0x03, 0x57, 0x4a, 0xdb, 0x7b, 0xcf, 0x1e,
|
||||
0x18, 0xb5, 0x57, 0x18, 0x62, 0xb6, 0xf9, 0x4d, 0x4e, 0xee, 0x39, 0xbf, 0xdf, 0xef, 0x7e, 0xbf,
|
||||
0xbf, 0xdf, 0xf9, 0x2b, 0x28, 0x40, 0x63, 0x63, 0xe3, 0x51, 0x04, 0xd7, 0x05, 0x42, 0xac, 0xd8,
|
||||
0xb2, 0x7a, 0xee, 0xe6, 0xf5, 0xbe, 0x6b, 0x1f, 0x84, 0x42, 0xa1, 0x7d, 0x42, 0x11, 0x3f, 0x15,
|
||||
0xfa, 0x72, 0xba, 0x31, 0x72, 0xad, 0x6f, 0xa0, 0xee, 0xd8, 0xb1, 0x63, 0xde, 0xb4, 0xb1, 0x34,
|
||||
0x21, 0x91, 0x45, 0x79, 0x32, 0xc1, 0xc2, 0x40, 0xff, 0xd5, 0xd2, 0x95, 0xa1, 0xad, 0x50, 0x48,
|
||||
0x08, 0xe1, 0x9d, 0x7c, 0x67, 0x36, 0xf5, 0xf3, 0xa1, 0xdf, 0x9c, 0x00, 0xaf, 0x3e, 0x74, 0xb2,
|
||||
0xef, 0xea, 0xeb, 0x65, 0x00, 0xaa, 0xaa, 0xba, 0x1e, 0x6e, 0x7f, 0xfc, 0xc7, 0xad, 0x8f, 0xc6,
|
||||
0x3d, 0x00, 0xce, 0xc7, 0x45, 0xbc, 0x17, 0x7d, 0xf3, 0x35, 0x00, 0xd3, 0x34, 0xed, 0x4b, 0xc5,
|
||||
0x59, 0xe5, 0xc6, 0xc7, 0x31, 0xfb, 0x0a, 0x57, 0xe8, 0xcb, 0x5d, 0x2a, 0x20, 0x00, 0x09, 0xa0,
|
||||
0xf0, 0x92, 0xf0, 0xd2, 0x84, 0x6c, 0x4d, 0x4d, 0x4d, 0x1f, 0x3a, 0x9d, 0xce, 0x8b, 0x80, 0xc8,
|
||||
0xe5, 0x72, 0x2e, 0x45, 0x2a, 0xf6, 0xc2, 0x00, 0x55, 0xa8, 0x6f, 0x87, 0xc3, 0xe1, 0x7b, 0x86,
|
||||
0x61, 0x38, 0x04, 0xca, 0x26, 0x6b, 0x96, 0xca, 0xd6, 0x70, 0x38, 0x7c, 0x0f, 0xb0, 0xfd, 0x49,
|
||||
0xfa, 0x95, 0x67, 0xb8, 0xb5, 0x70, 0x38, 0xfc, 0xab, 0x69, 0x9a, 0xe3, 0xd1, 0x68, 0xf4, 0xb0,
|
||||
0x22, 0x84, 0x78, 0xcb, 0xef, 0xf7, 0xfb, 0x22, 0x91, 0x48, 0x65, 0x30, 0x18, 0x2c, 0xd5, 0x6d,
|
||||
0x9a, 0xa5, 0xca, 0xb2, 0x2d, 0x65, 0x45, 0x91, 0x48, 0xa4, 0xf2, 0xf8, 0xf1, 0xe3, 0x5b, 0xed,
|
||||
0x45, 0xc5, 0x16, 0x9f, 0xdb, 0xe3, 0xb6, 0x45, 0x22, 0x91, 0xca, 0xb6, 0xb6, 0xb6, 0x0a, 0xbd,
|
||||
0x48, 0xb7, 0xf8, 0x54, 0x9b, 0x2a, 0xce, 0x9e, 0x3d, 0x5b, 0x69, 0x18, 0xc6, 0x7e, 0xf8, 0x7b,
|
||||
0x33, 0x78, 0x3c, 0x1e, 0x7c, 0x3e, 0x1f, 0x0f, 0x1e, 0x3c, 0xa0, 0xe4, 0x87, 0x4d, 0x1c, 0xba,
|
||||
0xb1, 0x73, 0x39, 0x78, 0x51, 0xe0, 0xb0, 0xdb, 0xf1, 0xf9, 0x7c, 0xcc, 0xcf, 0xcf, 0xe3, 0xfe,
|
||||
0xbd, 0x98, 0xc3, 0x37, 0x6b, 0x97, 0xab, 0xc9, 0x42, 0xb1, 0x56, 0x8c, 0xcf, 0xe7, 0x23, 0x99,
|
||||
0x4c, 0xa2, 0xa6, 0x04, 0xef, 0xdf, 0xa8, 0x7e, 0xaa, 0x94, 0x93, 0x54, 0x54, 0x54, 0x3c, 0x9d,
|
||||
0xba, 0xc2, 0x2c, 0xfc, 0x7e, 0x3f, 0xed, 0xfa, 0x27, 0x48, 0x29, 0xf3, 0xb6, 0xf2, 0xf2, 0x72,
|
||||
0x00, 0xaa, 0xaa, 0xaa, 0xf8, 0xbc, 0xb5, 0xc3, 0xe2, 0xf3, 0x78, 0x3c, 0xf9, 0xef, 0x67, 0xad,
|
||||
0x9f, 0x92, 0xcd, 0x66, 0xf3, 0x3e, 0x7b, 0x83, 0x1d, 0xf1, 0xf4, 0x24, 0x60, 0x93, 0x52, 0xe6,
|
||||
0x47, 0x0e, 0x87, 0x83, 0x3d, 0x7b, 0xf6, 0xb0, 0x16, 0x34, 0x4d, 0xa3, 0xba, 0xba, 0x7a, 0x4d,
|
||||
0x9f, 0x10, 0x02, 0xbf, 0xdf, 0xbf, 0xca, 0xfe, 0xe4, 0xc9, 0x93, 0x7c, 0x5f, 0x11, 0x42, 0xbc,
|
||||
0x3b, 0x38, 0x38, 0xa8, 0x8e, 0x8d, 0x8d, 0xad, 0x49, 0xf2, 0x5f, 0x41, 0x01, 0x7e, 0xdc, 0xb1,
|
||||
0x63, 0x87, 0xd9, 0xd5, 0xd5, 0xc5, 0xc2, 0xc2, 0xc2, 0xff, 0x26, 0x64, 0x03, 0x8c, 0xd2, 0xd2,
|
||||
0x52, 0x99, 0x4c, 0x26, 0x99, 0x9a, 0x9a, 0xa2, 0xaa, 0xaa, 0xea, 0x1f, 0x83, 0xd3, 0xe9, 0x34,
|
||||
0xc3, 0xc3, 0xc3, 0x96, 0x75, 0x5a, 0x0f, 0x99, 0x4c, 0x86, 0xcd, 0x9b, 0x37, 0x6b, 0xe7, 0xcf,
|
||||
0x9f, 0x6f, 0x57, 0xa4, 0x94, 0x62, 0x76, 0x76, 0x56, 0xcc, 0xcc, 0xcc, 0xb0, 0x6d, 0xdb, 0xb6,
|
||||
0x75, 0x7f, 0x8c, 0xc7, 0xe3, 0x8c, 0x8d, 0x8d, 0x61, 0x18, 0xc6, 0x86, 0x9a, 0xaa, 0xaa, 0xd4,
|
||||
0xd7, 0xd7, 0x6b, 0xc0, 0x05, 0x1b, 0xb0, 0x7f, 0x64, 0x64, 0x44, 0x69, 0x69, 0x69, 0xc1, 0xed,
|
||||
0x76, 0x3f, 0x37, 0x4b, 0xb7, 0xdb, 0xcd, 0x81, 0x03, 0x07, 0x36, 0x54, 0x11, 0x80, 0x69, 0x9a,
|
||||
0xdc, 0xbe, 0x7d, 0x1b, 0x45, 0x08, 0x71, 0x2b, 0x10, 0x08, 0x18, 0x6b, 0xed, 0x9a, 0xe7, 0x61,
|
||||
0x71, 0x71, 0x91, 0x50, 0x28, 0xc4, 0xa9, 0x53, 0xa7, 0x98, 0x9c, 0x9c, 0x5c, 0x37, 0x56, 0x01,
|
||||
0x8c, 0x17, 0x56, 0x28, 0x80, 0x69, 0x9a, 0xc4, 0x62, 0x31, 0x4e, 0x9e, 0x3c, 0x49, 0x4f, 0x4f,
|
||||
0x8f, 0xe5, 0x2c, 0x3d, 0x2b, 0x94, 0x87, 0x61, 0x18, 0x4c, 0x4c, 0x4c, 0x58, 0x5a, 0x22, 0x91,
|
||||
0xc8, 0x13, 0xce, 0xcc, 0xcc, 0x60, 0x9a, 0x66, 0x3e, 0xde, 0x6e, 0xb7, 0x13, 0x8d, 0x46, 0x09,
|
||||
0x06, 0x83, 0xe4, 0x72, 0x39, 0x7a, 0x7a, 0x7a, 0x38, 0x71, 0xe2, 0x04, 0xa3, 0xa3, 0xa3, 0xab,
|
||||
0x84, 0x2c, 0x37, 0xc3, 0xe8, 0xe8, 0x28, 0x17, 0xbf, 0xf9, 0x82, 0xec, 0xca, 0x73, 0xb5, 0x24,
|
||||
0x29, 0xd7, 0xb6, 0xf0, 0xd5, 0x85, 0x2e, 0xc6, 0xc7, 0xc7, 0xe9, 0xfe, 0xee, 0x5b, 0x76, 0x55,
|
||||
0xd7, 0x58, 0x08, 0x5c, 0x2e, 0x17, 0xed, 0xed, 0xed, 0x1c, 0x3c, 0x78, 0x90, 0xce, 0xce, 0x4e,
|
||||
0xa6, 0xa7, 0xa7, 0x39, 0x7d, 0xfa, 0x34, 0xb5, 0xb5, 0xb5, 0x5c, 0xba, 0x74, 0xc9, 0x5a, 0x51,
|
||||
0x2a, 0x95, 0x22, 0x1e, 0x8f, 0x33, 0x37, 0x37, 0x47, 0x62, 0x7b, 0x8a, 0x81, 0x86, 0x3b, 0x0c,
|
||||
0x34, 0xdc, 0x61, 0x30, 0xf0, 0x0b, 0xe9, 0x6c, 0x9a, 0x78, 0x3c, 0x4e, 0x22, 0x91, 0x60, 0xc9,
|
||||
0x6b, 0x90, 0xd5, 0xd6, 0x9e, 0xe9, 0xba, 0xba, 0x3a, 0x9a, 0x9b, 0x9b, 0xd1, 0x34, 0x0d, 0x29,
|
||||
0x25, 0xb1, 0x58, 0xcc, 0x5a, 0x91, 0x94, 0x72, 0x7a, 0x68, 0x68, 0x28, 0x3d, 0x34, 0x34, 0x24,
|
||||
0x4c, 0xd3, 0x54, 0xd3, 0xbe, 0xb4, 0xce, 0xf2, 0xcb, 0x08, 0xc0, 0xa3, 0x47, 0x8f, 0x64, 0x5b,
|
||||
0x5b, 0xdb, 0x22, 0xa0, 0x64, 0xca, 0x64, 0x51, 0xa1, 0x6f, 0x05, 0x53, 0x53, 0x53, 0x74, 0x76,
|
||||
0x76, 0x72, 0xf7, 0xee, 0x5d, 0x00, 0x6a, 0x6a, 0x6a, 0x38, 0x73, 0xe6, 0x8c, 0x55, 0xe8, 0xca,
|
||||
0x95, 0x2b, 0x97, 0x81, 0xcb, 0x00, 0x8d, 0x8d, 0x8d, 0x41, 0x53, 0x91, 0xbd, 0x40, 0x7e, 0x9f,
|
||||
0x4b, 0x21, 0xef, 0xf7, 0xf7, 0xf7, 0xbf, 0xd1, 0xd4, 0xd4, 0xb4, 0x57, 0x0a, 0xe5, 0x7b, 0xc0,
|
||||
0x55, 0x48, 0xd0, 0xd7, 0xd7, 0x47, 0x77, 0x77, 0x37, 0x99, 0x4c, 0x06, 0x8f, 0xc7, 0x43, 0x4b,
|
||||
0x4b, 0x0b, 0xf5, 0xf5, 0xf5, 0xab, 0x2a, 0xb6, 0xad, 0xb2, 0xbc, 0x00, 0x92, 0xc9, 0x64, 0x7e,
|
||||
0x1d, 0x02, 0x81, 0x00, 0xad, 0xad, 0xad, 0x78, 0xbd, 0xde, 0x35, 0x63, 0xff, 0x95, 0x90, 0xd7,
|
||||
0xeb, 0xe5, 0xdc, 0xb9, 0x73, 0x94, 0x94, 0x94, 0xb0, 0x7b, 0xf7, 0xee, 0x75, 0x63, 0x2d, 0x42,
|
||||
0x8a, 0xa2, 0xa4, 0xcb, 0xee, 0xbb, 0xed, 0x47, 0xbf, 0xde, 0x39, 0x0f, 0x20, 0x4c, 0x14, 0x45,
|
||||
0x8a, 0xe5, 0xbe, 0x10, 0x29, 0xd7, 0x5c, 0xb1, 0xd3, 0xb6, 0xa4, 0x5a, 0x08, 0x8e, 0x1c, 0x39,
|
||||
0xb2, 0xa1, 0xa4, 0x56, 0x2d, 0x6c, 0x30, 0x18, 0xf4, 0x38, 0x1c, 0x8e, 0xbc, 0x5d, 0xd7, 0xf5,
|
||||
0xc5, 0xde, 0xde, 0xde, 0x34, 0x40, 0x47, 0x47, 0xc7, 0x5e, 0x5d, 0xd7, 0x6f, 0x15, 0xbe, 0x61,
|
||||
0x1b, 0x81, 0xa2, 0x28, 0x0b, 0x7f, 0x01, 0x15, 0x0c, 0xa7, 0xd1, 0x9f, 0xd3, 0xfe, 0xa7, 0x00,
|
||||
0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE module_name_filtered_list_xpm[1] = {{ png, sizeof( png ), "module_name_filtered_list_xpm" }};
|
||||
|
||||
//EOF
|
|
@ -0,0 +1,162 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
height="26"
|
||||
width="26"
|
||||
version="1.1"
|
||||
viewBox="0 0 26 26"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="module_name_filtered_list.svg">
|
||||
<metadata
|
||||
id="metadata100">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by/3.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by/3.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1267"
|
||||
inkscape:window-height="751"
|
||||
id="namedview98"
|
||||
showgrid="true"
|
||||
inkscape:zoom="33.560376"
|
||||
inkscape:cx="5.98956"
|
||||
inkscape:cy="6.5381667"
|
||||
inkscape:window-x="395"
|
||||
inkscape:window-y="82"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg2"
|
||||
inkscape:snap-to-guides="false"
|
||||
inkscape:snap-grids="false">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid3048"
|
||||
empspacing="1"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true" />
|
||||
</sodipodi:namedview>
|
||||
<defs
|
||||
id="defs4" />
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#545454;stroke-width:0.97711289000000001;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
transform="matrix(0,-1,1,0,0,0)"
|
||||
height="22.924355"
|
||||
width="14.08869"
|
||||
y="1.4947493"
|
||||
x="-20.593565"
|
||||
id="rect51" />
|
||||
<path
|
||||
style="fill:none;stroke:#545454;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 0.98623924,11.082126 a 2.2240581,1.9589449 0 1 1 0.0137601,3.917871"
|
||||
id="path53" />
|
||||
<g
|
||||
id="g3983">
|
||||
<rect
|
||||
id="rect73"
|
||||
x="-8.5317764"
|
||||
y="4.5123401"
|
||||
width="6.0590835"
|
||||
height="4.0659709"
|
||||
transform="matrix(0,-1,1,0,0,0)"
|
||||
style="fill:#00c921;stroke:#545454;stroke-width:0.93241322000000004;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1;stroke-opacity:1" />
|
||||
<rect
|
||||
id="rect73-5"
|
||||
x="-8.5076618"
|
||||
y="11.451617"
|
||||
width="6.0590835"
|
||||
height="4.0659709"
|
||||
transform="matrix(0,-1,1,0,0,0)"
|
||||
style="fill:#00c921;fill-opacity:1;stroke:#545454;stroke-width:0.93241322;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<rect
|
||||
id="rect73-56"
|
||||
x="-8.5498009"
|
||||
y="18.488895"
|
||||
width="6.0590835"
|
||||
height="4.0659709"
|
||||
transform="matrix(0,-1,1,0,0,0)"
|
||||
style="fill:#00c921;fill-opacity:1;stroke:#545454;stroke-width:0.93241322;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
</g>
|
||||
<g
|
||||
transform="translate(0.05384896,16.090848)"
|
||||
id="g3983-1">
|
||||
<rect
|
||||
id="rect73-0"
|
||||
x="-8.5317764"
|
||||
y="4.5123401"
|
||||
width="6.0590835"
|
||||
height="4.0659709"
|
||||
transform="matrix(0,-1,1,0,0,0)"
|
||||
style="fill:#00c921;fill-opacity:1;stroke:#545454;stroke-width:0.93241322;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<rect
|
||||
id="rect73-5-4"
|
||||
x="-8.5076618"
|
||||
y="11.451617"
|
||||
width="6.0590835"
|
||||
height="4.0659709"
|
||||
transform="matrix(0,-1,1,0,0,0)"
|
||||
style="fill:#00c921;fill-opacity:1;stroke:#545454;stroke-width:0.93241322;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<rect
|
||||
id="rect73-56-9"
|
||||
x="-8.5498009"
|
||||
y="18.488895"
|
||||
width="6.0590835"
|
||||
height="4.0659709"
|
||||
transform="matrix(0,-1,1,0,0,0)"
|
||||
style="fill:#00c921;fill-opacity:1;stroke:#545454;stroke-width:0.93241322;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:#f9f9f9;stroke:#808080;stroke-width:0.99121374;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 12.500122,13.492781 12.961754,0 0,11.985901 -12.961754,0 c 0,-3.9953 0,-7.990602 0,-11.985901 z"
|
||||
id="rect3938"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
style="opacity:0.92000002;fill:none;stroke:#333333;stroke-width:2.25878382;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 15.158618,22.826969 5.439219,-3.188993"
|
||||
id="path3943-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="opacity:0.92000002;fill:none;stroke:#333333;stroke-width:2.25878382;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 20.538241,19.430106 15.099022,16.241113"
|
||||
id="path3943-2-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
</svg>
|
After Width: | Height: | Size: 6.0 KiB |
|
@ -224,7 +224,6 @@ void BITMAP_BASE::DrawBitmap( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
|
|||
wxSize size = GetSize();
|
||||
|
||||
// This fixes a bug in OSX that should be fixed in the 3.0.3 version or later.
|
||||
// See: http://trac.wxwidgets.org/ticket/16329 for more information.
|
||||
if( ( size.x == 0 ) || ( size.y == 0 ) )
|
||||
return;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2004-2015 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2004-2016 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
|
||||
|
@ -1076,6 +1076,7 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
|
|||
|
||||
// Transfer EDA_DRAW_PANEL settings
|
||||
GetGalCanvas()->GetViewControls()->EnableCursorWarping( !m_canvas->GetEnableZoomNoCenter() );
|
||||
GetGalCanvas()->GetViewControls()->EnableMousewheelPan( m_canvas->GetEnableMousewheelPan() );
|
||||
GetToolManager()->RunAction( "pcbnew.Control.switchCursor" );
|
||||
}
|
||||
else if( m_galCanvasActive )
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 2007-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -48,6 +48,7 @@ static const int CURSOR_SIZE = 12; ///< Cursor size in pixels
|
|||
|
||||
// keys to store options in config:
|
||||
#define ENBL_ZOOM_NO_CENTER_KEY wxT( "ZoomNoCenter" )
|
||||
#define ENBL_MOUSEWHEEL_PAN_KEY wxT( "MousewheelPAN" )
|
||||
#define ENBL_MIDDLE_BUTT_PAN_KEY wxT( "MiddleButtonPAN" )
|
||||
#define MIDDLE_BUTT_PAN_LIMITED_KEY wxT( "MiddleBtnPANLimited" )
|
||||
#define ENBL_AUTO_PAN_KEY wxT( "AutoPAN" )
|
||||
|
@ -96,11 +97,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
|
|||
{
|
||||
wxASSERT( parent );
|
||||
|
||||
#ifndef USE_OSX_MAGNIFY_EVENT
|
||||
ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS );
|
||||
#else
|
||||
ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
|
||||
#endif
|
||||
DisableKeyboardScrolling();
|
||||
|
||||
m_scrollIncrementX = std::min( size.x / 8, 10 );
|
||||
|
@ -117,6 +114,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
|
|||
m_ClipBox.SetY( 0 );
|
||||
m_canStartBlock = -1; // Command block can start if >= 0
|
||||
m_abortRequest = false;
|
||||
m_enableMousewheelPan = false;
|
||||
m_enableMiddleButtonPan = true;
|
||||
m_enableZoomNoCenter = false;
|
||||
m_panScrollbarLimits = false;
|
||||
|
@ -131,6 +129,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
|
|||
|
||||
if( cfg )
|
||||
{
|
||||
cfg->Read( ENBL_MOUSEWHEEL_PAN_KEY, &m_enableMousewheelPan, false );
|
||||
cfg->Read( ENBL_MIDDLE_BUTT_PAN_KEY, &m_enableMiddleButtonPan, true );
|
||||
cfg->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false );
|
||||
cfg->Read( MIDDLE_BUTT_PAN_LIMITED_KEY, &m_panScrollbarLimits, false );
|
||||
|
@ -160,6 +159,7 @@ EDA_DRAW_PANEL::~EDA_DRAW_PANEL()
|
|||
|
||||
if( cfg )
|
||||
{
|
||||
cfg->Write( ENBL_MOUSEWHEEL_PAN_KEY, m_enableMousewheelPan );
|
||||
cfg->Write( ENBL_MIDDLE_BUTT_PAN_KEY, m_enableMiddleButtonPan );
|
||||
cfg->Write( ENBL_ZOOM_NO_CENTER_KEY, m_enableZoomNoCenter );
|
||||
cfg->Write( MIDDLE_BUTT_PAN_LIMITED_KEY, m_panScrollbarLimits );
|
||||
|
@ -432,7 +432,7 @@ void EDA_DRAW_PANEL::OnScroll( wxScrollWinEvent& event )
|
|||
// so we skip these events.
|
||||
// Note they are here just in case, because they are not actually used
|
||||
// in Kicad
|
||||
#if wxCHECK_VERSION( 3, 1, 0 ) || !wxCHECK_VERSION( 2, 9, 5 ) || !defined (__WINDOWS__)
|
||||
#if wxCHECK_VERSION( 3, 1, 0 ) || !wxCHECK_VERSION( 2, 9, 5 ) || ( !defined (__WINDOWS__) && !defined (__WXMAC__) )
|
||||
int maxX = unitsX - csizeX;
|
||||
int maxY = unitsY - csizeY;
|
||||
|
||||
|
@ -643,6 +643,15 @@ void EDA_DRAW_PANEL::ReDraw( wxDC* DC, bool erasebg )
|
|||
}
|
||||
|
||||
|
||||
void EDA_DRAW_PANEL::SetEnableMousewheelPan( bool aEnable )
|
||||
{
|
||||
m_enableMousewheelPan = aEnable;
|
||||
|
||||
if( GetParent()->IsGalCanvasActive() )
|
||||
GetParent()->GetGalCanvas()->GetViewControls()->EnableMousewheelPan( aEnable );
|
||||
}
|
||||
|
||||
|
||||
void EDA_DRAW_PANEL::SetEnableZoomNoCenter( bool aEnable )
|
||||
{
|
||||
m_enableZoomNoCenter = aEnable;
|
||||
|
@ -954,9 +963,21 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
|
|||
offCenterReq = offCenterReq || m_enableZoomNoCenter;
|
||||
|
||||
int axis = event.GetWheelAxis();
|
||||
int wheelRotation = event.GetWheelRotation();
|
||||
|
||||
// This is a zoom in or out command
|
||||
if( event.GetWheelRotation() > 0 )
|
||||
if( m_enableMousewheelPan )
|
||||
{
|
||||
wxPoint newStart = GetViewStart();
|
||||
if( axis == wxMOUSE_WHEEL_HORIZONTAL )
|
||||
newStart.x += wheelRotation;
|
||||
else
|
||||
newStart.y -= wheelRotation;
|
||||
|
||||
wxPoint center = GetScreenCenterLogicalPosition();
|
||||
GetParent()->SetScrollCenterPosition( center );
|
||||
Scroll( newStart );
|
||||
}
|
||||
else if( wheelRotation > 0 )
|
||||
{
|
||||
if( event.ShiftDown() && !event.ControlDown() )
|
||||
{
|
||||
|
@ -972,7 +993,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
|
|||
else
|
||||
cmd.SetId( ID_POPUP_ZOOM_IN );
|
||||
}
|
||||
else if( event.GetWheelRotation() < 0 )
|
||||
else if( wheelRotation < 0 )
|
||||
{
|
||||
if( event.ShiftDown() && !event.ControlDown() )
|
||||
{
|
||||
|
@ -989,7 +1010,8 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
|
|||
cmd.SetId( ID_POPUP_ZOOM_OUT );
|
||||
}
|
||||
|
||||
GetEventHandler()->ProcessEvent( cmd );
|
||||
if( cmd.GetId() )
|
||||
GetEventHandler()->ProcessEvent( cmd );
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
*
|
||||
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
|
||||
* Copyright (C) 2013-2015 CERN
|
||||
* Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
|
@ -96,20 +98,31 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
|
|||
{
|
||||
const double wheelPanSpeed = 0.001;
|
||||
|
||||
if( aEvent.ControlDown() || aEvent.ShiftDown() )
|
||||
if( aEvent.ControlDown() || aEvent.ShiftDown() || m_enableMousewheelPan )
|
||||
{
|
||||
// Scrolling
|
||||
VECTOR2D scrollVec = m_view->ToWorld( m_view->GetScreenPixelSize(), false ) *
|
||||
( (double) aEvent.GetWheelRotation() * wheelPanSpeed );
|
||||
double scrollSpeed;
|
||||
int axis = aEvent.GetWheelAxis();
|
||||
double scrollX = 0.0;
|
||||
double scrollY = 0.0;
|
||||
|
||||
if( std::abs( scrollVec.x ) > std::abs( scrollVec.y ) )
|
||||
scrollSpeed = scrollVec.x;
|
||||
if ( m_enableMousewheelPan )
|
||||
{
|
||||
if ( axis == wxMOUSE_WHEEL_HORIZONTAL )
|
||||
scrollX = scrollVec.x;
|
||||
else
|
||||
scrollY = -scrollVec.y;
|
||||
}
|
||||
else
|
||||
scrollSpeed = scrollVec.y;
|
||||
{
|
||||
if ( aEvent.ControlDown() )
|
||||
scrollX = -scrollVec.x;
|
||||
else
|
||||
scrollY = -scrollVec.y;
|
||||
}
|
||||
|
||||
VECTOR2D delta( aEvent.ControlDown() ? -scrollSpeed : 0.0,
|
||||
aEvent.ShiftDown() ? -scrollSpeed : 0.0 );
|
||||
VECTOR2D delta( scrollX, scrollY );
|
||||
|
||||
m_view->SetCenter( m_view->GetCenter() + delta );
|
||||
}
|
||||
|
@ -121,7 +134,7 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
|
|||
int rotation = aEvent.GetWheelRotation();
|
||||
double zoomScale;
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __WXMAC__
|
||||
// The following is to support Apple pointer devices (MagicMouse &
|
||||
// Macbook touchpad), which send events more frequently, but with smaller
|
||||
// wheel rotation.
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
# the map generation creates on Windows/gcc a lot of useless warnings
|
||||
# so disable it on windows
|
||||
if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
|
||||
set( MAKE_LINK_MAPS false )
|
||||
else()
|
||||
set( MAKE_LINK_MAPS true )
|
||||
endif()
|
||||
|
||||
add_definitions( -DCVPCB )
|
||||
|
||||
include_directories( BEFORE ${INC_BEFORE} )
|
||||
|
@ -137,6 +129,7 @@ add_library( cvpcb_kiface MODULE
|
|||
${CVPCB_SRCS}
|
||||
${CVPCB_DIALOGS}
|
||||
)
|
||||
|
||||
set_target_properties( cvpcb_kiface PROPERTIES
|
||||
OUTPUT_NAME cvpcb
|
||||
PREFIX ${KIFACE_PREFIX}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#include <cvpcb.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <autosel.h>
|
||||
|
||||
#define QUOTE '\''
|
||||
|
@ -215,7 +215,7 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
|
|||
if( equivItem.m_ComponentValue.CmpNoCase( component->GetValue() ) != 0 )
|
||||
continue;
|
||||
|
||||
const FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( equivItem.m_FootprintFPID );
|
||||
const FOOTPRINT_INFO *module = m_FootprintsList.GetModuleInfo( equivItem.m_FootprintFPID );
|
||||
|
||||
bool equ_is_unique = true;
|
||||
unsigned next = idx+1;
|
||||
|
@ -277,7 +277,7 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
|
|||
{
|
||||
// we do not need to analyze wildcards: single footprint do not
|
||||
// contain them and if there are wildcards it just will not match any
|
||||
const FOOTPRINT_INFO* module = m_footprints.GetModuleInfo( component->GetFootprintFilters()[0] );
|
||||
const FOOTPRINT_INFO* module = m_FootprintsList.GetModuleInfo( component->GetFootprintFilters()[0] );
|
||||
|
||||
if( module )
|
||||
SetNewPkg( component->GetFootprintFilters()[0] );
|
||||
|
|
|
@ -52,9 +52,6 @@ PARAM_CFG_ARRAY& CVPCB_MAINFRAME::GetProjectFileParameters()
|
|||
m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST(
|
||||
wxT( "EquName" ), &m_EquFilesNames, GROUP_CVP_EQU ) );
|
||||
|
||||
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING(
|
||||
wxT( "NetIExt" ), &m_NetlistFileExtension ) );
|
||||
|
||||
return m_projectFileParams;
|
||||
}
|
||||
|
||||
|
@ -67,16 +64,12 @@ void CVPCB_MAINFRAME::LoadProjectFile()
|
|||
m_EquFilesNames.Clear();
|
||||
|
||||
prj.ConfigLoad( Kiface().KifaceSearch(), GROUP_CVP, GetProjectFileParameters() );
|
||||
|
||||
if( m_NetlistFileExtension.IsEmpty() )
|
||||
m_NetlistFileExtension = wxT( "net" );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::SaveProjectFile( wxCommandEvent& aEvent )
|
||||
void CVPCB_MAINFRAME::SaveProjectFile()
|
||||
{
|
||||
PROJECT& prj = Prj();
|
||||
SetTitle( wxString::Format( _( "Project file: '%s'" ), GetChars( prj.GetProjectFullName() ) ) );
|
||||
wxFileName fn = prj.GetProjectFullName();
|
||||
|
||||
if( !IsWritable( fn ) )
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <cvpcb_mainframe.h>
|
||||
#include <class_DisplayFootprintsFrame.h>
|
||||
#include <cvpcb_id.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
|
||||
#include <3d_viewer.h>
|
||||
|
||||
|
@ -487,7 +487,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
|||
|
||||
CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
|
||||
|
||||
wxString footprintName = parentframe->m_footprintListBox->GetSelectedFootprint();
|
||||
wxString footprintName = parentframe->GetSelectedFootprint();
|
||||
|
||||
if( !footprintName.IsEmpty() )
|
||||
{
|
||||
|
@ -495,7 +495,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
|||
|
||||
SetTitle( msg );
|
||||
const FOOTPRINT_INFO* module_info =
|
||||
parentframe->m_footprints.GetModuleInfo( footprintName );
|
||||
parentframe->m_FootprintsList.GetModuleInfo( footprintName );
|
||||
|
||||
const wxChar* libname;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include <cvpcb.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <cvpcb_id.h>
|
||||
|
||||
|
||||
|
|
|
@ -29,14 +29,12 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <wxstruct.h>
|
||||
#include <macros.h>
|
||||
#include <pgm_base.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
#include <cvpcb.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <cvpcb_id.h>
|
||||
#include <eda_pattern_match.h>
|
||||
|
||||
|
||||
FOOTPRINTS_LISTBOX::FOOTPRINTS_LISTBOX( CVPCB_MAINFRAME* parent,
|
||||
|
@ -127,18 +125,23 @@ void FOOTPRINTS_LISTBOX::SetSelection( int index, bool State )
|
|||
|
||||
|
||||
void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& aLibName,
|
||||
COMPONENT* aComponent, int aFilterType )
|
||||
COMPONENT* aComponent,
|
||||
const wxString &aFootPrintFilterPattern,
|
||||
int aFilterType )
|
||||
{
|
||||
wxArrayString newList;
|
||||
wxString msg;
|
||||
wxString oldSelection;
|
||||
|
||||
EDA_PATTERN_MATCH_WILDCARD patternFilter;
|
||||
patternFilter.SetPattern( aFootPrintFilterPattern.Lower() ); // Use case insensitive search
|
||||
|
||||
if( GetSelection() >= 0 && GetSelection() < (int)m_footprintList.GetCount() )
|
||||
oldSelection = m_footprintList[ GetSelection() ];
|
||||
|
||||
for( unsigned ii = 0; ii < aList.GetCount(); ii++ )
|
||||
{
|
||||
if( aFilterType == UNFILTERED )
|
||||
if( aFilterType == UNFILTERED_FP_LIST )
|
||||
{
|
||||
msg.Printf( wxT( "%3d %s:%s" ), int( newList.GetCount() + 1 ),
|
||||
GetChars( aList.GetItem( ii ).GetNickname() ),
|
||||
|
@ -147,18 +150,31 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
|
|||
continue;
|
||||
}
|
||||
|
||||
if( (aFilterType & BY_LIBRARY) && !aLibName.IsEmpty()
|
||||
&& !aList.GetItem( ii ).InLibrary( aLibName ) )
|
||||
if( (aFilterType & FILTERING_BY_LIBRARY) && !aLibName.IsEmpty()
|
||||
&& !aList.GetItem( ii ).InLibrary( aLibName ) )
|
||||
continue;
|
||||
|
||||
if( (aFilterType & BY_COMPONENT) && aComponent
|
||||
&& !aComponent->MatchesFootprintFilters( aList.GetItem( ii ).GetFootprintName() ) )
|
||||
if( (aFilterType & FILTERING_BY_COMPONENT_KEYWORD) && aComponent
|
||||
&& !aComponent->MatchesFootprintFilters( aList.GetItem( ii ).GetFootprintName() ) )
|
||||
continue;
|
||||
|
||||
if( (aFilterType & BY_PIN_COUNT) && aComponent
|
||||
&& aComponent->GetNetCount() != aList.GetItem( ii ).GetUniquePadCount() )
|
||||
if( (aFilterType & FILTERING_BY_PIN_COUNT) && aComponent
|
||||
&& aComponent->GetNetCount() != aList.GetItem( ii ).GetUniquePadCount() )
|
||||
continue;
|
||||
|
||||
// We can search (Using case insensitive search) in full FPID or only
|
||||
// in the fp name itself.
|
||||
// After tests, only in the fp name itself looks better.
|
||||
// However, the code to take in account the nickname is just commented, no removed.
|
||||
wxString currname = //aList.GetItem( ii ).GetNickname().Lower() + ":" +
|
||||
aList.GetItem( ii ).GetFootprintName().Lower();
|
||||
|
||||
if( (aFilterType & FILTERING_BY_NAME) && !aFootPrintFilterPattern.IsEmpty()
|
||||
&& patternFilter.Find( currname ) == EDA_PATTERN_NOT_FOUND )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
msg.Printf( wxT( "%3d %s:%s" ), int( newList.GetCount() + 1 ),
|
||||
GetChars( aList.GetItem( ii ).GetNickname() ),
|
||||
GetChars( aList.GetItem( ii ).GetFootprintName() ) );
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include <cvpcb.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <cvpcb_id.h>
|
||||
|
||||
|
||||
|
|
|
@ -53,8 +53,10 @@ enum id_cvpcb_frm
|
|||
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
|
||||
ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
|
||||
ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
|
||||
ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
|
||||
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
|
||||
ID_CVPCB_LIBRARY_LIST,
|
||||
ID_CVPCB_EQUFILES_LIST_EDIT,
|
||||
ID_CVPCB_LIB_TABLE_EDIT
|
||||
ID_CVPCB_LIB_TABLE_EDIT,
|
||||
ID_CVPCB_FILTER_TEXT_EDIT
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <cvpcb.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <invoke_pcb_dialog.h>
|
||||
#include <class_DisplayFootprintsFrame.h>
|
||||
#include <cvpcb_id.h>
|
||||
|
@ -66,7 +66,6 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER )
|
|||
EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
|
||||
EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
|
||||
EVT_MENU( wxID_ABOUT, CVPCB_MAINFRAME::GetKicadAbout )
|
||||
EVT_MENU( ID_SAVE_PROJECT, CVPCB_MAINFRAME::SaveProjectFile )
|
||||
EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, CVPCB_MAINFRAME::OnConfigurePaths )
|
||||
EVT_MENU( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnKeepOpenOnSave )
|
||||
EVT_MENU( ID_CVPCB_EQUFILES_LIST_EDIT, CVPCB_MAINFRAME::OnEditEquFilesList )
|
||||
|
@ -87,12 +86,21 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER )
|
|||
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
|
||||
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
|
||||
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
|
||||
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
|
||||
CVPCB_MAINFRAME::OnSelectFilteringFootprint )
|
||||
EVT_TEXT( ID_CVPCB_FILTER_TEXT_EDIT, CVPCB_MAINFRAME::OnEnterFilteringText )
|
||||
|
||||
// Frame events
|
||||
EVT_CLOSE( CVPCB_MAINFRAME::OnCloseWindow )
|
||||
EVT_SIZE( CVPCB_MAINFRAME::OnSize )
|
||||
|
||||
// UI event handlers
|
||||
EVT_UPDATE_UI( ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE, CVPCB_MAINFRAME::OnUpdateKeepOpenOnSave )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, CVPCB_MAINFRAME::OnFilterFPbyKeywords)
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, CVPCB_MAINFRAME::OnFilterFPbyPinCount )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, CVPCB_MAINFRAME::OnFilterFPbyLibrary )
|
||||
EVT_UPDATE_UI( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME, CVPCB_MAINFRAME::OnFilterFPbyKeyName )
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
@ -108,11 +116,11 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_libListBox = NULL;
|
||||
m_mainToolBar = NULL;
|
||||
m_modified = false;
|
||||
m_isEESchemaNetlist = false;
|
||||
m_KeepCvpcbOpen = false;
|
||||
m_keepCvpcbOpen = false;
|
||||
m_undefinedComponentCnt = 0;
|
||||
m_skipComponentSelect = false;
|
||||
m_NetlistFileExtension = wxT( "net" );
|
||||
m_filteringOptions = 0;
|
||||
m_tcFilterString = NULL;
|
||||
|
||||
/* Name of the document footprint list
|
||||
* usually located in share/modules/footprints_doc
|
||||
|
@ -199,9 +207,10 @@ void CVPCB_MAINFRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
{
|
||||
EDA_BASE_FRAME::LoadSettings( aCfg );
|
||||
|
||||
aCfg->Read( KeepCvpcbOpenEntry, &m_KeepCvpcbOpen, true );
|
||||
aCfg->Read( KeepCvpcbOpenEntry, &m_keepCvpcbOpen, true );
|
||||
aCfg->Read( FootprintDocFileEntry, &m_DocModulesFileName,
|
||||
DEFAULT_FOOTPRINTS_LIST_FILENAME );
|
||||
aCfg->Read( FILTERFOOTPRINTKEY, &m_filteringOptions, FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST );
|
||||
}
|
||||
|
||||
|
||||
|
@ -209,21 +218,9 @@ void CVPCB_MAINFRAME::SaveSettings( wxConfigBase* aCfg )
|
|||
{
|
||||
EDA_BASE_FRAME::SaveSettings( aCfg );
|
||||
|
||||
aCfg->Write( KeepCvpcbOpenEntry, m_KeepCvpcbOpen );
|
||||
aCfg->Write( KeepCvpcbOpenEntry, m_keepCvpcbOpen );
|
||||
aCfg->Write( FootprintDocFileEntry, m_DocModulesFileName );
|
||||
|
||||
int state = 0;
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
|
||||
state |= FOOTPRINTS_LISTBOX::BY_COMPONENT;
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST ) )
|
||||
state |= FOOTPRINTS_LISTBOX::BY_PIN_COUNT;
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST ) )
|
||||
state |= FOOTPRINTS_LISTBOX::BY_LIBRARY;
|
||||
|
||||
aCfg->Write( wxT( FILTERFOOTPRINTKEY ), state );
|
||||
aCfg->Write( FILTERFOOTPRINTKEY, m_filteringOptions );
|
||||
}
|
||||
|
||||
|
||||
|
@ -256,7 +253,7 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
break;
|
||||
|
||||
case wxID_YES:
|
||||
SaveEdits();
|
||||
SaveFootprintAssociation();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -359,11 +356,11 @@ void CVPCB_MAINFRAME::ToPreviousNA( wxCommandEvent& event )
|
|||
|
||||
void CVPCB_MAINFRAME::SaveQuitCvpcb( wxCommandEvent& aEvent )
|
||||
{
|
||||
SaveEdits();
|
||||
SaveFootprintAssociation();
|
||||
|
||||
m_modified = false;
|
||||
|
||||
if( !m_KeepCvpcbOpen )
|
||||
if( !m_keepCvpcbOpen )
|
||||
Close( true );
|
||||
}
|
||||
|
||||
|
@ -397,36 +394,6 @@ void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/* Remove in favor of Kiway messaging method of sending netlist
|
||||
void CVPCB_MAINFRAME::LoadNetList( wxCommandEvent& event )
|
||||
{
|
||||
int id = event.GetId();
|
||||
wxFileName newFileName;
|
||||
|
||||
if( id >= wxID_FILE1 && id <= wxID_FILE9 )
|
||||
{
|
||||
newFileName = GetFileFromHistory( id, _( "Netlist" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxFileDialog dlg( this, _( "Open Net List" ), wxGetCwd(),
|
||||
wxEmptyString, NetlistFileWildcard,
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
newFileName = dlg.GetPath();
|
||||
}
|
||||
|
||||
if( newFileName == m_NetlistFileName )
|
||||
return;
|
||||
|
||||
OpenProjectFiles( std::vector<wxString>( 1, newFileName.GetFullPath() ) );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
bool CVPCB_MAINFRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
|
||||
{
|
||||
return true;
|
||||
|
@ -481,14 +448,14 @@ void CVPCB_MAINFRAME::OnEditFootprintLibraryTable( wxCommandEvent& aEvent )
|
|||
if( tableChanged )
|
||||
{
|
||||
BuildLIBRARY_LISTBOX();
|
||||
m_footprints.ReadFootprintFiles( Prj().PcbFootprintLibs() );
|
||||
m_FootprintsList.ReadFootprintFiles( Prj().PcbFootprintLibs() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnKeepOpenOnSave( wxCommandEvent& event )
|
||||
{
|
||||
m_KeepCvpcbOpen = event.IsChecked();
|
||||
m_keepCvpcbOpen = event.IsChecked();
|
||||
}
|
||||
|
||||
|
||||
|
@ -511,22 +478,18 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
|||
return;
|
||||
|
||||
wxString libraryName;
|
||||
COMPONENT* component = NULL;
|
||||
int filter = FOOTPRINTS_LISTBOX::UNFILTERED;
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
|
||||
filter |= FOOTPRINTS_LISTBOX::BY_COMPONENT;
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST ) )
|
||||
filter |= FOOTPRINTS_LISTBOX::BY_PIN_COUNT;
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST ) )
|
||||
filter |= FOOTPRINTS_LISTBOX::BY_LIBRARY;
|
||||
|
||||
component = GetSelectedComponent();
|
||||
COMPONENT* component = GetSelectedComponent();
|
||||
libraryName = m_libListBox->GetSelectedLibrary();
|
||||
m_footprintListBox->SetFootprints( m_footprints, libraryName, component, filter );
|
||||
|
||||
m_footprintListBox->SetFootprints( m_FootprintsList, libraryName, component,
|
||||
m_currentSearchPattern, m_filteringOptions);
|
||||
|
||||
refreshAfterComponentSearch (component);
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::refreshAfterComponentSearch( COMPONENT* component )
|
||||
{
|
||||
// Tell AuiMgr that objects are changed !
|
||||
if( m_auimgr.GetManagedWindow() ) // Be sure Aui Manager is initialized
|
||||
// (could be not the case when starting CvPcb
|
||||
|
@ -580,18 +543,82 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
|||
DisplayStatus();
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnSelectFilteringFootprint( wxCommandEvent& event )
|
||||
{
|
||||
wxListEvent l_event;
|
||||
int option = 0;
|
||||
|
||||
switch( event.GetId() )
|
||||
{
|
||||
case ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST:
|
||||
option = FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD;
|
||||
break;
|
||||
|
||||
case ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST:
|
||||
option = FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT;
|
||||
break;
|
||||
|
||||
case ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST:
|
||||
option = FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY;
|
||||
break;
|
||||
|
||||
case ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME:
|
||||
m_currentSearchPattern = m_tcFilterString->GetValue();
|
||||
option = FOOTPRINTS_LISTBOX::FILTERING_BY_NAME;
|
||||
break;
|
||||
}
|
||||
|
||||
if( event.IsChecked() )
|
||||
m_filteringOptions |= option;
|
||||
else
|
||||
m_filteringOptions &= ~option;
|
||||
|
||||
wxListEvent l_event;
|
||||
OnSelectComponent( l_event );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Check( m_KeepCvpcbOpen );
|
||||
event.Check( m_keepCvpcbOpen );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnFilterFPbyKeywords( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Check( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnFilterFPbyPinCount( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Check( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnFilterFPbyLibrary( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Check( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnFilterFPbyKeyName( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Check( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_NAME );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
|
||||
{
|
||||
// Called when changing the filter string in main toolbar.
|
||||
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_NAME is set, update the list of
|
||||
// available footprints which match the filter
|
||||
|
||||
m_currentSearchPattern = m_tcFilterString->GetValue();
|
||||
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_NAME ) == 0 )
|
||||
return;
|
||||
|
||||
OnSelectFilteringFootprint( aEvent );
|
||||
}
|
||||
|
||||
|
||||
|
@ -627,9 +654,9 @@ void CVPCB_MAINFRAME::DisplayStatus()
|
|||
}
|
||||
else
|
||||
{
|
||||
wxString footprintName = m_footprintListBox->GetSelectedFootprint();
|
||||
wxString footprintName = GetSelectedFootprint();
|
||||
|
||||
FOOTPRINT_INFO* module = m_footprints.GetModuleInfo( footprintName );
|
||||
FOOTPRINT_INFO* module = m_FootprintsList.GetModuleInfo( footprintName );
|
||||
|
||||
if( module ) // can be NULL if no netlist loaded
|
||||
{
|
||||
|
@ -646,10 +673,10 @@ void CVPCB_MAINFRAME::DisplayStatus()
|
|||
|
||||
if( m_footprintListBox )
|
||||
{
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD ) )
|
||||
filters = _( "key words" );
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST ) )
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT ) )
|
||||
{
|
||||
if( !filters.IsEmpty() )
|
||||
filters += wxT( "+" );
|
||||
|
@ -657,7 +684,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
|
|||
filters += _( "pin count" );
|
||||
}
|
||||
|
||||
if( m_mainToolBar->GetToolToggled( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST ) )
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY ) )
|
||||
{
|
||||
if( !filters.IsEmpty() )
|
||||
filters += wxT( "+" );
|
||||
|
@ -665,6 +692,14 @@ void CVPCB_MAINFRAME::DisplayStatus()
|
|||
filters += _( "library" );
|
||||
}
|
||||
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_NAME ) )
|
||||
{
|
||||
if( !filters.IsEmpty() )
|
||||
filters += wxT( "+" );
|
||||
|
||||
filters += _( "name" );
|
||||
}
|
||||
|
||||
if( filters.IsEmpty() )
|
||||
msg = _( "No filtering" );
|
||||
else
|
||||
|
@ -689,11 +724,11 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles()
|
|||
return false;
|
||||
}
|
||||
|
||||
m_footprints.ReadFootprintFiles( fptbl );
|
||||
m_FootprintsList.ReadFootprintFiles( fptbl );
|
||||
|
||||
if( m_footprints.GetErrorCount() )
|
||||
if( m_FootprintsList.GetErrorCount() )
|
||||
{
|
||||
m_footprints.DisplayErrors( this );
|
||||
m_FootprintsList.DisplayErrors( this );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -821,8 +856,8 @@ void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX()
|
|||
wxFONTWEIGHT_NORMAL ) );
|
||||
}
|
||||
|
||||
m_footprintListBox->SetFootprints( m_footprints, wxEmptyString, NULL,
|
||||
FOOTPRINTS_LISTBOX::UNFILTERED );
|
||||
m_footprintListBox->SetFootprints( m_FootprintsList, wxEmptyString, NULL,
|
||||
wxEmptyString, FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST );
|
||||
DisplayStatus();
|
||||
}
|
||||
|
||||
|
@ -914,6 +949,13 @@ DISPLAY_FOOTPRINTS_FRAME* CVPCB_MAINFRAME::GetFootprintViewerFrame()
|
|||
( wxWindow::FindWindowByName( FOOTPRINTVIEWER_FRAME_NAME ) );
|
||||
}
|
||||
|
||||
const wxString CVPCB_MAINFRAME::GetSelectedFootprint()
|
||||
{
|
||||
// returns the FPID of the selected footprint in footprint listview
|
||||
// or a empty string
|
||||
return m_footprintListBox->GetSelectedFootprint();
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::OnConfigurePaths( wxCommandEvent& aEvent )
|
||||
{
|
||||
|
|
|
@ -58,24 +58,25 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER
|
|||
friend struct CV::IFACE;
|
||||
|
||||
wxArrayString m_footprintListEntries;
|
||||
|
||||
public:
|
||||
bool m_KeepCvpcbOpen;
|
||||
wxString m_currentSearchPattern;
|
||||
bool m_keepCvpcbOpen;
|
||||
NETLIST m_netlist;
|
||||
int m_filteringOptions;
|
||||
wxAuiToolBar* m_mainToolBar;
|
||||
FOOTPRINTS_LISTBOX* m_footprintListBox;
|
||||
LIBRARY_LISTBOX* m_libListBox;
|
||||
COMPONENTS_LISTBOX* m_compListBox;
|
||||
wxAuiToolBar* m_mainToolBar;
|
||||
wxTextCtrl* m_tcFilterString;
|
||||
|
||||
public:
|
||||
wxArrayString m_ModuleLibNames;
|
||||
wxArrayString m_EquFilesNames;
|
||||
wxString m_NetlistFileExtension;
|
||||
wxString m_DocModulesFileName;
|
||||
FOOTPRINT_LIST m_footprints;
|
||||
NETLIST m_netlist;
|
||||
FOOTPRINT_LIST m_FootprintsList;
|
||||
|
||||
protected:
|
||||
int m_undefinedComponentCnt;
|
||||
bool m_modified;
|
||||
bool m_isEESchemaNetlist;
|
||||
bool m_skipComponentSelect; // true to skip OnSelectComponent event
|
||||
// (in automatic selection/deletion of associations)
|
||||
PARAM_CFG_ARRAY m_projectFileParams;
|
||||
|
@ -104,11 +105,11 @@ public:
|
|||
void OnSelectComponent( wxListEvent& event );
|
||||
|
||||
/**
|
||||
* Function OnEditFootrprintLibraryTable
|
||||
* Function OnEditFootprintLibraryTable
|
||||
* displays the footprint library table editing dialog and updates the global and local
|
||||
* footprint tables accordingly.
|
||||
*/
|
||||
void OnEditFootrprintLibraryTable( wxCommandEvent& event );
|
||||
void OnEditFootprintLibraryTable( wxCommandEvent& event );
|
||||
|
||||
void OnQuit( wxCommandEvent& event );
|
||||
void OnCloseWindow( wxCloseEvent& Event );
|
||||
|
@ -127,22 +128,8 @@ public:
|
|||
*/
|
||||
void DelAssociations( wxCommandEvent& event );
|
||||
|
||||
void SaveProjectFile( wxCommandEvent& aEvent );
|
||||
void SaveQuitCvpcb( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function LoadNetList
|
||||
* reads a netlist selected by user when clicking on load netlist button or any entry
|
||||
* in the file history menu.
|
||||
*/
|
||||
void LoadNetList( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function OnEditLibraryTable
|
||||
* envokes the footprint library table edit dialog.
|
||||
*/
|
||||
void OnEditFootprintLibraryTable( wxCommandEvent& aEvent );
|
||||
|
||||
void OnConfigurePaths( wxCommandEvent& aEvent );
|
||||
|
||||
/**
|
||||
|
@ -172,7 +159,11 @@ public:
|
|||
*/
|
||||
void OnSelectFilteringFootprint( wxCommandEvent& event );
|
||||
|
||||
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
|
||||
/**
|
||||
* Function OnEnterFilteringText
|
||||
* Is called each time the text of m_tcFilterString is changed.
|
||||
*/
|
||||
void OnEnterFilteringText( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Function SetNewPkg
|
||||
|
@ -193,11 +184,11 @@ public:
|
|||
void CreateScreenCmp();
|
||||
|
||||
/**
|
||||
* Function SaveEdits
|
||||
* Function SaveFootprintAssociation
|
||||
* saves the edits that the user has done by sending them back to eeschema
|
||||
* via the kiway.
|
||||
*/
|
||||
void SaveEdits();
|
||||
void SaveFootprintAssociation();
|
||||
|
||||
/**
|
||||
* Function ReadNetList
|
||||
|
@ -211,10 +202,16 @@ public:
|
|||
|
||||
/**
|
||||
* Function LoadProjectFile
|
||||
* reads the configuration parameter from the project (.pro) file \a aFileName
|
||||
* reads the CvPcb configuration parameter from the project (.pro) file \a aFileName
|
||||
*/
|
||||
void LoadProjectFile();
|
||||
|
||||
/**
|
||||
* Function SaveProjectFile
|
||||
* Saves the CvPcb configuration parameter from the project (.pro) file \a aFileName
|
||||
*/
|
||||
void SaveProjectFile();
|
||||
|
||||
void LoadSettings( wxConfigBase* aCfg ); // override virtual
|
||||
|
||||
void SaveSettings( wxConfigBase* aCfg ); // override virtual
|
||||
|
@ -265,10 +262,9 @@ public:
|
|||
* Function UpdateTitle
|
||||
* sets the main window title bar text.
|
||||
* <p>
|
||||
* If file name defined by CVPCB_MAINFRAME::m_NetlistFileName is not set, the title is
|
||||
* set to the application name appended with no file. Otherwise, the title is set to
|
||||
* the full path and file name and read only is appended to the title if the user does
|
||||
* not have write access to the file.
|
||||
* If no current project open( eeschema run outside kicad manager with no schematic loaded),
|
||||
* the title is set to the application name appended with "no project".
|
||||
* Otherwise, the title shows the project name.
|
||||
*/
|
||||
void UpdateTitle();
|
||||
|
||||
|
@ -282,7 +278,20 @@ public:
|
|||
|
||||
COMPONENT* GetSelectedComponent();
|
||||
|
||||
/**
|
||||
* @return the FPID of the selected footprint in footprint listview
|
||||
* or a empty string if no selection
|
||||
*/
|
||||
const wxString GetSelectedFootprint();
|
||||
|
||||
private:
|
||||
// UI event handlers.
|
||||
// Keep consistent the display state of toggle menus or tools in toolbar
|
||||
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
|
||||
void OnFilterFPbyKeywords( wxUpdateUIEvent& event );
|
||||
void OnFilterFPbyPinCount( wxUpdateUIEvent& event );
|
||||
void OnFilterFPbyLibrary( wxUpdateUIEvent& event );
|
||||
void OnFilterFPbyKeyName( wxUpdateUIEvent& event );
|
||||
|
||||
/**
|
||||
* read the .equ files and populate the list of equvalents
|
||||
|
@ -293,6 +302,8 @@ private:
|
|||
*/
|
||||
int buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages = NULL );
|
||||
|
||||
void refreshAfterComponentSearch (COMPONENT* component);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
|
|
@ -116,12 +116,6 @@ void DIALOG_CONFIG_EQUFILES::OnEditEquFile( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_CONFIG_EQUFILES::OnCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_CONFIG_EQUFILES::OnOkClick( wxCommandEvent& event )
|
||||
{
|
||||
// Save new equ file list if the files list was modified
|
||||
|
@ -134,7 +128,7 @@ void DIALOG_CONFIG_EQUFILES::OnOkClick( wxCommandEvent& event )
|
|||
m_Parent->m_EquFilesNames.Add( m_ListEquiv->GetString( ii ) );
|
||||
|
||||
wxCommandEvent evt( ID_SAVE_PROJECT );
|
||||
m_Parent->SaveProjectFile( evt );
|
||||
m_Parent->SaveProjectFile();
|
||||
}
|
||||
|
||||
EndModal( wxID_OK );
|
||||
|
|
|
@ -46,7 +46,6 @@ private:
|
|||
// Virtual event handlers
|
||||
void OnCloseWindow( wxCloseEvent& event );
|
||||
void OnOkClick( wxCommandEvent& event );
|
||||
void OnCancelClick( wxCommandEvent& event );
|
||||
void OnAddFiles( wxCommandEvent& event );
|
||||
void OnEditEquFile( wxCommandEvent& event );
|
||||
void OnRemoveFiles( wxCommandEvent& event );
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jan 1 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -22,7 +22,7 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi
|
|||
wxBoxSizer* bSizerFlist;
|
||||
bSizerFlist = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_ListEquiv = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
|
||||
m_ListEquiv = new wxListBox( sbEquivChoiceSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
|
||||
m_ListEquiv->SetMinSize( wxSize( 350,-1 ) );
|
||||
|
||||
bSizerFlist->Add( m_ListEquiv, 1, wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
@ -33,21 +33,21 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi
|
|||
wxBoxSizer* bSizerButtons;
|
||||
bSizerButtons = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonAddEqu = new wxButton( this, ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonAddEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonRemoveEqu = new wxButton( this, ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonRemoveEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonRemoveEqu->SetToolTip( _("Unload the selected library") );
|
||||
|
||||
bSizerButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonMoveUp = new wxButton( this, ID_EQU_UP, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonMoveUp = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_UP, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonMoveUp, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonMoveDown = new wxButton( this, ID_EQU_DOWN, _("Move Down"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonMoveDown = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_DOWN, _("Move Down"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonMoveDown, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonEdit = new wxButton( this, wxID_ANY, _("Edit Equ File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonEdit = new wxButton( sbEquivChoiceSizer->GetStaticBox(), wxID_ANY, _("Edit Equ File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonEdit, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@ -132,7 +132,6 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi
|
|||
m_buttonMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveUp ), NULL, this );
|
||||
m_buttonMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveDown ), NULL, this );
|
||||
m_buttonEdit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnEditEquFile ), NULL, this );
|
||||
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnCancelClick ), NULL, this );
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnOkClick ), NULL, this );
|
||||
}
|
||||
|
||||
|
@ -145,7 +144,6 @@ DIALOG_CONFIG_EQUFILES_BASE::~DIALOG_CONFIG_EQUFILES_BASE()
|
|||
m_buttonMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveUp ), NULL, this );
|
||||
m_buttonMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnButtonMoveDown ), NULL, this );
|
||||
m_buttonEdit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnEditEquFile ), NULL, this );
|
||||
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnCancelClick ), NULL, this );
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CONFIG_EQUFILES_BASE::OnOkClick ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
<property name="minimum_size"></property>
|
||||
<property name="name">sbEquivChoiceSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -1093,7 +1094,7 @@
|
|||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnApplyButtonClick"></event>
|
||||
<event name="OnCancelButtonClick">OnCancelClick</event>
|
||||
<event name="OnCancelButtonClick"></event>
|
||||
<event name="OnContextHelpButtonClick"></event>
|
||||
<event name="OnHelpButtonClick"></event>
|
||||
<event name="OnNoButtonClick"></event>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jan 1 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -68,7 +68,6 @@ class DIALOG_CONFIG_EQUFILES_BASE : public DIALOG_SHIM
|
|||
virtual void OnButtonMoveUp( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnButtonMoveDown( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditEquFile( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <common.h>
|
||||
#include <cvpcb.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <class_DisplayFootprintsFrame.h>
|
||||
|
||||
#include <dialog_display_options.h>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include <cvpcb.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <cvpcb_id.h>
|
||||
|
||||
|
||||
|
|
|
@ -90,12 +90,14 @@ private:
|
|||
wxArrayString m_footprintList;
|
||||
|
||||
public:
|
||||
// OR'ed mask to manage footprint filtering options
|
||||
enum FP_FILTER_T
|
||||
{
|
||||
UNFILTERED = 0,
|
||||
BY_COMPONENT = 0x0001,
|
||||
BY_PIN_COUNT = 0x0002,
|
||||
BY_LIBRARY = 0x0004,
|
||||
UNFILTERED_FP_LIST = 0,
|
||||
FILTERING_BY_COMPONENT_KEYWORD = 0x0001,
|
||||
FILTERING_BY_PIN_COUNT = 0x0002,
|
||||
FILTERING_BY_LIBRARY = 0x0004,
|
||||
FILTERING_BY_NAME = 0x0008
|
||||
};
|
||||
|
||||
FOOTPRINTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
|
||||
|
@ -116,10 +118,11 @@ public:
|
|||
* @param aLibName is wxString containing the name of the selected library. Can be
|
||||
* wxEmptyString.
|
||||
* @param aComponent is the #COMPONENT used by the filtering criteria. Can be NULL.
|
||||
* @param aFootPrintFilterPattern = a filter used to filter list by names
|
||||
* @param aFilterType defines the criteria to filter \a aList.
|
||||
*/
|
||||
void SetFootprints( FOOTPRINT_LIST& aList, const wxString& aLibName,
|
||||
COMPONENT* aComponent, int aFilterType );
|
||||
COMPONENT* aComponent, const wxString &aFootPrintFilterPattern, int aFilterType );
|
||||
|
||||
wxString GetSelectedFootprint();
|
||||
|
|
@ -29,8 +29,6 @@
|
|||
#include <fctsys.h>
|
||||
#include <pgm_base.h>
|
||||
#include <kiface_i.h>
|
||||
#include <confirm.h>
|
||||
#include <gestfich.h>
|
||||
#include <menus_helpers.h>
|
||||
|
||||
#include <cvpcb.h>
|
||||
|
@ -45,8 +43,7 @@
|
|||
*/
|
||||
void CVPCB_MAINFRAME::ReCreateMenuBar()
|
||||
{
|
||||
// Create and try to get the current menubar
|
||||
wxMenuItem* item;
|
||||
// Create the current menubar if it does not yet exist
|
||||
wxMenuBar* menuBar = GetMenuBar();
|
||||
|
||||
if( ! menuBar ) // Delete all menus
|
||||
|
@ -66,7 +63,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
|
|||
|
||||
// Save the footprints back into eeschema
|
||||
AddMenuItem( filesMenu, wxID_SAVE,
|
||||
_( "&Save Edits\tCtrl+S" ),
|
||||
_( "&Save Footprint Association\tCtrl+S" ),
|
||||
_( "Save footprint association in schematic component footprint fields" ),
|
||||
KiBitmap( save_xpm ) );
|
||||
|
||||
|
@ -78,7 +75,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
|
|||
_( "&Close" ), _( "Close CvPcb" ),
|
||||
KiBitmap( exit_xpm ) );
|
||||
|
||||
// Menu Preferences:
|
||||
// Preferences Menu :
|
||||
wxMenu* preferencesMenu = new wxMenu;
|
||||
|
||||
AddMenuItem( preferencesMenu, ID_CVPCB_LIB_TABLE_EDIT,
|
||||
|
@ -92,27 +89,24 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
|
|||
_( "Edit path configuration environment variables" ),
|
||||
KiBitmap( editor_xpm ) );
|
||||
|
||||
preferencesMenu->AppendSeparator();
|
||||
AddMenuItem( preferencesMenu, ID_CVPCB_EQUFILES_LIST_EDIT,
|
||||
_( "Edit &Equ Files List" ),
|
||||
_( "Setup equ files list (.equ files)\n"
|
||||
"They are files which give the footprint name from the component value"),
|
||||
KiBitmap( library_table_xpm ) );
|
||||
preferencesMenu->AppendSeparator();
|
||||
|
||||
// Language submenu
|
||||
Pgm().AddMenuLanguageList( preferencesMenu );
|
||||
|
||||
// Keep open on save
|
||||
item = new wxMenuItem( preferencesMenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
|
||||
// Keep open on save data
|
||||
preferencesMenu->AppendSeparator();
|
||||
AddMenuItem( preferencesMenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
|
||||
_( "&Keep Open On Save" ),
|
||||
_( "Prevent CvPcb from exiting after saving netlist file" ),
|
||||
KiBitmap( exit_xpm ),
|
||||
wxITEM_CHECK );
|
||||
preferencesMenu->Append( item );
|
||||
SETBITMAPS( window_close_xpm );
|
||||
|
||||
// Separator
|
||||
preferencesMenu->AppendSeparator();
|
||||
AddMenuItem( preferencesMenu, ID_SAVE_PROJECT,
|
||||
_( "&Save Project File" ), SAVE_HLP_MSG, KiBitmap( save_setup_xpm ) );
|
||||
|
||||
// Menu Help:
|
||||
wxMenu* helpMenu = new wxMenu;
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include <cvpcb.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <cvstruct.h>
|
||||
#include <listview_classes.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <fp_conflict_assignment_selector.h>
|
||||
|
||||
|
@ -368,7 +368,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles( const std::string& aNetlist )
|
|||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::SaveEdits()
|
||||
void CVPCB_MAINFRAME::SaveFootprintAssociation()
|
||||
{
|
||||
STRING_FORMATTER sf;
|
||||
|
||||
|
@ -376,5 +376,5 @@ void CVPCB_MAINFRAME::SaveEdits()
|
|||
|
||||
Kiway().ExpressMail( FRAME_SCH, MAIL_BACKANNOTATE_FOOTPRINTS, sf.GetString() );
|
||||
|
||||
SetStatusText( _("Edits sent to Eeschema") );
|
||||
SetStatusText( _("Footprint association sent to Eeschema") );
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* 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) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2007-2013 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2007-2016 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
|
||||
|
@ -41,8 +41,6 @@
|
|||
|
||||
void CVPCB_MAINFRAME::ReCreateHToolbar()
|
||||
{
|
||||
wxConfigBase* config = Kiface().KifaceSettings();
|
||||
|
||||
if( m_mainToolBar != NULL )
|
||||
return;
|
||||
|
||||
|
@ -89,7 +87,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
|||
KiBitmap( module_filtered_list_xpm ),
|
||||
wxNullBitmap,
|
||||
true, NULL,
|
||||
_( "Filter footprint list by keywords" ),
|
||||
_( "Filter footprint list by schematic components keywords" ),
|
||||
wxEmptyString );
|
||||
|
||||
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
|
||||
|
@ -105,15 +103,17 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
|||
_( "Filter footprint list by library" ),
|
||||
wxEmptyString );
|
||||
|
||||
if( config )
|
||||
{
|
||||
wxString key = wxT( FILTERFOOTPRINTKEY );
|
||||
int opt = config->Read( key, (long) 1 );
|
||||
m_mainToolBar->AddSeparator();
|
||||
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
|
||||
KiBitmap( module_name_filtered_list_xpm ),
|
||||
wxNullBitmap, true, NULL,
|
||||
_( "Filter footprint list using a partial name or a pattern" ),
|
||||
wxEmptyString );
|
||||
|
||||
m_tcFilterString = new wxTextCtrl( m_mainToolBar, ID_CVPCB_FILTER_TEXT_EDIT );
|
||||
|
||||
m_mainToolBar->AddControl( m_tcFilterString );
|
||||
|
||||
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST, opt & 4 );
|
||||
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST, opt & 2 );
|
||||
m_mainToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, opt & 1 );
|
||||
}
|
||||
|
||||
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
|
||||
m_mainToolBar->Realize();
|
||||
|
|
|
@ -1,18 +1,10 @@
|
|||
# the map generation creates on Windows/gcc a lot of useless warnings
|
||||
# so disable it on windows
|
||||
if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
|
||||
set( MAKE_LINK_MAPS false )
|
||||
else()
|
||||
set( MAKE_LINK_MAPS true )
|
||||
endif()
|
||||
|
||||
add_definitions( -DEESCHEMA )
|
||||
|
||||
|
||||
include_directories( BEFORE ${INC_BEFORE} )
|
||||
include_directories(
|
||||
./dialogs
|
||||
./netlist_exporters
|
||||
./widgets
|
||||
../common
|
||||
../common/dialogs
|
||||
${INC_AFTER}
|
||||
|
@ -72,6 +64,8 @@ set( EESCHEMA_DLGS
|
|||
|
||||
set( EESCHEMA_WIDGETS
|
||||
widgets/widget_eeschema_color_config.cpp
|
||||
widgets/pin_shape_combobox.cpp
|
||||
widgets/pin_type_combobox.cpp
|
||||
)
|
||||
|
||||
|
||||
|
@ -137,6 +131,8 @@ set( EESCHEMA_SRCS
|
|||
operations_on_items_lists.cpp
|
||||
pinedit.cpp
|
||||
pin_number.cpp
|
||||
pin_shape.cpp
|
||||
pin_type.cpp
|
||||
plot_schematic_DXF.cpp
|
||||
plot_schematic_HPGL.cpp
|
||||
plot_schematic_PS.cpp
|
||||
|
@ -303,6 +299,7 @@ if( APPLE )
|
|||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT binary
|
||||
)
|
||||
|
||||
install( CODE "
|
||||
# override default embedded path settings
|
||||
${OSX_BUNDLE_OVERRIDE_PATHS}
|
||||
|
|
|
@ -301,7 +301,8 @@ void DIALOG_LABEL_EDITOR::TextPropertiesAccept( wxCommandEvent& aEvent )
|
|||
m_CurrentText->SetSize( wxSize( value, value ) );
|
||||
|
||||
if( m_TextShape )
|
||||
m_CurrentText->SetShape( m_TextShape->GetSelection() );
|
||||
/// @todo move cast to widget
|
||||
m_CurrentText->SetShape( static_cast<PINSHEETLABEL_SHAPE>( m_TextShape->GetSelection() ) );
|
||||
|
||||
int style = m_TextStyle->GetSelection();
|
||||
|
||||
|
|
|
@ -333,6 +333,20 @@ public:
|
|||
return m_checkMiddleButtonPanLimited->GetValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetEnableMousewheelPan
|
||||
* Sets the MousewheelPan setting in the dialog
|
||||
*
|
||||
* @param enable The boolean value to set the AutoPan value in the dialog
|
||||
*/
|
||||
void SetEnableMousewheelPan( bool enable ) { m_checkEnableMousewheelPan->SetValue( enable ); }
|
||||
|
||||
/**
|
||||
* Function GetEnableMousewheelPan
|
||||
* Return the MousewheelPan setting from the dialog
|
||||
*/
|
||||
bool GetEnableMousewheelPan( void ) { return m_checkEnableMousewheelPan->GetValue(); }
|
||||
|
||||
/**
|
||||
* Function SetEnableAutoPan
|
||||
* Sets the AutoPan setting in the dialog
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Mar 28 2015)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -20,18 +20,18 @@ END_EVENT_TABLE()
|
|||
DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* mainSizer;
|
||||
mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bOptionsSizer;
|
||||
bOptionsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_panel5 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer82;
|
||||
bSizer82 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxFlexGridSizer* fgSizer32;
|
||||
fgSizer32 = new wxFlexGridSizer( 0, 3, 0, 0 );
|
||||
fgSizer32->AddGrowableCol( 0 );
|
||||
|
@ -39,89 +39,89 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
|||
fgSizer32->AddGrowableCol( 2 );
|
||||
fgSizer32->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer32->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
|
||||
m_staticText3 = new wxStaticText( m_panel5, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText3->Wrap( -1 );
|
||||
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 );
|
||||
m_choiceGridSize->SetSelection( 0 );
|
||||
fgSizer32->Add( m_choiceGridSize, 0, wxEXPAND|wxALL, 3 );
|
||||
|
||||
|
||||
m_staticGridUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticGridUnits->Wrap( -1 );
|
||||
fgSizer32->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_staticText51 = new wxStaticText( m_panel5, wxID_ANY, _("&Bus thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText51->Wrap( -1 );
|
||||
fgSizer32->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_spinBusWidth = new wxSpinCtrl( m_panel5, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
|
||||
fgSizer32->Add( m_spinBusWidth, 0, wxALL|wxEXPAND, 3 );
|
||||
|
||||
|
||||
m_staticBusWidthUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticBusWidthUnits->Wrap( -1 );
|
||||
fgSizer32->Add( m_staticBusWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_staticText5 = new wxStaticText( m_panel5, wxID_ANY, _("&Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText5->Wrap( -1 );
|
||||
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 );
|
||||
|
||||
|
||||
m_staticLineWidthUnits = new wxStaticText( m_panel5, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticLineWidthUnits->Wrap( -1 );
|
||||
fgSizer32->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_staticText26 = new wxStaticText( m_panel5, wxID_ANY, _("&Part ID notation:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText26->Wrap( -1 );
|
||||
fgSizer32->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 3 );
|
||||
|
||||
|
||||
wxString m_choiceSeparatorRefIdChoices[] = { _("A"), _(".A"), _("-A"), _("_A"), _(".1"), _("-1"), _("_1") };
|
||||
int m_choiceSeparatorRefIdNChoices = sizeof( m_choiceSeparatorRefIdChoices ) / sizeof( wxString );
|
||||
m_choiceSeparatorRefId = new wxChoice( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSeparatorRefIdNChoices, m_choiceSeparatorRefIdChoices, 0 );
|
||||
m_choiceSeparatorRefId->SetSelection( 0 );
|
||||
fgSizer32->Add( m_choiceSeparatorRefId, 0, wxALL|wxEXPAND, 3 );
|
||||
|
||||
|
||||
|
||||
|
||||
fgSizer32->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer82->Add( fgSizer32, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer92;
|
||||
bSizer92 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_staticline3 = new wxStaticLine( m_panel5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizer92->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
m_checkShowGrid = new wxCheckBox( m_panel5, wxID_ANY, _("&Show grid"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer92->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_checkHVOrientation = new wxCheckBox( m_panel5, wxID_ANY, _("&Restrict buses and wires to H and V orientation"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer92->Add( m_checkHVOrientation, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_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, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkPageLimits->SetValue(true);
|
||||
m_checkPageLimits->SetValue(true);
|
||||
bSizer92->Add( m_checkPageLimits, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer82->Add( bSizer92, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
m_panel5->SetSizer( bSizer82 );
|
||||
m_panel5->Layout();
|
||||
bSizer82->Fit( m_panel5 );
|
||||
m_notebook->AddPage( m_panel5, _("Display"), false );
|
||||
m_notebook->AddPage( m_panel5, _("Display"), true );
|
||||
m_panel3 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer8;
|
||||
bSizer8 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxFlexGridSizer* fgSizer3;
|
||||
fgSizer3 = new wxFlexGridSizer( 0, 3, 0, 0 );
|
||||
fgSizer3->AddGrowableCol( 0 );
|
||||
|
@ -129,106 +129,106 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
|||
fgSizer3->AddGrowableCol( 2 );
|
||||
fgSizer3->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
|
||||
m_staticText2 = new wxStaticText( m_panel3, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText2->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
wxArrayString m_choiceUnitsChoices;
|
||||
m_choiceUnits = new wxChoice( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsChoices, 0 );
|
||||
m_choiceUnits->SetSelection( 0 );
|
||||
fgSizer3->Add( m_choiceUnits, 0, wxALL|wxEXPAND, 3 );
|
||||
|
||||
|
||||
|
||||
|
||||
fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 );
|
||||
|
||||
|
||||
m_staticText9 = new wxStaticText( m_panel3, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText9->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticText9, 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 );
|
||||
|
||||
|
||||
m_staticRepeatXUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticRepeatXUnits->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticRepeatXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_staticText12 = new wxStaticText( m_panel3, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText12->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticText12, 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 );
|
||||
|
||||
|
||||
m_staticRepeatYUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticRepeatYUnits->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticRepeatYUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_staticText16 = new wxStaticText( m_panel3, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText16->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticText16, 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 );
|
||||
|
||||
|
||||
|
||||
|
||||
fgSizer3->Add( 0, 0, 1, wxEXPAND, 3 );
|
||||
|
||||
|
||||
m_staticText7 = new wxStaticText( m_panel3, wxID_ANY, _("Def&ault text size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText7->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticText7, 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 );
|
||||
|
||||
|
||||
m_staticTextSizeUnits = new wxStaticText( m_panel3, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextSizeUnits->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_stMaxUndoItems = new wxStaticText( m_panel3, wxID_ANY, _("Ma&ximum undo items:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_stMaxUndoItems->Wrap( -1 );
|
||||
fgSizer3->Add( m_stMaxUndoItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||
|
||||
|
||||
m_spinMaxUndoItems = new wxSpinCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65536, 0 );
|
||||
fgSizer3->Add( m_spinMaxUndoItems, 0, wxALL|wxEXPAND, 3 );
|
||||
|
||||
|
||||
m_staticText22 = new wxStaticText( m_panel3, wxID_ANY, _("(0 = unlimited)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText22->Wrap( -1 );
|
||||
fgSizer3->Add( m_staticText22, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 );
|
||||
|
||||
|
||||
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 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer9;
|
||||
bSizer9 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_staticline2 = new wxStaticLine( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizer9->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
m_checkAutoplaceFields = new wxCheckBox( m_panel3, wxID_ANY, _("A&utomatically place component fields"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer9->Add( m_checkAutoplaceFields, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
|
||||
|
||||
|
||||
m_checkAutoplaceJustify = new wxCheckBox( m_panel3, wxID_ANY, _("A&llow field autoplace to change justification"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer9->Add( m_checkAutoplaceJustify, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
|
||||
|
||||
|
||||
m_checkAutoplaceAlign = new wxCheckBox( m_panel3, wxID_ANY, _("Al&ways align autoplaced fields to the 50 mil grid"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer9->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer8->Add( bSizer9, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
m_panel3->SetSizer( bSizer8 );
|
||||
m_panel3->Layout();
|
||||
bSizer8->Fit( m_panel3 );
|
||||
|
@ -236,7 +236,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
|||
m_tabControls = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer81;
|
||||
bSizer81 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxFlexGridSizer* fgSizer31;
|
||||
fgSizer31 = new wxFlexGridSizer( 0, 3, 0, 0 );
|
||||
fgSizer31->AddGrowableCol( 0 );
|
||||
|
@ -244,51 +244,56 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
|||
fgSizer31->AddGrowableCol( 2 );
|
||||
fgSizer31->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer81->Add( fgSizer31, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_controlsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer13;
|
||||
bSizer13 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
m_staticText20 = new wxStaticText( m_tabControls, wxID_ANY, _("Hotkeys:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText20->Wrap( -1 );
|
||||
bSizer13->Add( m_staticText20, 1, wxALL, 5 );
|
||||
|
||||
|
||||
m_staticText21 = new wxStaticText( m_tabControls, wxID_ANY, _("Double-click to edit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText21->Wrap( -1 );
|
||||
bSizer13->Add( m_staticText21, 0, wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
m_controlsSizer->Add( bSizer13, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_panelHotkeys = new wxPanel( m_tabControls, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_controlsSizer->Add( m_panelHotkeys, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
m_checkEnableZoomCenter = new wxCheckBox( m_tabControls, wxID_ANY, _("Cen&ter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkEnableZoomCenter->SetToolTip( _("Keep the cursor at its current location when zooming") );
|
||||
|
||||
|
||||
m_controlsSizer->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_checkEnableMiddleButtonPan = new wxCheckBox( m_tabControls, xwID_ANY, _("&Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkEnableMiddleButtonPan->SetToolTip( _("Use middle mouse button dragging to pan") );
|
||||
|
||||
|
||||
m_controlsSizer->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_checkMiddleButtonPanLimited = new wxCheckBox( m_tabControls, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkMiddleButtonPanLimited->SetToolTip( _("Middle mouse button panning limited by current scrollbar size") );
|
||||
|
||||
|
||||
m_controlsSizer->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_checkEnableMousewheelPan = new wxCheckBox( m_tabControls, xwID_ANY, _("Use touchpa&d to pan"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkEnableMousewheelPan->SetToolTip( _("Use touchpad to pan canvas") );
|
||||
|
||||
m_controlsSizer->Add( m_checkEnableMousewheelPan, 0, wxLEFT|wxRIGHT|wxTOP, 3 );
|
||||
|
||||
m_checkAutoPan = new wxCheckBox( m_tabControls, wxID_ANY, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_controlsSizer->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer81->Add( m_controlsSizer, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
m_tabControls->SetSizer( bSizer81 );
|
||||
m_tabControls->Layout();
|
||||
bSizer81->Fit( m_tabControls );
|
||||
|
@ -296,33 +301,33 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
|||
m_tabColors = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizer14;
|
||||
bSizer14 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_panelColors = new wxPanel( m_tabColors, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
bSizer14->Add( m_panelColors, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
m_tabColors->SetSizer( bSizer14 );
|
||||
m_tabColors->Layout();
|
||||
bSizer14->Fit( m_tabColors );
|
||||
m_notebook->AddPage( m_tabColors, _("Colors"), true );
|
||||
m_notebook->AddPage( m_tabColors, _("Colors"), false );
|
||||
m_panel2 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_panel2->SetToolTip( _("User defined field names for schematic components. ") );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer6;
|
||||
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer11;
|
||||
bSizer11 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_fieldGrid = new wxGrid( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
|
||||
// Grid
|
||||
m_fieldGrid->CreateGrid( 0, 3 );
|
||||
m_fieldGrid->EnableEditing( true );
|
||||
m_fieldGrid->EnableGridLines( true );
|
||||
m_fieldGrid->EnableDragGridSize( false );
|
||||
m_fieldGrid->SetMargins( 0, 0 );
|
||||
|
||||
|
||||
// Columns
|
||||
m_fieldGrid->SetColSize( 0, 150 );
|
||||
m_fieldGrid->SetColSize( 1, 150 );
|
||||
|
@ -336,67 +341,67 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
|
|||
m_fieldGrid->SetColLabelValue( 3, _("Name") );
|
||||
m_fieldGrid->SetColLabelValue( 4, wxEmptyString );
|
||||
m_fieldGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
|
||||
|
||||
|
||||
// Rows
|
||||
m_fieldGrid->EnableDragRowSize( true );
|
||||
m_fieldGrid->SetRowLabelSize( 80 );
|
||||
m_fieldGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
|
||||
|
||||
|
||||
// Label Appearance
|
||||
|
||||
|
||||
// Cell Defaults
|
||||
m_fieldGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
bSizer11->Add( m_fieldGrid, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer6->Add( bSizer11, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer10;
|
||||
bSizer10 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
addFieldButton = new wxButton( m_panel2, wxID_ADD_FIELD, _("&Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer10->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
deleteFieldButton = new wxButton( m_panel2, wxID_DELETE_FIELD, _("De&lete"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer10->Add( deleteFieldButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer10->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bSizer6->Add( bSizer10, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
m_panel2->SetSizer( bSizer6 );
|
||||
m_panel2->Layout();
|
||||
bSizer6->Fit( m_panel2 );
|
||||
m_notebook->AddPage( m_panel2, _("Default Fields"), false );
|
||||
|
||||
|
||||
bOptionsSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bSizer12;
|
||||
bSizer12 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
|
||||
bSizer12->Add( m_sdbSizer, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bOptionsSizer->Add( bSizer12, 0, wxBOTTOM|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
mainSizer->Add( bOptionsSizer, 1, wxEXPAND, 12 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( mainSizer );
|
||||
this->Layout();
|
||||
mainSizer->Fit( this );
|
||||
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
}
|
||||
|
||||
|
|
|
@ -184,10 +184,10 @@
|
|||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="notebookpage" expanded="0">
|
||||
<object class="notebookpage" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Display</property>
|
||||
<property name="select">0</property>
|
||||
<property name="select">1</property>
|
||||
<object class="wxPanel" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
|
@ -3771,7 +3771,7 @@
|
|||
<property name="bitmap"></property>
|
||||
<property name="label">Controls</property>
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="1">
|
||||
<object class="wxPanel" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -4398,6 +4398,94 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">xwID_ANY</property>
|
||||
<property name="label">Use touchpa&d to pan</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_checkEnableMousewheelPan</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Use touchpad to pan canvas</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
|
@ -4494,8 +4582,8 @@
|
|||
<object class="notebookpage" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Colors</property>
|
||||
<property name="select">1</property>
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -4569,16 +4657,16 @@
|
|||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer14</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxPanel" expanded="1">
|
||||
<object class="wxPanel" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Mar 28 2015)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -43,15 +43,15 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
|
|||
{
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
|
||||
|
||||
// Private event handlers
|
||||
void _wxFB_OnSize( wxSizeEvent& event ){ OnSize( event ); }
|
||||
void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); }
|
||||
void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); }
|
||||
void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); }
|
||||
void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
|
|||
wxID_ADD_FIELD,
|
||||
wxID_DELETE_FIELD
|
||||
};
|
||||
|
||||
|
||||
wxNotebook* m_notebook;
|
||||
wxPanel* m_panel5;
|
||||
wxStaticText* m_staticText3;
|
||||
|
@ -111,6 +111,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
|
|||
wxCheckBox* m_checkEnableZoomCenter;
|
||||
wxCheckBox* m_checkEnableMiddleButtonPan;
|
||||
wxCheckBox* m_checkMiddleButtonPanLimited;
|
||||
wxCheckBox* m_checkEnableMousewheelPan;
|
||||
wxCheckBox* m_checkAutoPan;
|
||||
wxPanel* m_tabColors;
|
||||
wxPanel* m_panelColors;
|
||||
|
@ -121,20 +122,20 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
|
|||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
|
||||
virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnMiddleBtnPanEnbl( 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|wxRESIZE_BORDER );
|
||||
|
||||
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();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_EESCHEMA_OPTIONS_BASE_H__
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
#include <erc.h>
|
||||
#include <id.h>
|
||||
|
||||
extern int DiagErc[PIN_NMAX][PIN_NMAX];
|
||||
extern int DefaultDiagErc[PIN_NMAX][PIN_NMAX];
|
||||
extern int DiagErc[PINTYPE_COUNT][PINTYPE_COUNT];
|
||||
extern int DefaultDiagErc[PINTYPE_COUNT][PINTYPE_COUNT];
|
||||
|
||||
|
||||
|
||||
|
@ -63,7 +63,7 @@ bool DIALOG_ERC::m_tstUniqueGlobalLabels = true; // saved only for the curren
|
|||
#define ID_MATRIX_0 1800
|
||||
|
||||
BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
|
||||
EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PIN_NMAX * PIN_NMAX ) - 1,
|
||||
EVT_COMMAND_RANGE( ID_MATRIX_0, ID_MATRIX_0 + ( PINTYPE_COUNT * PINTYPE_COUNT ) - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, DIALOG_ERC::ChangeErrorLevel )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
@ -91,9 +91,9 @@ void DIALOG_ERC::Init()
|
|||
{
|
||||
m_initialized = false;
|
||||
|
||||
for( int ii = 0; ii < PIN_NMAX; ii++ )
|
||||
for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
|
||||
{
|
||||
for( int jj = 0; jj < PIN_NMAX; jj++ )
|
||||
for( int jj = 0; jj < PINTYPE_COUNT; jj++ )
|
||||
m_buttonList[ii][jj] = NULL;
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
|
|||
if( m_initialized == false )
|
||||
{
|
||||
// Print row labels
|
||||
for( int ii = 0; ii < PIN_NMAX; ii++ )
|
||||
for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
|
||||
{
|
||||
int y = pos.y + (ii * bitmap_size.y);
|
||||
text = new wxStaticText( m_matrixPanel, -1, CommentERC_H[ii],
|
||||
|
@ -305,7 +305,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
|
|||
else
|
||||
pos = m_buttonList[0][0]->GetPosition();
|
||||
|
||||
for( int ii = 0; ii < PIN_NMAX; ii++ )
|
||||
for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
|
||||
{
|
||||
int y = pos.y + (ii * bitmap_size.y);
|
||||
|
||||
|
@ -323,7 +323,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
|
|||
text = new wxStaticText( m_matrixPanel, -1, CommentERC_V[ii], txtpos );
|
||||
}
|
||||
|
||||
int event_id = ID_MATRIX_0 + ii + ( jj * PIN_NMAX );
|
||||
int event_id = ID_MATRIX_0 + ii + ( jj * PINTYPE_COUNT );
|
||||
BITMAP_DEF bitmap_butt = erc_green_xpm;
|
||||
|
||||
delete m_buttonList[ii][jj];
|
||||
|
@ -420,7 +420,7 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
|
|||
wxBitmapButton* butt = (wxBitmapButton*) event.GetEventObject();
|
||||
pos = butt->GetPosition();
|
||||
|
||||
x = ii / PIN_NMAX; y = ii % PIN_NMAX;
|
||||
x = ii / PINTYPE_COUNT; y = ii % PINTYPE_COUNT;
|
||||
|
||||
level = DiagErc[y][x];
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <wx/htmllbox.h>
|
||||
#include <vector>
|
||||
#include <lib_pin.h> // For PIN_NMAX definition
|
||||
#include <lib_pin.h> // For PINTYPE_COUNT definition
|
||||
|
||||
#include <dialog_erc_base.h>
|
||||
#include "dialog_erc_listbox.h"
|
||||
|
@ -40,7 +40,7 @@ class DIALOG_ERC : public DIALOG_ERC_BASE
|
|||
|
||||
private:
|
||||
SCH_EDIT_FRAME* m_parent;
|
||||
wxBitmapButton* m_buttonList[PIN_NMAX][PIN_NMAX];
|
||||
wxBitmapButton* m_buttonList[PINTYPE_COUNT][PINTYPE_COUNT];
|
||||
bool m_initialized;
|
||||
const SCH_MARKER* m_lastMarkerFound;
|
||||
static bool m_writeErcFile;
|
||||
|
|
|
@ -133,7 +133,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
|
|||
int pinNumSize = ValueFromString( g_UserUnit, GetPadNameTextSize());
|
||||
int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
|
||||
int pinLength = ValueFromString( g_UserUnit, GetLength() );
|
||||
int pinShape = LIB_PIN::GetStyleCode( GetStyle() );
|
||||
GRAPHIC_PINSHAPE pinShape = GetStyle();
|
||||
ELECTRICAL_PINTYPE pinType = GetElectricalType();
|
||||
|
||||
m_dummyPin->SetName( GetPinName() );
|
||||
|
@ -161,28 +161,3 @@ void DIALOG_LIB_EDIT_PIN::SetOrientationList( const wxArrayString& list,
|
|||
m_choiceOrientation->Insert( list[ii], KiBitmap( aBitmaps[ii] ), ii );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_EDIT_PIN::SetElectricalTypeList( const wxArrayString& list,
|
||||
const BITMAP_DEF* aBitmaps )
|
||||
{
|
||||
for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
|
||||
{
|
||||
if( aBitmaps == NULL )
|
||||
m_choiceElectricalType->Append( list[ii] );
|
||||
else
|
||||
m_choiceElectricalType->Insert( list[ii], KiBitmap( aBitmaps[ii] ), ii );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_LIB_EDIT_PIN::SetStyleList( const wxArrayString& list, const BITMAP_DEF* aBitmaps )
|
||||
{
|
||||
for ( unsigned ii = 0; ii < list.GetCount(); ii++ )
|
||||
{
|
||||
if( aBitmaps == NULL )
|
||||
m_choiceStyle->Append( list[ii] );
|
||||
else
|
||||
m_choiceStyle->Insert( list[ii], KiBitmap( aBitmaps[ii] ), ii );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
*/
|
||||
|
||||
#include <wx/bmpcbox.h>
|
||||
#include <pin_shape_combobox.h>
|
||||
#include <pin_type_combobox.h>
|
||||
|
||||
#include <dialog_lib_edit_pin_base.h>
|
||||
|
||||
|
@ -59,22 +61,18 @@ public:
|
|||
}
|
||||
int GetOrientation( void ) { return m_choiceOrientation->GetSelection(); }
|
||||
|
||||
void SetElectricalTypeList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
|
||||
void SetElectricalType( int type )
|
||||
void SetElectricalType( ELECTRICAL_PINTYPE type )
|
||||
{
|
||||
m_choiceElectricalType->SetSelection( type );
|
||||
}
|
||||
|
||||
ELECTRICAL_PINTYPE GetElectricalType( void )
|
||||
{
|
||||
// m_choiceElectricalType is expected having the eletrical type names
|
||||
// order indentical to the ELECTRICAL_PINTYPE enum
|
||||
return (ELECTRICAL_PINTYPE)m_choiceElectricalType->GetSelection();
|
||||
return m_choiceElectricalType->GetSelection();
|
||||
}
|
||||
|
||||
void SetStyleList( const wxArrayString& list, const BITMAP_DEF* aBitmaps );
|
||||
void SetStyle( int style ) { m_choiceStyle->SetSelection( style ); }
|
||||
int GetStyle( void ) { return m_choiceStyle->GetSelection(); }
|
||||
void SetStyle( GRAPHIC_PINSHAPE style ) { m_choiceStyle->SetSelection( style ); }
|
||||
GRAPHIC_PINSHAPE GetStyle( void ) { return m_choiceStyle->GetSelection(); }
|
||||
|
||||
void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
|
||||
wxString GetPinName( void ) { return m_textPinName->GetValue(); }
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "pin_shape_combobox.h"
|
||||
#include "pin_type_combobox.h"
|
||||
#include "wx/bmpcbox.h"
|
||||
|
||||
#include "dialog_lib_edit_pin_base.h"
|
||||
|
@ -61,14 +63,14 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
|
|||
|
||||
fgSizerPins->Add( m_staticTextEType, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||
|
||||
m_choiceElectricalType = new wxBitmapComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
m_choiceElectricalType = new PinTypeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
fgSizerPins->Add( m_choiceElectricalType, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
m_staticTextGstyle = new wxStaticText( this, wxID_ANY, _("Graphic &Style:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextGstyle->Wrap( -1 );
|
||||
fgSizerPins->Add( m_staticTextGstyle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||
|
||||
m_choiceStyle = new wxBitmapComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
m_choiceStyle = new PinShapeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
fgSizerPins->Add( m_choiceStyle, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
|
|
|
@ -784,7 +784,7 @@
|
|||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxCB_READONLY</property>
|
||||
<property name="subclass">wxBitmapComboBox; wx/bmpcbox.h</property>
|
||||
<property name="subclass">PinTypeComboBox; pin_type_combobox.h</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
|
@ -958,7 +958,7 @@
|
|||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxCB_READONLY</property>
|
||||
<property name="subclass">wxBitmapComboBox; wx/bmpcbox.h</property>
|
||||
<property name="subclass">PinShapeComboBox; pin_shape_combobox.h</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class DIALOG_SHIM;
|
||||
class PinShapeComboBox;
|
||||
class PinTypeComboBox;
|
||||
class wxBitmapComboBox;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
|
@ -64,9 +66,9 @@ class DIALOG_LIB_EDIT_PIN_BASE : public DIALOG_SHIM
|
|||
wxStaticText* m_staticTextOrient;
|
||||
wxBitmapComboBox* m_choiceOrientation;
|
||||
wxStaticText* m_staticTextEType;
|
||||
wxBitmapComboBox* m_choiceElectricalType;
|
||||
PinTypeComboBox* m_choiceElectricalType;
|
||||
wxStaticText* m_staticTextGstyle;
|
||||
wxBitmapComboBox* m_choiceStyle;
|
||||
PinShapeComboBox* m_choiceStyle;
|
||||
wxCheckBox* m_checkApplyToAllParts;
|
||||
wxCheckBox* m_checkApplyToAllConversions;
|
||||
wxCheckBox* m_checkShow;
|
||||
|
|
|
@ -183,7 +183,7 @@ DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE( wxWindow* parent,
|
|||
100,
|
||||
wxAlignment( wxALIGN_LEFT | wxALIGN_TOP ),
|
||||
wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE );
|
||||
wxDataViewTextRenderer* rend2 = new wxDataViewTextRenderer( wxT( "string" ), wxDATAVIEW_CELL_INERT );
|
||||
wxDataViewIconTextRenderer* rend2 = new wxDataViewIconTextRenderer( wxT( "wxDataViewIconText" ), wxDATAVIEW_CELL_INERT );
|
||||
wxDataViewColumn* col2 = new wxDataViewColumn( _( "Type" ),
|
||||
rend2,
|
||||
DataViewModel::PIN_TYPE,
|
||||
|
@ -255,7 +255,23 @@ unsigned int DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::GetColumnCount() const
|
|||
|
||||
wxString DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::GetColumnType( unsigned int aCol ) const
|
||||
{
|
||||
return wxT( "string" );
|
||||
switch( aCol )
|
||||
{
|
||||
case PIN_NUMBER:
|
||||
return wxT( "string" );
|
||||
|
||||
case PIN_NAME:
|
||||
return wxT( "string" );
|
||||
|
||||
case PIN_TYPE:
|
||||
return wxT( "wxDataViewIconText" );
|
||||
|
||||
case PIN_POSITION:
|
||||
return wxT( "string" );
|
||||
}
|
||||
|
||||
assert( ! "Unhandled column" );
|
||||
return wxT( "" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -431,8 +447,20 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Group::GetValue( wxVariant& aValu
|
|||
if( aCol == m_GroupingColumn )
|
||||
// shortcut
|
||||
m_Members.front()->GetValue( aValue, aCol );
|
||||
else
|
||||
else if( aCol != PIN_TYPE )
|
||||
aValue = GetString( aCol );
|
||||
else
|
||||
{
|
||||
PinNumbers values;
|
||||
|
||||
for( std::list<Pin*>::const_iterator i = m_Members.begin(); i != m_Members.end(); ++i )
|
||||
values.insert( (*i)->GetString( aCol ) );
|
||||
|
||||
if( values.size() > 1 )
|
||||
aValue << wxDataViewIconText( boost::algorithm::join( values, "," ), wxNullIcon );
|
||||
else
|
||||
m_Members.front()->GetValue( aValue, aCol );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -476,7 +504,22 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Group::Add( Pin* aPin )
|
|||
void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::GetValue( wxVariant& aValue,
|
||||
unsigned int aCol ) const
|
||||
{
|
||||
aValue = GetString( aCol );
|
||||
switch( aCol )
|
||||
{
|
||||
case PIN_NUMBER:
|
||||
case PIN_NAME:
|
||||
case PIN_POSITION:
|
||||
aValue = GetString( aCol );
|
||||
break;
|
||||
|
||||
case PIN_TYPE:
|
||||
{
|
||||
wxIcon icon;
|
||||
icon.CopyFromBitmap( KiBitmap ( GetBitmap( m_Backing->GetType() ) ) );
|
||||
aValue << wxDataViewIconText( m_Backing->GetElectricalTypeName(), icon );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2015-2016 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -92,6 +92,7 @@ public:
|
|||
void DrawPage( SCH_SCREEN* aScreen );
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Custom schematic print preview frame.
|
||||
* This derived preview frame remembers its size and position during a session
|
||||
|
@ -136,6 +137,7 @@ private:
|
|||
static wxSize s_size;
|
||||
};
|
||||
|
||||
|
||||
wxPoint SCH_PREVIEW_FRAME::s_pos;
|
||||
wxSize SCH_PREVIEW_FRAME::s_size;
|
||||
|
||||
|
@ -251,7 +253,7 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
|
|||
|
||||
if( preview == NULL )
|
||||
{
|
||||
DisplayError( this, wxT( "Print preview error!" ) );
|
||||
DisplayError( this, _( "Print preview error!" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -320,12 +322,13 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
|
|||
|
||||
SCH_SCREEN* screen = m_parent->GetScreen();
|
||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
||||
SCH_SHEET_PATH list;
|
||||
SCH_SHEET_LIST SheetList( NULL );
|
||||
SCH_SHEET_PATH* sheetpath = SheetList.GetSheet( page - 1 );
|
||||
SCH_SHEET_PATH list;
|
||||
|
||||
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||
if( sheetpath )
|
||||
{
|
||||
list = *sheetpath;
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
|
@ -360,6 +363,7 @@ bool SCH_PRINTOUT::HasPage( int pageNum )
|
|||
int pageCount;
|
||||
|
||||
pageCount = g_RootSheet->CountSheets();
|
||||
|
||||
if( pageCount >= pageNum )
|
||||
return true;
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
|
||||
#include <dialog_sch_edit_sheet_pin_base.h>
|
||||
#include <sch_text.h> // enum PINSHEETLABEL_SHAPE definition
|
||||
|
||||
|
||||
class DIALOG_SCH_EDIT_SHEET_PIN : public DIALOG_SCH_EDIT_SHEET_PIN_BASE
|
||||
|
@ -49,8 +50,9 @@ public:
|
|||
void SetTextWidth( const wxString& aWidth ) { m_textWidth->SetValue( aWidth ); }
|
||||
wxString GetTextWidth() const { return m_textWidth->GetValue(); }
|
||||
|
||||
void SetConnectionType( int aType ) { m_choiceConnectionType->SetSelection( aType ); }
|
||||
int GetConnectionType() const { return m_choiceConnectionType->GetCurrentSelection(); }
|
||||
void SetConnectionType( PINSHEETLABEL_SHAPE aType ) { m_choiceConnectionType->SetSelection( aType ); }
|
||||
/// @todo move cast to widget
|
||||
PINSHEETLABEL_SHAPE GetConnectionType() const { return static_cast<PINSHEETLABEL_SHAPE>( m_choiceConnectionType->GetCurrentSelection() ); }
|
||||
|
||||
void SetTextHeightUnits( const wxString& aUnit ) { m_staticHeightUnits->SetLabel( aUnit ); }
|
||||
void SetTextWidthUnits( const wxString& aUnit ) { m_staticWidthUnits->SetLabel( aUnit ); }
|
||||
|
|
|
@ -41,10 +41,10 @@
|
|||
#include <eeschema_id.h>
|
||||
|
||||
|
||||
static int lastGlobalLabelShape = (int) NET_INPUT;
|
||||
static int lastTextOrientation = 0;
|
||||
static bool lastTextBold = false;
|
||||
static bool lastTextItalic = false;
|
||||
static PINSHEETLABEL_SHAPE lastGlobalLabelShape = NET_INPUT;
|
||||
static int lastTextOrientation = 0;
|
||||
static bool lastTextBold = false;
|
||||
static bool lastTextItalic = false;
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::ChangeTextOrient( SCH_TEXT* aTextItem, wxDC* aDC )
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2014-2016 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -314,6 +314,7 @@ void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
|
|||
dlg.SetShowGrid( IsGridVisible() );
|
||||
dlg.SetShowHiddenPins( m_showAllPins );
|
||||
dlg.SetEnableMiddleButtonPan( m_canvas->GetEnableMiddleButtonPan() );
|
||||
dlg.SetEnableMousewheelPan( m_canvas->GetEnableMousewheelPan() );
|
||||
dlg.SetEnableZoomNoCenter( m_canvas->GetEnableZoomNoCenter() );
|
||||
dlg.SetMiddleButtonPanLimited( m_canvas->GetMiddleButtonPanLimited() );
|
||||
dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() );
|
||||
|
@ -365,6 +366,7 @@ void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
|
|||
SetGridVisibility( dlg.GetShowGrid() );
|
||||
m_showAllPins = dlg.GetShowHiddenPins();
|
||||
m_canvas->SetEnableMiddleButtonPan( dlg.GetEnableMiddleButtonPan() );
|
||||
m_canvas->SetEnableMousewheelPan( dlg.GetEnableMousewheelPan() );
|
||||
m_canvas->SetEnableZoomNoCenter( dlg.GetEnableZoomNoCenter() );
|
||||
m_canvas->SetMiddleButtonPanLimited( dlg.GetMiddleButtonPanLimited() );
|
||||
m_canvas->SetEnableAutoPan( dlg.GetEnableAutoPan() );
|
||||
|
|
|
@ -121,7 +121,7 @@ const wxString CommentERC_V[] =
|
|||
* at start up: must be loaded by DefaultDiagErc
|
||||
* Can be modified in dialog ERC
|
||||
*/
|
||||
int DiagErc[PIN_NMAX][PIN_NMAX];
|
||||
int DiagErc[PINTYPE_COUNT][PINTYPE_COUNT];
|
||||
|
||||
/**
|
||||
* Default Look up table which gives the ERC error level for a pair of connected pins
|
||||
|
@ -130,7 +130,7 @@ int DiagErc[PIN_NMAX][PIN_NMAX];
|
|||
* note also, to avoid inconsistancy:
|
||||
* DefaultDiagErc[i][j] = DefaultDiagErc[j][i]
|
||||
*/
|
||||
int DefaultDiagErc[PIN_NMAX][PIN_NMAX] =
|
||||
int DefaultDiagErc[PINTYPE_COUNT][PINTYPE_COUNT] =
|
||||
{
|
||||
/* I, O, Bi, 3S, Pas, UnS, PwrI, PwrO, OC, OE, NC */
|
||||
/* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, ERR },
|
||||
|
@ -157,7 +157,7 @@ int DefaultDiagErc[PIN_NMAX][PIN_NMAX] =
|
|||
* in net. Nets are OK when their final state is NET_NC or DRV. Nets with the state
|
||||
* NOD have no valid source signal.
|
||||
*/
|
||||
static int MinimalReq[PIN_NMAX][PIN_NMAX] =
|
||||
static int MinimalReq[PINTYPE_COUNT][PINTYPE_COUNT] =
|
||||
{
|
||||
/* In Out, Bi, 3S, Pas, UnS, PwrI,PwrO,OC, OE, NC */
|
||||
/* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NPI },
|
||||
|
@ -228,9 +228,9 @@ int TestDuplicateSheetNames( bool aCreateMarker )
|
|||
void Diagnose( NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemTst,
|
||||
int aMinConn, int aDiag )
|
||||
{
|
||||
SCH_MARKER* marker = NULL;
|
||||
SCH_SCREEN* screen;
|
||||
int ii, jj;
|
||||
SCH_MARKER* marker = NULL;
|
||||
SCH_SCREEN* screen;
|
||||
ELECTRICAL_PINTYPE ii, jj;
|
||||
|
||||
if( aDiag == OK )
|
||||
return;
|
||||
|
@ -297,7 +297,7 @@ void Diagnose( NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemTst,
|
|||
{
|
||||
msg.Printf( _( "Pin %s (%s) of component %s is unconnected." ),
|
||||
GetChars( string_pinnum ),
|
||||
GetChars( LIB_PIN::GetElectricalTypeName( ii ) ),
|
||||
GetChars( GetText( ii ) ),
|
||||
GetChars( cmp_ref ) );
|
||||
marker->SetData( ERCE_PIN_NOT_CONNECTED,
|
||||
aNetItemRef->m_Start,
|
||||
|
@ -314,7 +314,7 @@ void Diagnose( NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemTst,
|
|||
|
||||
msg.Printf( _( "Pin %s (%s) of component %s is not driven (Net %d)." ),
|
||||
GetChars( string_pinnum ),
|
||||
GetChars( LIB_PIN::GetElectricalTypeName( ii ) ),
|
||||
GetChars( GetText( ii ) ),
|
||||
GetChars( cmp_ref ),
|
||||
aNetItemRef->GetNet() );
|
||||
marker->SetData( ERCE_PIN_NOT_DRIVEN,
|
||||
|
@ -356,12 +356,12 @@ void Diagnose( NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemTst,
|
|||
|
||||
msg.Printf( _( "Pin %s (%s) of component %s is connected to " ),
|
||||
GetChars( string_pinnum ),
|
||||
GetChars( LIB_PIN::GetElectricalTypeName( ii ) ),
|
||||
GetChars( GetText( ii ) ),
|
||||
GetChars( cmp_ref ) );
|
||||
marker->SetData( errortype, aNetItemRef->m_Start, msg, aNetItemRef->m_Start );
|
||||
msg.Printf( _( "pin %s (%s) of component %s (net %d)." ),
|
||||
GetChars( alt_string_pinnum ),
|
||||
GetChars( LIB_PIN::GetElectricalTypeName( jj ) ),
|
||||
GetChars( GetText( jj ) ),
|
||||
GetChars( alt_cmp ),
|
||||
aNetItemRef->GetNet() );
|
||||
marker->SetAuxiliaryData( msg, aNetItemTst->m_Start );
|
||||
|
@ -374,7 +374,7 @@ void TestOthersItems( NETLIST_OBJECT_LIST* aList,
|
|||
int* aMinConnexion )
|
||||
{
|
||||
unsigned netItemTst = aNetStart;
|
||||
int jj;
|
||||
ELECTRICAL_PINTYPE jj;
|
||||
int erc = OK;
|
||||
|
||||
/* Analysis of the table of connections. */
|
||||
|
|
|
@ -158,7 +158,7 @@ HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* aParent, const wxPoint
|
|||
m_Tree->SetItemBold( cellule, true );
|
||||
|
||||
SCH_SHEET_PATH list;
|
||||
list.Push( g_RootSheet );
|
||||
list.push_back( g_RootSheet );
|
||||
m_Tree->SetItemData( cellule, new TreeItemData( list ) );
|
||||
|
||||
if( m_Parent->GetCurrentSheet().Last() == g_RootSheet )
|
||||
|
@ -227,7 +227,7 @@ void HIERARCHY_NAVIG_DLG::BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId*
|
|||
SCH_SHEET* sheet = (SCH_SHEET*) schitem;
|
||||
m_nbsheets++;
|
||||
menu = m_Tree->AppendItem( *previousmenu, sheet->GetName(), 0, 1 );
|
||||
list->Push( sheet );
|
||||
list->push_back( sheet );
|
||||
m_Tree->SetItemData( menu, new TreeItemData( *list ) );
|
||||
int ll = m_Tree->GetItemText( menu ).Len();
|
||||
|
||||
|
@ -248,7 +248,7 @@ void HIERARCHY_NAVIG_DLG::BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId*
|
|||
|
||||
BuildSheetsTree( list, &menu );
|
||||
m_Tree->Expand( menu );
|
||||
list->Pop();
|
||||
list->pop_back();
|
||||
}
|
||||
|
||||
schitem = schitem->Next();
|
||||
|
|
|
@ -70,60 +70,10 @@ static const BITMAP_DEF iconsPinsOrientations[] =
|
|||
};
|
||||
|
||||
|
||||
// bitmaps to show pins shapes in dialog editor
|
||||
// must have same order than pin_style_names
|
||||
static BITMAP_DEF iconsPinsShapes[] =
|
||||
const wxString LIB_PIN::GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType )
|
||||
{
|
||||
pinshape_normal_xpm,
|
||||
pinshape_invert_xpm,
|
||||
pinshape_clock_normal_xpm,
|
||||
pinshape_clock_invert_xpm,
|
||||
pinshape_active_low_input_xpm,
|
||||
pinshape_clock_active_low_xpm,
|
||||
pinshape_active_low_output_xpm,
|
||||
pinshape_clock_fall_xpm,
|
||||
pinshape_nonlogic_xpm
|
||||
};
|
||||
assert( aType >= 0 && aType < (int) PINTYPE_COUNT );
|
||||
|
||||
|
||||
|
||||
static const int pin_style_codes[] =
|
||||
{
|
||||
NONE,
|
||||
INVERT,
|
||||
CLOCK,
|
||||
CLOCK | INVERT,
|
||||
LOWLEVEL_IN,
|
||||
LOWLEVEL_IN | CLOCK,
|
||||
LOWLEVEL_OUT,
|
||||
CLOCK_FALL,
|
||||
NONLOGIC
|
||||
};
|
||||
|
||||
#define PIN_STYLE_CNT DIM( pin_style_codes )
|
||||
|
||||
// bitmaps to show pins electrical type in dialog editor
|
||||
// must have same order than enum ELECTRICAL_PINTYPE (see lib_pin.h)
|
||||
static const BITMAP_DEF iconsPinsElectricalType[] =
|
||||
{
|
||||
pintype_input_xpm,
|
||||
pintype_output_xpm,
|
||||
pintype_bidi_xpm,
|
||||
pintype_3states_xpm,
|
||||
pintype_passive_xpm,
|
||||
pintype_notspecif_xpm,
|
||||
pintype_powerinput_xpm,
|
||||
pintype_poweroutput_xpm,
|
||||
pintype_opencoll_xpm,
|
||||
pintype_openemit_xpm,
|
||||
pintype_noconnect_xpm
|
||||
};
|
||||
|
||||
#define PIN_ELECTRICAL_TYPE_CNT DIM( iconsPinsElectricalType )
|
||||
|
||||
|
||||
const wxString LIB_PIN::GetCanonicalElectricalTypeName( unsigned aType )
|
||||
{
|
||||
// These strings are the canonical name of the electrictal type
|
||||
// Not translated, no space in name, only ASCII chars.
|
||||
// to use when the string name must be known and well defined
|
||||
|
@ -140,12 +90,11 @@ const wxString LIB_PIN::GetCanonicalElectricalTypeName( unsigned aType )
|
|||
wxT( "power_out" ),
|
||||
wxT( "openCol" ),
|
||||
wxT( "openEm" ),
|
||||
wxT( "NotConnected" ),
|
||||
wxT( "???" )
|
||||
wxT( "NotConnected" )
|
||||
};
|
||||
|
||||
if( aType > PIN_NMAX )
|
||||
aType = PIN_NMAX;
|
||||
if( aType > (int) PINTYPE_COUNT )
|
||||
return wxT( "???" );
|
||||
|
||||
return msgPinElectricType[ aType ];
|
||||
}
|
||||
|
@ -176,53 +125,6 @@ static const wxString getPinOrientationName( unsigned aPinOrientationCode )
|
|||
return pin_orientation_names[ aPinOrientationCode ];
|
||||
}
|
||||
|
||||
const wxString LIB_PIN::GetElectricalTypeName( unsigned aPinsElectricalType )
|
||||
{
|
||||
const wxString pin_electrical_type_names[] =
|
||||
{ // Keep these translated strings not static
|
||||
_( "Input" ),
|
||||
_( "Output" ),
|
||||
_( "Bidirectional" ),
|
||||
_( "Tri-state" ),
|
||||
_( "Passive" ),
|
||||
_( "Unspecified" ),
|
||||
_( "Power input" ),
|
||||
_( "Power output" ),
|
||||
_( "Open collector" ),
|
||||
_( "Open emitter" ),
|
||||
_( "Not connected" ),
|
||||
wxT( "???" )
|
||||
};
|
||||
|
||||
if( aPinsElectricalType > PIN_ELECTRICAL_TYPE_CNT )
|
||||
aPinsElectricalType = PIN_ELECTRICAL_TYPE_CNT;
|
||||
|
||||
return pin_electrical_type_names[ aPinsElectricalType ];
|
||||
}
|
||||
|
||||
static const wxString getPinStyleName( unsigned aPinsStyle )
|
||||
{
|
||||
const wxString pin_style_names[] =
|
||||
{ // Keep these translated strings not static
|
||||
_( "Line" ),
|
||||
_( "Inverted" ),
|
||||
_( "Clock" ),
|
||||
_( "Inverted clock" ),
|
||||
_( "Input low" ),
|
||||
_( "Clock low" ),
|
||||
_( "Output low" ),
|
||||
_( "Falling edge clock" ),
|
||||
_( "NonLogic" ),
|
||||
wxT( "???" )
|
||||
};
|
||||
|
||||
if( aPinsStyle > PIN_STYLE_CNT )
|
||||
aPinsStyle = PIN_STYLE_CNT;
|
||||
|
||||
return pin_style_names[ aPinsStyle ];
|
||||
}
|
||||
|
||||
|
||||
/// Utility for getting the size of the 'internal' pin decorators (as a radius)
|
||||
// i.e. the clock symbols (falling clock is actually external but is of
|
||||
// the same kind)
|
||||
|
@ -241,11 +143,11 @@ static int ExternalPinDecoSize( const LIB_PIN &aPin )
|
|||
}
|
||||
|
||||
LIB_PIN::LIB_PIN( LIB_PART* aParent ) :
|
||||
LIB_ITEM( LIB_PIN_T, aParent )
|
||||
LIB_ITEM( LIB_PIN_T, aParent ),
|
||||
m_shape( PINSHAPE_LINE )
|
||||
{
|
||||
m_length = LIB_EDIT_FRAME::GetDefaultPinLength();
|
||||
m_orientation = PIN_RIGHT; // Pin orient: Up, Down, Left, Right
|
||||
m_shape = NONE; // Pin shape, bitwise.
|
||||
m_type = PIN_UNSPECIFIED; // electrical type of pin
|
||||
m_attributes = 0; // bit 0 != 0: pin invisible
|
||||
m_number = 0; // pin number (i.e. 4 ASCII chars)
|
||||
|
@ -378,8 +280,10 @@ void LIB_PIN::SetOrientation( int orientation )
|
|||
}
|
||||
|
||||
|
||||
void LIB_PIN::SetShape( int aShape )
|
||||
void LIB_PIN::SetShape( GRAPHIC_PINSHAPE aShape )
|
||||
{
|
||||
assert( aShape >= 0 && aShape < int( PINSHAPE_COUNT ) );
|
||||
|
||||
if( m_shape != aShape )
|
||||
{
|
||||
m_shape = aShape;
|
||||
|
@ -407,10 +311,12 @@ void LIB_PIN::SetShape( int aShape )
|
|||
|
||||
void LIB_PIN::SetType( ELECTRICAL_PINTYPE aType )
|
||||
{
|
||||
assert( aType >= 0 && aType < (int)PINTYPE_COUNT );
|
||||
|
||||
if( aType < PIN_INPUT )
|
||||
aType = PIN_INPUT;
|
||||
|
||||
if( aType >= PIN_NMAX )
|
||||
if( aType >= (int)PINTYPE_COUNT )
|
||||
aType = PIN_NC;
|
||||
|
||||
if( m_type != aType )
|
||||
|
@ -691,23 +597,55 @@ bool LIB_PIN::Save( OUTPUTFORMATTER& aFormatter )
|
|||
if( !IsVisible() && aFormatter.Print( 0, "N" ) < 0 )
|
||||
return false;
|
||||
|
||||
if( m_shape & INVERT && aFormatter.Print( 0, "I" ) < 0 )
|
||||
return false;
|
||||
switch( m_shape )
|
||||
{
|
||||
case PINSHAPE_LINE:
|
||||
break;
|
||||
|
||||
if( m_shape & CLOCK && aFormatter.Print( 0, "C" ) < 0 )
|
||||
return false;
|
||||
case PINSHAPE_INVERTED:
|
||||
if( aFormatter.Print( 0, "I" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
if( m_shape & LOWLEVEL_IN && aFormatter.Print( 0, "L" ) < 0 )
|
||||
return false;
|
||||
case PINSHAPE_CLOCK:
|
||||
if( aFormatter.Print( 0, "C" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
if( m_shape & LOWLEVEL_OUT && aFormatter.Print( 0, "V" ) < 0 )
|
||||
return false;
|
||||
case PINSHAPE_INVERTED_CLOCK:
|
||||
if( aFormatter.Print( 0, "IC" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
if( m_shape & CLOCK_FALL && aFormatter.Print( 0, "F" ) < 0 )
|
||||
return false;
|
||||
case PINSHAPE_INPUT_LOW:
|
||||
if( aFormatter.Print( 0, "L" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
if( m_shape & NONLOGIC && aFormatter.Print( 0, "X" ) < 0 )
|
||||
case PINSHAPE_CLOCK_LOW:
|
||||
if( aFormatter.Print( 0, "CL" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
case PINSHAPE_OUTPUT_LOW:
|
||||
if( aFormatter.Print( 0, "V" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
case PINSHAPE_FALLING_EDGE_CLOCK:
|
||||
if( aFormatter.Print( 0, "F" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
case PINSHAPE_NONLOGIC:
|
||||
if( aFormatter.Print( 0, "X" ) < 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert( !"Invalid pin shape" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( aFormatter.Print( 0, "\n" ) < 0 )
|
||||
return false;
|
||||
|
@ -831,6 +769,18 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
|||
|
||||
if( prms_count >= 12 ) /* Special Symbol defined */
|
||||
{
|
||||
enum
|
||||
{
|
||||
INVERTED = 1 << 0,
|
||||
CLOCK = 1 << 1,
|
||||
LOWLEVEL_IN = 1 << 2,
|
||||
LOWLEVEL_OUT = 1 << 3,
|
||||
FALLING_EDGE = 1 << 4,
|
||||
NONLOGIC = 1 << 5
|
||||
};
|
||||
|
||||
int flags = 0;
|
||||
|
||||
for( int j = strlen( pinAttrs ); j > 0; )
|
||||
{
|
||||
switch( pinAttrs[--j] )
|
||||
|
@ -843,27 +793,27 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
|||
break;
|
||||
|
||||
case 'I':
|
||||
m_shape |= INVERT;
|
||||
flags |= INVERTED;
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
m_shape |= CLOCK;
|
||||
flags |= CLOCK;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
m_shape |= LOWLEVEL_IN;
|
||||
flags |= LOWLEVEL_IN;
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
m_shape |= LOWLEVEL_OUT;
|
||||
flags |= LOWLEVEL_OUT;
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
m_shape |= CLOCK_FALL;
|
||||
flags |= FALLING_EDGE;
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
m_shape |= NONLOGIC;
|
||||
flags |= NONLOGIC;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -871,6 +821,49 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
switch( flags )
|
||||
{
|
||||
case 0:
|
||||
m_shape = PINSHAPE_LINE;
|
||||
break;
|
||||
|
||||
case INVERTED:
|
||||
m_shape = PINSHAPE_INVERTED;
|
||||
break;
|
||||
|
||||
case CLOCK:
|
||||
m_shape = PINSHAPE_CLOCK;
|
||||
break;
|
||||
|
||||
case INVERTED | CLOCK:
|
||||
m_shape = PINSHAPE_INVERTED_CLOCK;
|
||||
break;
|
||||
|
||||
case LOWLEVEL_IN:
|
||||
m_shape = PINSHAPE_INPUT_LOW;
|
||||
break;
|
||||
|
||||
case LOWLEVEL_IN | CLOCK:
|
||||
m_shape = PINSHAPE_CLOCK_LOW;
|
||||
break;
|
||||
|
||||
case LOWLEVEL_OUT:
|
||||
m_shape = PINSHAPE_OUTPUT_LOW;
|
||||
break;
|
||||
|
||||
case FALLING_EDGE:
|
||||
m_shape = PINSHAPE_FALLING_EDGE_CLOCK;
|
||||
break;
|
||||
|
||||
case NONLOGIC:
|
||||
m_shape = PINSHAPE_NONLOGIC;
|
||||
break;
|
||||
|
||||
default:
|
||||
aErrorMsg.Printf( wxT( "pin attributes do not give a valid pin shape [%s]" ), pinAttrs );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1021,7 +1014,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
|||
return;
|
||||
|
||||
|
||||
if( m_shape & INVERT )
|
||||
if( m_shape == PINSHAPE_INVERTED || m_shape == PINSHAPE_INVERTED_CLOCK )
|
||||
{
|
||||
const int radius = ExternalPinDecoSize( *this );
|
||||
GRCircle( clipbox, aDC, MapX1 * radius + x1,
|
||||
|
@ -1032,7 +1025,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
|||
MapY1 * radius * 2 + y1 );
|
||||
GRLineTo( clipbox, aDC, posX, posY, width, color );
|
||||
}
|
||||
else if( m_shape & CLOCK_FALL ) /* an alternative for Inverted Clock */
|
||||
else if( m_shape == PINSHAPE_FALLING_EDGE_CLOCK ) /* an alternative for Inverted Clock */
|
||||
{
|
||||
const int clock_size = InternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
|
@ -1059,7 +1052,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
|||
GRLineTo( clipbox, aDC, posX, posY, width, color );
|
||||
}
|
||||
|
||||
if( m_shape & CLOCK )
|
||||
if( m_shape == PINSHAPE_CLOCK || m_shape == PINSHAPE_INVERTED_CLOCK || m_shape == PINSHAPE_CLOCK_LOW )
|
||||
{
|
||||
const int clock_size = InternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
|
@ -1080,7 +1073,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
|||
}
|
||||
}
|
||||
|
||||
if( m_shape & LOWLEVEL_IN ) /* IEEE symbol "Active Low Input" */
|
||||
if( m_shape == PINSHAPE_INPUT_LOW || m_shape == PINSHAPE_CLOCK_LOW )
|
||||
{
|
||||
const int symbol_size = ExternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
|
@ -1101,7 +1094,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
|||
}
|
||||
|
||||
|
||||
if( m_shape & LOWLEVEL_OUT ) /* IEEE symbol "Active Low Output" */
|
||||
if( m_shape == PINSHAPE_OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */
|
||||
{
|
||||
const int symbol_size = ExternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
|
@ -1121,7 +1114,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
|||
width, color );
|
||||
}
|
||||
}
|
||||
else if( m_shape & NONLOGIC ) /* NonLogic pin symbol */
|
||||
else if( m_shape == PINSHAPE_NONLOGIC ) /* NonLogic pin symbol */
|
||||
{
|
||||
const int symbol_size = ExternalPinDecoSize( *this );
|
||||
GRMoveTo( x1 - (MapX1 + MapY1) * symbol_size,
|
||||
|
@ -1397,7 +1390,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
|||
break;
|
||||
}
|
||||
|
||||
if( m_shape & INVERT )
|
||||
if( m_shape == PINSHAPE_INVERTED || m_shape == PINSHAPE_INVERTED_CLOCK )
|
||||
{
|
||||
const int radius = ExternalPinDecoSize( *this );
|
||||
aPlotter->Circle( wxPoint( MapX1 * radius + x1,
|
||||
|
@ -1410,7 +1403,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
|||
MapY1 * radius * 2 + y1 ) );
|
||||
aPlotter->FinishTo( aPosition );
|
||||
}
|
||||
else if( m_shape & CLOCK_FALL )
|
||||
else if( m_shape == PINSHAPE_FALLING_EDGE_CLOCK )
|
||||
{
|
||||
const int clock_size = InternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
|
@ -1436,7 +1429,8 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
|||
aPlotter->FinishTo( aPosition );
|
||||
}
|
||||
|
||||
if( m_shape & CLOCK )
|
||||
if( m_shape == PINSHAPE_CLOCK || m_shape == PINSHAPE_INVERTED_CLOCK ||
|
||||
m_shape == PINSHAPE_CLOCK_LOW )
|
||||
{
|
||||
const int clock_size = InternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
|
@ -1453,7 +1447,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
|||
}
|
||||
}
|
||||
|
||||
if( m_shape & LOWLEVEL_IN ) /* IEEE symbol "Active Low Input" */
|
||||
if( m_shape == PINSHAPE_INPUT_LOW || m_shape == PINSHAPE_CLOCK_LOW ) /* IEEE symbol "Active Low Input" */
|
||||
{
|
||||
const int symbol_size = ExternalPinDecoSize( *this );
|
||||
|
||||
|
@ -1474,7 +1468,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
|||
}
|
||||
|
||||
|
||||
if( m_shape & LOWLEVEL_OUT ) /* IEEE symbol "Active Low Output" */
|
||||
if( m_shape == PINSHAPE_OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */
|
||||
{
|
||||
const int symbol_size = ExternalPinDecoSize( *this );
|
||||
|
||||
|
@ -1489,7 +1483,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie
|
|||
aPlotter->FinishTo( wxPoint( x1, y1 + MapY1 * symbol_size * 2 ) );
|
||||
}
|
||||
}
|
||||
else if( m_shape & NONLOGIC ) /* NonLogic pin symbol */
|
||||
else if( m_shape == PINSHAPE_NONLOGIC ) /* NonLogic pin symbol */
|
||||
{
|
||||
const int symbol_size = ExternalPinDecoSize( *this );
|
||||
aPlotter->MoveTo( wxPoint( x1 - (MapX1 + MapY1) * symbol_size,
|
||||
|
@ -1984,15 +1978,10 @@ void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
|||
aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text, DARKCYAN ) );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Type" ),
|
||||
LIB_PIN::GetElectricalTypeName( m_type ),
|
||||
GetText( m_type ),
|
||||
RED ) );
|
||||
|
||||
int styleCodeIndex = GetStyleCodeIndex( m_shape );
|
||||
|
||||
if( styleCodeIndex >= 0 )
|
||||
text = getPinStyleName( styleCodeIndex );
|
||||
else
|
||||
text = wxT( "?" );
|
||||
text = GetText( m_shape );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text, BLUE ) );
|
||||
|
||||
|
@ -2042,7 +2031,7 @@ const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles ) const
|
|||
// Actual text height is bigger than text size
|
||||
int numberTextHeight = showNum ? KiROUND( m_numTextSize * 1.1 ) : 0;
|
||||
|
||||
if( m_shape & INVERT )
|
||||
if( m_shape == PINSHAPE_INVERTED || m_shape == PINSHAPE_INVERTED_CLOCK )
|
||||
minsizeV = std::max( TARGET_PIN_RADIUS, ExternalPinDecoSize( *this ) );
|
||||
|
||||
// calculate top left corner position
|
||||
|
@ -2187,72 +2176,15 @@ void LIB_PIN::Rotate()
|
|||
}
|
||||
|
||||
|
||||
wxArrayString LIB_PIN::GetStyleNames( void )
|
||||
{
|
||||
wxArrayString tmp;
|
||||
|
||||
for( unsigned ii = 0; ii < PIN_STYLE_CNT; ii++ )
|
||||
tmp.Add( getPinStyleName( ii ) );
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
int LIB_PIN::GetStyleCode( int index )
|
||||
{
|
||||
if( index >= 0 && index < (int) PIN_STYLE_CNT )
|
||||
return pin_style_codes[ index ];
|
||||
|
||||
return NONE;
|
||||
}
|
||||
|
||||
|
||||
int LIB_PIN::GetStyleCodeIndex( int code )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for( i = 0; i < PIN_STYLE_CNT; i++ )
|
||||
{
|
||||
if( pin_style_codes[i] == code )
|
||||
return (int) i;
|
||||
}
|
||||
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
wxArrayString LIB_PIN::GetElectricalTypeNames( void )
|
||||
{
|
||||
wxArrayString tmp;
|
||||
|
||||
for( unsigned ii = 0; ii < PIN_ELECTRICAL_TYPE_CNT; ii++ )
|
||||
tmp.Add( LIB_PIN::GetElectricalTypeName( ii ) );
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
const BITMAP_DEF* LIB_PIN::GetElectricalTypeSymbols()
|
||||
{
|
||||
return iconsPinsElectricalType;
|
||||
}
|
||||
|
||||
|
||||
const BITMAP_DEF* LIB_PIN::GetOrientationSymbols()
|
||||
{
|
||||
return iconsPinsOrientations;
|
||||
}
|
||||
|
||||
|
||||
const BITMAP_DEF* LIB_PIN::GetStyleSymbols()
|
||||
{
|
||||
return iconsPinsShapes;
|
||||
}
|
||||
|
||||
|
||||
BITMAP_DEF LIB_PIN::GetMenuImage() const
|
||||
{
|
||||
return iconsPinsElectricalType[m_type];
|
||||
return GetBitmap( m_type );
|
||||
}
|
||||
|
||||
|
||||
|
@ -2261,12 +2193,7 @@ wxString LIB_PIN::GetSelectMenuText() const
|
|||
wxString tmp;
|
||||
wxString style;
|
||||
|
||||
int styleCode = GetStyleCodeIndex( m_shape );
|
||||
|
||||
if( styleCode >= 0 )
|
||||
style = getPinStyleName( styleCode );
|
||||
else
|
||||
style = wxT( "?" );
|
||||
style = GetText( m_shape );
|
||||
|
||||
tmp.Printf( _( "Pin %s, %s, %s" ),
|
||||
GetChars( GetNumberString() ),
|
||||
|
|
|
@ -32,46 +32,15 @@
|
|||
|
||||
#include <lib_draw_item.h>
|
||||
|
||||
#include "pin_shape.h"
|
||||
#include "pin_type.h"
|
||||
|
||||
#define TARGET_PIN_RADIUS 12 // Circle diameter drawn at the active end of pins
|
||||
|
||||
/**
|
||||
* The component library pin object electrical types used in ERC tests.
|
||||
*/
|
||||
enum ELECTRICAL_PINTYPE {
|
||||
PIN_INPUT,
|
||||
PIN_OUTPUT,
|
||||
PIN_BIDI,
|
||||
PIN_TRISTATE,
|
||||
PIN_PASSIVE,
|
||||
PIN_UNSPECIFIED,
|
||||
PIN_POWER_IN,
|
||||
PIN_POWER_OUT,
|
||||
PIN_OPENCOLLECTOR,
|
||||
PIN_OPENEMITTER,
|
||||
PIN_NC, /* No connect */
|
||||
PIN_NMAX /* End of List (not used as pin type) */
|
||||
};
|
||||
|
||||
|
||||
/* Pin visibility flag bit. */
|
||||
#define PIN_INVISIBLE 1 /* Set makes pin invisible */
|
||||
|
||||
|
||||
/**
|
||||
* The component library pin object drawing shapes.
|
||||
*/
|
||||
enum DrawPinShape {
|
||||
NONE = 0,
|
||||
INVERT = 1,
|
||||
CLOCK = 2,
|
||||
LOWLEVEL_IN = 4,
|
||||
LOWLEVEL_OUT = 8,
|
||||
CLOCK_FALL = 0x10, /* this is common form for inverted clock in Eastern Block */
|
||||
NONLOGIC = 0x20
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The component library pin object orientations.
|
||||
*/
|
||||
|
@ -94,7 +63,7 @@ class LIB_PIN : public LIB_ITEM
|
|||
wxPoint m_position; ///< Position of the pin.
|
||||
int m_length; ///< Length of the pin.
|
||||
int m_orientation; ///< Pin orientation (Up, Down, Left, Right)
|
||||
int m_shape; ///< Bitwise ORed of pin shapes (see enum DrawPinShape)
|
||||
GRAPHIC_PINSHAPE m_shape; ///< Shape drawn around pin
|
||||
int m_width; ///< Line width of the pin.
|
||||
ELECTRICAL_PINTYPE m_type; ///< Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
|
||||
int m_attributes; ///< Set bit 0 to indicate pin is invisible.
|
||||
|
@ -263,21 +232,21 @@ public:
|
|||
|
||||
void Rotate();
|
||||
|
||||
int GetShape() const { return m_shape; }
|
||||
GRAPHIC_PINSHAPE GetShape() const { return m_shape; }
|
||||
|
||||
/**
|
||||
* Set the shape of the pin to \a aShape.
|
||||
*
|
||||
* This will also update the draw style of the pins marked by EnableEditMode().
|
||||
*
|
||||
* @param aShape - The draw shape of the pin. See enum DrawPinShape.
|
||||
* @param aShape - The draw shape of the pin. See enum GRAPHIC_PINSHAPE.
|
||||
*/
|
||||
void SetShape( int aShape );
|
||||
void SetShape( GRAPHIC_PINSHAPE aShape );
|
||||
|
||||
/**
|
||||
* Get the electrical type of the pin.
|
||||
*
|
||||
* @return The electrical type of the pin (see enun ELECTRICAL_PINTYPE for values).
|
||||
* @return The electrical type of the pin (see enum ELECTRICAL_PINTYPE for values).
|
||||
*/
|
||||
ELECTRICAL_PINTYPE GetType() const { return m_type; }
|
||||
|
||||
|
@ -287,7 +256,7 @@ public:
|
|||
* @param aType is the electrical type (see enum ELECTRICAL_PINTYPE )
|
||||
* @return The electrical name for a pin type (see enun MsgPinElectricType for names).
|
||||
*/
|
||||
static const wxString GetCanonicalElectricalTypeName( unsigned aType );
|
||||
static const wxString GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType );
|
||||
|
||||
/**
|
||||
* return a string giving the electrical type of the pin.
|
||||
|
@ -299,20 +268,13 @@ public:
|
|||
return GetCanonicalElectricalTypeName( m_type );
|
||||
}
|
||||
|
||||
/**
|
||||
* return a translated string for messages giving the electrical type of a pin.
|
||||
* @param aType is the electrical type (see enum ELECTRICAL_PINTYPE )
|
||||
* @return The electrical name of the pin (see enun MsgPinElectricType for names).
|
||||
*/
|
||||
static const wxString GetElectricalTypeName( unsigned aType );
|
||||
|
||||
/**
|
||||
* return a translated string for messages giving the electrical type of the pin.
|
||||
* @return The electrical name of the pin.
|
||||
*/
|
||||
wxString const GetElectricalTypeName() const
|
||||
{
|
||||
return GetElectricalTypeName( m_type );
|
||||
return GetText( m_type );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -478,52 +440,6 @@ public:
|
|||
*/
|
||||
static int GetOrientationCodeIndex( int aCode );
|
||||
|
||||
/**
|
||||
* Get a list of pin draw style names.
|
||||
*
|
||||
* @return List of valid pin draw style names.
|
||||
*/
|
||||
static wxArrayString GetStyleNames();
|
||||
|
||||
/**
|
||||
* Get a list of pin styles bitmaps for menus and dialogs.
|
||||
*
|
||||
* @return List of valid pin electrical type bitmaps symbols in .xpm format.
|
||||
*/
|
||||
static const BITMAP_DEF* GetStyleSymbols();
|
||||
|
||||
/**
|
||||
* Get the pin draw style code by index used to set the pin draw style.
|
||||
*
|
||||
* @param aIndex - The index of the pin draw style code to look up.
|
||||
* @return Pin draw style code if index is valid. Returns NONE
|
||||
* style on index error.
|
||||
*/
|
||||
static int GetStyleCode( int aIndex );
|
||||
|
||||
/**
|
||||
* Get the index of the pin draw style code.
|
||||
*
|
||||
* @param aCode - The pin draw style code to look up.
|
||||
* @return The index of the pin draw style code if found. Otherwise,
|
||||
* return wxNOT_FOUND.
|
||||
*/
|
||||
static int GetStyleCodeIndex( int aCode );
|
||||
|
||||
/**
|
||||
* Get a list of pin electrical type names.
|
||||
*
|
||||
* @return List of valid pin electrical type names.
|
||||
*/
|
||||
static wxArrayString GetElectricalTypeNames();
|
||||
|
||||
/**
|
||||
* Get a list of pin electrical bitmaps for menus and dialogs.
|
||||
*
|
||||
* @return List of valid pin electrical type bitmaps symbols in .xpm format
|
||||
*/
|
||||
static const BITMAP_DEF* GetElectricalTypeSymbols();
|
||||
|
||||
void SetOffset( const wxPoint& aOffset );
|
||||
|
||||
bool Inside( EDA_RECT& aRect ) const;
|
||||
|
|
|
@ -114,12 +114,12 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
|
||||
if( item ) // The user has clicked on a sheet: this is an enter sheet command
|
||||
{
|
||||
m_CurrentSheet->Push( (SCH_SHEET*) item );
|
||||
m_CurrentSheet->push_back( (SCH_SHEET*) item );
|
||||
DisplayCurrentSheet();
|
||||
}
|
||||
else if( m_CurrentSheet->Last() != g_RootSheet )
|
||||
{ // The user has clicked ouside a sheet:this is an leave sheet command
|
||||
m_CurrentSheet->Pop();
|
||||
m_CurrentSheet->pop_back();
|
||||
DisplayCurrentSheet();
|
||||
}
|
||||
break;
|
||||
|
@ -356,7 +356,7 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
switch( item->Type() )
|
||||
{
|
||||
case SCH_SHEET_T:
|
||||
m_CurrentSheet->Push( (SCH_SHEET*) item );
|
||||
m_CurrentSheet->push_back( (SCH_SHEET*) item );
|
||||
DisplayCurrentSheet();
|
||||
break;
|
||||
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_shape.cpp
|
||||
* @brief Pin shape handling
|
||||
*/
|
||||
|
||||
#include "pin_shape.h"
|
||||
|
||||
#include <macros.h>
|
||||
|
||||
wxString GetText( GRAPHIC_PINSHAPE shape )
|
||||
{
|
||||
switch( shape )
|
||||
{
|
||||
case PINSHAPE_LINE:
|
||||
return _( "Line" );
|
||||
|
||||
case PINSHAPE_INVERTED:
|
||||
return _( "Inverted" );
|
||||
|
||||
case PINSHAPE_CLOCK:
|
||||
return _( "Clock" );
|
||||
|
||||
case PINSHAPE_INVERTED_CLOCK:
|
||||
return _( "Inverted clock" );
|
||||
|
||||
case PINSHAPE_INPUT_LOW:
|
||||
return _( "Input low" );
|
||||
|
||||
case PINSHAPE_CLOCK_LOW:
|
||||
return _( "Clock low" );
|
||||
|
||||
case PINSHAPE_OUTPUT_LOW:
|
||||
return _( "Output low" );
|
||||
|
||||
case PINSHAPE_FALLING_EDGE_CLOCK:
|
||||
return _( "Falling edge clock" );
|
||||
|
||||
case PINSHAPE_NONLOGIC:
|
||||
return _( "NonLogic" );
|
||||
}
|
||||
|
||||
assert( !"Invalid pin shape" );
|
||||
return wxT( "?" );
|
||||
}
|
||||
|
||||
|
||||
BITMAP_DEF GetBitmap( GRAPHIC_PINSHAPE shape )
|
||||
{
|
||||
switch( shape )
|
||||
{
|
||||
case PINSHAPE_LINE:
|
||||
return pinshape_normal_xpm;
|
||||
|
||||
case PINSHAPE_INVERTED:
|
||||
return pinshape_invert_xpm;
|
||||
|
||||
case PINSHAPE_CLOCK:
|
||||
return pinshape_clock_normal_xpm;
|
||||
|
||||
case PINSHAPE_INVERTED_CLOCK:
|
||||
return pinshape_clock_invert_xpm;
|
||||
|
||||
case PINSHAPE_INPUT_LOW:
|
||||
return pinshape_active_low_input_xpm;
|
||||
|
||||
case PINSHAPE_CLOCK_LOW:
|
||||
return pinshape_clock_active_low_xpm;
|
||||
|
||||
case PINSHAPE_OUTPUT_LOW:
|
||||
return pinshape_active_low_output_xpm;
|
||||
|
||||
case PINSHAPE_FALLING_EDGE_CLOCK:
|
||||
return pinshape_clock_fall_xpm;
|
||||
|
||||
case PINSHAPE_NONLOGIC:
|
||||
return pinshape_nonlogic_xpm;
|
||||
}
|
||||
|
||||
assert( !"Invalid pin shape" );
|
||||
return 0;
|
||||
};
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_shape.h
|
||||
* @brief Pin shape handling
|
||||
*/
|
||||
|
||||
#ifndef _PIN_SHAPE_H_
|
||||
#define _PIN_SHAPE_H_
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
enum GRAPHIC_PINSHAPE
|
||||
{
|
||||
PINSHAPE_LINE,
|
||||
PINSHAPE_INVERTED,
|
||||
PINSHAPE_CLOCK,
|
||||
PINSHAPE_INVERTED_CLOCK,
|
||||
PINSHAPE_INPUT_LOW,
|
||||
PINSHAPE_CLOCK_LOW,
|
||||
PINSHAPE_OUTPUT_LOW,
|
||||
PINSHAPE_FALLING_EDGE_CLOCK,
|
||||
PINSHAPE_NONLOGIC
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PINSHAPE_COUNT = PINSHAPE_NONLOGIC + 1
|
||||
};
|
||||
|
||||
// UI
|
||||
wxString GetText( GRAPHIC_PINSHAPE shape );
|
||||
BITMAP_DEF GetBitmap( GRAPHIC_PINSHAPE shape );
|
||||
|
||||
#endif
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_type.cpp
|
||||
* @brief Electrical pin type handling
|
||||
*/
|
||||
|
||||
#include "pin_type.h"
|
||||
|
||||
#include <macros.h>
|
||||
|
||||
wxString GetText( ELECTRICAL_PINTYPE aType )
|
||||
{
|
||||
switch( aType )
|
||||
{
|
||||
case PIN_INPUT:
|
||||
return _( "Input" );
|
||||
|
||||
case PIN_OUTPUT:
|
||||
return _( "Output" );
|
||||
|
||||
case PIN_BIDI:
|
||||
return _( "Bidirectional" );
|
||||
|
||||
case PIN_TRISTATE:
|
||||
return _( "Tri-state" );
|
||||
|
||||
case PIN_PASSIVE:
|
||||
return _( "Passive" );
|
||||
|
||||
case PIN_UNSPECIFIED:
|
||||
return _( "Unspecified" );
|
||||
|
||||
case PIN_POWER_IN:
|
||||
return _( "Power input" );
|
||||
|
||||
case PIN_POWER_OUT:
|
||||
return _( "Power output" );
|
||||
|
||||
case PIN_OPENCOLLECTOR:
|
||||
return _( "Open collector" );
|
||||
|
||||
case PIN_OPENEMITTER:
|
||||
return _( "Open emitter" );
|
||||
|
||||
case PIN_NC:
|
||||
return _( "Not connected" );
|
||||
};
|
||||
|
||||
assert( !"invalid pin type" );
|
||||
return wxT( "???" );
|
||||
}
|
||||
|
||||
|
||||
BITMAP_DEF GetBitmap( ELECTRICAL_PINTYPE aType )
|
||||
{
|
||||
switch( aType )
|
||||
{
|
||||
case PIN_INPUT:
|
||||
return pintype_input_xpm;
|
||||
|
||||
case PIN_OUTPUT:
|
||||
return pintype_output_xpm;
|
||||
|
||||
case PIN_BIDI:
|
||||
return pintype_bidi_xpm;
|
||||
|
||||
case PIN_TRISTATE:
|
||||
return pintype_3states_xpm;
|
||||
|
||||
case PIN_PASSIVE:
|
||||
return pintype_passive_xpm;
|
||||
|
||||
case PIN_UNSPECIFIED:
|
||||
return pintype_notspecif_xpm;
|
||||
|
||||
case PIN_POWER_IN:
|
||||
return pintype_powerinput_xpm;
|
||||
|
||||
case PIN_POWER_OUT:
|
||||
return pintype_poweroutput_xpm;
|
||||
|
||||
case PIN_OPENCOLLECTOR:
|
||||
return pintype_opencoll_xpm;
|
||||
|
||||
case PIN_OPENEMITTER:
|
||||
return pintype_openemit_xpm;
|
||||
|
||||
case PIN_NC:
|
||||
return pintype_noconnect_xpm;
|
||||
};
|
||||
|
||||
assert( !"invalid pin type" );
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_type.h
|
||||
* @brief Electrical pin type handling
|
||||
*/
|
||||
#ifndef PIN_TYPE_H_
|
||||
#define PIN_TYPE_H_
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
/**
|
||||
* The component library pin object electrical types used in ERC tests.
|
||||
*/
|
||||
enum ELECTRICAL_PINTYPE {
|
||||
PIN_INPUT,
|
||||
PIN_OUTPUT,
|
||||
PIN_BIDI,
|
||||
PIN_TRISTATE,
|
||||
PIN_PASSIVE,
|
||||
PIN_UNSPECIFIED,
|
||||
PIN_POWER_IN,
|
||||
PIN_POWER_OUT,
|
||||
PIN_OPENCOLLECTOR,
|
||||
PIN_OPENEMITTER,
|
||||
PIN_NC /* No connect */
|
||||
};
|
||||
|
||||
enum {
|
||||
PINTYPE_COUNT = PIN_NC + 1
|
||||
};
|
||||
|
||||
// UI
|
||||
wxString GetText( ELECTRICAL_PINTYPE );
|
||||
BITMAP_DEF GetBitmap( ELECTRICAL_PINTYPE );
|
||||
|
||||
#endif
|
|
@ -57,7 +57,7 @@ static wxPoint OldPos;
|
|||
static wxPoint PinPreviousPos;
|
||||
static ELECTRICAL_PINTYPE LastPinType = PIN_INPUT;
|
||||
static int LastPinOrient = PIN_RIGHT;
|
||||
static int LastPinShape = NONE;
|
||||
static GRAPHIC_PINSHAPE LastPinShape = PINSHAPE_LINE;
|
||||
static bool LastPinCommonConvert = false;
|
||||
static bool LastPinCommonUnit = false;
|
||||
static bool LastPinVisible = true;
|
||||
|
@ -104,10 +104,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
wxString units = GetUnitsLabel( g_UserUnit );
|
||||
dlg.SetOrientationList( LIB_PIN::GetOrientationNames(), LIB_PIN::GetOrientationSymbols() );
|
||||
dlg.SetOrientation( LIB_PIN::GetOrientationCodeIndex( pin->GetOrientation() ) );
|
||||
dlg.SetStyleList( LIB_PIN::GetStyleNames(), LIB_PIN::GetStyleSymbols() );
|
||||
dlg.SetStyle( LIB_PIN::GetStyleCodeIndex( pin->GetShape() ) );
|
||||
dlg.SetElectricalTypeList( LIB_PIN::GetElectricalTypeNames(),
|
||||
LIB_PIN::GetElectricalTypeSymbols() );
|
||||
dlg.SetStyle( pin->GetShape() );
|
||||
dlg.SetElectricalType( pin->GetType() );
|
||||
dlg.SetPinName( pin->GetName() );
|
||||
dlg.SetPinNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
|
||||
|
@ -147,7 +144,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
LastPinNumSize = ValueFromString( g_UserUnit, dlg.GetPadNameTextSize() );
|
||||
LastPinOrient = LIB_PIN::GetOrientationCode( dlg.GetOrientation() );
|
||||
LastPinLength = ValueFromString( g_UserUnit, dlg.GetLength() );
|
||||
LastPinShape = LIB_PIN::GetStyleCode( dlg.GetStyle() );
|
||||
LastPinShape = dlg.GetStyle();
|
||||
LastPinType = dlg.GetElectricalType();
|
||||
LastPinCommonConvert = dlg.GetAddToAllBodyStyles();
|
||||
LastPinCommonUnit = dlg.GetAddToAllParts();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2010 Lorenzo Marcantonio
|
||||
* Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -62,20 +62,11 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
if( sheetpath == NULL )
|
||||
break;
|
||||
|
||||
list.Clear();
|
||||
|
||||
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||
{
|
||||
schframe->SetCurrentSheet( list );
|
||||
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
schframe->SetSheetNumberAndCount();
|
||||
screen = schframe->GetCurrentSheet().LastScreen();
|
||||
}
|
||||
else // Should not happen
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
list = *sheetpath;
|
||||
schframe->SetCurrentSheet( list );
|
||||
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
schframe->SetSheetNumberAndCount();
|
||||
screen = schframe->GetCurrentSheet().LastScreen();
|
||||
sheetpath = SheetList.GetNext();
|
||||
}
|
||||
|
||||
|
@ -89,14 +80,16 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
wxFileName plotFileName = createPlotFileName( m_outputDirectoryName, fname,
|
||||
ext, &reporter );
|
||||
|
||||
if( PlotOneSheetDXF( plotFileName.GetFullPath(), screen, plot_offset, 1.0, aPlotFrameRef ) )
|
||||
if( PlotOneSheetDXF( plotFileName.GetFullPath(), screen, plot_offset, 1.0,
|
||||
aPlotFrameRef ) )
|
||||
{
|
||||
msg.Printf( _( "Plot: '%s' OK.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_ACTION );
|
||||
}
|
||||
else // Error
|
||||
{
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ),
|
||||
GetChars( plotFileName.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2010 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -135,21 +135,15 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
if( sheetpath == NULL )
|
||||
break;
|
||||
|
||||
list.Clear();
|
||||
list = *sheetpath;
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
|
||||
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||
{
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
|
||||
if( !screen ) // LastScreen() may return NULL
|
||||
screen = m_parent->GetScreen();
|
||||
}
|
||||
else // Should not happen
|
||||
return;
|
||||
if( !screen ) // LastScreen() may return NULL
|
||||
screen = m_parent->GetScreen();
|
||||
|
||||
sheetpath = SheetList.GetNext();
|
||||
}
|
||||
|
@ -192,7 +186,8 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ),
|
||||
GetChars( plotFileName.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2010 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -67,23 +67,20 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
|
||||
// First page handling is different
|
||||
bool first_page = true;
|
||||
|
||||
do
|
||||
{
|
||||
// Step over the schematic hierarchy
|
||||
if( aPlotAll )
|
||||
{
|
||||
SCH_SHEET_PATH list;
|
||||
wxCHECK_RET( sheetpath != NULL, wxT( "Attempt to plot undefined sheet path." ) );
|
||||
|
||||
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||
{
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
}
|
||||
else // Should not happen
|
||||
wxASSERT( 0 );
|
||||
SCH_SHEET_PATH list = *sheetpath;
|
||||
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
sheetpath = SheetList.GetNext();
|
||||
}
|
||||
|
||||
|
@ -99,7 +96,8 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
|
||||
if( !plotter->OpenFile( plotFileName.GetFullPath() ) )
|
||||
{
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ),
|
||||
GetChars( plotFileName.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||
delete plotter;
|
||||
return;
|
||||
|
@ -139,14 +137,12 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
msg.Printf( _( "Plot: '%s' OK.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_ACTION );
|
||||
|
||||
|
||||
restoreEnvironment(plotter, oldsheetpath );
|
||||
|
||||
restoreEnvironment( plotter, oldsheetpath );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLOT_SCHEMATIC::restoreEnvironment( PDF_PLOTTER* aPlotter,
|
||||
SCH_SHEET_PATH& aOldsheetpath )
|
||||
SCH_SHEET_PATH& aOldsheetpath )
|
||||
{
|
||||
aPlotter->EndPlot();
|
||||
delete aPlotter;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -62,18 +62,11 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
if( sheetpath == NULL )
|
||||
break;
|
||||
|
||||
list.Clear();
|
||||
|
||||
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||
{
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
}
|
||||
else // Should not happen
|
||||
return;
|
||||
|
||||
list = *sheetpath;
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
sheetpath = SheetList.GetNext();
|
||||
}
|
||||
|
||||
|
@ -125,7 +118,8 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
else
|
||||
{
|
||||
// Error
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
||||
msg.Printf( _( "Unable to create file '%s'.\n" ),
|
||||
GetChars( plotFileName.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -49,7 +49,7 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
|
|||
if( aPrintAll )
|
||||
{
|
||||
SCH_SHEET_PATH* sheetpath;
|
||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
||||
SCH_SHEET_LIST SheetList( NULL );
|
||||
sheetpath = SheetList.GetFirst();
|
||||
SCH_SHEET_PATH list;
|
||||
|
@ -62,20 +62,11 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
|
|||
}
|
||||
|
||||
SCH_SCREEN* screen;
|
||||
list.Clear();
|
||||
|
||||
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||
{
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
}
|
||||
else // Should not happen
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
list = *sheetpath;
|
||||
m_parent->SetCurrentSheet( list );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
sheetpath = SheetList.GetNext();
|
||||
|
||||
try
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2011 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -725,7 +725,7 @@ bool SCH_SHEET::LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList )
|
|||
{
|
||||
if( m_screen )
|
||||
{
|
||||
aList->Push( this );
|
||||
aList->push_back( this );
|
||||
|
||||
if( m_screen == aScreen )
|
||||
return true;
|
||||
|
@ -745,8 +745,9 @@ bool SCH_SHEET::LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList )
|
|||
strct = strct->Next();
|
||||
}
|
||||
|
||||
aList->Pop();
|
||||
aList->pop_back();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1082,7 +1083,7 @@ void SCH_SHEET::GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
|
|||
SCH_SHEET_PATH* aSheetPath )
|
||||
{
|
||||
SCH_SHEET_PATH sheetPath = *aSheetPath;
|
||||
sheetPath.Push( this );
|
||||
sheetPath.push_back( this );
|
||||
|
||||
for( size_t i = 0; i < m_pins.size(); i++ )
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -37,7 +37,6 @@
|
|||
|
||||
#include <sch_reference_list.h>
|
||||
#include <class_library.h>
|
||||
#include <sch_sheet.h>
|
||||
#include <sch_sheet_path.h>
|
||||
#include <sch_component.h>
|
||||
#include <template_fieldnames.h>
|
||||
|
@ -50,64 +49,25 @@
|
|||
|
||||
SCH_SHEET_PATH::SCH_SHEET_PATH()
|
||||
{
|
||||
for( int i = 0; i<DSLSZ; i++ )
|
||||
m_sheets[i] = NULL;
|
||||
|
||||
m_numSheets = 0;
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SHEET_PATH::BuildSheetPathInfoFromSheetPathValue( const wxString& aPath, bool aFound )
|
||||
{
|
||||
if( aFound )
|
||||
return true;
|
||||
|
||||
if( GetCount() == 0 )
|
||||
Push( g_RootSheet );
|
||||
|
||||
if( aPath == Path() )
|
||||
return true;
|
||||
|
||||
SCH_ITEM* schitem = LastDrawList();
|
||||
|
||||
while( schitem && GetCount() < NB_MAX_SHEET )
|
||||
{
|
||||
if( schitem->Type() == SCH_SHEET_T )
|
||||
{
|
||||
SCH_SHEET* sheet = (SCH_SHEET*) schitem;
|
||||
Push( sheet );
|
||||
|
||||
if( aPath == Path() )
|
||||
return true;
|
||||
|
||||
if( BuildSheetPathInfoFromSheetPathValue( aPath ) )
|
||||
return true;
|
||||
|
||||
Pop();
|
||||
}
|
||||
|
||||
schitem = schitem->Next();
|
||||
}
|
||||
|
||||
return false;
|
||||
m_pageNumber = 0;
|
||||
}
|
||||
|
||||
|
||||
int SCH_SHEET_PATH::Cmp( const SCH_SHEET_PATH& aSheetPathToTest ) const
|
||||
{
|
||||
if( m_numSheets > aSheetPathToTest.m_numSheets )
|
||||
if( size() > aSheetPathToTest.size() )
|
||||
return 1;
|
||||
|
||||
if( m_numSheets < aSheetPathToTest.m_numSheets )
|
||||
if( size() < aSheetPathToTest.size() )
|
||||
return -1;
|
||||
|
||||
//otherwise, same number of sheets.
|
||||
for( unsigned i = 0; i<m_numSheets; i++ )
|
||||
for( unsigned i = 0; i < size(); i++ )
|
||||
{
|
||||
if( m_sheets[i]->GetTimeStamp() > aSheetPathToTest.m_sheets[i]->GetTimeStamp() )
|
||||
if( at( i )->GetTimeStamp() > aSheetPathToTest.at( i )->GetTimeStamp() )
|
||||
return 1;
|
||||
|
||||
if( m_sheets[i]->GetTimeStamp() < aSheetPathToTest.m_sheets[i]->GetTimeStamp() )
|
||||
if( at( i )->GetTimeStamp() < aSheetPathToTest.at( i )->GetTimeStamp() )
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -117,8 +77,8 @@ int SCH_SHEET_PATH::Cmp( const SCH_SHEET_PATH& aSheetPathToTest ) const
|
|||
|
||||
SCH_SHEET* SCH_SHEET_PATH::Last() const
|
||||
{
|
||||
if( m_numSheets )
|
||||
return m_sheets[m_numSheets - 1];
|
||||
if( !empty() )
|
||||
return at( size() - 1 );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -150,8 +110,8 @@ SCH_ITEM* SCH_SHEET_PATH::FirstDrawList() const
|
|||
{
|
||||
SCH_ITEM* item = NULL;
|
||||
|
||||
if( m_numSheets && m_sheets[0]->GetScreen() )
|
||||
item = m_sheets[0]->GetScreen()->GetDrawItems();
|
||||
if( !empty() && at( 0 )->GetScreen() )
|
||||
item = at( 0 )->GetScreen()->GetDrawItems();
|
||||
|
||||
/* @fixme - These lists really should be one of the boost pointer containers. This
|
||||
* is a brain dead hack to allow reverse iteration of EDA_ITEM linked
|
||||
|
@ -169,29 +129,6 @@ SCH_ITEM* SCH_SHEET_PATH::FirstDrawList() const
|
|||
}
|
||||
|
||||
|
||||
void SCH_SHEET_PATH::Push( SCH_SHEET* aSheet )
|
||||
{
|
||||
wxCHECK_RET( m_numSheets < DSLSZ,
|
||||
wxString::Format( _( "Schematic sheets can only be nested %d levels deep." ),
|
||||
DSLSZ ) );
|
||||
|
||||
m_sheets[ m_numSheets ] = aSheet;
|
||||
m_numSheets++;
|
||||
}
|
||||
|
||||
|
||||
SCH_SHEET* SCH_SHEET_PATH::Pop()
|
||||
{
|
||||
if( m_numSheets > 0 )
|
||||
{
|
||||
m_numSheets--;
|
||||
return m_sheets[m_numSheets];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_SHEET_PATH::Path() const
|
||||
{
|
||||
wxString s, t;
|
||||
|
@ -201,9 +138,9 @@ wxString SCH_SHEET_PATH::Path() const
|
|||
// start at 1 to avoid the root sheet,
|
||||
// which does not need to be added to the path
|
||||
// it's timestamp changes anyway.
|
||||
for( unsigned i = 1; i < m_numSheets; i++ )
|
||||
for( unsigned i = 1; i < size(); i++ )
|
||||
{
|
||||
t.Printf( _( "%8.8lX/" ), (long unsigned) m_sheets[i]->GetTimeStamp() );
|
||||
t.Printf( _( "%8.8lX/" ), (long unsigned) at( i )->GetTimeStamp() );
|
||||
s = s + t;
|
||||
}
|
||||
|
||||
|
@ -218,9 +155,9 @@ wxString SCH_SHEET_PATH::PathHumanReadable() const
|
|||
s = wxT( "/" );
|
||||
|
||||
// start at 1 to avoid the root sheet, as above.
|
||||
for( unsigned i = 1; i< m_numSheets; i++ )
|
||||
for( unsigned i = 1; i < size(); i++ )
|
||||
{
|
||||
s = s + m_sheets[i]->GetName() + wxT( "/" );
|
||||
s = s + at( i )->GetName() + wxT( "/" );
|
||||
}
|
||||
|
||||
return s;
|
||||
|
@ -255,7 +192,7 @@ void SCH_SHEET_PATH::AnnotatePowerSymbols( PART_LIBS* aLibs, int* aReference )
|
|||
for( EDA_ITEM* item = LastDrawList(); item; item = item->Next() )
|
||||
{
|
||||
if( item->Type() != SCH_COMPONENT_T )
|
||||
continue;
|
||||
continue;
|
||||
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) item;
|
||||
LIB_PART* part = aLibs->FindLibPart( component->GetPartName() );
|
||||
|
@ -282,19 +219,9 @@ void SCH_SHEET_PATH::AnnotatePowerSymbols( PART_LIBS* aLibs, int* aReference )
|
|||
}
|
||||
|
||||
|
||||
void SCH_SHEET_PATH::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols )
|
||||
void SCH_SHEET_PATH::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences,
|
||||
bool aIncludePowerSymbols )
|
||||
{
|
||||
// Search to sheet path number:
|
||||
int sheetnumber = 1; // 1 = root
|
||||
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext(), sheetnumber++ )
|
||||
{
|
||||
if( Cmp( *path ) == 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
for( SCH_ITEM* item = LastDrawList(); item; item = item->Next() )
|
||||
{
|
||||
if( item->Type() == SCH_COMPONENT_T )
|
||||
|
@ -307,33 +234,28 @@ void SCH_SHEET_PATH::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aRefer
|
|||
continue;
|
||||
|
||||
LIB_PART* part = aLibs->FindLibPart( component->GetPartName() );
|
||||
|
||||
if( part )
|
||||
{
|
||||
SCH_REFERENCE reference = SCH_REFERENCE( component, part, *this );
|
||||
reference.SetSheetNumber( sheetnumber );
|
||||
reference.SetSheetNumber( m_pageNumber );
|
||||
aReferences.AddItem( reference );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SCH_SHEET_PATH::GetMultiUnitComponents( PART_LIBS* aLibs, SCH_MULTI_UNIT_REFERENCE_MAP &aRefList,
|
||||
bool aIncludePowerSymbols )
|
||||
|
||||
void SCH_SHEET_PATH::GetMultiUnitComponents( PART_LIBS* aLibs,
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP &aRefList,
|
||||
bool aIncludePowerSymbols )
|
||||
{
|
||||
// Find sheet path number
|
||||
int sheetnumber = 1; // 1 = root
|
||||
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext(), sheetnumber++ )
|
||||
{
|
||||
if( Cmp( *path ) == 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
for( SCH_ITEM* item = LastDrawList(); item; item = item->Next() )
|
||||
{
|
||||
if( item->Type() != SCH_COMPONENT_T ) continue;
|
||||
if( item->Type() != SCH_COMPONENT_T )
|
||||
continue;
|
||||
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) item;
|
||||
|
||||
// Skip pseudo components, which have a reference starting with #. This mainly
|
||||
|
@ -342,14 +264,16 @@ void SCH_SHEET_PATH::GetMultiUnitComponents( PART_LIBS* aLibs, SCH_MULTI_UNIT_RE
|
|||
continue;
|
||||
|
||||
LIB_PART* part = aLibs->FindLibPart( component->GetPartName() );
|
||||
|
||||
if( part && part->GetUnitCount() > 1 )
|
||||
{
|
||||
SCH_REFERENCE reference = SCH_REFERENCE( component, part, *this );
|
||||
reference.SetSheetNumber( sheetnumber );
|
||||
reference.SetSheetNumber( m_pageNumber );
|
||||
wxString reference_str = reference.GetRef();
|
||||
|
||||
// Never lock unassigned references
|
||||
if( reference_str[reference_str.Len() - 1] == '?' ) continue;
|
||||
if( reference_str[reference_str.Len() - 1] == '?' )
|
||||
continue;
|
||||
|
||||
aRefList[reference_str].AddItem( reference );
|
||||
}
|
||||
|
@ -435,33 +359,14 @@ bool SCH_SHEET_PATH::SetComponentFootprint( const wxString& aReference, const wx
|
|||
}
|
||||
|
||||
|
||||
SCH_SHEET_PATH& SCH_SHEET_PATH::operator=( const SCH_SHEET_PATH& d1 )
|
||||
{
|
||||
if( this == &d1 ) // Self assignment is bad!
|
||||
return *this;
|
||||
|
||||
m_numSheets = d1.m_numSheets;
|
||||
|
||||
unsigned i;
|
||||
|
||||
for( i = 0; i < m_numSheets; i++ )
|
||||
m_sheets[i] = d1.m_sheets[i];
|
||||
|
||||
for( ; i < DSLSZ; i++ )
|
||||
m_sheets[i] = 0;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SHEET_PATH::operator==( const SCH_SHEET_PATH& d1 ) const
|
||||
{
|
||||
if( m_numSheets != d1.m_numSheets )
|
||||
if( size() != d1.size() )
|
||||
return false;
|
||||
|
||||
for( unsigned i = 0; i < m_numSheets; i++ )
|
||||
for( unsigned i = 0; i < size(); i++ )
|
||||
{
|
||||
if( m_sheets[i] != d1.m_sheets[i] )
|
||||
if( at( i ) != d1[i] )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -492,9 +397,9 @@ bool SCH_SHEET_PATH::TestForRecursion( const wxString& aSrcFileName,
|
|||
/// located in the project folder which may or may not be desirable.
|
||||
unsigned i = 0;
|
||||
|
||||
while( i < m_numSheets )
|
||||
while( i < size() )
|
||||
{
|
||||
wxFileName cmpFn = m_sheets[i]->GetFileName();
|
||||
wxFileName cmpFn = at( i )->GetFileName();
|
||||
|
||||
if( cmpFn.IsRelative() )
|
||||
cmpFn.MakeAbsolute( rootFn.GetPath() );
|
||||
|
@ -508,7 +413,7 @@ bool SCH_SHEET_PATH::TestForRecursion( const wxString& aSrcFileName,
|
|||
|
||||
// The destination sheet file name was not found in the sheet path or the destination
|
||||
// sheet file name is the root sheet so no recursion is possible.
|
||||
if( i >= m_numSheets || i == 0 )
|
||||
if( i >= size() || i == 0 )
|
||||
return false;
|
||||
|
||||
// Walk back up to the root sheet to see if the source file name is already a parent in
|
||||
|
@ -517,7 +422,7 @@ bool SCH_SHEET_PATH::TestForRecursion( const wxString& aSrcFileName,
|
|||
{
|
||||
i -= 1;
|
||||
|
||||
wxFileName cmpFn = m_sheets[i]->GetFileName();
|
||||
wxFileName cmpFn = at( i )->GetFileName();
|
||||
|
||||
if( cmpFn.IsRelative() )
|
||||
cmpFn.MakeAbsolute( rootFn.GetPath() );
|
||||
|
@ -534,9 +439,9 @@ bool SCH_SHEET_PATH::TestForRecursion( const wxString& aSrcFileName,
|
|||
|
||||
int SCH_SHEET_PATH::FindSheet( const wxString& aFileName ) const
|
||||
{
|
||||
for( unsigned i = 0; i < m_numSheets; i++ )
|
||||
for( unsigned i = 0; i < size(); i++ )
|
||||
{
|
||||
if( m_sheets[i]->GetFileName().CmpNoCase( aFileName ) == 0 )
|
||||
if( at( i )->GetFileName().CmpNoCase( aFileName ) == 0 )
|
||||
return (int)i;
|
||||
}
|
||||
|
||||
|
@ -546,10 +451,10 @@ int SCH_SHEET_PATH::FindSheet( const wxString& aFileName ) const
|
|||
|
||||
SCH_SHEET* SCH_SHEET_PATH::FindSheetByName( const wxString& aSheetName )
|
||||
{
|
||||
for( unsigned i = 0; i < m_numSheets; i++ )
|
||||
for( unsigned i = 0; i < size(); i++ )
|
||||
{
|
||||
if( m_sheets[i]->GetName().CmpNoCase( aSheetName ) == 0 )
|
||||
return m_sheets[i];
|
||||
if( at( i )->GetName().CmpNoCase( aSheetName ) == 0 )
|
||||
return at( i );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -657,10 +562,17 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
|
|||
m_count = count;
|
||||
m_index = 0;
|
||||
m_list = new SCH_SHEET_PATH[ count ];
|
||||
m_currList.Clear();
|
||||
m_currList.clear();
|
||||
}
|
||||
|
||||
m_currList.Push( aSheet );
|
||||
m_currList.push_back( aSheet );
|
||||
|
||||
/**
|
||||
* @todo: Schematic page number is currently a left over relic and is generated as
|
||||
* SCH_SHEET_PATH object is pushed to the list. This only has meaning when
|
||||
* entire hierarchy is created from the root sheet down.
|
||||
*/
|
||||
m_currList.SetPageNumber( m_index + 1 );
|
||||
m_list[m_index] = m_currList;
|
||||
m_index++;
|
||||
|
||||
|
@ -680,7 +592,7 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
|
|||
}
|
||||
}
|
||||
|
||||
m_currList.Pop();
|
||||
m_currList.pop_back();
|
||||
}
|
||||
|
||||
|
||||
|
@ -896,7 +808,7 @@ bool SCH_SHEET_LIST::TestForRecursion( const SCH_SHEET_LIST& aSrcSheetHierarchy,
|
|||
{
|
||||
SCH_SHEET_PATH* sheetPath = aSrcSheetHierarchy.GetSheet( j );
|
||||
|
||||
for( unsigned k = 0; k < sheetPath->GetCount(); k++ )
|
||||
for( unsigned k = 0; k < sheetPath->size(); k++ )
|
||||
{
|
||||
if( m_list[i].TestForRecursion( sheetPath->GetSheet( k )->GetFileName(),
|
||||
aDestFileName ) )
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -76,11 +76,11 @@
|
|||
* (usable in flat and simple hierarchies).
|
||||
*/
|
||||
|
||||
#include "sch_sheet.h" // SCH_SHEETS
|
||||
|
||||
class wxFindReplaceData;
|
||||
class SCH_SCREEN;
|
||||
class SCH_MARKER;
|
||||
class SCH_SHEET;
|
||||
class SCH_ITEM;
|
||||
class SCH_REFERENCE_LIST;
|
||||
class PART_LIBS;
|
||||
|
@ -96,39 +96,34 @@ typedef std::map<wxString, SCH_REFERENCE_LIST> SCH_MULTI_UNIT_REFERENCE_MAP;
|
|||
|
||||
/**
|
||||
* Class SCH_SHEET_PATH
|
||||
* handles access to a sheet by way of a path.
|
||||
*
|
||||
* handles access to a stack of flattened #SCH_SHEET objects by way of a path for
|
||||
* creating a flattened schematic hierarchy.
|
||||
*
|
||||
* <p>
|
||||
* The member m_sheets stores the list of sheets from the first (usually
|
||||
* g_RootSheet) to a given sheet in last position.
|
||||
* The _last_ sheet is usually the sheet we want to select or reach (which is
|
||||
* what the function Last() returns).
|
||||
* Others sheets constitute the "path" from the first to the last sheet.
|
||||
* The #SCH_SHEET objects are stored in a list from first (usually the root sheet) to a
|
||||
* given sheet in last position. The _last_ sheet is usually the sheet we want to select
|
||||
* or reach (which is what the function Last() returns). Others sheets constitute the
|
||||
* "path" from the first to the last sheet.
|
||||
* </p>
|
||||
*/
|
||||
class SCH_SHEET_PATH
|
||||
class SCH_SHEET_PATH : public SCH_SHEETS
|
||||
{
|
||||
#define DSLSZ 32 // Max number of levels for a sheet path
|
||||
#define MAX_SHEET_DEPTH 32 /// Maximum number of levels for a sheet path.
|
||||
|
||||
SCH_SHEET* m_sheets[ DSLSZ ];
|
||||
unsigned m_numSheets;
|
||||
int m_pageNumber; /// Page numbers are maintained by the sheet load order.
|
||||
|
||||
public:
|
||||
SCH_SHEET_PATH();
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_numSheets = 0;
|
||||
}
|
||||
void SetPageNumber( int aPageNumber ) { m_pageNumber = aPageNumber; }
|
||||
|
||||
unsigned GetCount()
|
||||
{
|
||||
return m_numSheets;
|
||||
}
|
||||
int GetPageNumber() const { return m_pageNumber; }
|
||||
|
||||
SCH_SHEET* GetSheet( unsigned index )
|
||||
SCH_SHEET* GetSheet( unsigned aIndex )
|
||||
{
|
||||
if( index < m_numSheets )
|
||||
return m_sheets[index];
|
||||
if( aIndex < size() )
|
||||
return at( aIndex );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -171,24 +166,6 @@ public:
|
|||
*/
|
||||
SCH_ITEM* FirstDrawList() const;
|
||||
|
||||
/**
|
||||
* Function Push
|
||||
* store (push) aSheet in list
|
||||
* @param aSheet = pointer to the SCH_SHEET to store in list
|
||||
* Push is used when entered a sheet to select or analyze it
|
||||
* This is like cd <directory> in directories navigation
|
||||
*/
|
||||
void Push( SCH_SHEET* aSheet );
|
||||
|
||||
/**
|
||||
* Function Pop
|
||||
* retrieves (pop) the last entered sheet and remove it from list
|
||||
* @return a SCH_SHEET* pointer to the removed sheet in list
|
||||
* Pop is used when leaving a sheet after a selection or analyze
|
||||
* This is like cd .. in directories navigation
|
||||
*/
|
||||
SCH_SHEET* Pop();
|
||||
|
||||
/**
|
||||
* Function Path
|
||||
* the path uses the time stamps which do not changes even when editing
|
||||
|
@ -206,15 +183,6 @@ public:
|
|||
*/
|
||||
wxString PathHumanReadable() const;
|
||||
|
||||
/**
|
||||
* Function BuildSheetPathInfoFromSheetPathValue
|
||||
* Fill this with data to access to the hierarchical sheet known by its path \a aPath
|
||||
* @param aPath = path of the sheet to reach (in non human readable format)
|
||||
* @param aFound - Please document me.
|
||||
* @return true if success else false
|
||||
*/
|
||||
bool BuildSheetPathInfoFromSheetPathValue( const wxString& aPath, bool aFound = false );
|
||||
|
||||
/**
|
||||
* Function UpdateAllScreenReferences
|
||||
* updates the reference and the m_Multi parameter (part selection) for all
|
||||
|
@ -321,7 +289,15 @@ public:
|
|||
*/
|
||||
SCH_SHEET* FindSheetByName( const wxString& aSheetName );
|
||||
|
||||
SCH_SHEET_PATH& operator=( const SCH_SHEET_PATH& d1 );
|
||||
/**
|
||||
* Function FindSheetByPageNumber
|
||||
*
|
||||
* searches the #SCH_SHEET_LIST for a sheet with \a aPageNumber.
|
||||
*
|
||||
* @param aPageNumber is the number of the sheet to find.
|
||||
* @return a pointer to a #SCH_SHEET object page \a aPageNumber if found or NULL if not found.
|
||||
*/
|
||||
SCH_SHEET* FindSheetByPageNumber( int aPageNumber );
|
||||
|
||||
bool operator==( const SCH_SHEET_PATH& d1 ) const;
|
||||
|
||||
|
|
|
@ -466,7 +466,7 @@ void SCH_SHEET_PIN::CreateGraphicShape( std::vector <wxPoint>& aPoints, const wx
|
|||
* for INPUT type the icon is the OUTPUT shape of SCH_HIERLABEL
|
||||
* for OUTPUT type the icon is the INPUT shape of SCH_HIERLABEL
|
||||
*/
|
||||
int tmp = m_shape;
|
||||
PINSHEETLABEL_SHAPE tmp = m_shape;
|
||||
|
||||
switch( m_shape )
|
||||
{
|
||||
|
|
|
@ -102,11 +102,11 @@ static int* TemplateShape[5][4] =
|
|||
|
||||
SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
|
||||
SCH_ITEM( NULL, aType ),
|
||||
EDA_TEXT( text )
|
||||
EDA_TEXT( text ),
|
||||
m_shape( NET_INPUT )
|
||||
{
|
||||
m_Layer = LAYER_NOTES;
|
||||
m_Pos = pos;
|
||||
m_shape = 0;
|
||||
m_isDangling = false;
|
||||
m_MultilineAllowed = true;
|
||||
m_schematicOrientation = 0;
|
||||
|
|
|
@ -40,17 +40,16 @@ class LINE_READER;
|
|||
class NETLIST_OBJECT_LIST;
|
||||
|
||||
|
||||
/* Type of SCH_HIERLABEL and SCH_GLOBALLABEL
|
||||
/* Shape/Type of SCH_HIERLABEL and SCH_GLOBALLABEL
|
||||
* mainly used to handle the graphic associated shape
|
||||
*/
|
||||
typedef enum {
|
||||
enum PINSHEETLABEL_SHAPE {
|
||||
NET_INPUT,
|
||||
NET_OUTPUT,
|
||||
NET_BIDI,
|
||||
NET_TRISTATE,
|
||||
NET_UNSPECIFIED,
|
||||
NET_TMAX /* Last value */
|
||||
} TypeSheetLabel;
|
||||
NET_UNSPECIFIED
|
||||
};
|
||||
|
||||
|
||||
extern const char* SheetLabelType[]; /* names of types of labels */
|
||||
|
@ -58,7 +57,7 @@ extern const char* SheetLabelType[]; /* names of types of labels */
|
|||
class SCH_TEXT : public SCH_ITEM, public EDA_TEXT
|
||||
{
|
||||
protected:
|
||||
int m_shape;
|
||||
PINSHEETLABEL_SHAPE m_shape;
|
||||
|
||||
/// True if not connected to another object if the object derive from SCH_TEXT
|
||||
/// supports connections.
|
||||
|
@ -120,9 +119,9 @@ public:
|
|||
|
||||
int GetOrientation() { return m_schematicOrientation; }
|
||||
|
||||
int GetShape() const { return m_shape; }
|
||||
PINSHEETLABEL_SHAPE GetShape() const { return m_shape; }
|
||||
|
||||
void SetShape( int aShape ) { m_shape = aShape; }
|
||||
void SetShape( PINSHEETLABEL_SHAPE aShape ) { m_shape = aShape; }
|
||||
|
||||
/**
|
||||
* Function GetSchematicTextOffset (virtual)
|
||||
|
|
|
@ -315,7 +315,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
if( item && (item->Type() == SCH_SHEET_T) )
|
||||
{
|
||||
m_CurrentSheet->Push( (SCH_SHEET*) item );
|
||||
m_CurrentSheet->push_back( (SCH_SHEET*) item );
|
||||
DisplayCurrentSheet();
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_SCH_LEAVE_SHEET:
|
||||
if( m_CurrentSheet->Last() != g_RootSheet )
|
||||
{
|
||||
m_CurrentSheet->Pop();
|
||||
m_CurrentSheet->pop_back();
|
||||
DisplayCurrentSheet();
|
||||
}
|
||||
|
||||
|
|
|
@ -535,8 +535,8 @@ void SCH_EDIT_FRAME::CreateScreens()
|
|||
|
||||
g_RootSheet->GetScreen()->SetFileName( m_DefaultSchematicFileName );
|
||||
|
||||
m_CurrentSheet->Clear();
|
||||
m_CurrentSheet->Push( g_RootSheet );
|
||||
m_CurrentSheet->clear();
|
||||
m_CurrentSheet->push_back( g_RootSheet );
|
||||
|
||||
if( GetScreen() == NULL )
|
||||
{
|
||||
|
@ -680,7 +680,7 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
|
|||
g_RootSheet->GetScreen()->Clear();
|
||||
|
||||
// all sub sheets are deleted, only the main sheet is usable
|
||||
m_CurrentSheet->Clear();
|
||||
m_CurrentSheet->clear();
|
||||
|
||||
Destroy();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include <class_sch_screen.h>
|
||||
#include <sch_collectors.h>
|
||||
|
||||
// enum PINSHEETLABEL_SHAPE
|
||||
#include <sch_text.h>
|
||||
|
||||
class LIB_EDIT_FRAME;
|
||||
class LIB_VIEW_FRAME;
|
||||
|
@ -173,9 +175,9 @@ private:
|
|||
wxArrayString m_componentLibFiles;
|
||||
*/
|
||||
|
||||
static int m_lastSheetPinType; ///< Last sheet pin type.
|
||||
static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size.
|
||||
static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position.
|
||||
static PINSHEETLABEL_SHAPE m_lastSheetPinType; ///< Last sheet pin type.
|
||||
static wxSize m_lastSheetPinTextSize; ///< Last sheet pin text size.
|
||||
static wxPoint m_lastSheetPinPosition; ///< Last sheet pin position.
|
||||
|
||||
protected:
|
||||
TEMPLATES m_TemplateFieldNames;
|
||||
|
@ -669,7 +671,6 @@ public:
|
|||
void SetPrintSheetReference( bool aShow ) { m_printSheetReference = aShow; }
|
||||
|
||||
// Plot functions:
|
||||
// void ToPostProcess( wxCommandEvent& event );
|
||||
void PlotSchematic( wxCommandEvent& event );
|
||||
|
||||
// read and save files
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <dialogs/dialog_sch_edit_sheet_pin.h>
|
||||
|
||||
|
||||
int SCH_EDIT_FRAME::m_lastSheetPinType = NET_INPUT;
|
||||
PINSHEETLABEL_SHAPE SCH_EDIT_FRAME::m_lastSheetPinType = NET_INPUT;
|
||||
wxSize SCH_EDIT_FRAME::m_lastSheetPinTextSize( -1, -1 );
|
||||
wxPoint SCH_EDIT_FRAME::m_lastSheetPinPosition;
|
||||
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Simon Richter <Simon.Richter@hogyros.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_shape_combobox.cpp
|
||||
* @brief ComboBox widget for pin shape
|
||||
*/
|
||||
|
||||
#include "pin_shape_combobox.h"
|
||||
|
||||
#include <lib_pin.h>
|
||||
|
||||
PinShapeComboBox::PinShapeComboBox( wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n,
|
||||
const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name ) :
|
||||
wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
|
||||
{
|
||||
for( unsigned ii = 0; ii < PINSHAPE_COUNT; ++ii )
|
||||
{
|
||||
GRAPHIC_PINSHAPE shape = static_cast<GRAPHIC_PINSHAPE>( ii );
|
||||
|
||||
wxString text = GetText( shape );
|
||||
BITMAP_DEF bitmap = GetBitmap( shape );
|
||||
|
||||
if( bitmap == NULL )
|
||||
Append( text );
|
||||
else
|
||||
Insert( text, KiBitmap( bitmap ), ii );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GRAPHIC_PINSHAPE PinShapeComboBox::GetSelection()
|
||||
{
|
||||
return static_cast<GRAPHIC_PINSHAPE>( wxBitmapComboBox::GetSelection() );
|
||||
}
|
||||
|
||||
|
||||
void PinShapeComboBox::SetSelection( GRAPHIC_PINSHAPE aShape )
|
||||
{
|
||||
wxBitmapComboBox::SetSelection( aShape );
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Simon Richter <Simon.Richter@hogyros.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_shape_combobox.h
|
||||
* @brief ComboBox widget for pin shape
|
||||
*/
|
||||
|
||||
#include <wx/bmpcbox.h>
|
||||
|
||||
#include <pin_shape.h>
|
||||
|
||||
class PinShapeComboBox : public wxBitmapComboBox
|
||||
{
|
||||
public:
|
||||
/// @todo C++11: replace with forwarder
|
||||
|
||||
PinShapeComboBox( wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr );
|
||||
|
||||
GRAPHIC_PINSHAPE GetSelection();
|
||||
void SetSelection( GRAPHIC_PINSHAPE aShape );
|
||||
};
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Simon Richter <Simon.Richter@hogyros.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_type_combobox.cpp
|
||||
* @brief ComboBox widget for pin type
|
||||
*/
|
||||
|
||||
#include "pin_type_combobox.h"
|
||||
|
||||
#include <lib_pin.h>
|
||||
|
||||
PinTypeComboBox::PinTypeComboBox( wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n,
|
||||
const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name ) :
|
||||
wxBitmapComboBox( parent, id, value, pos, size, n, choices, style, validator, name )
|
||||
{
|
||||
for( unsigned ii = 0; ii < PINTYPE_COUNT; ++ii )
|
||||
{
|
||||
ELECTRICAL_PINTYPE type = static_cast<ELECTRICAL_PINTYPE>( ii );
|
||||
|
||||
wxString text = GetText( type );
|
||||
BITMAP_DEF bitmap = GetBitmap( type );
|
||||
|
||||
if( bitmap == NULL )
|
||||
Append( text );
|
||||
else
|
||||
Insert( text, KiBitmap( bitmap ), ii );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ELECTRICAL_PINTYPE PinTypeComboBox::GetSelection()
|
||||
{
|
||||
return static_cast<ELECTRICAL_PINTYPE>( wxBitmapComboBox::GetSelection() );
|
||||
}
|
||||
|
||||
|
||||
void PinTypeComboBox::SetSelection( ELECTRICAL_PINTYPE aType )
|
||||
{
|
||||
wxBitmapComboBox::SetSelection( aType );
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Simon Richter <Simon.Richter@hogyros.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file pin_type_combobox.h
|
||||
* @brief ComboBox widget for pin type
|
||||
*/
|
||||
|
||||
#include <wx/bmpcbox.h>
|
||||
|
||||
#include <pin_type.h>
|
||||
|
||||
class PinTypeComboBox : public wxBitmapComboBox
|
||||
{
|
||||
public:
|
||||
/// @todo C++11: replace with forwarder
|
||||
|
||||
PinTypeComboBox( wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr );
|
||||
|
||||
ELECTRICAL_PINTYPE GetSelection();
|
||||
void SetSelection( ELECTRICAL_PINTYPE aType );
|
||||
};
|
|
@ -1,11 +1,3 @@
|
|||
# the map generation creates on Windows/gcc a lot of useless warnings
|
||||
# so disable it on windows
|
||||
if( WIN32 AND NOT CMAKE_CROSSCOMPILING )
|
||||
set( MAKE_LINK_MAPS false )
|
||||
else()
|
||||
set( MAKE_LINK_MAPS true )
|
||||
endif()
|
||||
|
||||
add_definitions(-DGERBVIEW)
|
||||
|
||||
include_directories( BEFORE ${INC_BEFORE} )
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2014 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -72,6 +72,7 @@ void GERBVIEW_FRAME::InstallGerberOptionsDialog( wxCommandEvent& event )
|
|||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS( GERBVIEW_FRAME *parent) :
|
||||
DIALOG_DISPLAY_OPTIONS_BASE( parent, wxID_ANY )
|
||||
{
|
||||
|
@ -125,6 +126,7 @@ void DIALOG_DISPLAY_OPTIONS::initOptDialog( )
|
|||
|
||||
|
||||
m_OptZoomNoCenter->SetValue( m_Parent->GetCanvas()->GetEnableZoomNoCenter() );
|
||||
m_OptMousewheelPan->SetValue( m_Parent->GetCanvas()->GetEnableMousewheelPan() );
|
||||
m_OptMiddleButtonPan->SetValue( m_Parent->GetCanvas()->GetEnableMiddleButtonPan() );
|
||||
m_OptMiddleButtonPanLimited->SetValue( m_Parent->GetCanvas()->GetMiddleButtonPanLimited() );
|
||||
m_OptMiddleButtonPanLimited->Enable( m_OptMiddleButtonPan->GetValue() );
|
||||
|
@ -169,6 +171,7 @@ void DIALOG_DISPLAY_OPTIONS::OnOKBUttonClick( wxCommandEvent& event )
|
|||
m_Parent->SetPageSettings( pageInfo );
|
||||
|
||||
m_Parent->GetCanvas()->SetEnableZoomNoCenter( m_OptZoomNoCenter->GetValue() );
|
||||
m_Parent->GetCanvas()->SetEnableMousewheelPan( m_OptMousewheelPan->GetValue() );
|
||||
m_Parent->GetCanvas()->SetEnableMiddleButtonPan( m_OptMiddleButtonPan->GetValue() );
|
||||
m_Parent->GetCanvas()->SetMiddleButtonPanLimited( m_OptMiddleButtonPanLimited->GetValue() );
|
||||
|
||||
|
|
|
@ -12,114 +12,119 @@
|
|||
DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* bDialogSizer;
|
||||
bDialogSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bUpperSizer;
|
||||
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
wxBoxSizer* bLeftSizer;
|
||||
bLeftSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") };
|
||||
int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString );
|
||||
m_PolarDisplay = new wxRadioBox( this, wxID_ANY, _("Coordinates"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_PolarDisplay->SetSelection( 0 );
|
||||
bLeftSizer->Add( m_PolarDisplay, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxString m_BoxUnitsChoices[] = { _("Inches"), _("Millimeters") };
|
||||
int m_BoxUnitsNChoices = sizeof( m_BoxUnitsChoices ) / sizeof( wxString );
|
||||
m_BoxUnits = new wxRadioBox( this, wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, m_BoxUnitsNChoices, m_BoxUnitsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_BoxUnits->SetSelection( 0 );
|
||||
bLeftSizer->Add( m_BoxUnits, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxString m_CursorShapeChoices[] = { _("Small cross"), _("Full screen cursor") };
|
||||
int m_CursorShapeNChoices = sizeof( m_CursorShapeChoices ) / sizeof( wxString );
|
||||
m_CursorShape = new wxRadioBox( this, wxID_ANY, _("Cursor"), wxDefaultPosition, wxDefaultSize, m_CursorShapeNChoices, m_CursorShapeChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_CursorShape->SetSelection( 1 );
|
||||
bLeftSizer->Add( m_CursorShape, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_OptDisplayDCodes = new wxCheckBox( this, wxID_ANY, _("Show D codes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_OptDisplayDCodes->SetValue(true);
|
||||
m_OptDisplayDCodes->SetValue(true);
|
||||
bLeftSizer->Add( m_OptDisplayDCodes, 0, wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bUpperSizer->Add( bLeftSizer, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bMiddleSizer;
|
||||
bMiddleSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxString m_OptDisplayLinesChoices[] = { _("Sketch"), _("Filled") };
|
||||
int m_OptDisplayLinesNChoices = sizeof( m_OptDisplayLinesChoices ) / sizeof( wxString );
|
||||
m_OptDisplayLines = new wxRadioBox( this, wxID_ANY, _("Lines"), wxDefaultPosition, wxDefaultSize, m_OptDisplayLinesNChoices, m_OptDisplayLinesChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_OptDisplayLines->SetSelection( 1 );
|
||||
bMiddleSizer->Add( m_OptDisplayLines, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxString m_OptDisplayFlashedItemsChoices[] = { _("Sketch"), _("Filled") };
|
||||
int m_OptDisplayFlashedItemsNChoices = sizeof( m_OptDisplayFlashedItemsChoices ) / sizeof( wxString );
|
||||
m_OptDisplayFlashedItems = new wxRadioBox( this, wxID_ANY, _("Pads"), wxDefaultPosition, wxDefaultSize, m_OptDisplayFlashedItemsNChoices, m_OptDisplayFlashedItemsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_OptDisplayFlashedItems->SetSelection( 1 );
|
||||
bMiddleSizer->Add( m_OptDisplayFlashedItems, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxString m_OptDisplayPolygonsChoices[] = { _("Sketch"), _("Filled") };
|
||||
int m_OptDisplayPolygonsNChoices = sizeof( m_OptDisplayPolygonsChoices ) / sizeof( wxString );
|
||||
m_OptDisplayPolygons = new wxRadioBox( this, wxID_ANY, _("Polygons"), wxDefaultPosition, wxDefaultSize, m_OptDisplayPolygonsNChoices, m_OptDisplayPolygonsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_OptDisplayPolygons->SetSelection( 1 );
|
||||
bMiddleSizer->Add( m_OptDisplayPolygons, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bUpperSizer->Add( bMiddleSizer, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bRightSizer;
|
||||
bRightSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxString m_ShowPageLimitsChoices[] = { _("Full size without limits"), _("Full size"), _("Size A4"), _("Size A3"), _("Size A2"), _("Size A"), _("Size B"), _("Size C") };
|
||||
int m_ShowPageLimitsNChoices = sizeof( m_ShowPageLimitsChoices ) / sizeof( wxString );
|
||||
m_ShowPageLimits = new wxRadioBox( this, wxID_ANY, _("Page"), wxDefaultPosition, wxDefaultSize, m_ShowPageLimitsNChoices, m_ShowPageLimitsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_ShowPageLimits->SetSelection( 0 );
|
||||
bRightSizer->Add( m_ShowPageLimits, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
wxStaticBoxSizer* bLeftBottomSizer;
|
||||
bLeftBottomSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pan and Zoom") ), wxVERTICAL );
|
||||
|
||||
|
||||
m_OptZoomNoCenter = new wxCheckBox( bLeftBottomSizer->GetStaticBox(), wxID_ANY, _("Do not center and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_OptZoomNoCenter->SetToolTip( _("Keep the cursor at its current location when zooming") );
|
||||
|
||||
|
||||
bLeftBottomSizer->Add( m_OptZoomNoCenter, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
|
||||
m_OptMiddleButtonPan = new wxCheckBox( bLeftBottomSizer->GetStaticBox(), wxID_ANY, _("Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bLeftBottomSizer->Add( m_OptMiddleButtonPan, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
|
||||
m_OptMiddleButtonPanLimited = new wxCheckBox( bLeftBottomSizer->GetStaticBox(), wxID_ANY, _("Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bLeftBottomSizer->Add( m_OptMiddleButtonPanLimited, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bLeftBottomSizer->Add( m_OptMiddleButtonPanLimited, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_OptMousewheelPan = new wxCheckBox( bLeftBottomSizer->GetStaticBox(), wxID_ANY, _("Use touchpad to pan"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_OptMousewheelPan->SetToolTip( _("Use touchpad to pan canvas") );
|
||||
|
||||
bLeftBottomSizer->Add( m_OptMousewheelPan, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bRightSizer->Add( bLeftBottomSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bUpperSizer->Add( bRightSizer, 2, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
bDialogSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bDialogSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer1->AddButton( m_sdbSizer1OK );
|
||||
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
|
||||
m_sdbSizer1->Realize();
|
||||
|
||||
|
||||
bDialogSizer->Add( m_sdbSizer1, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( bDialogSizer );
|
||||
this->Layout();
|
||||
bDialogSizer->Fit( this );
|
||||
|
||||
|
||||
// Connect Events
|
||||
m_OptMiddleButtonPan->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this );
|
||||
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this );
|
||||
|
@ -132,5 +137,5 @@ DIALOG_DISPLAY_OPTIONS_BASE::~DIALOG_DISPLAY_OPTIONS_BASE()
|
|||
m_OptMiddleButtonPan->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnMiddleBtnPanEnbl ), NULL, this );
|
||||
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnCancelButtonClick ), NULL, this );
|
||||
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_OPTIONS_BASE::OnOKBUttonClick ), NULL, this );
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1041,7 +1041,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -1127,6 +1127,94 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Use touchpad to pan</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_OptMousewheelPan</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Use touchpad to pan canvas</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -36,7 +36,7 @@ class DIALOG_SHIM;
|
|||
class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
wxRadioBox* m_PolarDisplay;
|
||||
wxRadioBox* m_BoxUnits;
|
||||
|
@ -49,22 +49,23 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM
|
|||
wxCheckBox* m_OptZoomNoCenter;
|
||||
wxCheckBox* m_OptMiddleButtonPan;
|
||||
wxCheckBox* m_OptMiddleButtonPanLimited;
|
||||
wxCheckBox* m_OptMousewheelPan;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
wxButton* m_sdbSizer1Cancel;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOKBUttonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Gerbview Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Gerbview Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_DISPLAY_OPTIONS_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__GERBVIEW_DIALOG_DISPLAY_OPTIONS_FRAME_BASE_H__
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2014 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file options.cpp
|
||||
* @brief Set some general options of GerbView.
|
||||
*/
|
||||
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <common.h>
|
||||
#include <class_drawpanel.h>
|
||||
|
||||
#include <gerbview.h>
|
||||
#include <gerbview_id.h>
|
||||
|
||||
|
||||
/**
|
||||
* Function OnSelectOptionToolbar
|
||||
* called to validate current choices
|
||||
*/
|
||||
void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||
{
|
||||
int id = event.GetId();
|
||||
bool state;
|
||||
|
||||
switch( id )
|
||||
{
|
||||
case ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG:
|
||||
state = ! m_show_layer_manager_tools;
|
||||
id = ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR;
|
||||
break;
|
||||
|
||||
default:
|
||||
state = m_optionsToolBar->GetToolToggled( id );
|
||||
break;
|
||||
}
|
||||
|
||||
switch( id )
|
||||
{
|
||||
case ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH:
|
||||
m_DisplayOptions.m_DisplayFlashedItemsFill = not state;
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_LINES_SKETCH:
|
||||
m_DisplayOptions.m_DisplayLinesFill = not state;
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_POLYGONS_SKETCH:
|
||||
m_DisplayOptions.m_DisplayPolygonsFill = not state;
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_DCODES:
|
||||
SetElementVisibility( DCODES_VISIBLE, state );
|
||||
m_canvas->Refresh( true );
|
||||
break;
|
||||
|
||||
case ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR:
|
||||
// show/hide auxiliary Vertical layers and visibility manager toolbar
|
||||
m_show_layer_manager_tools = state;
|
||||
m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );
|
||||
m_auimgr.Update();
|
||||
GetMenuBar()->SetLabel( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
|
||||
m_show_layer_manager_tools ?
|
||||
_("Hide &Layers Manager" ) : _("Show &Layers Manager" ));
|
||||
break;
|
||||
|
||||
default:
|
||||
wxMessageBox( wxT( "GERBVIEW_FRAME::OnSelectOptionToolbar error" ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -328,6 +328,7 @@ EXTERN_BITMAP( module_wizard_xpm )
|
|||
EXTERN_BITMAP( module_filtered_list_xpm )
|
||||
EXTERN_BITMAP( module_pin_filtered_list_xpm )
|
||||
EXTERN_BITMAP( module_library_list_xpm )
|
||||
EXTERN_BITMAP( module_name_filtered_list_xpm )
|
||||
EXTERN_BITMAP( module_full_list_xpm )
|
||||
EXTERN_BITMAP( module_options_xpm )
|
||||
EXTERN_BITMAP( module_ratsnest_xpm )
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2016 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
|
||||
|
@ -73,6 +73,7 @@ private:
|
|||
bool m_abortRequest; ///< Flag used to abort long commands.
|
||||
|
||||
bool m_enableZoomNoCenter; ///< True to enable zooming around the crosshair instead of the center
|
||||
bool m_enableMousewheelPan; ///< True to enable mousewheel panning by default.
|
||||
bool m_enableMiddleButtonPan; ///< True to enable middle mouse button panning.
|
||||
bool m_panScrollbarLimits; ///< has meaning only if m_enableMiddleButtonPan = true
|
||||
///< true to limit panning to scrollbar current limits
|
||||
|
@ -142,6 +143,10 @@ public:
|
|||
|
||||
void SetAbortRequest( bool aAbortRequest ) { m_abortRequest = aAbortRequest; }
|
||||
|
||||
bool GetEnableMousewheelPan() const { return m_enableMousewheelPan; }
|
||||
|
||||
void SetEnableMousewheelPan( bool aEnable );
|
||||
|
||||
bool GetEnableMiddleButtonPan() const { return m_enableMiddleButtonPan; }
|
||||
|
||||
void SetEnableMiddleButtonPan( bool aEnable ) { m_enableMiddleButtonPan = aEnable; }
|
||||
|
|
|
@ -30,23 +30,15 @@
|
|||
* in menubars or popup menus
|
||||
*/
|
||||
|
||||
|
||||
#include <wx/menu.h>
|
||||
#include <wx/menuitem.h>
|
||||
|
||||
#include <bitmaps.h>
|
||||
|
||||
/**
|
||||
* Definition SETBITMAPS
|
||||
* is a macro use to add a bitmaps to check menu item.
|
||||
* @note Do not use with normal menu items or any platform other than Windows.
|
||||
* @param aImage is the image to add the menu item.
|
||||
*/
|
||||
#if defined( USE_IMAGES_IN_MENUS ) && defined( __WINDOWS__ )
|
||||
# define SETBITMAPS( aImage ) item->SetBitmaps( KiBitmap( checked_ok_xpm ), KiBitmap( aImage ) )
|
||||
#else
|
||||
# define SETBITMAPS( aImage )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Definition SETBITMAP
|
||||
* is a macro use to add a bitmap to a menu items.
|
||||
* SET_BITMAP is a macro used to add a bitmap to a menu item.
|
||||
* @note Do not use with checked menu items.
|
||||
* @param aImage is the image to add the menu item.
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
*
|
||||
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
|
||||
* Copyright (C) 2013 CERN
|
||||
* Copyright (C) 2013-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -49,7 +51,7 @@ public:
|
|||
VIEW_CONTROLS( VIEW* aView ) : m_view( aView ),
|
||||
m_forceCursorPosition( false ), m_cursorCaptured( false ), m_snappingEnabled( false ),
|
||||
m_grabMouse( false ), m_autoPanEnabled( false ), m_autoPanMargin( 0.1 ),
|
||||
m_autoPanSpeed( 0.15 ), m_warpCursor( false )
|
||||
m_autoPanSpeed( 0.15 ), m_warpCursor( false ), m_enableMousewheelPan( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -193,6 +195,25 @@ public:
|
|||
return m_warpCursor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function EnableMousewheelPan()
|
||||
* Enables or disables mousewheel panning.
|
||||
* @param aEnabled is true if mouse-wheel panning is enabled.
|
||||
*/
|
||||
virtual void EnableMousewheelPan( bool aEnable )
|
||||
{
|
||||
m_enableMousewheelPan = aEnable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function IsMousewheelPanEnabled()
|
||||
* Returns the current setting for mousewheel panning
|
||||
*/
|
||||
virtual bool IsMousewheelPanEnabled() const
|
||||
{
|
||||
return m_enableMousewheelPan;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function CenterOnCursor()
|
||||
* Sets the viewport center to the current cursor position and warps the cursor to the
|
||||
|
@ -239,6 +260,9 @@ protected:
|
|||
|
||||
/// If the cursor is allowed to be warped
|
||||
bool m_warpCursor;
|
||||
|
||||
/// Mousewheel (2-finger touchpad) panning
|
||||
bool m_enableMousewheelPan;
|
||||
};
|
||||
} // namespace KIGFX
|
||||
|
||||
|
|
|
@ -111,9 +111,6 @@ if( APPLE )
|
|||
# do all the work
|
||||
include( BundleUtilities )
|
||||
|
||||
# If `BU_CHMOD_BUNDLE_ITEMS` is not set, `install_name_tool` will fail to re-write some loader paths due to lack of writable permissions if the build dependencies were installed by brew (or didn't have writable permissions)
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
|
||||
fixup_bundle( ${OSX_BUNDLE_INSTALL_BIN_DIR}/kicad
|
||||
\"\${BUNDLE_FIX_LIBS}\"
|
||||
\"\"
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
/**
|
||||
* @file class_treeproject_item.cpp
|
||||
*
|
||||
* @brief Class TREEPROJECT_ITEM is a derived class from wxTreeItemData and
|
||||
* store info about a file or directory shown in the KiCad tree project files
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
|
@ -28,21 +21,24 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file class_treeproject_item.cpp
|
||||
*
|
||||
* @brief Class TREEPROJECT_ITEM is a derived class from wxTreeItemData and
|
||||
* store info about a file or directory shown in the KiCad tree project files
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <gestfich.h>
|
||||
#include <macros.h>
|
||||
|
||||
#include <kicad.h>
|
||||
#include <project.h>
|
||||
#include <pgm_base.h>
|
||||
#include <tree_project_frame.h>
|
||||
#include <class_treeprojectfiles.h>
|
||||
#include <class_treeproject_item.h>
|
||||
#include <wx/imaglist.h>
|
||||
|
||||
#include <wx/regex.h>
|
||||
#include <wx/dir.h>
|
||||
|
||||
#include <gestfich.h>
|
||||
|
||||
#include "class_treeprojectfiles.h"
|
||||
#include "pgm_kicad.h"
|
||||
#include "tree_project_frame.h"
|
||||
|
||||
#include "class_treeproject_item.h"
|
||||
|
||||
|
||||
TREEPROJECT_ITEM::TREEPROJECT_ITEM( enum TreeFileType type, const wxString& data,
|
||||
wxTreeCtrl* parent ) :
|
||||
|
|
|
@ -25,6 +25,12 @@
|
|||
#ifndef TREEPROJECT_ITEM_H_
|
||||
#define TREEPROJECT_ITEM_H_
|
||||
|
||||
|
||||
#include <wx/treebase.h>
|
||||
|
||||
#include "kicad.h"
|
||||
|
||||
|
||||
/**
|
||||
* Class TREEPROJECT_ITEM
|
||||
* handles one item (a file or a directory name) for the tree file
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
/**
|
||||
* @file class_treeprojectfiles.cpp
|
||||
* this is the wxTreeCtrl that shows a KiCad tree project files
|
||||
*/
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
|
@ -26,17 +22,18 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file class_treeprojectfiles.cpp
|
||||
* this is the wxTreeCtrl that shows a KiCad tree project files
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
|
||||
#include <kicad.h>
|
||||
#include <tree_project_frame.h>
|
||||
#include <class_treeprojectfiles.h>
|
||||
#include <class_treeproject_item.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <wx/regex.h>
|
||||
#include <wx/imaglist.h>
|
||||
#include <menus_helpers.h>
|
||||
#include "class_treeproject_item.h"
|
||||
#include "tree_project_frame.h"
|
||||
|
||||
#include "class_treeprojectfiles.h"
|
||||
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS( TREEPROJECTFILES, wxTreeCtrl )
|
||||
|
@ -109,4 +106,3 @@ int TREEPROJECTFILES::OnCompareItems( const wxTreeItemId& item1, const wxTreeIte
|
|||
|
||||
return myitem1->GetFileName().CmpNoCase( myitem2->GetFileName() );
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,12 @@
|
|||
#ifndef CLASS_TREEPROJECTFILES_H
|
||||
#define CLASS_TREEPROJECTFILES_H
|
||||
|
||||
|
||||
#include <wx/treectrl.h>
|
||||
|
||||
#include "kicad.h"
|
||||
|
||||
|
||||
/** Class TREEPROJECTFILES
|
||||
* This is the class to show (as a tree) the files in the project directory
|
||||
*/
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/**
|
||||
* @file commandframe.cpp
|
||||
* @brief Frame showing fast launch buttons and messages box
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
|
@ -27,12 +22,15 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file commandframe.cpp
|
||||
* @brief Frame showing fast launch buttons and messages box
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <macros.h>
|
||||
|
||||
#include <kicad.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include "kicad.h"
|
||||
|
||||
|
||||
LAUNCHER_PANEL::LAUNCHER_PANEL( wxWindow* parent ) :
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
/**
|
||||
* @file kicad/files-io.cpp
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
|
@ -26,21 +22,23 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <pgm_kicad.h>
|
||||
#include <kiway.h>
|
||||
#include <wx/fs_zip.h>
|
||||
#include <wx/zipstrm.h>
|
||||
#include <wx/docview.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/zstream.h>
|
||||
/**
|
||||
* @file kicad/files-io.cpp
|
||||
*/
|
||||
|
||||
|
||||
#include <wx/dir.h>
|
||||
#include <wx/fs_zip.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/zipstrm.h>
|
||||
|
||||
#include <confirm.h>
|
||||
#include <gestfich.h>
|
||||
#include <macros.h>
|
||||
#include <kiway.h>
|
||||
|
||||
#include "pgm_kicad.h"
|
||||
|
||||
#include "kicad.h"
|
||||
|
||||
#include <kicad.h>
|
||||
|
||||
#define ZipFileExtension wxT( "zip" )
|
||||
#define ZipFileWildcard _( "Zip file (*.zip)|*.zip" )
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/**
|
||||
* @file kicad.cpp
|
||||
* @brief Main KiCad Project manager file
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
|
@ -27,19 +22,26 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file kicad.cpp
|
||||
* @brief Main KiCad Project manager file
|
||||
*/
|
||||
|
||||
#include <macros.h>
|
||||
#include <fctsys.h>
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/stdpaths.h>
|
||||
#include <kicad.h>
|
||||
#include <kiway.h>
|
||||
#include <pgm_kicad.h>
|
||||
#include <tree_project_frame.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
#include <hotkeys_basic.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
#include <build_version.h>
|
||||
#include <common.h>
|
||||
#include <hotkeys_basic.h>
|
||||
#include <kiway.h>
|
||||
#include <richio.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
#include "pgm_kicad.h"
|
||||
|
||||
#include "kicad.h"
|
||||
|
||||
|
||||
/// Extend LIB_ENV_VAR list with the directory from which I came, prepending it.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue