Compare commits
429 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad43570ec0 | |||
| 5dd4718db0 | |||
| ea70d8cf4c | |||
| cd2879880a | |||
| b51c8c1b3d | |||
| 5db1ee930f | |||
| 695dd57477 | |||
| 224c989072 | |||
| 80db7ff8cf | |||
| 6e6d3e9b03 | |||
| c08dd172d6 | |||
| 7972805d07 | |||
| a86147b4b1 | |||
| 335bb8792f | |||
| c8f7887cf8 | |||
| 2fe5c28787 | |||
| 64365de9de | |||
| a950d55cb2 | |||
| 3748a10ed5 | |||
| 227bb76909 | |||
| a20a6bb2a3 | |||
| 7c17aa5974 | |||
| 59795c81c5 | |||
| 84d00a7887 | |||
| 3774e31db8 | |||
| 69ac570658 | |||
| 46ecb22ef5 | |||
| ff7ea6eae0 | |||
| 2f70ac171f | |||
| 360011e563 | |||
| 2a0785d188 | |||
| a480b1a5ba | |||
| 6f31e306a1 | |||
| 5983815415 | |||
| 288050b6ec | |||
| 6d36363403 | |||
| 720c7d9fc4 | |||
| e009afd4a1 | |||
| 9e13ff25d0 | |||
| af1899ddc3 | |||
| beb30dd881 | |||
| 6d09293b11 | |||
| ca7378924c | |||
| 74316a62d3 | |||
| 3150f467bb | |||
| c033c364d4 | |||
| 37c14a65ed | |||
| dbf64ac0cf | |||
| 0eda576189 | |||
| 6ee9fb4027 | |||
| 64134cee92 | |||
| fead0eb33b | |||
| ff71b324a1 | |||
| b10ab478bd | |||
| 710b6adb8c | |||
| 6a01bdbabd | |||
| 76e19c6dcf | |||
| 8af289c33e | |||
| 35fa7db5c7 | |||
| 67739ee3d1 | |||
| d8ba7284a8 | |||
| fdc0309592 | |||
| 55d77f0dbb | |||
| 14fafebbc7 | |||
| 7ca472deb8 | |||
| fdb3612565 | |||
| bf59a6305a | |||
| 17db770d92 | |||
| b3004c9d96 | |||
| c54ebdecd2 | |||
| 6fc15ed8df | |||
| e7779d9b91 | |||
| 06a91637a7 | |||
| 08e9ce2828 | |||
| 24f82ab87d | |||
| bcf069699d | |||
| f8d694e4d0 | |||
| b80334baa1 | |||
| 6c359e2f06 | |||
| a3eff548b7 | |||
| e33a732371 | |||
| 95d3200a3a | |||
| 5ee7ae4a45 | |||
| b13a9e231b | |||
| 1011f361fd | |||
| 288a08b9c2 | |||
| cac1979f61 | |||
| 38a9477423 | |||
| 072446e79d | |||
| 4fc528819d | |||
| d5f52000ce | |||
| 8e4d7da4ea | |||
| ea3f0bada4 | |||
| 3b33ce8bcc | |||
| 74b42f1bb2 | |||
| b455a4cd54 | |||
| 5021f6ee26 | |||
| 0be2b88f5a | |||
| f3a57cf763 | |||
| ddd69019bc | |||
| 94e34cb1eb | |||
| 6470212edd | |||
| 8c3bcade1c | |||
| 70e99acce6 | |||
| 25be138ac1 | |||
| 9f196d2e64 | |||
| b51fed4118 | |||
| a914f361d3 | |||
| 846b634e0e | |||
| 08b54e205d | |||
| 7cba1e1a55 | |||
| 6ae334a751 | |||
| 61687e8499 | |||
| e014f2274f | |||
| 7e0f05f991 | |||
| 1e21b41be5 | |||
| 4a7dcfdd1f | |||
| d1684b8a72 | |||
| 8da026baff | |||
| 89a3ead51e | |||
| 5064834716 | |||
| 51a3859d7e | |||
| bf37bd8ed5 | |||
| 283fed83c3 | |||
| 48983dd31d | |||
| ccd4b0cf05 | |||
| 154c755a1b | |||
| 4157d3350e | |||
| 08ba185003 | |||
| 7b0e5cd080 | |||
| 66f50d0c0b | |||
| 973d2d6c03 | |||
| fa854b80da | |||
| 05f8bc05ec | |||
| d9af68b910 | |||
| 0c8172880f | |||
| 45559cb809 | |||
| d3e1d94046 | |||
| 2c75396b80 | |||
| 7aae0a9f65 | |||
| bfd6d96ffc | |||
| f4efa47fe7 | |||
| d1fd8b18ad | |||
| 5ee1c0ab42 | |||
| 8d53326021 | |||
| 246afee56e | |||
| 352faf526f | |||
| c183a63c50 | |||
| 9c34432b99 | |||
| 76bc0e27fc | |||
| b2f6d341dd | |||
| 7b5afe805e | |||
| b77a591c45 | |||
| 3adec39b0c | |||
| a0ad6add34 | |||
| 80079c16e8 | |||
| 632ae136d8 | |||
| 88b11ef065 | |||
| 63b89688df | |||
| ab9a4295a0 | |||
| e6ce4eb73e | |||
| 86f122416b | |||
| be91576758 | |||
| 784c2cda5a | |||
| 836de8d233 | |||
| ac01d1986f | |||
| 8a0693d328 | |||
| 2a62ffe32d | |||
| cb895c9710 | |||
| 52a73986bc | |||
| 15582773bd | |||
| fc3435113d | |||
| 801492b708 | |||
| 8c25e5b68e | |||
| 1525da154f | |||
| f2199eebf5 | |||
| 1a761bf6ce | |||
| 21f8b23ade | |||
| 4fc82b97cf | |||
| 721e7359b3 | |||
| 7e0c822451 | |||
| 6d9160ea31 | |||
| 31cc51fe42 | |||
| c85ef81e6b | |||
| ddb29d6ab8 | |||
| d666021572 | |||
| 360d6d87a4 | |||
| 97d3b369d5 | |||
| 7936df3e1e | |||
| eca370792a | |||
| af68514acd | |||
| a0e0f05977 | |||
| 78c09b1e2f | |||
| a2051132b5 | |||
| a67bf40def | |||
| 9b47650b4a | |||
| 748dd4f02c | |||
| 530167cf69 | |||
| 7d6e8853db | |||
| 9f3631f0e9 | |||
| c8253a5018 | |||
| 3aaae7405d | |||
| f2e012119a | |||
| 48b9027842 | |||
| 0511926a4c | |||
| 1ac1a5bb3b | |||
| 6cfe4482f7 | |||
| 61680eacd4 | |||
| 3aef3818cd | |||
| 355805756e | |||
| 96acf00e81 | |||
| 1ad4fb2eea | |||
| 1dcd65ec71 | |||
| 1109878da0 | |||
| 7a0803f384 | |||
| 8f56d0b38e | |||
| 9309f612ef | |||
| d2b13060fe | |||
| 393a72216e | |||
| 76e50881fb | |||
| 9779ee0fd3 | |||
| 9fdd825681 | |||
| f4f9513f80 | |||
| d35431c888 | |||
| bcb7acf5c2 | |||
| 1e82ed302d | |||
| 1fde8ea6f5 | |||
| dab3a38815 | |||
| c9db8f6bfc | |||
| 3c655836df | |||
| 544b235910 | |||
| bf34bf24ab | |||
| 6b199c52a1 | |||
| 94f667d87f | |||
| 464c3815b9 | |||
| 53732e2276 | |||
| bd554a5808 | |||
| b48051d52f | |||
| 03079a4f4f | |||
| 6daa857c2d | |||
| 5a1f60a7c6 | |||
| e8553dcdf7 | |||
| dc3012933a | |||
| 291ff615bc | |||
| 26d1080e52 | |||
| c1452a24d2 | |||
| 34c833966f | |||
| f0e1bc3562 | |||
| 6da9034322 | |||
| 6887e8cbe3 | |||
| 89ef5986e7 | |||
| 5572a72bb3 | |||
| b40e446149 | |||
| 757bfd7b32 | |||
| c5e1c3db62 | |||
| b25ff44ff7 | |||
| cad7a18fa0 | |||
| 1c3637cb33 | |||
| 3a5f84d1ec | |||
| 44f8df592b | |||
| 17e19f8652 | |||
| 34fe104431 | |||
| 2bdb155838 | |||
| 22ebade907 | |||
| 9d594214fe | |||
| 2c89717c0a | |||
| 7574a46a19 | |||
| e5c4d75ce1 | |||
| f038ee3083 | |||
| e1ab2a0836 | |||
| 9070d9ff22 | |||
| 606c19780d | |||
| 8fecebb209 | |||
| da8e1be1c8 | |||
| e14a3caf18 | |||
| 5afb3ad5cc | |||
| b29ca47f25 | |||
| 5d1737d654 | |||
| bdc371f057 | |||
| dc2dd20ec7 | |||
| 057174caa0 | |||
| 4b035d5b5c | |||
| b22948988f | |||
| 7a05d58b3e | |||
| 695ab290e6 | |||
| 54a373a7e2 | |||
| 637f331724 | |||
| 931a9697ca | |||
| 5ffc58844f | |||
| 3ea2c6f1ff | |||
| 2cba724659 | |||
| 254260a616 | |||
| 45b13d513b | |||
| ba86c3ac75 | |||
| 19d4c31fcc | |||
| 160f69d720 | |||
| 4fa42960e9 | |||
| 9c4ca6da14 | |||
| c113385016 | |||
| 68e37a93ec | |||
| 9b158e70f5 | |||
| ab536192c3 | |||
| bc87b0db60 | |||
| 981f82db93 | |||
| b6f5aeba1e | |||
| 4fa34677ea | |||
| c67346991f | |||
| 811de6a462 | |||
| cfe7992723 | |||
| 8c84f2ac23 | |||
| fb23d62b6b | |||
| 84f182ef03 | |||
| 987d151977 | |||
| c622da5fbf | |||
| 19f163b724 | |||
| 3fcf207443 | |||
| 4814f29fbd | |||
| 39f4ea5ffa | |||
| 5d08531ecb | |||
| 4a0fdfd2ab | |||
| c88aab3a4f | |||
| bf4aebff4d | |||
| 39627bfcfa | |||
| 55fafe3401 | |||
| dd870deec5 | |||
| 7ecf18ba80 | |||
| 68e4ccf196 | |||
| 0a28398944 | |||
| 27002f568b | |||
| 9b5840b7ee | |||
| 5a3f8b4235 | |||
| 7be78d50a4 | |||
| b1f861137e | |||
| 3e3a958d4f | |||
| cc5a3eb61f | |||
| eabf2f57aa | |||
| 1667b1312e | |||
| 1123a25f04 | |||
| ef757ffd28 | |||
| f63d018f1c | |||
| 83de056de9 | |||
| 015906d862 | |||
| c288c469fb | |||
| 7a8efc1d27 | |||
| aaaa8a8835 | |||
| 2891c580b1 | |||
| 97d75ae844 | |||
| 7ccc89196b | |||
| 7774145a8f | |||
| 0bf2d2ca32 | |||
| 6338a69f17 | |||
| 5f8ba6f9a1 | |||
| a53bbd92f5 | |||
| aa71423d5f | |||
| f3ae7afec2 | |||
| 29194761e5 | |||
| f56c05ac3e | |||
| 15256b379c | |||
| b4113decc5 | |||
| b249932888 | |||
| 6b6057b194 | |||
| b9623e9359 | |||
| 735b05ba30 | |||
| 62724f9cb6 | |||
| 2e4dd4bc3f | |||
| 87139ce571 | |||
| 582d2e7bdb | |||
| 5c89937870 | |||
| 412e244d48 | |||
| 0940565025 | |||
| c5b2e859c1 | |||
| e06a8131c5 | |||
| 16dee8608b | |||
| 396e531e7c | |||
| 24c234fd93 | |||
| fdbe35e20c | |||
| cc3e3ee34c | |||
| d0da1725ca | |||
| 7e115249af | |||
| 07e8edfcdf | |||
| cbb2c187bd | |||
| 011018b002 | |||
| d3a44607e6 | |||
| 1ad3532740 | |||
| 26caad8b35 | |||
| f1da2e90d7 | |||
| 59492bd947 | |||
| 7b96cc3d0c | |||
| df873158bc | |||
| f88e1aa279 | |||
| a02f12c68a | |||
| cc141e346d | |||
| f5954b0d7d | |||
| 6bb1e59e10 | |||
| ced6b1cbb7 | |||
| d1d7d0eb05 | |||
| e1e196f1b1 | |||
| b55d760cd5 | |||
| b0a0408528 | |||
| d238a149a6 | |||
| 57d2f7209a | |||
| 8d08992c24 | |||
| 9938e7f723 | |||
| 17ad578675 | |||
| 044dd59c5c | |||
| 6ef90cfa18 | |||
| 7abf4c2d91 | |||
| 896ff72019 | |||
| 9c2eeb54fc | |||
| 69f583660f | |||
| 6334c733e1 | |||
| a50144f889 | |||
| 1ed85d521d | |||
| 793790b359 | |||
| 154112d4cc | |||
| 97d8ddeb4f | |||
| 4809b00206 | |||
| 5bc1040a8b | |||
| f6c8dbe81e | |||
| 0280989920 | |||
| 0b762fb804 | |||
| b71eb1186f | |||
| c78273cb99 | |||
| 26b8978b3e | |||
| 618bbfda8d | |||
| ee573a1480 | |||
| 20efc3b6e6 | |||
| 8632e74c5c | |||
| 6f35fd7058 |
@@ -381,7 +381,13 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
|
||||
|
||||
fclose( fp );
|
||||
unsigned int digest[5];
|
||||
dblock.get_digest( digest );
|
||||
// V8 only
|
||||
// Boost 1.86 and later changed digest_type from uchar[20] from int[5]
|
||||
// But KiCad 8.99 and later use MurmurHash3 here, so just do a fairly ugly cast to keep
|
||||
// this going for another few months.
|
||||
static_assert( sizeof( digest ) == sizeof( boost::uuids::detail::sha1::digest_type& ),
|
||||
"SHA1 digest size mismatch" );
|
||||
dblock.get_digest( reinterpret_cast<boost::uuids::detail::sha1::digest_type&>( digest ) );
|
||||
|
||||
// ensure MSB order
|
||||
for( int i = 0; i < 5; ++i )
|
||||
|
||||
@@ -374,6 +374,13 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
// Remove group membership from dummy item before deleting
|
||||
dummy.SetParentGroup( nullptr );
|
||||
}
|
||||
else if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
|
||||
{
|
||||
// A custom pad can have many complex subshape items. To avoid issues, use its
|
||||
// final polygon shape, not its basic shape set. One cannot apply the clearance
|
||||
// to each subshape: it does no work
|
||||
aPad->TransformShapeToPolygon( poly, aLayer, 0, maxError );
|
||||
}
|
||||
else
|
||||
{
|
||||
auto padShapes = std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
|
||||
@@ -422,7 +429,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
break;
|
||||
|
||||
case SH_POLY_SET:
|
||||
poly = *(SHAPE_POLY_SET*) shape;
|
||||
poly.Append( *static_cast<const SHAPE_POLY_SET*>( shape ) );
|
||||
break;
|
||||
|
||||
case SH_ARC:
|
||||
|
||||
@@ -185,8 +185,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
for( PCB_TRACK* track : m_board->Tracks() )
|
||||
{
|
||||
if( !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) ) // Skip non enabled layers
|
||||
// Skip tracks (not vias that are on more than one layer ) on disabled layers
|
||||
if( track->Type() != PCB_VIA_T
|
||||
&& !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Note: a PCB_TRACK holds normal segment tracks and also vias circles (that have also
|
||||
// drill values)
|
||||
|
||||
@@ -752,6 +752,11 @@ void EDA_3D_CANVAS::OnLeftDown( wxMouseEvent& event )
|
||||
SetFocus();
|
||||
stop_editingTimeOut_Timer();
|
||||
|
||||
// Ensure m_camera.m_lastPosition (current mouse position) is up to date for
|
||||
// future drag events (can be not the case when left clicking after
|
||||
// opening a context menu)
|
||||
OnMouseMoveCamera( event );
|
||||
|
||||
if( !event.Dragging() && ( m_3d_render_raytracing != nullptr ) )
|
||||
{
|
||||
RAY mouseRay = getRayAtCurrentMousePosition();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
add_library(3d-viewer_navlib STATIC
|
||||
"nl_3d_viewer_plugin.cpp"
|
||||
"nl_3d_viewer_plugin_impl.cpp"
|
||||
"nl_footprint_properties_plugin.cpp"
|
||||
"nl_footprint_properties_plugin_impl.cpp"
|
||||
)
|
||||
|
||||
# 3d-viewer_navlib depends on make_lexer outputs in common
|
||||
|
||||
@@ -25,20 +25,17 @@
|
||||
|
||||
|
||||
NL_3D_VIEWER_PLUGIN::NL_3D_VIEWER_PLUGIN( EDA_3D_CANVAS* aViewport )
|
||||
: m_impl( nullptr )
|
||||
{
|
||||
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
|
||||
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
|
||||
{
|
||||
m_impl = new NL_3D_VIEWER_PLUGIN_IMPL( aViewport );
|
||||
m_impl = std::make_unique<NL_3D_VIEWER_PLUGIN_IMPL>( aViewport, "KiCAD 3D" );
|
||||
m_impl->Connect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN()
|
||||
{
|
||||
delete m_impl;
|
||||
}
|
||||
NL_3D_VIEWER_PLUGIN::~NL_3D_VIEWER_PLUGIN() = default;
|
||||
|
||||
|
||||
void NL_3D_VIEWER_PLUGIN::SetFocus( bool focus )
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#ifndef NL_3D_VIEWER_PLUGIN_H_
|
||||
#define NL_3D_VIEWER_PLUGIN_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
// Forward declarations.
|
||||
class EDA_3D_CANVAS;
|
||||
class NL_3D_VIEWER_PLUGIN_IMPL;
|
||||
@@ -54,7 +56,7 @@ public:
|
||||
void SetFocus( bool aFocus = true );
|
||||
|
||||
private:
|
||||
NL_3D_VIEWER_PLUGIN_IMPL* m_impl;
|
||||
std::unique_ptr<NL_3D_VIEWER_PLUGIN_IMPL> m_impl;
|
||||
};
|
||||
|
||||
#endif // NL_3D_VIEWER_PLUGIN_H_
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2021 3Dconnexion
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2024 3Dconnexion
|
||||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -27,6 +27,7 @@
|
||||
// KiCAD includes
|
||||
#include <tool/action_manager.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/tools_holder.h>
|
||||
|
||||
// stdlib
|
||||
#include <map>
|
||||
@@ -72,7 +73,7 @@ bool equals( glm::mat<L, C, T, Q> const& aFirst, glm::mat<L, C, T, Q> const& aSe
|
||||
}
|
||||
|
||||
|
||||
NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) :
|
||||
NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, const std::string& aProfileHint ) :
|
||||
NAV_3D( false, false ),
|
||||
m_canvas( aCanvas ),
|
||||
m_capIsMoving( false ),
|
||||
@@ -80,12 +81,7 @@ NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) :
|
||||
{
|
||||
m_camera = dynamic_cast<TRACK_BALL*>( m_canvas->GetCamera() );
|
||||
|
||||
PutProfileHint( "KiCAD 3D" );
|
||||
|
||||
EnableNavigation( true );
|
||||
PutFrameTimingSource( TimingSource::SpaceMouse );
|
||||
|
||||
exportCommandsAndImages();
|
||||
PutProfileHint( aProfileHint );
|
||||
}
|
||||
|
||||
|
||||
@@ -101,8 +97,19 @@ void NL_3D_VIEWER_PLUGIN_IMPL::SetFocus( bool aFocus )
|
||||
NAV_3D::Write( navlib::focus_k, aFocus );
|
||||
}
|
||||
|
||||
// temporary store for the categories
|
||||
typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
|
||||
|
||||
EDA_3D_CANVAS* NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas() const
|
||||
{
|
||||
return m_canvas;
|
||||
}
|
||||
|
||||
|
||||
void NL_3D_VIEWER_PLUGIN_IMPL::Connect()
|
||||
{
|
||||
EnableNavigation(true);
|
||||
PutFrameTimingSource(TimingSource::SpaceMouse);
|
||||
exportCommandsAndImages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a category to the store.
|
||||
@@ -571,7 +578,7 @@ long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
|
||||
|
||||
if( parent->IsEnabled() )
|
||||
{
|
||||
TOOL_MANAGER* tool_manager = static_cast<PCB_BASE_FRAME*>( parent )->GetToolManager();
|
||||
TOOL_MANAGER* tool_manager = dynamic_cast<TOOLS_HOLDER*>( parent )->GetToolManager();
|
||||
|
||||
if( tool_manager == nullptr )
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2021 3Dconnexion
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2024 3Dconnexion
|
||||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -42,6 +42,11 @@
|
||||
class EDA_3D_CANVAS;
|
||||
class TRACK_BALL;
|
||||
|
||||
// temporary store for the categories
|
||||
typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
|
||||
|
||||
CATEGORY_STORE::iterator add_category( std::string aCategoryPath, CATEGORY_STORE& aCategoryStore );
|
||||
|
||||
// Convenience typedef.
|
||||
typedef TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D;
|
||||
|
||||
@@ -56,8 +61,9 @@ public:
|
||||
* Initializes a new instance of the NL_3DVIEWER_PLUGIN.
|
||||
*
|
||||
* @param aCanvas is the viewport to be navigated.
|
||||
* @param aProfileHint tells the 3DConnexion UI which profile to use.
|
||||
*/
|
||||
NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas );
|
||||
NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, const std::string& aProfileHint );
|
||||
|
||||
virtual ~NL_3D_VIEWER_PLUGIN_IMPL();
|
||||
|
||||
@@ -69,11 +75,21 @@ public:
|
||||
*/
|
||||
void SetFocus( bool aFocus = true );
|
||||
|
||||
/**
|
||||
* Get the m_canvas pointer.
|
||||
*/
|
||||
EDA_3D_CANVAS* GetCanvas() const;
|
||||
|
||||
/**
|
||||
* Connect plugin implementation to the driver.
|
||||
*/
|
||||
void Connect();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Export the invocable actions and images to the 3Dconnexion UI.
|
||||
*/
|
||||
void exportCommandsAndImages();
|
||||
virtual void exportCommandsAndImages();
|
||||
|
||||
long GetCameraMatrix( navlib::matrix_t& aMatrix ) const override;
|
||||
long GetPointerPosition( navlib::point_t& aPosition ) const override;
|
||||
@@ -111,6 +127,7 @@ private:
|
||||
long GetCoordinateSystem( navlib::matrix_t& aMatrix ) const override;
|
||||
long GetIsViewRotatable( navlib::bool_t& isRotatable ) const override;
|
||||
|
||||
|
||||
private:
|
||||
EDA_3D_CANVAS* m_canvas;
|
||||
TRACK_BALL* m_camera;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 3Dconnexion
|
||||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nl_footprint_properties_plugin.h"
|
||||
#include "nl_footprint_properties_plugin_impl.h"
|
||||
#include <advanced_config.h>
|
||||
#include <kiplatform/drivers.h>
|
||||
|
||||
|
||||
NL_FOOTPRINT_PROPERTIES_PLUGIN::NL_FOOTPRINT_PROPERTIES_PLUGIN( EDA_3D_CANVAS* aViewport )
|
||||
{
|
||||
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
|
||||
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
|
||||
{
|
||||
m_impl = std::make_unique<NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL>( aViewport );
|
||||
m_impl->Connect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NL_FOOTPRINT_PROPERTIES_PLUGIN::~NL_FOOTPRINT_PROPERTIES_PLUGIN() = default;
|
||||
|
||||
|
||||
void NL_FOOTPRINT_PROPERTIES_PLUGIN::SetFocus( bool focus )
|
||||
{
|
||||
if( m_impl )
|
||||
m_impl->SetFocus( focus );
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 3Dconnexion
|
||||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file nl_footprint_properties_plugin.h
|
||||
* @brief declaration of the nl_footprint_properties_plugin class
|
||||
*/
|
||||
|
||||
#ifndef NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
|
||||
#define NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
// Forward declarations.
|
||||
class EDA_3D_CANVAS;
|
||||
class NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL;
|
||||
|
||||
/**
|
||||
* The class that implements the public interface to the SpaceMouse plug-in.
|
||||
*/
|
||||
class NL_FOOTPRINT_PROPERTIES_PLUGIN
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Initializes a new instance of the NL_FOOTPRINT_PROPERTIES_PLUGIN.
|
||||
*
|
||||
* @param aViewport is the viewport to be navigated.
|
||||
*/
|
||||
NL_FOOTPRINT_PROPERTIES_PLUGIN( EDA_3D_CANVAS* aViewport );
|
||||
|
||||
virtual ~NL_FOOTPRINT_PROPERTIES_PLUGIN();
|
||||
|
||||
/**
|
||||
* Set the connection to the 3Dconnexion driver to the focus state so that
|
||||
* 3DMouse data is routed here.
|
||||
*
|
||||
* @param aFocus is true to set the connection active.
|
||||
*/
|
||||
void SetFocus( bool aFocus = true );
|
||||
|
||||
private:
|
||||
std::unique_ptr<NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL> m_impl;
|
||||
};
|
||||
|
||||
#endif // NL_FOOTPRINT_PROPERTIES_PLUGIN_H_
|
||||
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 3Dconnexion
|
||||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nl_footprint_properties_plugin_impl.h"
|
||||
#include <3d-viewer/3d_canvas/eda_3d_canvas.h>
|
||||
|
||||
// KiCAD includes
|
||||
#include <tool/action_manager.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/tools_holder.h>
|
||||
|
||||
#include <wx/mstream.h>
|
||||
|
||||
#define BOUNDING_BOX_SCALE_FACTOR 1.3f
|
||||
|
||||
/**
|
||||
* Flag to enable the NL_FOOTPRINT_PROPERTIES_PLUGIN debug tracing.
|
||||
*
|
||||
* Use "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN" to enable.
|
||||
*
|
||||
* @ingroup trace_env_vars
|
||||
*/
|
||||
const wxChar* NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::m_logTrace =
|
||||
wxT( "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN" );
|
||||
|
||||
|
||||
NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL(EDA_3D_CANVAS* aCanvas) :
|
||||
NL_3D_VIEWER_PLUGIN_IMPL(aCanvas, "KiCAD Footprint Properties")
|
||||
{}
|
||||
|
||||
|
||||
long NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::GetModelExtents( navlib::box_t& extents ) const
|
||||
{
|
||||
SFVEC3F min = NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas()->GetBoardAdapter().GetBBox().Min();
|
||||
SFVEC3F max = NL_3D_VIEWER_PLUGIN_IMPL::GetCanvas()->GetBoardAdapter().GetBBox().Max();
|
||||
|
||||
SFVEC3F diff = ( BOUNDING_BOX_SCALE_FACTOR - 1.f ) / 2.f * ( max - min );
|
||||
|
||||
min -= diff;
|
||||
max += diff;
|
||||
|
||||
extents = { min.x, min.y, min.z, max.x, max.y, max.z };
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages()
|
||||
{
|
||||
std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
|
||||
|
||||
if( actions.size() == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
using TDx::SpaceMouse::CCommand;
|
||||
using TDx::SpaceMouse::CCommandSet;
|
||||
|
||||
// The root action set node
|
||||
CCommandSet commandSet( "EDA_3D_CANVAS", "3D Viewer" );
|
||||
|
||||
// Activate the command set
|
||||
NAV_3D::PutActiveCommands( commandSet.GetId() );
|
||||
|
||||
// temporary store for the categories
|
||||
CATEGORY_STORE categoryStore;
|
||||
|
||||
std::vector<TDx::CImage> vImages;
|
||||
|
||||
// add the action set to the category_store
|
||||
categoryStore.insert( categoryStore.end(), CATEGORY_STORE::value_type( ".", &commandSet ) );
|
||||
|
||||
std::list<TOOL_ACTION*>::const_iterator it;
|
||||
|
||||
for( it = actions.begin(); it != actions.end(); ++it )
|
||||
{
|
||||
const TOOL_ACTION* action = *it;
|
||||
std::string label = action->GetMenuLabel().ToStdString();
|
||||
|
||||
if( label.empty() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string name = action->GetName();
|
||||
|
||||
// Do no export commands for the pcbnew app.
|
||||
if( name.rfind( "pcbnew.", 0 ) == 0 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Exclude commands which can't be used in the footprint properties.
|
||||
if( name.rfind( "3DViewer.Control.pivotCenter", 0 ) == 0
|
||||
|| name.rfind( "3DViewer.Control.material", 0 ) == 0
|
||||
|| name.rfind( "3DViewer.Control.attribute", 0 ) == 0
|
||||
|| name.rfind( "3DViewer.Control.show", 0 ) == 0 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string strCategory = action->GetToolName();
|
||||
CATEGORY_STORE::iterator iter = categoryStore.find( strCategory );
|
||||
|
||||
if( iter == categoryStore.end() )
|
||||
{
|
||||
iter = add_category( std::move( strCategory ), categoryStore );
|
||||
}
|
||||
|
||||
std::string description = action->GetDescription().ToStdString();
|
||||
|
||||
// Arbitrary 8-bit data stream
|
||||
wxMemoryOutputStream imageStream;
|
||||
|
||||
if( action->GetIcon() != BITMAPS::INVALID_BITMAP )
|
||||
{
|
||||
wxImage image = KiBitmap( action->GetIcon() ).ConvertToImage();
|
||||
image.SaveFile( imageStream, wxBitmapType::wxBITMAP_TYPE_PNG );
|
||||
image.Destroy();
|
||||
|
||||
if( imageStream.GetSize() )
|
||||
{
|
||||
wxStreamBuffer* streamBuffer = imageStream.GetOutputStreamBuffer();
|
||||
TDx::CImage tdxImage = TDx::CImage::FromData( "", 0, name.c_str() );
|
||||
tdxImage.AssignImage( std::string( reinterpret_cast<const char*>(
|
||||
streamBuffer->GetBufferStart() ),
|
||||
streamBuffer->GetBufferSize() ),
|
||||
0 );
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "Adding image for : %s" ), name );
|
||||
vImages.push_back( std::move( tdxImage ) );
|
||||
}
|
||||
}
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "Inserting command: %s, description: %s, in category: %s" ),
|
||||
name, description, iter->first );
|
||||
|
||||
iter->second->push_back(
|
||||
CCommand( std::move( name ), std::move( label ), std::move( description ) ) );
|
||||
}
|
||||
|
||||
NAV_3D::AddCommandSet( commandSet );
|
||||
NAV_3D::AddImages( vImages );
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2024 3Dconnexion
|
||||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file nl_footprint_properties_plugin_impl.h
|
||||
* @brief declaration of the nl_footprint_properties_plugin_impl class
|
||||
*/
|
||||
|
||||
#ifndef NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
|
||||
#define NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
|
||||
|
||||
#include "nl_3d_viewer_plugin_impl.h"
|
||||
// TDxWare SDK.
|
||||
#include <SpaceMouse/CNavigation3D.hpp>
|
||||
|
||||
/**
|
||||
* The class that adjusts NL_3D_VIEWER_PLUGIN_IMPL implementation for 3D Model preview in footprint properties dialog.
|
||||
*/
|
||||
class NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL : public NL_3D_VIEWER_PLUGIN_IMPL
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Initializes a new instance of the NL_FOOTPRINT_PROPERTIES_PLUGIN.
|
||||
*
|
||||
* @param aCanvas is the viewport to be navigated.
|
||||
*/
|
||||
NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas );
|
||||
|
||||
private:
|
||||
/**
|
||||
* Get Footprint 3D Model extents.
|
||||
*
|
||||
* @param extents is the box around the 3D model.
|
||||
*/
|
||||
long GetModelExtents( navlib::box_t& extents ) const override;
|
||||
|
||||
/**
|
||||
* Export the invocable actions and images to the 3Dconnexion UI.
|
||||
*/
|
||||
void exportCommandsAndImages() override;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Trace mask used to enable or disable the trace output of this class.
|
||||
* The debug output can be turned on by setting the WXTRACE environment variable to
|
||||
* "KI_TRACE_NL_FOOTPRINT_PROPERTIES_PLUGIN". See the wxWidgets documentation on wxLogTrace for
|
||||
* more information.
|
||||
*/
|
||||
static const wxChar* m_logTrace;
|
||||
};
|
||||
#endif // NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL_H_
|
||||
@@ -570,6 +570,9 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
|
||||
{
|
||||
applySettings( cfg );
|
||||
|
||||
if( !GetBoard()->GetProject() )
|
||||
GetBoard()->SetProject( &Prj() );
|
||||
|
||||
m_boardAdapter.SetBoard( GetBoard() );
|
||||
|
||||
// When opening the 3D viewer, we use the OpenGL mode, never the ray tracing engine
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
#include <eda_3d_viewer_settings.h>
|
||||
#include <board_design_settings.h>
|
||||
|
||||
#include <3d_navlib/nl_footprint_properties_plugin.h>
|
||||
|
||||
PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
|
||||
FOOTPRINT* aFootprint,
|
||||
std::vector<FP_3DMODEL>* aParentModelList ) :
|
||||
@@ -125,6 +127,9 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
|
||||
OGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
|
||||
m_boardAdapter, m_currentCamera, PROJECT_PCB::Get3DCacheManager( &aFrame->Prj() ) );
|
||||
|
||||
m_spaceMouse = new NL_FOOTPRINT_PROPERTIES_PLUGIN( m_previewPane );
|
||||
m_spaceMouse->SetFocus( true );
|
||||
|
||||
m_boardAdapter.SetBoard( m_dummyBoard );
|
||||
m_boardAdapter.m_IsBoardView = false;
|
||||
m_boardAdapter.m_IsPreviewer = true; // Force display 3D models, regardless the 3D viewer options
|
||||
@@ -162,6 +167,8 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
|
||||
wxCommandEventHandler( PANEL_PREVIEW_3D_MODEL::onUnitsChanged ),
|
||||
nullptr, this );
|
||||
|
||||
Bind( wxCUSTOM_PANEL_SHOWN_EVENT, &PANEL_PREVIEW_3D_MODEL::onPanelShownEvent, this );
|
||||
|
||||
#ifdef __WXOSX__
|
||||
// Call layout once to get the proper button sizes after the bitmaps have been set
|
||||
Layout();
|
||||
@@ -190,6 +197,7 @@ PANEL_PREVIEW_3D_MODEL::~PANEL_PREVIEW_3D_MODEL()
|
||||
if( m_boardAdapter.m_Cfg )
|
||||
m_boardAdapter.m_Cfg->m_Render = m_initialRender;
|
||||
|
||||
delete m_spaceMouse;
|
||||
delete m_dummyBoard;
|
||||
delete m_previewPane;
|
||||
}
|
||||
@@ -620,6 +628,17 @@ void PANEL_PREVIEW_3D_MODEL::onUnitsChanged( wxCommandEvent& aEvent )
|
||||
}
|
||||
|
||||
|
||||
void PANEL_PREVIEW_3D_MODEL::onPanelShownEvent( wxCommandEvent& aEvent )
|
||||
{
|
||||
if( m_spaceMouse != nullptr )
|
||||
{
|
||||
m_spaceMouse->SetFocus( static_cast<bool>( aEvent.GetInt() ) );
|
||||
}
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
||||
|
||||
void PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint( bool aReloadRequired )
|
||||
{
|
||||
m_dummyFootprint->Models().clear();
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <3d_canvas/eda_3d_canvas.h>
|
||||
#include <3d_viewer_id.h>
|
||||
#include <3d_rendering/track_ball.h>
|
||||
#include <wx/event.h>
|
||||
|
||||
// Define min and max parameter values
|
||||
#define MAX_SCALE 10000.0
|
||||
@@ -52,6 +53,7 @@
|
||||
#define OFFSET_INCREMENT_MIL 25.0
|
||||
#define OFFSET_INCREMENT_MIL_FINE 5.0
|
||||
|
||||
wxDECLARE_EVENT( wxCUSTOM_PANEL_SHOWN_EVENT, wxCommandEvent );
|
||||
|
||||
// Declared classes to create pointers
|
||||
class WX_INFOBAR;
|
||||
@@ -60,6 +62,7 @@ class FILENAME_RESOLVER;
|
||||
class BOARD;
|
||||
class BOARD_ADAPTER;
|
||||
class FOOTPRINT;
|
||||
class NL_FOOTPRINT_PROPERTIES_PLUGIN;
|
||||
|
||||
class PANEL_PREVIEW_3D_MODEL: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREVIEW_3D_MODEL_BASE
|
||||
{
|
||||
@@ -139,6 +142,7 @@ private:
|
||||
void doIncrementOffset( wxSpinEvent& aEvent, double aSign );
|
||||
|
||||
void onUnitsChanged( wxCommandEvent& aEvent );
|
||||
void onPanelShownEvent( wxCommandEvent& aEvent );
|
||||
|
||||
wxString formatScaleValue( double aValue );
|
||||
wxString formatRotationValue( double aValue );
|
||||
@@ -211,6 +215,8 @@ private:
|
||||
bool m_bodyStyleShowAll; /// true if the board body is show
|
||||
/// The 3d viewer Render initial settings (must be saved and restored)
|
||||
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender;
|
||||
|
||||
NL_FOOTPRINT_PROPERTIES_PLUGIN* m_spaceMouse;
|
||||
};
|
||||
|
||||
#endif // PANEL_PREVIEW_3D_MODEL_H
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
|
||||
find_program(SWIG_EXECUTABLE NAMES swig4.2 swig4.1 swig4.0 swig3.0 swig2.0 swig)
|
||||
|
||||
if(SWIG_EXECUTABLE)
|
||||
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "8.0.4" )
|
||||
set( KICAD_SEMANTIC_VERSION "8.0.7" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -109,6 +109,7 @@ static const wxChar OcePluginAngularDeflection[] = wxT( "OcePluginAngularDeflect
|
||||
static const wxChar TriangulateSimplificationLevel[] = wxT( "TriangulateSimplificationLevel" );
|
||||
static const wxChar TriangulateMinimumArea[] = wxT( "TriangulateMinimumArea" );
|
||||
static const wxChar EnableCacheFriendlyFracture[] = wxT( "EnableCacheFriendlyFracture" );
|
||||
static const wxChar MinParallelAngle[] = wxT( "MinParallelAngle" );
|
||||
} // namespace KEYS
|
||||
|
||||
|
||||
@@ -261,6 +262,8 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
|
||||
m_EnableCacheFriendlyFracture = true;
|
||||
|
||||
m_MinParallelAngle = 0.001;
|
||||
|
||||
loadFromConfigFile();
|
||||
}
|
||||
|
||||
@@ -477,6 +480,10 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
&m_EnableCacheFriendlyFracture,
|
||||
m_EnableCacheFriendlyFracture ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinParallelAngle,
|
||||
&m_MinParallelAngle, m_MinParallelAngle,
|
||||
0.0, 45.0 ) );
|
||||
|
||||
// Special case for trace mask setting...we just grab them and set them immediately
|
||||
// Because we even use wxLogTrace inside of advanced config
|
||||
wxString traceMasks;
|
||||
|
||||
@@ -209,7 +209,7 @@ void BACKGROUND_JOB_REPORTER::AdvancePhase()
|
||||
}
|
||||
|
||||
|
||||
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR() : m_jobListDialog( nullptr )
|
||||
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+80
-18
@@ -524,9 +524,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -926,9 +934,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -1328,9 +1344,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1730,9 +1754,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -2132,9 +2164,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2534,9 +2574,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2936,9 +2984,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3338,9 +3394,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3740,9 +3804,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -4142,9 +4214,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@@ -4394,24 +4474,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_32].emplace_back( BITMAPS::icon_pagelayout_editor_32, wxT( "icon_pagelayout_editor_32_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_32].emplace_back( BITMAPS::icon_pcbcalculator_32, wxT( "icon_pcbcalculator_32_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_32].emplace_back( BITMAPS::icon_pcbnew_32, wxT( "icon_pcbnew_32_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb].emplace_back( BITMAPS::icon_cvpcb, wxT( "icon_cvpcb_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema].emplace_back( BITMAPS::icon_eeschema, wxT( "icon_eeschema_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview].emplace_back( BITMAPS::icon_gerbview, wxT( "icon_gerbview_64.png" ), 64, wxT( "light" ) );
|
||||
|
||||
@@ -162,6 +162,9 @@ void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BAS
|
||||
ent.m_copy = aCopy;
|
||||
ent.m_screen = aScreen;
|
||||
|
||||
// N.B. Do not throw an assertion for multiple changed items. An item can be changed multiple times
|
||||
// in a single commit such as when importing graphics and grouping them.
|
||||
|
||||
m_changedItems.insert( aItem );
|
||||
m_changes.push_back( ent );
|
||||
}
|
||||
|
||||
+8
-12
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2014-2020 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023, 2024 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
|
||||
@@ -147,7 +147,8 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
|
||||
wxString strResult;
|
||||
strResult.Alloc( strlen ); // best guess (improves performance)
|
||||
|
||||
auto getVersionedEnvVar = []( const wxString& aMatch, wxString& aResult ) -> bool
|
||||
auto getVersionedEnvVar =
|
||||
[]( const wxString& aMatch, wxString& aResult ) -> bool
|
||||
{
|
||||
for ( const wxString& var : ENV_VAR::GetPredefinedEnvVars() )
|
||||
{
|
||||
@@ -180,7 +181,9 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
|
||||
Bracket bracket;
|
||||
#ifdef __WINDOWS__
|
||||
if( str_n == wxT( '%' ) )
|
||||
bracket = Bracket_Windows;
|
||||
{
|
||||
bracket = Bracket_Windows;
|
||||
}
|
||||
else
|
||||
#endif // __WINDOWS__
|
||||
if( n == strlen - 1 )
|
||||
@@ -344,18 +347,11 @@ const wxString ExpandEnvVarSubstitutions( const wxString& aString, const PROJECT
|
||||
}
|
||||
|
||||
|
||||
const wxString ResolveUriByEnvVars( const wxString& aUri, PROJECT* aProject )
|
||||
const wxString ResolveUriByEnvVars( const wxString& aUri, const PROJECT* aProject )
|
||||
{
|
||||
wxString uri = ExpandTextVars( aUri, aProject );
|
||||
|
||||
// URL-like URI: return as is.
|
||||
wxURL url( uri );
|
||||
|
||||
if( url.GetError() == wxURL_NOERR )
|
||||
return uri;
|
||||
|
||||
// Otherwise, the path points to a local file. Resolve environment variables if any.
|
||||
return ExpandEnvVarSubstitutions( aUri, aProject );
|
||||
return ExpandEnvVarSubstitutions( uri, aProject );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -106,6 +106,9 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
|
||||
|
||||
table.properties.exclude_from_board =
|
||||
fetchOrDefault<std::string>( pj, "exclude_from_board" );
|
||||
|
||||
table.properties.exclude_from_sim =
|
||||
fetchOrDefault<std::string>( pj, "exclude_from_sim" );
|
||||
}
|
||||
|
||||
if( entry.contains( "fields" ) && entry["fields"].is_array() )
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <wx/dcmemory.h>
|
||||
|
||||
#define ALPHA_MAX 100 // the max value returned by the alpha (opacity) slider
|
||||
#define SLOPE_AXIS ( bmsize.y / 5.28 ) // was 50 at 264 size
|
||||
|
||||
using KIGFX::COLOR4D;
|
||||
|
||||
@@ -52,13 +53,17 @@ DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER( wxWindow* aParent, const COLOR4D& aCur
|
||||
m_allowOpacityCtrl = aAllowOpacityControl;
|
||||
m_previousColor4D = aCurrentColor;
|
||||
m_newColor4D = aCurrentColor;
|
||||
m_cursorsSize = 8; // Size of square cursors drawn on color bitmaps
|
||||
m_newColor4D.ToHSV( m_hue, m_sat, m_val, true );
|
||||
m_bitmapRGB = nullptr;
|
||||
m_bitmapHSV = nullptr;
|
||||
m_selectedCursor = nullptr;
|
||||
m_defaultColor = aDefaultColor;
|
||||
|
||||
updateHandleSize();
|
||||
|
||||
m_OldColorRect->SetMinSize( FromDIP( wxSize( 24, 24 ) ) );
|
||||
m_NewColorRect->SetMinSize( FromDIP( wxSize( 24, 24 ) ) );
|
||||
|
||||
if( !m_allowOpacityCtrl )
|
||||
{
|
||||
m_SizerTransparency->Show( false );
|
||||
@@ -121,16 +126,15 @@ void DIALOG_COLOR_PICKER::updatePreview( wxStaticBitmap* aStaticBitmap, COLOR4D&
|
||||
wxBitmap newBm = COLOR_SWATCH::MakeBitmap( aColor4D, COLOR4D::WHITE, aStaticBitmap->GetSize(),
|
||||
ConvertDialogToPixels( CHECKERBOARD_SIZE_DU ),
|
||||
aStaticBitmap->GetParent()->GetBackgroundColour() );
|
||||
|
||||
newBm.SetScaleFactor( GetDPIScaleFactor() );
|
||||
aStaticBitmap->SetBitmap( newBm );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_COLOR_PICKER::TransferDataToWindow()
|
||||
{
|
||||
// Draw all bitmaps, with colors according to the color 4D
|
||||
updatePreview( m_OldColorRect, m_previousColor4D );
|
||||
SetEditVals( ALL_CHANGED, false );
|
||||
drawAll();
|
||||
|
||||
// Configure the spin control sizes
|
||||
configureSpinCtrl( m_spinCtrlGreen );
|
||||
@@ -144,6 +148,10 @@ bool DIALOG_COLOR_PICKER::TransferDataToWindow()
|
||||
|
||||
finishDialogSettings();
|
||||
|
||||
// Draw all bitmaps, with colors according to the color 4D
|
||||
updatePreview( m_OldColorRect, m_previousColor4D );
|
||||
drawAll();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -171,6 +179,8 @@ void DIALOG_COLOR_PICKER::initDefinedColors( CUSTOM_COLORS_LIST* aPredefinedColo
|
||||
{
|
||||
wxBitmap bm = COLOR_SWATCH::MakeBitmap( aColor, COLOR4D::WHITE, swatchSize,
|
||||
checkerboardSize, checkboardBackground );
|
||||
|
||||
bm.SetScaleFactor( GetDPIScaleFactor() );
|
||||
wxStaticBitmap* swatch = new wxStaticBitmap( m_panelDefinedColors, aId, bm );
|
||||
|
||||
m_fgridColor->Add( swatch, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
@@ -245,7 +255,6 @@ void DIALOG_COLOR_PICKER::createRGBBitmap()
|
||||
|
||||
// Red blue area in X Z 3d axis
|
||||
double inc = 255.0 / half_size;
|
||||
#define SLOPE_AXIS 50.0
|
||||
double slope = SLOPE_AXIS/half_size;
|
||||
color.g = 0.0;
|
||||
|
||||
@@ -315,6 +324,7 @@ void DIALOG_COLOR_PICKER::createRGBBitmap()
|
||||
|
||||
delete m_bitmapRGB;
|
||||
m_bitmapRGB = new wxBitmap( img, 24 );
|
||||
m_bitmapRGB->SetScaleFactor( m_RgbBitmap->GetDPIScaleFactor() );
|
||||
m_RgbBitmap->SetBitmap( *m_bitmapRGB );
|
||||
}
|
||||
|
||||
@@ -379,6 +389,7 @@ void DIALOG_COLOR_PICKER::createHSVBitmap()
|
||||
|
||||
delete m_bitmapHSV;
|
||||
m_bitmapHSV = new wxBitmap( img, 24 );
|
||||
m_bitmapHSV->SetScaleFactor( m_HsvBitmap->GetDPIScaleFactor() );
|
||||
m_HsvBitmap->SetBitmap( *m_bitmapHSV );
|
||||
}
|
||||
|
||||
@@ -413,8 +424,7 @@ void DIALOG_COLOR_PICKER::drawRGBPalette()
|
||||
bitmapDC.SetBrush( brush );
|
||||
int half_csize = m_cursorsSize / 2;
|
||||
|
||||
#define SLOPE_AXIS 50.0
|
||||
double slope = SLOPE_AXIS / half_size;
|
||||
double slope = SLOPE_AXIS / ( half_size );
|
||||
|
||||
// Red axis cursor (Z 3Daxis):
|
||||
m_cursorBitmapRed.x = 0;
|
||||
@@ -539,8 +549,15 @@ void DIALOG_COLOR_PICKER::SetEditVals( CHANGED_COLOR aChanged, bool aCheckTransp
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_COLOR_PICKER::updateHandleSize()
|
||||
{
|
||||
m_cursorsSize = FromDIP( 8 ); // Size of square cursors drawn on color bitmaps
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_COLOR_PICKER::drawAll()
|
||||
{
|
||||
updateHandleSize();
|
||||
m_NewColorRect->Freeze(); // Avoid flicker
|
||||
m_HsvBitmap->Freeze();
|
||||
m_RgbBitmap->Freeze();
|
||||
@@ -699,6 +716,14 @@ void DIALOG_COLOR_PICKER::onHSVMouseDrag( wxMouseEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_COLOR_PICKER::onSize( wxSizeEvent& event )
|
||||
{
|
||||
drawAll();
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_COLOR_PICKER::OnColorValueText( wxCommandEvent& event )
|
||||
{
|
||||
if( m_newColor4D.SetFromHexString( m_colorValue->GetValue() ) )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.1.0-0-g733bf3d)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -33,7 +33,10 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
|
||||
m_RgbBitmap = new wxStaticBitmap( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
|
||||
m_RgbBitmap->SetMinSize( wxSize( 264,264 ) );
|
||||
|
||||
sbSizerViewRGB->Add( m_RgbBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
sbSizerViewRGB->Add( m_RgbBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND|wxSHAPED, 5 );
|
||||
|
||||
|
||||
sbSizerViewRGB->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSizerRGB;
|
||||
fgSizerRGB = new wxFlexGridSizer( 0, 3, 0, 0 );
|
||||
@@ -68,18 +71,18 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
|
||||
sbSizerViewRGB->Add( fgSizerRGB, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerPanels->Add( sbSizerViewRGB, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerPanels->Add( sbSizerViewRGB, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxStaticBoxSizer* sbSizerViewHSV;
|
||||
sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("HSV") ), wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bSizer10;
|
||||
bSizer10 = new wxBoxSizer( wxVERTICAL );
|
||||
sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("HSV") ), wxVERTICAL );
|
||||
|
||||
m_HsvBitmap = new wxStaticBitmap( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
|
||||
m_HsvBitmap->SetMinSize( wxSize( 264,264 ) );
|
||||
|
||||
bSizer10->Add( m_HsvBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
sbSizerViewHSV->Add( m_HsvBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND|wxSHAPED, 5 );
|
||||
|
||||
|
||||
sbSizerViewHSV->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSizerHSV;
|
||||
fgSizerHSV = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
@@ -103,26 +106,23 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
|
||||
fgSizerHSV->Add( m_spinCtrlSaturation, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizer10->Add( fgSizerHSV, 0, wxEXPAND, 5 );
|
||||
sbSizerViewHSV->Add( fgSizerHSV, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
sbSizerViewHSV->Add( bSizer10, 0, wxEXPAND, 5 );
|
||||
bSizerPanels->Add( sbSizerViewHSV, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bSizerBright;
|
||||
bSizerBright = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticTextBright = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextBright = new wxStaticText( m_panelFreeColors, wxID_ANY, _("Value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextBright->Wrap( -1 );
|
||||
bSizerBright->Add( m_staticTextBright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
|
||||
m_sliderBrightness = new wxSlider( sbSizerViewHSV->GetStaticBox(), wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_INVERSE|wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
|
||||
m_sliderBrightness = new wxSlider( m_panelFreeColors, wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_INVERSE|wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
|
||||
bSizerBright->Add( m_sliderBrightness, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
|
||||
sbSizerViewHSV->Add( bSizerBright, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerPanels->Add( sbSizerViewHSV, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
|
||||
bSizerPanels->Add( bSizerBright, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerUpperFreeColors->Add( bSizerPanels, 1, wxEXPAND, 5 );
|
||||
@@ -153,7 +153,7 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
|
||||
m_SizerDefinedColors->Fit( m_panelDefinedColors );
|
||||
m_notebook->AddPage( m_panelDefinedColors, _("Defined Colors"), false );
|
||||
|
||||
bSizerUpperMain->Add( m_notebook, 0, wxEXPAND | wxALL, 5 );
|
||||
bSizerUpperMain->Add( m_notebook, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_SizerTransparency = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
@@ -171,35 +171,29 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
|
||||
bSizerUpperMain->Add( m_SizerTransparency, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerUpperMain->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerUpperMain, 0, wxEXPAND, 5 );
|
||||
bSizerMain->Add( bSizerUpperMain, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bButtonsSizer;
|
||||
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticTextOldColor = new wxStaticText( this, wxID_ANY, _("Preview (old/new):"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextOldColor->Wrap( -1 );
|
||||
bButtonsSizer->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
bButtonsSizer->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_OldColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
|
||||
m_OldColorRect->SetMinSize( wxSize( 24,24 ) );
|
||||
|
||||
bButtonsSizer->Add( m_OldColorRect, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
bButtonsSizer->Add( m_OldColorRect, 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 5 );
|
||||
|
||||
m_NewColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
|
||||
m_NewColorRect->SetMinSize( wxSize( 24,24 ) );
|
||||
|
||||
bButtonsSizer->Add( m_NewColorRect, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
bButtonsSizer->Add( 10, 0, 0, wxEXPAND, 5 );
|
||||
bButtonsSizer->Add( m_NewColorRect, 0, wxALIGN_CENTER_VERTICAL|wxSHAPED, 5 );
|
||||
|
||||
m_colorValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_colorValue->SetMinSize( wxSize( 176,-1 ) );
|
||||
|
||||
bButtonsSizer->Add( m_colorValue, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bButtonsSizer->Add( m_colorValue, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
|
||||
bButtonsSizer->Add( 20, 0, 0, wxEXPAND, 5 );
|
||||
@@ -217,7 +211,7 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
|
||||
bButtonsSizer->Add( m_sdbSizer, 1, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bButtonsSizer, 1, wxEXPAND|wxLEFT, 10 );
|
||||
bSizerMain->Add( bButtonsSizer, 0, wxEXPAND|wxLEFT, 10 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
@@ -234,6 +228,7 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
|
||||
m_spinCtrlBlue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditBlue ), NULL, this );
|
||||
m_HsvBitmap->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseClick ), NULL, this );
|
||||
m_HsvBitmap->Connect( wxEVT_MOTION, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseDrag ), NULL, this );
|
||||
m_HsvBitmap->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_COLOR_PICKER_BASE::onSize ), NULL, this );
|
||||
m_spinCtrlHue->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditHue ), NULL, this );
|
||||
m_spinCtrlSaturation->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditSat ), NULL, this );
|
||||
m_sliderBrightness->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeBrightness ), NULL, this );
|
||||
@@ -268,6 +263,7 @@ DIALOG_COLOR_PICKER_BASE::~DIALOG_COLOR_PICKER_BASE()
|
||||
m_spinCtrlBlue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditBlue ), NULL, this );
|
||||
m_HsvBitmap->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseClick ), NULL, this );
|
||||
m_HsvBitmap->Disconnect( wxEVT_MOTION, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onHSVMouseDrag ), NULL, this );
|
||||
m_HsvBitmap->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_COLOR_PICKER_BASE::onSize ), NULL, this );
|
||||
m_spinCtrlHue->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditHue ), NULL, this );
|
||||
m_spinCtrlSaturation->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeEditSat ), NULL, this );
|
||||
m_sliderBrightness->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeBrightness ), NULL, this );
|
||||
|
||||
+1767
-1752
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// C++ code generated with wxFormBuilder (version 4.1.0-0-g733bf3d)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -81,6 +81,7 @@ class DIALOG_COLOR_PICKER_BASE : public DIALOG_SHIM
|
||||
virtual void OnChangeEditBlue( wxSpinEvent& event ) { event.Skip(); }
|
||||
virtual void onHSVMouseClick( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void onHSVMouseDrag( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void onSize( wxSizeEvent& event ) { event.Skip(); }
|
||||
virtual void OnChangeEditHue( wxSpinEvent& event ) { event.Skip(); }
|
||||
virtual void OnChangeEditSat( wxSpinEvent& event ) { event.Skip(); }
|
||||
virtual void OnChangeBrightness( wxScrollEvent& event ) { event.Skip(); }
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <pgm_base.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <widgets/grid_text_helpers.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -49,7 +49,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
|
||||
// Label Appearance
|
||||
|
||||
// Cell Defaults
|
||||
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
|
||||
m_EnvVars->SetMinSize( wxSize( 604,170 ) );
|
||||
|
||||
sbEnvVars->Add( m_EnvVars, 1, wxALL|wxEXPAND, 5 );
|
||||
@@ -70,7 +70,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
|
||||
sbEnvVars->Add( bSizerEnvVarBtns, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( sbEnvVars, 1, wxEXPAND|wxALL, 5 );
|
||||
bSizerMain->Add( sbEnvVars, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
|
||||
@@ -62,109 +62,23 @@
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" 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="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="cell_bg"></property>
|
||||
<property name="cell_font"></property>
|
||||
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
|
||||
<property name="cell_text"></property>
|
||||
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="col_label_size">wxGRID_AUTOSIZE</property>
|
||||
<property name="col_label_values">"Environment Variables" "Path" ""</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">2</property>
|
||||
<property name="column_sizes">150,454</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="drag_col_move">0</property>
|
||||
<property name="drag_col_size">1</property>
|
||||
<property name="drag_grid_size">0</property>
|
||||
<property name="drag_row_size">1</property>
|
||||
<property name="editing">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="grid_line_color"></property>
|
||||
<property name="grid_lines">1</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label_bg"></property>
|
||||
<property name="label_font"></property>
|
||||
<property name="label_text"></property>
|
||||
<property name="margin_height">0</property>
|
||||
<property name="margin_width">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">604,170</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_EnvVars</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="row_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_label_size">0</property>
|
||||
<property name="row_label_values"></property>
|
||||
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_sizes"></property>
|
||||
<property name="rows">1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnSize">OnGridSize</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Environment Variables</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerEnvVarBtns</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="name">sbEnvVars</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@@ -173,209 +87,251 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="cell_bg"></property>
|
||||
<property name="cell_font"></property>
|
||||
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
|
||||
<property name="cell_text"></property>
|
||||
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="col_label_size">wxGRID_AUTOSIZE</property>
|
||||
<property name="col_label_values">"Name" "Path"</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">2</property>
|
||||
<property name="column_sizes">150,454</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_col_move">0</property>
|
||||
<property name="drag_col_size">1</property>
|
||||
<property name="drag_grid_size">0</property>
|
||||
<property name="drag_row_size">1</property>
|
||||
<property name="editing">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="grid_line_color"></property>
|
||||
<property name="grid_lines">1</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Add Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="label_bg"></property>
|
||||
<property name="label_font"></property>
|
||||
<property name="label_text"></property>
|
||||
<property name="margin_height">0</property>
|
||||
<property name="margin_width">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="minimum_size">604,170</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnAddEnvVar</property>
|
||||
<property name="name">m_EnvVars</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="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_label_size">0</property>
|
||||
<property name="row_label_values"></property>
|
||||
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_sizes"></property>
|
||||
<property name="rows">1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnAddEnvVar</event>
|
||||
<event name="OnSize">OnGridSize</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerEnvVarBtns</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" 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="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Add Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnAddEnvVar</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="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnAddEnvVar</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" 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="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Delete Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnDeleteEnvVar</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="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnRemoveEnvVar</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" 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="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Delete Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnDeleteEnvVar</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="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnRemoveEnvVar</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticline1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxLI_HORIZONTAL</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <project.h>
|
||||
#include <grid_tricks.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <widgets/grid_text_helpers.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ void KIGFX::DS_PAINTER::draw( const DS_DRAW_ITEM_TEXT* aItem, int aLayer ) const
|
||||
if( !font )
|
||||
{
|
||||
font = KIFONT::FONT::GetFont( m_renderSettings.GetDefaultFont(), aItem->IsBold(),
|
||||
aItem->IsItalic() );
|
||||
aItem->IsItalic(), true );
|
||||
}
|
||||
|
||||
const COLOR4D& color = m_renderSettings.GetColor( aItem, aLayer );
|
||||
|
||||
@@ -265,6 +265,10 @@ void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event )
|
||||
|
||||
EDA_BASE_FRAME::~EDA_BASE_FRAME()
|
||||
{
|
||||
Disconnect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER,
|
||||
wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) );
|
||||
Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_BASE_FRAME::windowClosing ) );
|
||||
|
||||
delete m_autoSaveTimer;
|
||||
delete m_fileHistory;
|
||||
|
||||
|
||||
+11
-5
@@ -401,8 +401,6 @@ void EDA_SHAPE::flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
|
||||
m_start.y = aCentre.y - ( m_start.y - aCentre.y );
|
||||
m_end.y = aCentre.y - ( m_end.y - aCentre.y );
|
||||
}
|
||||
|
||||
std::swap( m_start, m_end );
|
||||
break;
|
||||
|
||||
case SHAPE_T::CIRCLE:
|
||||
@@ -2072,9 +2070,17 @@ static struct EDA_SHAPE_DESC
|
||||
shapeProps )
|
||||
.SetAvailableFunc( fillAvailable );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, COLOR4D>( _HKI( "Fill Color" ),
|
||||
&EDA_SHAPE::SetFillColor, &EDA_SHAPE::GetFillColor ),
|
||||
shapeProps )
|
||||
auto fillColor = new PROPERTY<EDA_SHAPE, COLOR4D>( _HKI( "Fill Color" ),
|
||||
&EDA_SHAPE::SetFillColor, &EDA_SHAPE::GetFillColor );
|
||||
fillColor->SetWriteableFunc(
|
||||
[=]( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
if( EDA_SHAPE* edaShape = dynamic_cast<EDA_SHAPE*>( aItem ) )
|
||||
return edaShape->GetFillMode() == FILL_T::FILLED_WITH_COLOR;
|
||||
|
||||
return true;
|
||||
} );
|
||||
propMgr.AddProperty( fillColor, shapeProps )
|
||||
.SetAvailableFunc( fillAvailable )
|
||||
.SetIsHiddenFromRulesEditor();
|
||||
}
|
||||
|
||||
+65
-2
@@ -48,6 +48,7 @@
|
||||
#include <font/outline_font.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <properties/property_validators.h>
|
||||
#include <ctl_flags.h> // for CTL_OMIT_HIDE definition
|
||||
|
||||
#include <wx/debug.h> // for wxASSERT
|
||||
#include <wx/string.h>
|
||||
@@ -211,6 +212,26 @@ void EDA_TEXT::SetTextAngle( const EDA_ANGLE& aAngle )
|
||||
|
||||
|
||||
void EDA_TEXT::SetItalic( bool aItalic )
|
||||
{
|
||||
if( m_attributes.m_Italic != aItalic )
|
||||
{
|
||||
const KIFONT::FONT* font = GetFont();
|
||||
|
||||
if( !font || font->IsStroke() )
|
||||
{
|
||||
// For stroke fonts, just need to set the attribute.
|
||||
}
|
||||
else
|
||||
{
|
||||
// For outline fonts, italic-ness is determined by the font itself.
|
||||
SetFont( KIFONT::FONT::GetFont( font->GetName(), IsBold(), aItalic ) );
|
||||
}
|
||||
}
|
||||
|
||||
SetItalicFlag( aItalic );
|
||||
}
|
||||
|
||||
void EDA_TEXT::SetItalicFlag( bool aItalic )
|
||||
{
|
||||
m_attributes.m_Italic = aItalic;
|
||||
ClearRenderCache();
|
||||
@@ -219,6 +240,48 @@ void EDA_TEXT::SetItalic( bool aItalic )
|
||||
|
||||
|
||||
void EDA_TEXT::SetBold( bool aBold )
|
||||
{
|
||||
if( m_attributes.m_Bold != aBold )
|
||||
{
|
||||
const KIFONT::FONT* font = GetFont();
|
||||
|
||||
if( !font || font->IsStroke() )
|
||||
{
|
||||
// For stroke fonts, boldness is determined by the pen size.
|
||||
const int size = std::min( m_attributes.m_Size.x, m_attributes.m_Size.y );
|
||||
|
||||
if( aBold )
|
||||
{
|
||||
m_attributes.m_StoredStrokeWidth = m_attributes.m_StrokeWidth;
|
||||
m_attributes.m_StrokeWidth = GetPenSizeForBold( size );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Restore the original stroke width from `m_StoredStrokeWidth` if it was previously stored,
|
||||
// resetting the width after unbolding.
|
||||
if( m_attributes.m_StoredStrokeWidth )
|
||||
m_attributes.m_StrokeWidth = m_attributes.m_StoredStrokeWidth;
|
||||
else
|
||||
{
|
||||
m_attributes.m_StrokeWidth = GetPenSizeForNormal( size );
|
||||
// Sets `m_StrokeWidth` to the normal pen size and stores it in `m_StoredStrokeWidth`
|
||||
// as the default, but only if the bold option was applied before this feature was implemented.
|
||||
m_attributes.m_StoredStrokeWidth = m_attributes.m_StrokeWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// For outline fonts, boldness is determined by the font itself.
|
||||
SetFont( KIFONT::FONT::GetFont( font->GetName(), aBold, IsItalic() ) );
|
||||
}
|
||||
}
|
||||
|
||||
SetBoldFlag( aBold );
|
||||
}
|
||||
|
||||
|
||||
void EDA_TEXT::SetBoldFlag( bool aBold )
|
||||
{
|
||||
m_attributes.m_Bold = aBold;
|
||||
ClearRenderCache();
|
||||
@@ -918,7 +981,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
|
||||
if( IsItalic() )
|
||||
aFormatter->Print( 0, " (italic yes)" );
|
||||
|
||||
if( GetTextColor() != COLOR4D::UNSPECIFIED )
|
||||
if( !( aControlBits & CTL_OMIT_COLOR ) && GetTextColor() != COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
aFormatter->Print( 0, " (color %d %d %d %s)",
|
||||
KiROUND( GetTextColor().r * 255.0 ),
|
||||
@@ -949,7 +1012,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
|
||||
if( !( aControlBits & CTL_OMIT_HIDE ) && !IsVisible() )
|
||||
aFormatter->Print( 0, " (hide yes)" );
|
||||
|
||||
if( HasHyperlink() )
|
||||
if( !( aControlBits & CTL_OMIT_HYPERLINK ) && HasHyperlink() )
|
||||
{
|
||||
aFormatter->Print( 0, " (href %s)", aFormatter->Quotew( GetHyperlink() ).c_str() );
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ const METRICS& METRICS::Default()
|
||||
|
||||
FONT* FONT::s_defaultFont = nullptr;
|
||||
|
||||
std::map< std::tuple<wxString, bool, bool>, FONT*> FONT::s_fontMap;
|
||||
std::map< std::tuple<wxString, bool, bool, bool>, FONT*> FONT::s_fontMap;
|
||||
|
||||
class MARKUP_CACHE
|
||||
{
|
||||
@@ -143,12 +143,13 @@ FONT* FONT::getDefaultFont()
|
||||
}
|
||||
|
||||
|
||||
FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
|
||||
FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic,
|
||||
bool aForDrawingSheet )
|
||||
{
|
||||
if( aFontName.empty() || aFontName.StartsWith( KICAD_FONT_NAME ) )
|
||||
return getDefaultFont();
|
||||
|
||||
std::tuple<wxString, bool, bool> key = { aFontName, aBold, aItalic };
|
||||
std::tuple<wxString, bool, bool, bool> key = { aFontName, aBold, aItalic, aForDrawingSheet };
|
||||
|
||||
FONT* font = nullptr;
|
||||
|
||||
@@ -156,7 +157,7 @@ FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
|
||||
font = s_fontMap[key];
|
||||
|
||||
if( !font )
|
||||
font = OUTLINE_FONT::LoadFont( aFontName, aBold, aItalic );
|
||||
font = OUTLINE_FONT::LoadFont( aFontName, aBold, aItalic, aForDrawingSheet );
|
||||
|
||||
if( !font )
|
||||
font = getDefaultFont();
|
||||
|
||||
@@ -204,6 +204,17 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
|
||||
if( !g_fcInitSuccess )
|
||||
return retval;
|
||||
|
||||
// If the original font name contains any of these, then it is bold, regardless
|
||||
// of whether we are looking for bold or not
|
||||
if( aFontName.Lower().Contains( wxS( "bold" ) ) // also catches ultrabold
|
||||
|| aFontName.Lower().Contains( wxS( "heavy" ) )
|
||||
|| aFontName.Lower().Contains( wxS( "black" ) ) // also catches extrablack
|
||||
|| aFontName.Lower().Contains( wxS( "thick" ) )
|
||||
|| aFontName.Lower().Contains( wxS( "dark" ) ) )
|
||||
{
|
||||
aBold = true;
|
||||
}
|
||||
|
||||
wxString qualifiedFontName = aFontName;
|
||||
|
||||
wxScopedCharBuffer const fcBuffer = qualifiedFontName.ToUTF8();
|
||||
@@ -333,7 +344,10 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
|
||||
{
|
||||
fontName.Replace( ':', ' ' );
|
||||
|
||||
if( s_reporter )
|
||||
// If we missed a case but the matching found the original font name, then we are not substituting
|
||||
if( fontName.CmpNoCase( qualifiedFontName ) == 0 )
|
||||
retval = FF_RESULT::FF_OK;
|
||||
else if( s_reporter )
|
||||
s_reporter->Report( wxString::Format( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ OUTLINE_FONT::OUTLINE_FONT() :
|
||||
m_face(NULL),
|
||||
m_faceSize( 16 ),
|
||||
m_fakeBold( false ),
|
||||
m_fakeItal( false )
|
||||
m_fakeItal( false ),
|
||||
m_forDrawingSheet( false )
|
||||
{
|
||||
std::lock_guard<std::mutex> guard( m_freeTypeMutex );
|
||||
|
||||
@@ -53,7 +54,8 @@ OUTLINE_FONT::OUTLINE_FONT() :
|
||||
}
|
||||
|
||||
|
||||
OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, bool aItalic )
|
||||
OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, bool aItalic,
|
||||
bool aForDrawingSheet )
|
||||
{
|
||||
std::unique_ptr<OUTLINE_FONT> font = std::make_unique<OUTLINE_FONT>();
|
||||
|
||||
@@ -77,6 +79,7 @@ OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, boo
|
||||
|
||||
font->m_fontName = aFontName; // Keep asked-for name, even if we substituted.
|
||||
font->m_fontFileName = fontFile;
|
||||
font->m_forDrawingSheet = aForDrawingSheet;
|
||||
|
||||
return font.release();
|
||||
}
|
||||
@@ -260,6 +263,7 @@ struct GLYPH_CACHE_KEY {
|
||||
FT_Face face;
|
||||
hb_codepoint_t codepoint;
|
||||
double scaler;
|
||||
bool forDrawingSheet;
|
||||
bool fakeItalic;
|
||||
bool fakeBold;
|
||||
bool mirror;
|
||||
@@ -267,9 +271,14 @@ struct GLYPH_CACHE_KEY {
|
||||
|
||||
bool operator==(const GLYPH_CACHE_KEY& rhs ) const
|
||||
{
|
||||
return face == rhs.face && codepoint == rhs.codepoint && scaler == rhs.scaler
|
||||
&& fakeItalic == rhs.fakeItalic && fakeBold == rhs.fakeBold
|
||||
&& mirror == rhs.mirror && angle == rhs.angle;
|
||||
return face == rhs.face
|
||||
&& codepoint == rhs.codepoint
|
||||
&& scaler == rhs.scaler
|
||||
&& forDrawingSheet == rhs.forDrawingSheet
|
||||
&& fakeItalic == rhs.fakeItalic
|
||||
&& fakeBold == rhs.fakeBold
|
||||
&& mirror == rhs.mirror
|
||||
&& angle == rhs.angle;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,10 +289,14 @@ namespace std
|
||||
{
|
||||
std::size_t operator()( const GLYPH_CACHE_KEY& k ) const
|
||||
{
|
||||
return hash<const void*>()( k.face ) ^ hash<unsigned>()( k.codepoint )
|
||||
return hash<const void*>()( k.face )
|
||||
^ hash<unsigned>()( k.codepoint )
|
||||
^ hash<double>()( k.scaler )
|
||||
^ hash<int>()( k.fakeItalic ) ^ hash<int>()( k.fakeBold )
|
||||
^ hash<int>()( k.mirror ) ^ hash<int>()( k.angle.AsTenthsOfADegree() );
|
||||
^ hash<double>()( k.forDrawingSheet )
|
||||
^ hash<int>()( k.fakeItalic )
|
||||
^ hash<int>()( k.fakeBold )
|
||||
^ hash<int>()( k.mirror )
|
||||
^ hash<int>()( k.angle.AsTenthsOfADegree() );
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -341,8 +354,8 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
|
||||
|
||||
if( aGlyphs )
|
||||
{
|
||||
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, scaler, m_fakeItal, m_fakeBold,
|
||||
aMirror, aAngle };
|
||||
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, scaler, m_forDrawingSheet,
|
||||
m_fakeItal, m_fakeBold, aMirror, aAngle };
|
||||
GLYPH_DATA& glyphData = s_glyphCache[ key ];
|
||||
|
||||
if( glyphData.m_Contours.empty() )
|
||||
@@ -439,6 +452,8 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
|
||||
|
||||
for( SHAPE_LINE_CHAIN& hole : holes )
|
||||
{
|
||||
bool added_hole = false;
|
||||
|
||||
if( hole.PointCount() )
|
||||
{
|
||||
for( int ii = 0; ii < glyph->OutlineCount(); ++ii )
|
||||
@@ -446,9 +461,15 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
|
||||
if( glyph->Outline( ii ).PointInside( hole.GetPoint( 0 ) ) )
|
||||
{
|
||||
glyph->AddHole( std::move( hole ), ii );
|
||||
added_hole = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Some lovely TTF fonts decided that winding didn't matter for outlines that
|
||||
// don't have holes, so holes that don't fit in any outline are added as outlines
|
||||
if( !added_hole )
|
||||
glyph->AddOutline( std::move( hole ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ TEXT_ATTRIBUTES::TEXT_ATTRIBUTES( KIFONT::FONT* aFont ) :
|
||||
m_Visible( true ),
|
||||
m_Mirrored( false ),
|
||||
m_Multiline( true ),
|
||||
m_KeepUpright( false )
|
||||
m_KeepUpright( false ),
|
||||
m_StoredStrokeWidth( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1828,7 +1828,7 @@ void CAIRO_GAL_BASE::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTota
|
||||
for( const std::vector<VECTOR2D>& pointList : glyph )
|
||||
drawPoly( pointList );
|
||||
}
|
||||
else if( aGlyph.IsOutline() )
|
||||
else if( aGlyph.IsOutline() )
|
||||
{
|
||||
const KIFONT::OUTLINE_GLYPH& glyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( aGlyph );
|
||||
|
||||
@@ -1866,15 +1866,9 @@ void CAIRO_GAL_BASE::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTota
|
||||
|
||||
if( aNth == aTotal - 1 )
|
||||
{
|
||||
/*
|
||||
cairo_close_path( currentContext );
|
||||
setSourceRgba( currentContext, fillColor );
|
||||
cairo_set_fill_rule( currentContext, CAIRO_FILL_RULE_EVEN_ODD );
|
||||
cairo_fill_preserve( currentContext );
|
||||
setSourceRgba( currentContext, strokeColor );
|
||||
cairo_stroke( currentContext );
|
||||
*/
|
||||
flushPath();
|
||||
SetIsFill( false );
|
||||
SetIsStroke( true );
|
||||
m_isElementAdded = true;
|
||||
}
|
||||
}
|
||||
|
||||
+16
-1
@@ -693,7 +693,14 @@ void GRID_TRICKS::paste_clipboard()
|
||||
|
||||
wxTheClipboard->GetData( data );
|
||||
|
||||
paste_text( data.GetText() );
|
||||
wxString text = data.GetText();
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// Some editors use windows linefeeds (\r\n), which wx re-writes to \n\n
|
||||
text.Replace( "\n\n", "\n" );
|
||||
#endif
|
||||
|
||||
paste_text( text );
|
||||
}
|
||||
|
||||
wxTheClipboard->Close();
|
||||
@@ -802,6 +809,14 @@ void GRID_TRICKS::paste_text( const wxString& cb_text )
|
||||
{
|
||||
tbl->SetValue( row, col, cellTxt );
|
||||
|
||||
wxGridEvent evt( m_grid->GetId(), wxEVT_GRID_CELL_CHANGED, m_grid, row, col );
|
||||
m_grid->GetEventHandler()->ProcessEvent( evt );
|
||||
}
|
||||
// Allow paste to any cell that can accept a boolean value
|
||||
else if( tbl->CanSetValueAs( row, col, wxGRID_VALUE_BOOL ) )
|
||||
{
|
||||
tbl->SetValueAsBool( row, col, cellTxt == wxT( "1" ) );
|
||||
|
||||
wxGridEvent evt( m_grid->GetId(), wxEVT_GRID_CELL_CHANGED, m_grid, row, col );
|
||||
m_grid->GetEventHandler()->ProcessEvent( evt );
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ DXF_IMPORT_PLUGIN::DXF_IMPORT_PLUGIN() : DL_CreationAdapter()
|
||||
m_brdLayer = Dwgs_User; // The default import layer
|
||||
m_importAsFPShapes = true;
|
||||
m_minX = m_minY = std::numeric_limits<double>::max();
|
||||
m_maxX = m_maxY = std::numeric_limits<double>::min();
|
||||
m_maxX = m_maxY = std::numeric_limits<double>::lowest();
|
||||
m_currentUnit = DXF_IMPORT_UNITS::DEFAULT;
|
||||
|
||||
m_importCoordinatePrecision = 4; // initial value per dxf spec
|
||||
@@ -131,7 +131,7 @@ bool DXF_IMPORT_PLUGIN::Load( const wxString& aFileName )
|
||||
|
||||
m_internalImporter.ClearShapes();
|
||||
|
||||
reportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
|
||||
ReportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ bool DXF_IMPORT_PLUGIN::LoadFromMemory( const wxMemoryBuffer& aMemBuffer )
|
||||
|
||||
m_internalImporter.ClearShapes();
|
||||
|
||||
reportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
|
||||
ReportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ bool DXF_IMPORT_PLUGIN::ImportDxfFile( const wxMemoryBuffer& aMemBuffer )
|
||||
}
|
||||
|
||||
|
||||
void DXF_IMPORT_PLUGIN::reportMsg( const wxString& aMessage )
|
||||
void DXF_IMPORT_PLUGIN::ReportMsg( const wxString& aMessage )
|
||||
{
|
||||
// Add message to keep trace of not handled dxf entities
|
||||
m_messages += aMessage;
|
||||
@@ -1411,8 +1411,8 @@ void DXF_IMPORT_PLUGIN::insertSpline( double aWidth )
|
||||
ctrlp.push_back( m_curr_entity.m_SplineControlPointList[ii].m_y );
|
||||
}
|
||||
|
||||
std::vector<double> coords;
|
||||
tinyspline::BSpline beziers;
|
||||
std::vector<double> coords;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -1421,15 +1421,18 @@ void DXF_IMPORT_PLUGIN::insertSpline( double aWidth )
|
||||
|
||||
dxfspline.setControlPoints( ctrlp );
|
||||
dxfspline.setKnots( m_curr_entity.m_SplineKnotsList );
|
||||
beziers = tinyspline::BSpline( dxfspline.toBeziers() );
|
||||
|
||||
if( dxfspline.degree() < 3 )
|
||||
dxfspline = dxfspline.elevateDegree( 3 - dxfspline.degree() );
|
||||
|
||||
beziers = dxfspline.toBeziers();
|
||||
coords = beziers.controlPoints();
|
||||
}
|
||||
catch( const std::runtime_error& ) // tinyspline throws everything including data validation
|
||||
// as runtime errors
|
||||
{
|
||||
// invalid spline definition, drop this block
|
||||
reportMsg( _( "Invalid spline definition encountered" ) );
|
||||
ReportMsg( _( "Invalid spline definition encountered" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1446,14 +1449,14 @@ void DXF_IMPORT_PLUGIN::insertSpline( double aWidth )
|
||||
// not sure why this happens, but it seems to sometimes slip degree on the final bezier
|
||||
VECTOR2D bezierControl2;
|
||||
|
||||
if( ii + 4 >= coords.size() )
|
||||
if( ii + 5 >= coords.size() )
|
||||
bezierControl2 = bezierControl1;
|
||||
else
|
||||
bezierControl2 = VECTOR2D( mapX( coords[ii + 4] ), mapY( coords[ii + 5] ) );
|
||||
|
||||
VECTOR2D end;
|
||||
|
||||
if( ii + 6 >= coords.size() )
|
||||
if( ii + 7 >= coords.size() )
|
||||
end = bezierControl2;
|
||||
else
|
||||
end = VECTOR2D( mapX( coords[ii + 6] ), mapY( coords[ii + 7] ) );
|
||||
|
||||
@@ -320,10 +320,10 @@ public:
|
||||
{
|
||||
return m_messages;
|
||||
}
|
||||
// report message to keep trace of not supported dxf entities:
|
||||
void ReportMsg( const wxString& aMessage ) override;
|
||||
|
||||
private:
|
||||
// report message to keep trace of not supported dxf entities:
|
||||
void reportMsg( const wxString& aMessage );
|
||||
|
||||
// coordinate conversions from dxf file to mm
|
||||
double mapX( double aDxfCoordX );
|
||||
@@ -455,77 +455,77 @@ private:
|
||||
// Not yet handled DXF entities:
|
||||
virtual void addXLine( const DL_XLineData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF construction lines not currently supported." ) );
|
||||
ReportMsg( _( "DXF construction lines not currently supported." ) );
|
||||
}
|
||||
virtual void addRay( const DL_RayData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF construction lines not currently supported." ) );
|
||||
ReportMsg( _( "DXF construction lines not currently supported." ) );
|
||||
}
|
||||
|
||||
virtual void addArcAlignedText( const DL_ArcAlignedTextData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF arc-aligned text not currently supported." ) );
|
||||
ReportMsg( _( "DXF arc-aligned text not currently supported." ) );
|
||||
}
|
||||
|
||||
virtual void addDimAlign( const DL_DimensionData&, const DL_DimAlignedData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addDimLinear( const DL_DimensionData&, const DL_DimLinearData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addDimRadial( const DL_DimensionData&, const DL_DimRadialData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addDimDiametric( const DL_DimensionData&, const DL_DimDiametricData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addDimAngular( const DL_DimensionData&, const DL_DimAngular2LData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addDimAngular3P( const DL_DimensionData&, const DL_DimAngular3PData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addDimOrdinate( const DL_DimensionData&, const DL_DimOrdinateData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addLeader( const DL_LeaderData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
ReportMsg( _( "DXF dimensions not currently supported." ) );
|
||||
}
|
||||
virtual void addLeaderVertex( const DL_LeaderVertexData& ) override { }
|
||||
|
||||
virtual void addHatch( const DL_HatchData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF hatches not currently supported." ) );
|
||||
ReportMsg( _( "DXF hatches not currently supported." ) );
|
||||
}
|
||||
virtual void addHatchLoop( const DL_HatchLoopData& ) override { }
|
||||
virtual void addHatchEdge( const DL_HatchEdgeData& ) override { }
|
||||
|
||||
virtual void addTrace( const DL_TraceData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF traces not currently supported." ) );
|
||||
ReportMsg( _( "DXF traces not currently supported." ) );
|
||||
}
|
||||
|
||||
virtual void add3dFace( const DL_3dFaceData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF 3dfaces not currently supported." ) );
|
||||
ReportMsg( _( "DXF 3dfaces not currently supported." ) );
|
||||
}
|
||||
|
||||
virtual void addSolid( const DL_SolidData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF solids not currently supported." ) );
|
||||
ReportMsg( _( "DXF solids not currently supported." ) );
|
||||
}
|
||||
|
||||
virtual void addImage( const DL_ImageData& ) override
|
||||
{
|
||||
reportMsg( _( "DXF images not currently supported." ) );
|
||||
ReportMsg( _( "DXF images not currently supported." ) );
|
||||
}
|
||||
virtual void linkImage( const DL_ImageDefData& ) override {}
|
||||
|
||||
|
||||
@@ -131,6 +131,8 @@ public:
|
||||
*/
|
||||
const virtual wxString& GetMessages() const = 0;
|
||||
|
||||
virtual void ReportMsg( const wxString& aMessage ) = 0;
|
||||
|
||||
protected:
|
||||
///< Importer used to create objects representing the imported shapes.
|
||||
GRAPHICS_IMPORTER* m_importer;
|
||||
|
||||
@@ -125,6 +125,11 @@ public:
|
||||
return m_plugin->GetMessages();
|
||||
}
|
||||
|
||||
void ReportMsg( const wxString& aMessage )
|
||||
{
|
||||
m_plugin->ReportMsg( aMessage );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get original image Width.
|
||||
*
|
||||
|
||||
@@ -98,6 +98,89 @@ void GRAPHICS_IMPORTER_BUFFER::AddShape( std::unique_ptr<IMPORTED_SHAPE>& aShape
|
||||
|
||||
void GRAPHICS_IMPORTER_BUFFER::ImportTo( GRAPHICS_IMPORTER& aImporter )
|
||||
{
|
||||
BOX2D boundingBox;
|
||||
|
||||
for( std::unique_ptr<IMPORTED_SHAPE>& shape : m_shapes )
|
||||
{
|
||||
BOX2D box = shape->GetBoundingBox();
|
||||
|
||||
if( box.IsValid() )
|
||||
boundingBox.Merge( box );
|
||||
}
|
||||
|
||||
boundingBox.SetOrigin( boundingBox.GetPosition().x * aImporter.GetScale().x,
|
||||
boundingBox.GetPosition().y * aImporter.GetScale().y );
|
||||
boundingBox.SetSize( boundingBox.GetSize().x * aImporter.GetScale().x,
|
||||
boundingBox.GetSize().y * aImporter.GetScale().y );
|
||||
|
||||
// Check that the scaled graphics fit in the KiCad numeric limits
|
||||
if( boundingBox.GetSize().x * aImporter.GetMillimeterToIuFactor() > std::numeric_limits<int>::max() ||
|
||||
boundingBox.GetSize().y * aImporter.GetMillimeterToIuFactor() > std::numeric_limits<int>::max() )
|
||||
{
|
||||
double scale_factor = std::numeric_limits<int>::max() / ( aImporter.GetMillimeterToIuFactor() + 100 );
|
||||
double max_scale = std::max( scale_factor / boundingBox.GetSize().x,
|
||||
scale_factor / boundingBox.GetSize().y );
|
||||
aImporter.ReportMsg( wxString::Format( _( "Imported graphic is too large. Maximum scale is %f" ),
|
||||
max_scale ) );
|
||||
return;
|
||||
}
|
||||
// They haven't set the import offset, so we set it to the bounding box origin to keep the graphics
|
||||
// in the KiCad drawing area
|
||||
else if( aImporter.GetImportOffsetMM() == VECTOR2D( 0, 0 ) )
|
||||
{
|
||||
VECTOR2D offset = boundingBox.GetOrigin();
|
||||
aImporter.SetImportOffsetMM( -offset );
|
||||
}
|
||||
else
|
||||
{
|
||||
VECTOR2D bbox_origin = boundingBox.GetOrigin();
|
||||
aImporter.SetImportOffsetMM( -bbox_origin + aImporter.GetImportOffsetMM() );
|
||||
|
||||
double total_scale_x = aImporter.GetScale().x * aImporter.GetMillimeterToIuFactor();
|
||||
double total_scale_y = aImporter.GetScale().y * aImporter.GetMillimeterToIuFactor();
|
||||
|
||||
double max_offset_x =
|
||||
( aImporter.GetImportOffsetMM().x + boundingBox.GetRight() ) * total_scale_x;
|
||||
double max_offset_y =
|
||||
( aImporter.GetImportOffsetMM().y + boundingBox.GetBottom() ) * total_scale_y;
|
||||
double min_offset_x =
|
||||
( aImporter.GetImportOffsetMM().x + boundingBox.GetLeft() ) * total_scale_x;
|
||||
double min_offset_y =
|
||||
( aImporter.GetImportOffsetMM().y + boundingBox.GetTop() ) * total_scale_y;
|
||||
|
||||
VECTOR2D newOffset = aImporter.GetImportOffsetMM();
|
||||
bool needsAdjustment = false;
|
||||
|
||||
if( max_offset_x >= std::numeric_limits<int>::max() )
|
||||
{
|
||||
newOffset.x -= ( max_offset_x - std::numeric_limits<int>::max() + 100.0 ) / total_scale_x;
|
||||
needsAdjustment = true;
|
||||
}
|
||||
else if( min_offset_x <= std::numeric_limits<int>::min() )
|
||||
{
|
||||
newOffset.x -= ( min_offset_x - std::numeric_limits<int>::min() - 100 ) / total_scale_x;
|
||||
needsAdjustment = true;
|
||||
}
|
||||
|
||||
if( max_offset_y >= std::numeric_limits<int>::max() )
|
||||
{
|
||||
newOffset.y -= ( max_offset_y - std::numeric_limits<int>::max() + 100 ) / total_scale_y;
|
||||
needsAdjustment = true;
|
||||
}
|
||||
else if( min_offset_y <= std::numeric_limits<int>::min() )
|
||||
{
|
||||
newOffset.y -= ( min_offset_y - std::numeric_limits<int>::min() - 100 ) / total_scale_y;
|
||||
needsAdjustment = true;
|
||||
}
|
||||
|
||||
if( needsAdjustment )
|
||||
{
|
||||
aImporter.ReportMsg( wxString::Format( _( "Import offset adjusted to (%f, %f) to fit within numeric limits" ),
|
||||
newOffset.x, newOffset.y ) );
|
||||
aImporter.SetImportOffsetMM( newOffset );
|
||||
}
|
||||
}
|
||||
|
||||
for( std::unique_ptr<IMPORTED_SHAPE>& shape : m_shapes )
|
||||
shape->ImportTo( aImporter );
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "graphics_importer.h"
|
||||
|
||||
#include <math/matrix3x3.h>
|
||||
#include <math/box2.h>
|
||||
#include <list>
|
||||
|
||||
|
||||
@@ -46,6 +47,8 @@ public:
|
||||
void SetParentShapeIndex( int aIndex ) { m_parentShapeIndex = aIndex; }
|
||||
int GetParentShapeIndex() const { return m_parentShapeIndex; }
|
||||
|
||||
virtual BOX2D GetBoundingBox() const = 0;
|
||||
|
||||
protected:
|
||||
int m_parentShapeIndex = -1;
|
||||
};
|
||||
@@ -75,6 +78,14 @@ public:
|
||||
m_end = aTransform * m_end + aTranslation;
|
||||
}
|
||||
|
||||
BOX2D GetBoundingBox() const override
|
||||
{
|
||||
BOX2D box;
|
||||
box.Merge( m_start );
|
||||
box.Merge( m_end );
|
||||
return box;
|
||||
}
|
||||
|
||||
private:
|
||||
VECTOR2D m_start;
|
||||
VECTOR2D m_end;
|
||||
@@ -113,6 +124,14 @@ public:
|
||||
m_radius = newRadius.EuclideanNorm();
|
||||
}
|
||||
|
||||
BOX2D GetBoundingBox() const override
|
||||
{
|
||||
BOX2D box;
|
||||
box.Merge( m_center - VECTOR2D( m_radius, m_radius ) );
|
||||
box.Merge( m_center + VECTOR2D( m_radius, m_radius ) );
|
||||
return box;
|
||||
}
|
||||
|
||||
private:
|
||||
VECTOR2D m_center;
|
||||
double m_radius;
|
||||
@@ -148,6 +167,26 @@ public:
|
||||
m_center = aTransform * m_center + aTranslation;
|
||||
}
|
||||
|
||||
BOX2D GetBoundingBox() const override
|
||||
{
|
||||
BOX2D box;
|
||||
|
||||
box.Merge( m_start + m_stroke.GetWidth() );
|
||||
box.Merge( m_start - m_stroke.GetWidth() );
|
||||
|
||||
for( double angle = 0; angle < m_angle.AsDegrees(); angle += 5 )
|
||||
{
|
||||
EDA_ANGLE ang = EDA_ANGLE( angle );
|
||||
VECTOR2D start = m_center + m_start;
|
||||
VECTOR2D pt = {start.x * ang.Cos() + start.y * ang.Sin(),
|
||||
start.x * ang.Sin() - start.y * ang.Cos()};
|
||||
|
||||
box.Merge( pt );
|
||||
}
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
private:
|
||||
VECTOR2D m_center;
|
||||
VECTOR2D m_start;
|
||||
@@ -192,6 +231,16 @@ public:
|
||||
|
||||
const IMPORTED_STROKE& GetStroke() const { return m_stroke; }
|
||||
|
||||
BOX2D GetBoundingBox() const override
|
||||
{
|
||||
BOX2D box;
|
||||
|
||||
for( const VECTOR2D& vert : m_vertices )
|
||||
box.Merge( vert );
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<VECTOR2D> m_vertices;
|
||||
IMPORTED_STROKE m_stroke;
|
||||
@@ -227,6 +276,19 @@ public:
|
||||
void Transform( const MATRIX3x3D& aTransform, const VECTOR2D& aTranslation ) override
|
||||
{
|
||||
m_origin = aTransform * m_origin + aTranslation;
|
||||
|
||||
VECTOR2D textSize = aTransform * VECTOR2D( m_width, m_height );
|
||||
m_width = textSize.x;
|
||||
m_height = textSize.y;
|
||||
}
|
||||
|
||||
BOX2D GetBoundingBox() const override
|
||||
{
|
||||
BOX2D box;
|
||||
box.Merge( m_origin );
|
||||
box.Merge( m_origin + VECTOR2D( m_width * m_text.length(), m_height ) );
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -272,6 +334,14 @@ public:
|
||||
m_end = aTransform * m_end + aTranslation;
|
||||
}
|
||||
|
||||
BOX2D GetBoundingBox() const override
|
||||
{
|
||||
BOX2D box;
|
||||
box.Merge( m_start );
|
||||
box.Merge( m_end );
|
||||
return box;
|
||||
}
|
||||
|
||||
private:
|
||||
VECTOR2D m_start;
|
||||
VECTOR2D m_bezierControl1;
|
||||
|
||||
@@ -426,3 +426,11 @@ static float distanceFromPointToLine( const VECTOR2D& aPoint, const VECTOR2D& aL
|
||||
|
||||
return fabs( distance );
|
||||
}
|
||||
|
||||
|
||||
void SVG_IMPORT_PLUGIN::ReportMsg( const wxString& aMessage )
|
||||
{
|
||||
// Add message to keep trace of not handled svg entities
|
||||
m_messages += aMessage;
|
||||
m_messages += '\n';
|
||||
}
|
||||
@@ -62,6 +62,8 @@ public:
|
||||
return m_messages;
|
||||
}
|
||||
|
||||
void ReportMsg( const wxString& aMessage ) override;
|
||||
|
||||
bool Import() override;
|
||||
bool Load( const wxString& aFileName ) override;
|
||||
bool LoadFromMemory( const wxMemoryBuffer& aMemBuffer ) override;
|
||||
|
||||
@@ -140,7 +140,8 @@ EASYEDAPRO::ProjectToSelectorDialog( const nlohmann::json& aProject, bool aPcbOn
|
||||
}
|
||||
|
||||
|
||||
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
|
||||
nlohmann::json EASYEDAPRO::FindJsonFile( const wxString& aZipFileName,
|
||||
const std::set<wxString>& aFileNames )
|
||||
{
|
||||
std::shared_ptr<wxZipEntry> entry;
|
||||
wxFFileInputStream in( aZipFileName );
|
||||
@@ -152,7 +153,7 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
|
||||
|
||||
try
|
||||
{
|
||||
if( name == wxS( "project.json" ) || name == wxS( "device.json" ) )
|
||||
if( aFileNames.find( name ) != aFileNames.end() )
|
||||
{
|
||||
wxMemoryOutputStream memos;
|
||||
memos << zip;
|
||||
@@ -175,6 +176,20 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
|
||||
}
|
||||
}
|
||||
|
||||
return nlohmann::json{};
|
||||
}
|
||||
|
||||
|
||||
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
|
||||
{
|
||||
static const std::set<wxString> c_files = { wxS( "project.json" ), wxS( "device.json" ),
|
||||
wxS( "footprint.json" ), wxS( "symbol.json" ) };
|
||||
|
||||
nlohmann::json j = FindJsonFile( aZipFileName, c_files );
|
||||
|
||||
if( !j.is_null() )
|
||||
return j;
|
||||
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "'%s' does not appear to be a valid EasyEDA (JLCEDA) Pro "
|
||||
"project or library file. Cannot find project.json or device.json." ),
|
||||
@@ -230,8 +245,17 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
|
||||
{
|
||||
try
|
||||
{
|
||||
nlohmann::json js = nlohmann::json::parse( txt.ReadLine() );
|
||||
lines.emplace_back( js );
|
||||
wxString line = txt.ReadLine();
|
||||
|
||||
if( !line.IsEmpty() )
|
||||
{
|
||||
nlohmann::json js = nlohmann::json::parse( line );
|
||||
lines.emplace_back( js );
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.emplace_back( nlohmann::json() );
|
||||
}
|
||||
}
|
||||
catch( nlohmann::json::exception& e )
|
||||
{
|
||||
@@ -244,3 +268,59 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::vector<nlohmann::json>>
|
||||
EASYEDAPRO::ParseJsonLinesWithSeparation( wxInputStream& aInput, const wxString& aSource )
|
||||
{
|
||||
wxTextInputStream txt( aInput, wxS( " " ), wxConvUTF8 );
|
||||
|
||||
int currentLine = 1;
|
||||
|
||||
std::vector<std::vector<nlohmann::json>> lineBlocks;
|
||||
lineBlocks.emplace_back();
|
||||
|
||||
while( aInput.CanRead() )
|
||||
{
|
||||
try
|
||||
{
|
||||
wxString line = txt.ReadLine();
|
||||
|
||||
if( !line.IsEmpty() )
|
||||
{
|
||||
nlohmann::json js = nlohmann::json::parse( line );
|
||||
lineBlocks.back().emplace_back( js );
|
||||
}
|
||||
else
|
||||
{
|
||||
lineBlocks.emplace_back();
|
||||
}
|
||||
}
|
||||
catch( nlohmann::json::exception& e )
|
||||
{
|
||||
wxLogWarning( wxString::Format( _( "Cannot parse JSON line %d in '%s': %s" ),
|
||||
currentLine, aSource, e.what() ) );
|
||||
}
|
||||
|
||||
currentLine++;
|
||||
}
|
||||
|
||||
return lineBlocks;
|
||||
}
|
||||
|
||||
|
||||
std::map<wxString, wxString>
|
||||
EASYEDAPRO::AnyMapToStringMap( const std::map<wxString, nlohmann::json>& aInput )
|
||||
{
|
||||
std::map<wxString, wxString> stringMap;
|
||||
|
||||
for( auto& [key, value] : aInput )
|
||||
{
|
||||
if( value.is_string() )
|
||||
stringMap[key] = value.get<wxString>();
|
||||
else if( value.is_number() )
|
||||
stringMap[key] = wxString::FromCDouble( value.get<double>() );
|
||||
}
|
||||
|
||||
return stringMap;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#ifndef EASYEDAPRO_IMPORT_UTILS_H_
|
||||
#define EASYEDAPRO_IMPORT_UTILS_H_
|
||||
|
||||
#include <set>
|
||||
#include <wx/stream.h>
|
||||
#include <wx/string.h>
|
||||
#include <lib_id.h>
|
||||
@@ -46,6 +47,8 @@ std::vector<IMPORT_PROJECT_DESC> ProjectToSelectorDialog( const nlohmann::json&
|
||||
bool aPcbOnly = false,
|
||||
bool aSchOnly = false );
|
||||
|
||||
nlohmann::json FindJsonFile( const wxString& aZipFileName, const std::set<wxString>& aFileNames );
|
||||
|
||||
nlohmann::json ReadProjectOrDeviceFile( const wxString& aZipFileName );
|
||||
|
||||
void IterateZipFiles(
|
||||
@@ -54,6 +57,14 @@ void IterateZipFiles(
|
||||
|
||||
std::vector<nlohmann::json> ParseJsonLines( wxInputStream& aInput, const wxString& aSource );
|
||||
|
||||
/**
|
||||
* Multiple document types (e.g. footprint and PCB) can be put into a single file, separated by empty line.
|
||||
*/
|
||||
std::vector<std::vector<nlohmann::json>> ParseJsonLinesWithSeparation( wxInputStream& aInput,
|
||||
const wxString& aSource );
|
||||
|
||||
std::map<wxString, wxString> AnyMapToStringMap( const std::map<wxString, nlohmann::json>& aInput );
|
||||
|
||||
} // namespace EASYEDAPRO
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <core/json_serializers.h>
|
||||
#include <string_utils.h>
|
||||
#include <io/easyedapro/easyedapro_import_utils.h>
|
||||
|
||||
|
||||
void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::SCH_ATTR& d )
|
||||
@@ -36,7 +37,9 @@ void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::SCH_ATTR& d )
|
||||
d.id = j.at( 1 ).get<wxString>();
|
||||
d.parentId = j.at( 2 ).get<wxString>();
|
||||
d.key = j.at( 3 ).get<wxString>();
|
||||
d.value = j.at( 4 ).get<wxString>();
|
||||
|
||||
if( j.at( 4 ).is_string() )
|
||||
d.value = j.at( 4 ).get<wxString>();
|
||||
|
||||
if( j.at( 5 ).is_number() )
|
||||
d.keyVisible = j.at( 5 ).get<int>();
|
||||
@@ -271,7 +274,7 @@ void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_DEVICE& d )
|
||||
d.custom_tags = j.at( "custom_tags" );
|
||||
|
||||
if( j.at( "attributes" ).is_object() )
|
||||
d.attributes = j.at( "attributes" );
|
||||
d.attributes = AnyMapToStringMap( j.at( "attributes" ) );
|
||||
}
|
||||
|
||||
void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::BLOB& d )
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
namespace EASYEDAPRO
|
||||
{
|
||||
|
||||
static const bool IMPORT_POURED = false;
|
||||
static const bool IMPORT_POURED = true;
|
||||
static const bool IMPORT_POURED_ECOP = false;
|
||||
|
||||
enum class SYMBOL_TYPE
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
|
||||
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015-2024 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
|
||||
@@ -27,11 +27,18 @@
|
||||
// conflicts for some defines, at least on Windows
|
||||
#include <kicad_curl/kicad_curl.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <ki_exception.h> // THROW_IO_ERROR
|
||||
|
||||
|
||||
static std::shared_mutex s_curlMutex;
|
||||
static bool s_curlShuttingDown = false;
|
||||
|
||||
|
||||
void KICAD_CURL::Init()
|
||||
{
|
||||
s_curlShuttingDown = false;
|
||||
|
||||
if( curl_global_init( CURL_GLOBAL_ALL ) != CURLE_OK )
|
||||
{
|
||||
THROW_IO_ERROR( "curl_global_init() failed." );
|
||||
@@ -41,10 +48,26 @@ void KICAD_CURL::Init()
|
||||
|
||||
void KICAD_CURL::Cleanup()
|
||||
{
|
||||
s_curlShuttingDown = true;
|
||||
|
||||
std::unique_lock lock( s_curlMutex );
|
||||
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
|
||||
std::shared_mutex& KICAD_CURL::Mutex()
|
||||
{
|
||||
return s_curlMutex;
|
||||
}
|
||||
|
||||
|
||||
bool KICAD_CURL::IsShuttingDown()
|
||||
{
|
||||
return s_curlShuttingDown;
|
||||
}
|
||||
|
||||
|
||||
std::string GetKicadCurlVersion()
|
||||
{
|
||||
return KICAD_CURL::GetVersion();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
|
||||
* Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015-2024 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
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <shared_mutex>
|
||||
#include <wx/app.h>
|
||||
|
||||
#include <build_version.h>
|
||||
@@ -88,6 +89,9 @@ static size_t stream_write_callback( void* aContents, size_t aSize, size_t aNmem
|
||||
static int xferinfo( void* aProgress, curl_off_t aDLtotal, curl_off_t aDLnow, curl_off_t aULtotal,
|
||||
curl_off_t aULnow )
|
||||
{
|
||||
if( KICAD_CURL::IsShuttingDown() )
|
||||
return 1; // Should abort the operation
|
||||
|
||||
CURL_PROGRESS* progress = static_cast<CURL_PROGRESS*>( aProgress );
|
||||
curl_off_t curtime = 0;
|
||||
|
||||
@@ -190,6 +194,12 @@ KICAD_CURL_EASY::~KICAD_CURL_EASY()
|
||||
|
||||
int KICAD_CURL_EASY::Perform()
|
||||
{
|
||||
std::shared_lock lock( KICAD_CURL::Mutex(), std::try_to_lock );
|
||||
|
||||
// If can't lock, we should be in the process of tearing down.
|
||||
if( !lock )
|
||||
return CURLE_ABORTED_BY_CALLBACK;
|
||||
|
||||
if( m_headers )
|
||||
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
|
||||
|
||||
|
||||
+2
-10
@@ -25,9 +25,9 @@
|
||||
|
||||
#include <kiid.h>
|
||||
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/uuid/uuid_generators.hpp>
|
||||
#include <boost/uuid/uuid_io.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
#if BOOST_VERSION >= 106700
|
||||
#include <boost/uuid/entropy_error.hpp>
|
||||
@@ -235,15 +235,7 @@ timestamp_t KIID::AsLegacyTimestamp() const
|
||||
|
||||
size_t KIID::Hash() const
|
||||
{
|
||||
size_t hash = 0;
|
||||
|
||||
// Note: this is NOT little-endian/big-endian safe, but as long as it's just used
|
||||
// at runtime it won't matter.
|
||||
|
||||
for( int i = 0; i < 4; ++i )
|
||||
boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
|
||||
|
||||
return hash;
|
||||
return boost::uuids::hash_value( m_uuid );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -199,16 +199,7 @@ LIB_TABLE_ROW* LIB_TABLE::findRow( const wxString& aNickName, bool aCheckIfEnabl
|
||||
|
||||
do
|
||||
{
|
||||
try
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
|
||||
}
|
||||
catch( std::system_error& e )
|
||||
{
|
||||
wxASSERT_MSG( false, wxString::Format( wxS( "Failed to lock lib table mutex: %s" ),
|
||||
e.what() ) );
|
||||
continue;
|
||||
}
|
||||
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
|
||||
|
||||
if( cur->m_rowsMap.count( aNickName ) )
|
||||
row = &*cur->m_rowsMap.at( aNickName );
|
||||
|
||||
@@ -273,7 +273,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
|
||||
}
|
||||
|
||||
ch = m_token.input[ ++m_token.pos ];
|
||||
} while( isdigit( ch ) || isDecimalSeparator( ch ) );
|
||||
} while( isdigit( (unsigned char) ch ) || isDecimalSeparator( ch ) );
|
||||
|
||||
m_token.token[ idx ] = 0;
|
||||
};
|
||||
@@ -373,7 +373,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
|
||||
{
|
||||
/* End of input */
|
||||
}
|
||||
else if( isdigit( ch ) || isDecimalSeparator( ch ) )
|
||||
else if( isdigit( (unsigned char) ch ) || isDecimalSeparator( ch ) )
|
||||
{
|
||||
// VALUE
|
||||
extractNumber( &siScaler );
|
||||
|
||||
@@ -178,6 +178,7 @@ public:
|
||||
m_contentSizer->Add( m_noNotificationsText, 1, wxALL | wxEXPAND, 5 );
|
||||
|
||||
Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
|
||||
m_scrolledWindow->Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
|
||||
|
||||
SetSizer( bSizer1 );
|
||||
Layout();
|
||||
|
||||
@@ -491,8 +491,15 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
|
||||
}
|
||||
#endif
|
||||
|
||||
// Ensure the instance checker directory exists
|
||||
// It should be globally writable because it is shared between all users on Linux, and so on a
|
||||
// multi-user machine, other need to be able to access it to check for the lock files or make
|
||||
// their own lock files.
|
||||
wxString instanceCheckerDir = PATHS::GetInstanceCheckerPath();
|
||||
PATHS::EnsurePathExists( instanceCheckerDir );
|
||||
wxChmod( instanceCheckerDir, wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | wxPOSIX_USER_EXECUTE |
|
||||
wxPOSIX_GROUP_READ | wxPOSIX_GROUP_WRITE | wxPOSIX_GROUP_EXECUTE |
|
||||
wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_WRITE | wxPOSIX_OTHERS_EXECUTE );
|
||||
|
||||
wxString instanceCheckerName = wxString::Format( wxS( "%s-%s" ), pgm_name,
|
||||
GetMajorMinorVersion() );
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2012 Lorenzo Marcantonio, l.marcantonio@logossrl.com
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023, 2024 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,8 @@
|
||||
#include <wx/datstrm.h>
|
||||
|
||||
#include <advanced_config.h>
|
||||
#include <eda_text.h> // for IsGotoPageHref
|
||||
#include <common.h> // ResolveUriByEnvVars
|
||||
#include <eda_text.h> // for IsGotoPageHref
|
||||
#include <font/font.h>
|
||||
#include <core/ignore.h>
|
||||
#include <macros.h>
|
||||
@@ -400,12 +401,12 @@ void PDF_PLOTTER::PlotPoly( const std::vector<VECTOR2I>& aCornerList, FILL_T aFi
|
||||
SetCurrentLineWidth( aWidth );
|
||||
|
||||
VECTOR2D pos = userToDeviceCoordinates( aCornerList[0] );
|
||||
fprintf( m_workFile, "%g %g m\n", pos.x, pos.y );
|
||||
fprintf( m_workFile, "%f %f m\n", pos.x, pos.y );
|
||||
|
||||
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||
{
|
||||
pos = userToDeviceCoordinates( aCornerList[ii] );
|
||||
fprintf( m_workFile, "%g %g l\n", pos.x, pos.y );
|
||||
fprintf( m_workFile, "%f %f l\n", pos.x, pos.y );
|
||||
}
|
||||
|
||||
// Close path and stroke and/or fill
|
||||
@@ -438,7 +439,7 @@ void PDF_PLOTTER::PenTo( const VECTOR2I& pos, char plume )
|
||||
if( m_penState != plume || pos != m_penLastpos )
|
||||
{
|
||||
VECTOR2D pos_dev = userToDeviceCoordinates( pos );
|
||||
fprintf( m_workFile, "%g %g %c\n",
|
||||
fprintf( m_workFile, "%f %f %c\n",
|
||||
pos_dev.x, pos_dev.y,
|
||||
( plume=='D' ) ? 'l' : 'm' );
|
||||
}
|
||||
@@ -1332,16 +1333,35 @@ bool PDF_PLOTTER::EndPlot()
|
||||
{
|
||||
wxString href = property.substr( property.Find( "http:" ) );
|
||||
|
||||
if( m_project )
|
||||
href = ResolveUriByEnvVars( href, m_project );
|
||||
|
||||
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
|
||||
EscapeString( property, CTX_JS_STR ),
|
||||
EscapeString( href, CTX_JS_STR ),
|
||||
EscapeString( href, CTX_JS_STR ) );
|
||||
}
|
||||
else if( property.Find( "https:" ) >= 0 )
|
||||
{
|
||||
wxString href = property.substr( property.Find( "https:" ) );
|
||||
|
||||
if( m_project )
|
||||
href = ResolveUriByEnvVars( href, m_project );
|
||||
|
||||
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
|
||||
EscapeString( property, CTX_JS_STR ),
|
||||
EscapeString( href, CTX_JS_STR ),
|
||||
EscapeString( href, CTX_JS_STR ) );
|
||||
}
|
||||
else if( property.Find( "file:" ) >= 0 )
|
||||
{
|
||||
wxString href = property.substr( property.Find( "file:" ) );
|
||||
|
||||
if( m_project )
|
||||
href = ResolveUriByEnvVars( href, m_project );
|
||||
|
||||
href = NormalizeFileUri( href );
|
||||
|
||||
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
|
||||
EscapeString( href, CTX_JS_STR ),
|
||||
EscapeString( href, CTX_JS_STR ) );
|
||||
}
|
||||
else
|
||||
@@ -1367,13 +1387,22 @@ bool PDF_PLOTTER::EndPlot()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( url.StartsWith( "http:" ) || url.StartsWith( "https:" ) )
|
||||
else if( url.StartsWith( "http:" ) || url.StartsWith( "https:" )
|
||||
|| url.StartsWith( "file:" ) )
|
||||
{
|
||||
wxString menuText = wxString::Format( _( "Open %s" ), url );
|
||||
wxString href = url;
|
||||
|
||||
if( m_project )
|
||||
href = ResolveUriByEnvVars( url, m_project );
|
||||
|
||||
if( url.StartsWith( "file:" ) )
|
||||
href = NormalizeFileUri( href );
|
||||
|
||||
wxString menuText = wxString::Format( _( "Open %s" ), href );
|
||||
|
||||
js += wxString::Format( wxT( "[\"%s\", \"%s\"],\n" ),
|
||||
EscapeString( menuText, CTX_JS_STR ),
|
||||
EscapeString( url, CTX_JS_STR ) );
|
||||
EscapeString( href, CTX_JS_STR ),
|
||||
EscapeString( href, CTX_JS_STR ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1413,6 +1442,7 @@ function ShM(aEntries) {
|
||||
var cChoice = app.popUpMenuEx.apply(app, aParams);
|
||||
if (cChoice != null && cChoice.substring(0, 1) == '#') this.pageNum = parseInt(cChoice.slice(1));
|
||||
else if (cChoice != null && cChoice.substring(0, 4) == 'http') app.launchURL(cChoice);
|
||||
else if (cChoice != null && cChoice.substring(0, 4) == 'file') app.openDoc(cChoice.substring(7));
|
||||
}
|
||||
)JS";
|
||||
|
||||
@@ -1634,7 +1664,7 @@ void PDF_PLOTTER::Text( const VECTOR2I& aPos,
|
||||
coordinate system will be used for the overlining. Also the %f
|
||||
for the trig part of the matrix to avoid %g going in exponential
|
||||
format (which is not supported) */
|
||||
fprintf( m_workFile, "q %f %f %f %f %g %g cm BT %s %g Tf %d Tr %g Tz ",
|
||||
fprintf( m_workFile, "q %f %f %f %f %f %f cm BT %s %g Tf %d Tr %g Tz ",
|
||||
ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f,
|
||||
fontname, heightFactor, render_mode, wideningFactor * 100 );
|
||||
|
||||
|
||||
@@ -162,7 +162,8 @@ static wxString XmlEsc( const wxString& aStr, bool isAttribute = false )
|
||||
}
|
||||
|
||||
|
||||
SVG_PLOTTER::SVG_PLOTTER()
|
||||
SVG_PLOTTER::SVG_PLOTTER( const PROJECT* aProject ) :
|
||||
PSLIKE_PLOTTER( aProject )
|
||||
{
|
||||
m_graphics_changed = true;
|
||||
SetTextMode( PLOT_TEXT_MODE::STROKE );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2023, 2024 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
|
||||
@@ -44,7 +44,8 @@
|
||||
#include <callback_gal.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
|
||||
PLOTTER::PLOTTER( )
|
||||
PLOTTER::PLOTTER( const PROJECT* aProject ) :
|
||||
m_project( aProject )
|
||||
{
|
||||
m_plotScale = 1;
|
||||
m_currentPenWidth = -1; // To-be-set marker
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||
* Copyright (C) 2024 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
|
||||
@@ -55,9 +55,12 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
|
||||
|
||||
|
||||
#if 0
|
||||
constexpr double correction = 0.8; // Looks best visually
|
||||
constexpr double correction = 0.8; // Looks best visually
|
||||
#else
|
||||
constexpr double correction = 1.0; // Matches ISO 128-2
|
||||
constexpr double correction = 1.0; // Matches ISO 128-2, but can creates issues on GTK and MSW:
|
||||
// "dots" are not always visible depending on the zoom level
|
||||
// because they create 0 lenght lines
|
||||
// So they will drawn as segments, even with correction = 1.0
|
||||
#endif
|
||||
|
||||
|
||||
@@ -69,7 +72,9 @@ double RENDER_SETTINGS::GetDashLength( int aLineWidth ) const
|
||||
|
||||
double RENDER_SETTINGS::GetDotLength( int aLineWidth ) const
|
||||
{
|
||||
return ( 1.0 - correction ) * aLineWidth;
|
||||
// The minimal length scale is arbitrary set to 0.2 after trials
|
||||
// 0 lenght can create drawing issues
|
||||
return std::max( ( 1.0 - correction ), 0.2 ) * aLineWidth;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+37
-6
@@ -42,6 +42,13 @@ REPORTER& REPORTER::Report( const char* aText, SEVERITY aSeverity )
|
||||
}
|
||||
|
||||
|
||||
bool REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
|
||||
{
|
||||
wxFAIL_MSG( "HasMessageOfSeverity is not implemented in this reporter" );
|
||||
return HasMessage();
|
||||
}
|
||||
|
||||
|
||||
REPORTER& WX_TEXT_CTRL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
||||
{
|
||||
wxCHECK_MSG( m_textCtrl != nullptr, *this,
|
||||
@@ -60,17 +67,34 @@ bool WX_TEXT_CTRL_REPORTER::HasMessage() const
|
||||
|
||||
REPORTER& WX_STRING_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
||||
{
|
||||
wxCHECK_MSG( m_string != nullptr, *this,
|
||||
wxT( "No wxString object defined in WX_STRING_REPORTER." ) );
|
||||
|
||||
*m_string << aText << wxS( "\n" );
|
||||
m_severityMask |= aSeverity;
|
||||
m_string << aText << wxS( "\n" );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
const wxString& WX_STRING_REPORTER::GetMessages() const
|
||||
{
|
||||
return m_string;
|
||||
}
|
||||
|
||||
|
||||
void WX_STRING_REPORTER::Clear()
|
||||
{
|
||||
m_severityMask = 0;
|
||||
m_string.clear();
|
||||
}
|
||||
|
||||
|
||||
bool WX_STRING_REPORTER::HasMessage() const
|
||||
{
|
||||
return !m_string->IsEmpty();
|
||||
return !m_string.IsEmpty();
|
||||
}
|
||||
|
||||
|
||||
bool WX_STRING_REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
|
||||
{
|
||||
return ( m_severityMask & aSeverityMask ) != 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +130,14 @@ REPORTER& WX_HTML_PANEL_REPORTER::ReportHead( const wxString& aText, SEVERITY aS
|
||||
|
||||
bool WX_HTML_PANEL_REPORTER::HasMessage() const
|
||||
{
|
||||
return m_panel->Count( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) > 0;
|
||||
// Check just for errors and warnings for compatibility
|
||||
return HasMessageOfSeverity( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING );
|
||||
}
|
||||
|
||||
|
||||
bool WX_HTML_PANEL_REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
|
||||
{
|
||||
return m_panel->Count( aSeverityMask ) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
|
||||
m_params.emplace_back( new PARAM<int>( "auto_backup.min_interval",
|
||||
&m_Backup.min_interval, 300 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "environment.vars",
|
||||
auto envVarsParam = m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "environment.vars",
|
||||
[&]() -> nlohmann::json
|
||||
{
|
||||
nlohmann::json ret = {};
|
||||
@@ -212,6 +212,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
|
||||
}
|
||||
},
|
||||
{} ) );
|
||||
envVarsParam->SetClearUnknownKeys();
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "input.focus_follow_sch_pcb",
|
||||
&m_Input.focus_follow_sch_pcb, false ) );
|
||||
|
||||
@@ -75,6 +75,7 @@ JSON_SETTINGS::JSON_SETTINGS( const wxString& aFilename, SETTINGS_LOC aLocation,
|
||||
m_createIfMissing( aCreateIfMissing ),
|
||||
m_createIfDefault( aCreateIfDefault ),
|
||||
m_writeFile( aWriteFile ),
|
||||
m_modified( false ),
|
||||
m_deleteLegacyAfterMigration( true ),
|
||||
m_resetParamsIfMissing( true ),
|
||||
m_schemaVersion( aSchemaVersion ),
|
||||
@@ -353,6 +354,8 @@ bool JSON_SETTINGS::LoadFromFile( const wxString& aDirectory )
|
||||
wxLogTrace( traceSettings, wxT( "Loaded <%s> with schema %d" ), GetFullFilename(),
|
||||
m_schemaVersion );
|
||||
|
||||
m_modified = false;
|
||||
|
||||
// If we migrated, clean up the legacy file (with no extension)
|
||||
if( m_writeFile && ( legacy_migrated || migrated ) )
|
||||
{
|
||||
@@ -373,15 +376,13 @@ bool JSON_SETTINGS::LoadFromFile( const wxString& aDirectory )
|
||||
|
||||
bool JSON_SETTINGS::Store()
|
||||
{
|
||||
bool modified = false;
|
||||
|
||||
for( PARAM_BASE* param : m_params )
|
||||
{
|
||||
modified |= !param->MatchesFile( this );
|
||||
m_modified |= !param->MatchesFile( this );
|
||||
param->Store( this );
|
||||
}
|
||||
|
||||
return modified;
|
||||
return m_modified;
|
||||
}
|
||||
|
||||
|
||||
@@ -469,10 +470,12 @@ bool JSON_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
|
||||
|
||||
for( PARAM_BASE* param : m_params )
|
||||
{
|
||||
if( PARAM_WXSTRING_MAP* stringMap = dynamic_cast<PARAM_WXSTRING_MAP*>( param ) )
|
||||
if( param->ClearUnknownKeys() )
|
||||
{
|
||||
if( stringMap->ClearUnknownKeys() )
|
||||
toSave[ stringMap->GetJsonPath() ] = nlohmann::json( {} );
|
||||
nlohmann::json_pointer p
|
||||
= JSON_SETTINGS_INTERNALS::PointerFromString( param->GetJsonPath() );
|
||||
|
||||
toSave[p] = nlohmann::json( {} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,6 +507,9 @@ bool JSON_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
|
||||
success = false;
|
||||
}
|
||||
|
||||
if( success )
|
||||
m_modified = false;
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -858,7 +864,7 @@ void JSON_SETTINGS::ReleaseNestedSettings( NESTED_SETTINGS* aSettings )
|
||||
if( it != m_nested_settings.end() )
|
||||
{
|
||||
wxLogTrace( traceSettings, wxT( "Flush and release %s" ), ( *it )->GetFilename() );
|
||||
( *it )->SaveToFile();
|
||||
m_modified |= ( *it )->SaveToFile();
|
||||
m_nested_settings.erase( it );
|
||||
}
|
||||
|
||||
|
||||
+93
-16
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -28,11 +28,15 @@
|
||||
|
||||
#include <clocale>
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include <core/map_helpers.h>
|
||||
#include <fmt/core.h>
|
||||
#include <macros.h>
|
||||
#include <richio.h> // StrPrintf
|
||||
#include <string_utils.h>
|
||||
#include <wx_filename.h>
|
||||
#include <fmt/chrono.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/regex.h>
|
||||
#include "locale_io.h"
|
||||
|
||||
@@ -42,7 +46,35 @@
|
||||
* platforms. This is the list of illegal file name characters for Windows which includes
|
||||
* the illegal file name characters for Linux and OSX.
|
||||
*/
|
||||
static const char illegalFileNameChars[] = "\\/:\"<>|";
|
||||
static const char illegalFileNameChars[] = "\\/:\"<>|*?";
|
||||
|
||||
|
||||
// Checks if a full filename is valid, i.e. does not contains illegal chars
|
||||
bool IsFullFileNameValid( const wxString& aFullFilename )
|
||||
{
|
||||
|
||||
// Test for forbidden chars in aFullFilename.
|
||||
// '\'and '/' are allowed here because aFullFilename can be a full path, and
|
||||
// ':' is allowed on Windows as second char in string.
|
||||
// So remove allowed separators from string to test
|
||||
wxString filtered_fullpath = aFullFilename;
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
// On MSW, the list returned by wxFileName::GetForbiddenChars() contains separators
|
||||
// '\'and '/'
|
||||
filtered_fullpath.Replace( "/", "_" );
|
||||
filtered_fullpath.Replace( "\\", "_" );
|
||||
|
||||
// A disk identifier is allowed, and therefore remove its separator
|
||||
if( filtered_fullpath.Length() > 1 && filtered_fullpath[1] == ':' )
|
||||
filtered_fullpath[1] = ' ';
|
||||
#endif
|
||||
|
||||
if( wxString::npos != filtered_fullpath.find_first_of( wxFileName::GetForbiddenChars() ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
wxString ConvertToNewOverbarNotation( const wxString& aOldStr )
|
||||
@@ -540,22 +572,32 @@ wxString UnescapeHTML( const wxString& aString )
|
||||
{
|
||||
wxString converted = aString;
|
||||
|
||||
converted.Replace( wxS( """ ), wxS( "\"" ) );
|
||||
converted.Replace( wxS( "'" ), wxS( "'" ) );
|
||||
converted.Replace( wxS( "&" ), wxS( "&" ) );
|
||||
converted.Replace( wxS( "<" ), wxS( "<" ) );
|
||||
converted.Replace( wxS( ">" ), wxS( ">" ) );
|
||||
// clang-format off
|
||||
static const std::map<wxString, wxString> c_replacements = {
|
||||
{ wxS( "quot" ), wxS( "\"" ) },
|
||||
{ wxS( "apos" ), wxS( "'" ) },
|
||||
{ wxS( "amp" ), wxS( "&" ) },
|
||||
{ wxS( "lt" ), wxS( "<" ) },
|
||||
{ wxS( "gt" ), wxS( ">" ) }
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
// Yes, &#123; is going to give unexpected results.
|
||||
// Construct regex
|
||||
wxString regexStr = "&(#(\\d*)|#x([a-zA-Z0-9]{4})";
|
||||
|
||||
wxString result;
|
||||
for( auto& [key, value] : c_replacements )
|
||||
regexStr << '|' << key;
|
||||
|
||||
wxRegEx regex( "&#(\\d*);" );
|
||||
regexStr << ");";
|
||||
|
||||
wxRegEx regex( regexStr );
|
||||
|
||||
// Process matches
|
||||
size_t start = 0;
|
||||
size_t len = 0;
|
||||
|
||||
wxString str = aString;
|
||||
wxString result;
|
||||
wxString str = converted;
|
||||
|
||||
while( regex.Matches( str ) )
|
||||
{
|
||||
@@ -564,12 +606,26 @@ wxString UnescapeHTML( const wxString& aString )
|
||||
|
||||
result << str.Left( start );
|
||||
|
||||
unsigned long codeVal = 0;
|
||||
wxString code = regex.GetMatch( str, 1 );
|
||||
code.ToCULong( &codeVal );
|
||||
wxString code = regex.GetMatch( str, 1 );
|
||||
wxString codeDec = regex.GetMatch( str, 2 );
|
||||
wxString codeHex = regex.GetMatch( str, 3 );
|
||||
|
||||
if( codeVal != 0 )
|
||||
result << wxUniChar( codeVal );
|
||||
if( !codeDec.IsEmpty() || !codeHex.IsEmpty() )
|
||||
{
|
||||
unsigned long codeVal = 0;
|
||||
|
||||
if( !codeDec.IsEmpty() )
|
||||
codeDec.ToCULong( &codeVal );
|
||||
else if( !codeHex.IsEmpty() )
|
||||
codeHex.ToCULong( &codeVal, 16 );
|
||||
|
||||
if( codeVal != 0 )
|
||||
result << wxUniChar( codeVal );
|
||||
}
|
||||
else if( auto val = get_opt( c_replacements, code ) )
|
||||
{
|
||||
result << *val;
|
||||
}
|
||||
|
||||
str = str.Mid( start + len );
|
||||
}
|
||||
@@ -1400,3 +1456,24 @@ wxString From_UTF8( const std::string& aString )
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
|
||||
wxString NormalizeFileUri( const wxString& aFileUri )
|
||||
{
|
||||
wxString uriPathAndFileName;
|
||||
|
||||
wxCHECK( aFileUri.StartsWith( wxS( "file://" ), &uriPathAndFileName ), aFileUri );
|
||||
|
||||
wxString tmp = uriPathAndFileName;
|
||||
wxString retv = wxS( "file://" );
|
||||
|
||||
tmp.Replace( wxS( "\\" ), wxS( "/" ) );
|
||||
tmp.Replace( wxS( ":" ), wxS( "" ) );
|
||||
|
||||
if( !tmp.IsEmpty() && tmp[0] != '/' )
|
||||
tmp = wxS( "/" ) + tmp;
|
||||
|
||||
retv += tmp;
|
||||
|
||||
return retv;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ ACTION_MANAGER::ACTION_MANAGER( TOOL_MANAGER* aToolManager ) :
|
||||
std::string groupName = "none";
|
||||
|
||||
std::optional<TOOL_ACTION_GROUP> group = action->GetActionGroup();
|
||||
|
||||
|
||||
if( group.has_value() )
|
||||
{
|
||||
groupID = group.value().GetGroupID();
|
||||
@@ -152,19 +152,21 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const
|
||||
// If no luck, try without Shift, to handle keys that require it
|
||||
// e.g. to get ? you need to press Shift+/ without US keyboard layout
|
||||
// Hardcoding ? as Shift+/ is a bad idea, as on another layout you may need to press a
|
||||
// different combination
|
||||
if( it == m_actionHotKeys.end() )
|
||||
// different combination.
|
||||
// This doesn't apply for letters, as we already handled case normalisation.
|
||||
if( it == m_actionHotKeys.end() && !std::isalpha( key ) )
|
||||
{
|
||||
wxLogTrace( kicadTraceToolStack,
|
||||
wxS( "ACTION_MANAGER::RunHotKey No actions found, searching with key: %s" ),
|
||||
KeyNameFromKeyCode( key | ( mod & ~MD_SHIFT ) ) );
|
||||
|
||||
it = m_actionHotKeys.find( key | ( mod & ~MD_SHIFT ) );
|
||||
|
||||
if( it == m_actionHotKeys.end() )
|
||||
return false; // no appropriate action found for the hotkey
|
||||
}
|
||||
|
||||
// Still no luck, we're done without a match
|
||||
if( it == m_actionHotKeys.end() )
|
||||
return false; // no appropriate action found for the hotkey
|
||||
|
||||
const std::list<TOOL_ACTION*>& actions = it->second;
|
||||
|
||||
// Choose the action that has the highest priority on the active tools stack
|
||||
|
||||
@@ -212,6 +212,21 @@ ACTION_TOOLBAR::ACTION_TOOLBAR( EDA_BASE_FRAME* parent, wxWindowID id, const wxP
|
||||
|
||||
ACTION_TOOLBAR::~ACTION_TOOLBAR()
|
||||
{
|
||||
Disconnect( wxEVT_COMMAND_TOOL_CLICKED, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolEvent ),
|
||||
nullptr, this );
|
||||
Disconnect( wxEVT_AUITOOLBAR_RIGHT_CLICK,
|
||||
wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolRightClick ), nullptr, this );
|
||||
Disconnect( wxEVT_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onItemDrag ),
|
||||
nullptr, this );
|
||||
Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr,
|
||||
this );
|
||||
Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr, this );
|
||||
Disconnect( m_paletteTimer->GetId(), wxEVT_TIMER,
|
||||
wxTimerEventHandler( ACTION_TOOLBAR::onTimerDone ), nullptr, this );
|
||||
|
||||
Unbind( wxEVT_SYS_COLOUR_CHANGED,
|
||||
wxSysColourChangedEventHandler( ACTION_TOOLBAR::onThemeChanged ), this );
|
||||
|
||||
delete m_paletteTimer;
|
||||
|
||||
// Clear all the maps keeping track of our items on the toolbar
|
||||
|
||||
+18
-34
@@ -38,35 +38,8 @@
|
||||
#include <wx/textentry.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/combo.h>
|
||||
|
||||
GRID_CELL_TEXT_EDITOR::GRID_CELL_TEXT_EDITOR() : wxGridCellTextEditor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::SetValidator( const wxValidator& validator )
|
||||
{
|
||||
// keep our own copy because wxGridCellTextEditor's is annoyingly private
|
||||
m_validator.reset( static_cast<wxValidator*>( validator.Clone() ) );
|
||||
|
||||
wxGridCellTextEditor::SetValidator( *m_validator );
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::StartingKey( wxKeyEvent& event )
|
||||
{
|
||||
if( m_validator )
|
||||
{
|
||||
m_validator.get()->SetWindow( Text() );
|
||||
m_validator.get()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
if( event.GetSkipped() )
|
||||
{
|
||||
wxGridCellTextEditor::StartingKey( event );
|
||||
event.Skip( false );
|
||||
}
|
||||
}
|
||||
#include <wx/msgdlg.h>
|
||||
#include <refdes_utils.h>
|
||||
|
||||
|
||||
FOOTPRINT_NAME_VALIDATOR::FOOTPRINT_NAME_VALIDATOR( wxString* aValue ) :
|
||||
@@ -384,18 +357,24 @@ bool FIELD_VALIDATOR::Validate( wxWindow* aParent )
|
||||
return false;
|
||||
|
||||
wxString val( text->GetValue() );
|
||||
|
||||
return DoValidate( val, aParent );
|
||||
}
|
||||
|
||||
bool FIELD_VALIDATOR::DoValidate( const wxString& aValue, wxWindow* aParent )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
if( HasFlag( wxFILTER_EMPTY ) && val.empty() )
|
||||
if( HasFlag( wxFILTER_EMPTY ) && aValue.empty() )
|
||||
msg.Printf( _( "The value of the field cannot be empty." ) );
|
||||
|
||||
if( HasFlag( wxFILTER_EXCLUDE_CHAR_LIST ) && ContainsExcludedCharacters( val ) )
|
||||
if( HasFlag( wxFILTER_EXCLUDE_CHAR_LIST ) && ContainsExcludedCharacters( aValue ) )
|
||||
{
|
||||
wxArrayString badCharsFound;
|
||||
|
||||
for( const wxUniCharRef& excludeChar : GetCharExcludes() )
|
||||
{
|
||||
if( val.Find( excludeChar ) != wxNOT_FOUND )
|
||||
if( aValue.Find( excludeChar ) != wxNOT_FOUND )
|
||||
{
|
||||
if( excludeChar == '\r' )
|
||||
badCharsFound.Add( _( "carriage return" ) );
|
||||
@@ -463,14 +442,19 @@ bool FIELD_VALIDATOR::Validate( wxWindow* aParent )
|
||||
break;
|
||||
};
|
||||
}
|
||||
else if( m_fieldId == REFERENCE_FIELD && val.Contains( wxT( "${" ) ) )
|
||||
else if( m_fieldId == REFERENCE_FIELD && aValue.Contains( wxT( "${" ) ) )
|
||||
{
|
||||
msg.Printf( _( "The reference designator cannot contain text variable references" ) );
|
||||
}
|
||||
else if( m_fieldId == REFERENCE_FIELD && UTIL::GetRefDesPrefix( aValue ).IsEmpty() )
|
||||
{
|
||||
msg.Printf( _( "References must start with a letter." ) );
|
||||
}
|
||||
|
||||
if( !msg.empty() )
|
||||
{
|
||||
m_validatorWindow->SetFocus();
|
||||
if( m_validatorWindow )
|
||||
m_validatorWindow->SetFocus();
|
||||
|
||||
wxMessageBox( msg, _( "Field Validation Error" ), wxOK | wxICON_EXCLAMATION, aParent );
|
||||
|
||||
|
||||
@@ -92,6 +92,13 @@ void BITMAP_BUTTON::setupEvents()
|
||||
|
||||
BITMAP_BUTTON::~BITMAP_BUTTON()
|
||||
{
|
||||
Unbind( wxEVT_PAINT, &BITMAP_BUTTON::OnPaint, this );
|
||||
Unbind( wxEVT_LEFT_UP, &BITMAP_BUTTON::OnLeftButtonUp, this );
|
||||
Unbind( wxEVT_LEFT_DOWN, &BITMAP_BUTTON::OnLeftButtonDown, this );
|
||||
Unbind( wxEVT_LEAVE_WINDOW, &BITMAP_BUTTON::OnMouseLeave, this );
|
||||
Unbind( wxEVT_ENTER_WINDOW, &BITMAP_BUTTON::OnMouseEnter, this );
|
||||
Unbind( wxEVT_KILL_FOCUS, &BITMAP_BUTTON::OnKillFocus, this );
|
||||
Unbind( wxEVT_SET_FOCUS, &BITMAP_BUTTON::OnSetFocus, this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -105,13 +105,19 @@ bool FONT_CHOICE::HaveFontSelection() const
|
||||
}
|
||||
|
||||
|
||||
KIFONT::FONT* FONT_CHOICE::GetFontSelection( bool aBold, bool aItalic ) const
|
||||
KIFONT::FONT* FONT_CHOICE::GetFontSelection( bool aBold, bool aItalic, bool aForDrawingSheet ) const
|
||||
{
|
||||
if( GetSelection() <= 0 )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
else if( GetSelection() == 1 && m_systemFontCount == 2 )
|
||||
{
|
||||
return KIFONT::FONT::GetFont( KICAD_FONT_NAME, aBold, aItalic );
|
||||
}
|
||||
else
|
||||
return KIFONT::FONT::GetFont( GetStringSelection(), aBold, aItalic );
|
||||
{
|
||||
return KIFONT::FONT::GetFont( GetStringSelection(), aBold, aItalic, aForDrawingSheet );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,20 +60,9 @@ wxString GRID_CELL_TEXT_BUTTON::GetValue() const
|
||||
void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect )
|
||||
{
|
||||
wxRect rect( aRect );
|
||||
WX_GRID::CellEditorTransformSizeRect( rect );
|
||||
|
||||
#if defined( __WXMAC__ )
|
||||
rect.Inflate( 2 ); // ignore FOCUS_RING
|
||||
#elif defined( __WXGTK__ )
|
||||
rect.Inflate( -3 ); // The -3 is a very sad hack here. Some GTK themes overrun the
|
||||
// default -1, preventing display. Unfortunately, we don't appear to
|
||||
// have a good method of finding the current margin needed.
|
||||
// Some GTK resize events seem to update the cell size but not all and
|
||||
// not consistently.
|
||||
#else
|
||||
rect.Inflate( -1 );
|
||||
#endif
|
||||
|
||||
Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE );
|
||||
wxGridCellEditor::SetSize( rect );
|
||||
}
|
||||
|
||||
|
||||
@@ -233,6 +222,7 @@ void GRID_CELL_SYMBOL_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_SYMBOL_CHOOSER( aParent, m_dlg, m_preselect );
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
wxGridCellEditor::Create( aParent, aId, aEventHandler );
|
||||
}
|
||||
@@ -244,7 +234,7 @@ public:
|
||||
TEXT_BUTTON_FP_CHOOSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg,
|
||||
const wxString& aSymbolNetlist, const wxString& aPreselect ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_preselect( aPreselect ),
|
||||
m_symbolNetlist( aSymbolNetlist.ToStdString() )
|
||||
@@ -316,6 +306,7 @@ void GRID_CELL_FPID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_FP_CHOOSER( aParent, m_dlg, m_symbolNetlist, m_preselect );
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
@@ -334,7 +325,7 @@ class TEXT_BUTTON_URL : public wxComboCtrl
|
||||
public:
|
||||
TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg, SEARCH_STACK* aSearchStack ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_searchStack( aSearchStack )
|
||||
{
|
||||
@@ -367,6 +358,7 @@ void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack );
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
@@ -388,7 +380,7 @@ public:
|
||||
bool aNormalize = false,
|
||||
const wxString& aNormalizeBasePath = wxEmptyString ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_grid( aGrid ),
|
||||
m_currentDir( aCurrentDir ),
|
||||
@@ -408,7 +400,7 @@ public:
|
||||
bool aNormalize = false,
|
||||
const wxString& aNormalizeBasePath = wxEmptyString ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_grid( aGrid ),
|
||||
m_currentDir( aCurrentDir ),
|
||||
@@ -524,6 +516,8 @@ void GRID_CELL_PATH_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_grid, m_currentDir, m_fileFilter,
|
||||
m_normalize, m_normalizeBasePath );
|
||||
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
if ( m_validator )
|
||||
|
||||
@@ -21,9 +21,56 @@
|
||||
#include <string_utils.h>
|
||||
#include <wx/stc/stc.h>
|
||||
#include <widgets/grid_text_helpers.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <scintilla_tricks.h>
|
||||
|
||||
|
||||
//-------- GRID_CELL_TEXT_EDITOR ------------------------------------------------------
|
||||
//
|
||||
|
||||
GRID_CELL_TEXT_EDITOR::GRID_CELL_TEXT_EDITOR() : wxGridCellTextEditor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::SetValidator( const wxValidator& validator )
|
||||
{
|
||||
// keep our own copy because wxGridCellTextEditor's is annoyingly private
|
||||
m_validator.reset( static_cast<wxValidator*>( validator.Clone() ) );
|
||||
|
||||
wxGridCellTextEditor::SetValidator( *m_validator );
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::StartingKey( wxKeyEvent& event )
|
||||
{
|
||||
if( m_validator )
|
||||
{
|
||||
m_validator.get()->SetWindow( Text() );
|
||||
m_validator.get()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
if( event.GetSkipped() )
|
||||
{
|
||||
wxGridCellTextEditor::StartingKey( event );
|
||||
event.Skip( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::SetSize( const wxRect& aRect )
|
||||
{
|
||||
wxRect rect( aRect );
|
||||
WX_GRID::CellEditorTransformSizeRect( rect );
|
||||
|
||||
#if defined( __WXMSW__ )
|
||||
rect.Offset( 0, 1 );
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::SetSize( rect );
|
||||
}
|
||||
|
||||
|
||||
//-------- GRID_CELL_ESCAPED_TEXT_RENDERER ------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -69,9 +116,25 @@ GRID_CELL_STC_EDITOR::GRID_CELL_STC_EDITOR( bool aIgnoreCase,
|
||||
{ }
|
||||
|
||||
|
||||
void GRID_CELL_STC_EDITOR::SetSize( const wxRect& aRect )
|
||||
{
|
||||
wxRect rect( aRect );
|
||||
WX_GRID::CellEditorTransformSizeRect( rect );
|
||||
|
||||
#if defined( __WXMSW__ )
|
||||
rect.Offset( -1, 1 );
|
||||
#elif defined( __WXGTK__ )
|
||||
rect.Offset( -1, 3 );
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::SetSize( rect );
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_STC_EDITOR::Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new wxStyledTextCtrl( aParent );
|
||||
m_control = new wxStyledTextCtrl( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||
wxBORDER_NONE );
|
||||
|
||||
stc_ctrl()->SetTabIndents( false );
|
||||
stc_ctrl()->SetBackSpaceUnIndents( false );
|
||||
|
||||
@@ -107,6 +107,15 @@ KISTATUSBAR::KISTATUSBAR( int aNumberFields, wxWindow* parent, wxWindowID id ) :
|
||||
}
|
||||
|
||||
|
||||
KISTATUSBAR::~KISTATUSBAR()
|
||||
{
|
||||
m_notificationsButton->Unbind( wxEVT_BUTTON, &KISTATUSBAR::onNotificationsIconClick, this );
|
||||
Unbind( wxEVT_SIZE, &KISTATUSBAR::onSize, this );
|
||||
m_backgroundProgressBar->Unbind( wxEVT_LEFT_DOWN, &KISTATUSBAR::onBackgroundProgressClick,
|
||||
this );
|
||||
}
|
||||
|
||||
|
||||
void KISTATUSBAR::onNotificationsIconClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
wxPoint pos = m_notificationsButton->GetScreenPosition();
|
||||
|
||||
@@ -73,6 +73,15 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId,
|
||||
|
||||
STD_BITMAP_BUTTON::~STD_BITMAP_BUTTON()
|
||||
{
|
||||
Unbind( wxEVT_PAINT, &STD_BITMAP_BUTTON::OnPaint, this );
|
||||
Unbind( wxEVT_LEFT_UP, &STD_BITMAP_BUTTON::OnLeftButtonUp, this );
|
||||
Unbind( wxEVT_LEFT_DOWN, &STD_BITMAP_BUTTON::OnLeftButtonDown, this );
|
||||
Unbind( wxEVT_KILL_FOCUS, &STD_BITMAP_BUTTON::OnKillFocus, this );
|
||||
Unbind( wxEVT_LEAVE_WINDOW, &STD_BITMAP_BUTTON::OnMouseLeave, this );
|
||||
Unbind( wxEVT_ENTER_WINDOW, &STD_BITMAP_BUTTON::OnMouseEnter, this );
|
||||
|
||||
Unbind( wxEVT_SYS_COLOUR_CHANGED,
|
||||
wxSysColourChangedEventHandler( STD_BITMAP_BUTTON::onThemeChanged ), this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/dc.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/event.h> // Needed for textentry.h on MSW
|
||||
#include <wx/textentry.h>
|
||||
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <widgets/ui_common.h>
|
||||
@@ -34,6 +36,21 @@
|
||||
#define MIN_GRIDCELL_MARGIN FromDIP( 3 )
|
||||
|
||||
|
||||
void WX_GRID::CellEditorSetMargins( wxTextEntryBase* aEntry )
|
||||
{
|
||||
// This is consistent with wxGridCellTextEditor. But works differently across platforms or course.
|
||||
aEntry->SetMargins( 0, 0 );
|
||||
}
|
||||
|
||||
|
||||
void WX_GRID::CellEditorTransformSizeRect( wxRect& aRect )
|
||||
{
|
||||
#if defined( __WXMSW__ ) || defined( __WXGTK__ )
|
||||
aRect.Deflate( 2 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
wxColour getBorderColour()
|
||||
{
|
||||
KIGFX::COLOR4D bg = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
|
||||
|
||||
@@ -159,7 +159,10 @@ void WX_INFOBAR::ShowMessage( const wxString& aMessage, int aFlags )
|
||||
|
||||
m_updateLock = true;
|
||||
|
||||
wxInfoBarGeneric::ShowMessage( aMessage, aFlags );
|
||||
wxString msg = aMessage;
|
||||
msg.Trim();
|
||||
|
||||
wxInfoBarGeneric::ShowMessage( msg, aFlags );
|
||||
|
||||
if( m_auiManager )
|
||||
updateAuiLayout( true );
|
||||
|
||||
@@ -154,15 +154,15 @@ wxString BOM_GENERATOR_HANDLER::readHeader( const wxString& aEndSection )
|
||||
const wxString header( wxS( "@package" ) );
|
||||
|
||||
// Extract substring between @package and endsection
|
||||
int strstart = data.Find( header );
|
||||
size_t strstart = data.find( header );
|
||||
|
||||
if( strstart == wxNOT_FOUND )
|
||||
if( strstart == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
strstart += header.Length();
|
||||
int strend = data.find( aEndSection, strstart );
|
||||
size_t strend = data.find( aEndSection, strstart );
|
||||
|
||||
if( strend == wxNOT_FOUND )
|
||||
if( strend == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
// Remove empty line if any
|
||||
@@ -179,15 +179,15 @@ wxString BOM_GENERATOR_HANDLER::getOutputExtension( const wxString& aHeader )
|
||||
// looks for output argument of the form `"%O.extension"`
|
||||
const wxString outputarg( wxS( "\"%O" ) );
|
||||
|
||||
int strstart = aHeader.Find( outputarg );
|
||||
size_t strstart = aHeader.find( outputarg );
|
||||
|
||||
if( strstart == wxNOT_FOUND )
|
||||
if( strstart == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
strstart += outputarg.Length();
|
||||
int strend = aHeader.find( wxS( "\"" ), strstart );
|
||||
size_t strend = aHeader.find( wxS( "\"" ), strstart );
|
||||
|
||||
if( strend == wxNOT_FOUND )
|
||||
if( strend == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
return aHeader.SubString( strstart, strend - 1 );
|
||||
|
||||
@@ -2338,6 +2338,12 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
|
||||
netSettings->m_NetClassLabelAssignments.clear();
|
||||
|
||||
// Used to track where netclasses are assigned to a net from a bus netclass
|
||||
// definition. Without this tracking, depending on the order of testing for
|
||||
// netclasses, an already-assigned netclass on a bus member can be deleted
|
||||
// if an explicitly labelled member net does not have a netclass assigned.
|
||||
std::unordered_set<wxString> netclassAssignedFromBus;
|
||||
|
||||
auto dirtySubgraphs =
|
||||
[&]( const std::vector<CONNECTION_SUBGRAPH*>& subgraphs )
|
||||
{
|
||||
@@ -2381,40 +2387,83 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
|
||||
const wxString netname = driverSubgraph->GetNetName();
|
||||
|
||||
// Handle netclass assignments on buses
|
||||
if( driverSubgraph->m_driver_connection->IsBus() )
|
||||
{
|
||||
for( const auto& member : driverSubgraph->m_driver_connection->Members() )
|
||||
auto processBusMember = [&, this]( const SCH_CONNECTION* member )
|
||||
{
|
||||
if( netclass.IsEmpty() )
|
||||
netSettings->m_NetClassLabelAssignments.erase( member->Name() );
|
||||
else
|
||||
if( !netclass.IsEmpty() )
|
||||
{
|
||||
netSettings->m_NetClassLabelAssignments[member->Name()] = netclass;
|
||||
netclassAssignedFromBus.insert( member->Name() );
|
||||
}
|
||||
|
||||
auto ii = m_net_name_to_subgraphs_map.find( member->Name() );
|
||||
|
||||
if( ii != m_net_name_to_subgraphs_map.end() )
|
||||
dirtySubgraphs( ii->second );
|
||||
if( oldAssignments.count( member->Name() ) )
|
||||
{
|
||||
if( oldAssignments[member->Name()] != netclass )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( member->Name() );
|
||||
|
||||
if( ii != m_net_name_to_subgraphs_map.end() )
|
||||
dirtySubgraphs( ii->second );
|
||||
}
|
||||
}
|
||||
else if( !netclass.IsEmpty() )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( member->Name() );
|
||||
|
||||
if( ii != m_net_name_to_subgraphs_map.end() )
|
||||
dirtySubgraphs( ii->second );
|
||||
}
|
||||
};
|
||||
|
||||
for( const std::shared_ptr<SCH_CONNECTION>& member :
|
||||
driverSubgraph->m_driver_connection->Members() )
|
||||
{
|
||||
// Check if this member itself is a bus (which can be the case
|
||||
// for vector buses as members of a bus, see
|
||||
// https://gitlab.com/kicad/code/kicad/-/issues/16545
|
||||
if( member->IsBus() )
|
||||
{
|
||||
for( const std::shared_ptr<SCH_CONNECTION>& nestedMember :
|
||||
member->Members() )
|
||||
{
|
||||
processBusMember( nestedMember.get() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
processBusMember( member.get() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( netclass.IsEmpty() )
|
||||
netSettings->m_NetClassLabelAssignments.erase( netname );
|
||||
else
|
||||
netSettings->m_NetClassLabelAssignments[netname] = netclass;
|
||||
|
||||
if( oldAssignments.count( netname ) )
|
||||
// Handle netclass assignments on nets / overarching bus definitions.
|
||||
// Note: currently a netclass definition on a bus will override any
|
||||
// on a net. This will be resolved with multiple netclasses.
|
||||
if( !netclassAssignedFromBus.count( netname ) )
|
||||
{
|
||||
if( oldAssignments[netname] != netclass )
|
||||
if( !netclass.IsEmpty() )
|
||||
{
|
||||
netSettings->m_NetClassLabelAssignments[netname] = netclass;
|
||||
}
|
||||
|
||||
if( oldAssignments.count( netname ) )
|
||||
{
|
||||
if( oldAssignments[netname] != netclass )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( netname );
|
||||
dirtySubgraphs( subgraphs );
|
||||
}
|
||||
}
|
||||
else if( !netclass.IsEmpty() )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( netname );
|
||||
dirtySubgraphs( subgraphs );
|
||||
}
|
||||
}
|
||||
else if( !netclass.IsEmpty() )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( netname );
|
||||
dirtySubgraphs( subgraphs );
|
||||
}
|
||||
};
|
||||
|
||||
for( const auto& [ netname, subgraphs ] : m_net_name_to_subgraphs_map )
|
||||
|
||||
@@ -230,7 +230,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
||||
m_sdbSizer1Cancel->SetDefault();
|
||||
|
||||
// Don't close dialog if there are things the user needs to address
|
||||
if( reporter.HasMessage() )
|
||||
if( reporter.HasMessageOfSeverity( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) )
|
||||
return;
|
||||
|
||||
if( m_infoBar->IsShown() )
|
||||
|
||||
@@ -333,8 +333,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
|
||||
wxString fullfilename = fn.GetFullPath();
|
||||
m_parent->ClearMsgPanel();
|
||||
|
||||
wxString reportmsg;
|
||||
WX_STRING_REPORTER reporter( &reportmsg );
|
||||
WX_STRING_REPORTER reporter;
|
||||
m_parent->SetNetListerCommand( m_textCtrlCommand->GetValue() );
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
@@ -350,7 +349,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
|
||||
if( !status )
|
||||
DisplayError( this, _( "Failed to create file." ) );
|
||||
|
||||
m_Messages->SetValue( reportmsg );
|
||||
m_Messages->SetValue( reporter.GetMessages() );
|
||||
|
||||
// Force focus back on the dialog
|
||||
SetFocus();
|
||||
|
||||
@@ -353,19 +353,8 @@ bool DIALOG_FIELD_PROPERTIES::TransferDataFromWindow()
|
||||
else if( m_StyledTextCtrl->IsShown() )
|
||||
m_text = UnescapeString( m_StyledTextCtrl->GetValue() );
|
||||
|
||||
if( m_fieldId == REFERENCE_FIELD )
|
||||
{
|
||||
// Test if the reference string is valid:
|
||||
if( !SCH_SYMBOL::IsReferenceStringValid( m_text ) )
|
||||
{
|
||||
DisplayError( this, _( "Illegal reference designator value!" ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if( m_fieldId == SHEETFILENAME_V )
|
||||
{
|
||||
if( m_fieldId == SHEETFILENAME_V )
|
||||
m_text = EnsureFileExtension( m_text, FILEEXT::KiCadSchematicFileExtension );
|
||||
}
|
||||
|
||||
m_position = VECTOR2I( m_posX.GetValue(), m_posY.GetValue() );
|
||||
m_size = m_textSize.GetValue();
|
||||
|
||||
@@ -293,10 +293,11 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( SCH_COMMIT* aCommit,
|
||||
if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED )
|
||||
eda_text->SetItalic( m_italic->GetValue() );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
|
||||
eda_text->SetBold( m_bold->GetValue() );
|
||||
|
||||
// Must come after bold & italic
|
||||
// Must come after SetBold() & SetItalic()
|
||||
if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
|
||||
{
|
||||
eda_text->SetFont( m_fontCtrl->GetFontSelection( eda_text->IsBold(),
|
||||
|
||||
@@ -553,20 +553,8 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
|
||||
else if( m_currentLabel->GetTextWidth() != m_textSize.GetValue() )
|
||||
m_currentLabel->SetTextSize( VECTOR2I( m_textSize.GetValue(), m_textSize.GetValue() ) );
|
||||
|
||||
if( m_bold->IsChecked() != m_currentLabel->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_currentLabel->SetBold( true );
|
||||
m_currentLabel->SetTextThickness( GetPenSizeForBold( m_currentLabel->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentLabel->SetBold( false );
|
||||
m_currentLabel->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_currentLabel->SetBold( m_bold->IsChecked() );
|
||||
m_currentLabel->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_currentLabel->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <string_utils.h>
|
||||
#include <project_sch.h>
|
||||
|
||||
#include <refdes_utils.h>
|
||||
#include <dialog_sim_model.h>
|
||||
|
||||
#include <dialog_lib_symbol_properties.h>
|
||||
@@ -238,8 +238,8 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::Validate()
|
||||
return false;
|
||||
|
||||
// Alias symbol reference can be empty because it inherits from the parent symbol.
|
||||
if( m_libEntry->IsRoot() &&
|
||||
!SCH_SYMBOL::IsReferenceStringValid( m_fields->at( REFERENCE_FIELD ).GetText() ) )
|
||||
if( m_libEntry->IsRoot()
|
||||
&& UTIL::GetRefDesPrefix( m_fields->at( REFERENCE_FIELD ).GetText() ).IsEmpty() )
|
||||
{
|
||||
if( m_NoteBook->GetSelection() != 0 )
|
||||
m_NoteBook->SetSelection( 0 );
|
||||
|
||||
@@ -262,8 +262,9 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
|
||||
else
|
||||
m_graphicText->SetBodyStyle( 0 );
|
||||
|
||||
m_graphicText->SetItalic( m_italic->IsChecked() );
|
||||
// Must come after SetTextSize()
|
||||
m_graphicText->SetBold( m_bold->IsChecked() );
|
||||
m_graphicText->SetItalic( m_italic->IsChecked() );
|
||||
m_graphicText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_hAlignLeft->IsChecked() )
|
||||
|
||||
@@ -279,21 +279,10 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow()
|
||||
m_italic->IsChecked() ) );
|
||||
}
|
||||
|
||||
if( m_bold->IsChecked() != m_currentText->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_currentText->SetBold( true );
|
||||
m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentText->SetBold( false );
|
||||
m_currentText->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_currentText->SetBold( m_italic->IsChecked() );
|
||||
m_currentText->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_currentText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_hAlignRight->IsChecked() )
|
||||
|
||||
@@ -147,26 +147,14 @@ bool DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow()
|
||||
m_italic->IsChecked() ) );
|
||||
}
|
||||
|
||||
if( m_bold->IsChecked() != m_sheetPin->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_sheetPin->SetBold( true );
|
||||
m_sheetPin->SetTextThickness( GetPenSizeForBold( m_sheetPin->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sheetPin->SetBold( false );
|
||||
m_sheetPin->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
m_sheetPin->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
// Currently, eeschema uses only the text width as text size,
|
||||
// and expects text width = text height
|
||||
m_sheetPin->SetTextSize( VECTOR2I( m_textSize.GetIntValue(), m_textSize.GetIntValue() ) );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_sheetPin->SetBold( m_bold->IsChecked() );
|
||||
m_sheetPin->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_sheetPin->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_input->GetValue() ) m_sheetPin->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <trace_helpers.h>
|
||||
#include "panel_eeschema_color_settings.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "string_utils.h"
|
||||
|
||||
DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_SHEET* aSheet,
|
||||
bool* aClearAnnotationNewItems,
|
||||
@@ -286,7 +287,15 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow()
|
||||
// but unedited data from existing files can be bad.)
|
||||
sheetFileName = EnsureFileExtension( sheetFileName, FILEEXT::KiCadSchematicFileExtension );
|
||||
|
||||
// Ensure sheetFileName is legal
|
||||
if( !IsFullFileNameValid( sheetFileName ) )
|
||||
{
|
||||
DisplayError( this, _( "A sheet must have a valid file name." ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
wxFileName fn( sheetFileName );
|
||||
|
||||
wxString newRelativeFilename = fn.GetFullPath();
|
||||
|
||||
// Inside Eeschema, filenames are stored using unix notation
|
||||
@@ -431,6 +440,9 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow()
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_updateHierarchyNavigator )
|
||||
*m_updateHierarchyNavigator = true;
|
||||
|
||||
// If we are renaming files, the undo/redo list becomes invalid and must be cleared.
|
||||
m_frame->ClearUndoRedoList();
|
||||
m_frame->OnModify();
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <sch_edit_frame.h>
|
||||
#include <sim/sim_model_l_mutual.h>
|
||||
#include <sim/spice_circuit_model.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
using CATEGORY = SIM_MODEL::PARAM::CATEGORY;
|
||||
|
||||
@@ -77,8 +78,7 @@ DIALOG_SIM_MODEL<T_symbol, T_field>::DIALOG_SIM_MODEL( wxWindow* aParent, EDA_BA
|
||||
m_scintillaTricksSubckt( nullptr ),
|
||||
m_firstCategory( nullptr ),
|
||||
m_prevParamGridSelection( nullptr ),
|
||||
m_lastParamGridWidth( 0 ),
|
||||
m_inKillFocus( false )
|
||||
m_lastParamGridWidth( 0 )
|
||||
{
|
||||
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
|
||||
|
||||
@@ -173,8 +173,7 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
wxString pinMap;
|
||||
bool storeInValue = false;
|
||||
|
||||
wxString msg;
|
||||
WX_STRING_REPORTER reporter( &msg );
|
||||
WX_STRING_REPORTER reporter;
|
||||
|
||||
auto setFieldValue =
|
||||
[&]( const wxString& aFieldName, const wxString& aValue )
|
||||
@@ -219,12 +218,14 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
// The model is sourced from a library, optionally with instance overrides.
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
|
||||
if( !loadLibrary( libraryFilename ) )
|
||||
if( !loadLibrary( libraryFilename, reporter ) )
|
||||
{
|
||||
if( reporter.HasMessage() )
|
||||
m_infoBar->ShowMessage( reporter.GetMessages() );
|
||||
|
||||
m_libraryPathText->ChangeValue( libraryFilename );
|
||||
m_curModelType = SIM_MODEL::ReadTypeFromFields( m_fields, reporter );
|
||||
|
||||
// load library will mangle the set reporter
|
||||
m_libraryModelsMgr.CreateModel( nullptr, m_sortedPartPins, m_fields, reporter );
|
||||
|
||||
m_modelNameChoice->Append( _( "<unknown>" ) );
|
||||
@@ -237,14 +238,15 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
|
||||
if( modelIdx == wxNOT_FOUND )
|
||||
{
|
||||
DisplayErrorMessage( this, wxString::Format( _( "No model named '%s' in library." ),
|
||||
modelName ) );
|
||||
m_infoBar->ShowMessage( wxString::Format( _( "No model named '%s' in library." ),
|
||||
modelName ) );
|
||||
|
||||
// Default to first item in library
|
||||
m_modelNameChoice->SetSelection( 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_infoBar->Hide();
|
||||
m_modelNameChoice->SetSelection( modelIdx );
|
||||
}
|
||||
|
||||
@@ -302,24 +304,24 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
// The model is sourced from the instance.
|
||||
m_rbBuiltinModel->SetValue( true );
|
||||
|
||||
msg.clear();
|
||||
reporter.Clear();
|
||||
m_curModelType = SIM_MODEL::ReadTypeFromFields( m_fields, reporter );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
DisplayErrorMessage( this, msg );
|
||||
DisplayErrorMessage( this, reporter.GetMessages() );
|
||||
}
|
||||
|
||||
for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
|
||||
{
|
||||
if( m_rbBuiltinModel->GetValue() && type == m_curModelType )
|
||||
{
|
||||
msg.clear();
|
||||
reporter.Clear();
|
||||
m_builtinModelsMgr.CreateModel( m_fields, m_sortedPartPins, false, reporter );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
{
|
||||
DisplayErrorMessage( this, _( "Failed to read simulation model from fields." )
|
||||
+ wxT( "\n\n" ) + msg );
|
||||
+ wxT( "\n\n" ) + reporter.GetMessages() );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -807,37 +809,28 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::removeOrphanedPinAssignments( SIM_MODE
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
bool DIALOG_SIM_MODEL<T_symbol, T_field>::loadLibrary( const wxString& aLibraryPath,
|
||||
bool aForceReload )
|
||||
bool DIALOG_SIM_MODEL<T_symbol, T_field>::loadLibrary( const wxString& aLibraryPath, REPORTER& aReporter,
|
||||
bool aForceReload )
|
||||
{
|
||||
if( m_prevLibrary == aLibraryPath && !aForceReload )
|
||||
return true;
|
||||
|
||||
wxString msg;
|
||||
WX_STRING_REPORTER reporter( &msg );
|
||||
|
||||
m_libraryModelsMgr.SetForceFullParse();
|
||||
m_libraryModelsMgr.SetLibrary( aLibraryPath, reporter );
|
||||
m_libraryModelsMgr.SetLibrary( aLibraryPath, aReporter );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
{
|
||||
DisplayErrorMessage( this, msg );
|
||||
if( aReporter.HasMessageOfSeverity( RPT_SEVERITY_UNDEFINED | RPT_SEVERITY_ERROR ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string modelName = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::NAME_FIELD );
|
||||
|
||||
for( const auto& [baseModelName, baseModel] : library()->GetModels() )
|
||||
{
|
||||
if( baseModelName == modelName )
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, m_fields, reporter );
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, m_fields, aReporter );
|
||||
else
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, reporter );
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, aReporter );
|
||||
}
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
DisplayErrorMessage( this, msg );
|
||||
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
m_libraryPathText->ChangeValue( aLibraryPath );
|
||||
|
||||
@@ -1088,16 +1081,16 @@ SIM_MODEL& DIALOG_SIM_MODEL<T_symbol, T_field>::curModel() const
|
||||
{
|
||||
int sel = m_modelNameChoice->GetSelection();
|
||||
|
||||
if( sel >= 0 && sel < (int) m_libraryModelsMgr.GetModels().size() )
|
||||
if( sel >= 0 && sel < static_cast<int>( m_libraryModelsMgr.GetModels().size() ) )
|
||||
return m_libraryModelsMgr.GetModels().at( sel ).get();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (int) m_curModelType < (int) m_builtinModelsMgr.GetModels().size() )
|
||||
return m_builtinModelsMgr.GetModels().at( (int) m_curModelType );
|
||||
if( static_cast<int>( m_curModelType ) < static_cast<int>( m_builtinModelsMgr.GetModels().size() ) )
|
||||
return m_builtinModelsMgr.GetModels().at( static_cast<int>( m_curModelType ) );
|
||||
}
|
||||
|
||||
return m_builtinModelsMgr.GetModels().at( (int) SIM_MODEL::TYPE::NONE );
|
||||
return m_builtinModelsMgr.GetModels().at( static_cast<int>( SIM_MODEL::TYPE::NONE ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1174,49 +1167,46 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onRadioButton( wxCommandEvent& aEvent
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibrarayPathText( wxCommandEvent& aEvent )
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathText( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathTextEnter( wxCommandEvent& aEvent )
|
||||
{
|
||||
if( m_rbLibraryModel->GetValue() )
|
||||
{
|
||||
wxString path = m_libraryPathText->GetValue();
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
|
||||
if( !path.IsEmpty() )
|
||||
{
|
||||
try
|
||||
{
|
||||
loadLibrary( path );
|
||||
updateWidgets();
|
||||
}
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
// TODO: Add an infobar to report the error?
|
||||
}
|
||||
}
|
||||
}
|
||||
WX_STRING_REPORTER reporter;
|
||||
wxString path = m_libraryPathText->GetValue();
|
||||
|
||||
if( loadLibrary( path, reporter, true ) )
|
||||
m_infoBar->Hide();
|
||||
else if( reporter.HasMessage() )
|
||||
m_infoBar->ShowMessage( reporter.GetMessages() );
|
||||
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathTextKillFocus( wxFocusEvent& aEvent )
|
||||
{
|
||||
if( !m_inKillFocus )
|
||||
{
|
||||
m_inKillFocus = true;
|
||||
CallAfter(
|
||||
[this]()
|
||||
{
|
||||
// Disable logging -- otherwise we'll end up in an endless loop of show-log,
|
||||
// kill-focus, show-log, kill-focus, etc.
|
||||
wxLogNull doNotLog;
|
||||
|
||||
wxCommandEvent dummy;
|
||||
onLibraryPathTextEnter( dummy );
|
||||
wxCommandEvent dummy;
|
||||
onLibraryPathTextEnter( dummy );
|
||||
} );
|
||||
|
||||
m_inKillFocus = false;
|
||||
}
|
||||
aEvent.Skip(); // mandatory in wxFocusEvent events
|
||||
}
|
||||
|
||||
|
||||
@@ -1241,7 +1231,13 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onBrowseButtonClick( wxCommandEvent& a
|
||||
if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS( ".." ) ) )
|
||||
path = fn.GetFullPath();
|
||||
|
||||
loadLibrary( path, true );
|
||||
WX_STRING_REPORTER reporter;
|
||||
|
||||
if( loadLibrary( path, reporter, true ) )
|
||||
m_infoBar->Hide();
|
||||
else
|
||||
m_infoBar->ShowMessage( reporter.GetMessages() );
|
||||
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,8 @@ private:
|
||||
|
||||
void removeOrphanedPinAssignments( SIM_MODEL* aModel );
|
||||
|
||||
bool loadLibrary( const wxString& aLibraryPath, bool aForceReload = false );
|
||||
bool loadLibrary( const wxString& aLibraryPath, REPORTER& aReporter,
|
||||
bool aForceReload = false );
|
||||
|
||||
void addParamPropertyIfRelevant( SIM_MODEL* aModel, int aParamIndex );
|
||||
wxPGProperty* newParamProperty( SIM_MODEL* aModel, int aParamIndex ) const;
|
||||
@@ -94,7 +95,7 @@ private:
|
||||
int getModelPinIndex( const wxString& aModelPinString ) const;
|
||||
|
||||
void onRadioButton( wxCommandEvent& aEvent ) override;
|
||||
void onLibrarayPathText( wxCommandEvent& aEvent ) override;
|
||||
void onLibraryPathText( wxCommandEvent& aEvent ) override;
|
||||
void onLibraryPathTextEnter( wxCommandEvent& aEvent ) override;
|
||||
void onLibraryPathTextKillFocus( wxFocusEvent& aEvent ) override;
|
||||
void onBrowseButtonClick( wxCommandEvent& aEvent ) override;
|
||||
@@ -140,8 +141,7 @@ private:
|
||||
wxPGProperty* m_firstCategory; // Used to add principal parameters to root.
|
||||
wxPGProperty* m_prevParamGridSelection;
|
||||
|
||||
int m_lastParamGridWidth;
|
||||
bool m_inKillFocus;
|
||||
int m_lastParamGridWidth;
|
||||
};
|
||||
|
||||
#endif /* DIALOG_SIM_MODEL_H */
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "widgets/std_bitmap_button.h"
|
||||
#include "widgets/wx_grid.h"
|
||||
#include "widgets/wx_infobar.h"
|
||||
|
||||
#include "dialog_sim_model_base.h"
|
||||
|
||||
@@ -19,6 +20,13 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
wxBoxSizer* bSizer8;
|
||||
bSizer8 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_infoBar = new WX_INFOBAR( this );
|
||||
m_infoBar->SetShowHideEffects( wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_NONE );
|
||||
m_infoBar->SetEffectDuration( 500 );
|
||||
m_infoBar->Hide();
|
||||
|
||||
bSizer8->Add( m_infoBar, 0, wxEXPAND, 5 );
|
||||
|
||||
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_modelPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizerPanel;
|
||||
@@ -330,7 +338,7 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
m_rbLibraryModel->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
|
||||
m_pathLabel->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathLabelUpdate ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextKillFocus ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibrarayPathText ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathText ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextEnter ), NULL, this );
|
||||
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonClick ), NULL, this );
|
||||
m_browseButton->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonUpdate ), NULL, this );
|
||||
@@ -367,7 +375,7 @@ DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE()
|
||||
m_rbLibraryModel->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
|
||||
m_pathLabel->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathLabelUpdate ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextKillFocus ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibrarayPathText ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathText ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextEnter ), NULL, this );
|
||||
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonClick ), NULL, this );
|
||||
m_browseButton->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonUpdate ), NULL, this );
|
||||
|
||||
@@ -63,10 +63,10 @@
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxNotebook" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxInfoBar" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@@ -77,6 +77,67 @@
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="duration">500</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">1</property>
|
||||
<property name="hide_effect">wxSHOW_EFFECT_NONE</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_infoBar</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="show_effect">wxSHOW_EFFECT_NONE</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_INFOBAR; widgets/wx_infobar.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxNotebook" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmapsize"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
@@ -129,10 +190,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -199,10 +260,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -283,10 +344,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -358,10 +419,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -385,7 +446,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
@@ -413,7 +474,7 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnKillFocus">onLibraryPathTextKillFocus</event>
|
||||
<event name="OnText">onLibrarayPathText</event>
|
||||
<event name="OnText">onLibraryPathText</event>
|
||||
<event name="OnTextEnter">onLibraryPathTextEnter</event>
|
||||
</object>
|
||||
</object>
|
||||
@@ -426,10 +487,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@@ -507,10 +568,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -573,10 +634,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -655,10 +716,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -721,10 +782,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -794,10 +855,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -864,10 +925,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -930,10 +991,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1003,10 +1064,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1068,10 +1129,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1146,10 +1207,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1228,10 +1289,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1291,10 +1352,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1358,10 +1419,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1421,10 +1482,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1499,10 +1560,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmapsize"></property>
|
||||
@@ -1558,10 +1619,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1619,10 +1680,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1690,10 +1751,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1751,10 +1812,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="backspace_unindents">1</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@@ -1834,10 +1895,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1914,10 +1975,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1975,10 +2036,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
@@ -2066,10 +2127,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -2128,10 +2189,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="backspace_unindents">1</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
|
||||
@@ -12,14 +12,16 @@
|
||||
#include <wx/intl.h>
|
||||
class STD_BITMAP_BUTTON;
|
||||
class WX_GRID;
|
||||
class WX_INFOBAR;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/infobar.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
@@ -52,6 +54,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
|
||||
private:
|
||||
|
||||
protected:
|
||||
WX_INFOBAR* m_infoBar;
|
||||
wxNotebook* m_notebook;
|
||||
wxPanel* m_modelPanel;
|
||||
wxRadioButton* m_rbLibraryModel;
|
||||
@@ -91,7 +94,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
|
||||
virtual void onRadioButton( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathLabelUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathTextKillFocus( wxFocusEvent& event ) { event.Skip(); }
|
||||
virtual void onLibrarayPathText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathTextEnter( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onBrowseButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onBrowseButtonUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
|
||||
@@ -634,17 +634,6 @@ bool DIALOG_SYMBOL_PROPERTIES::Validate()
|
||||
if( !m_fieldsGrid->CommitPendingChanges() || !m_fieldsGrid->Validate() )
|
||||
return false;
|
||||
|
||||
if( !SCH_SYMBOL::IsReferenceStringValid( m_fields->at( REFERENCE_FIELD ).GetText() ) )
|
||||
{
|
||||
DisplayErrorMessage( this, _( "References must start with a letter." ) );
|
||||
|
||||
wxCommandEvent *evt = new wxCommandEvent( SYMBOL_DELAY_FOCUS );
|
||||
evt->SetClientData( new VECTOR2I( REFERENCE_FIELD, FDC_VALUE ) );
|
||||
QueueEvent( evt );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check for missing field names.
|
||||
for( size_t i = MANDATORY_FIELDS; i < m_fields->size(); ++i )
|
||||
{
|
||||
|
||||
@@ -471,21 +471,10 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
|
||||
m_italic->IsChecked() ) );
|
||||
}
|
||||
|
||||
if( m_bold->IsChecked() != m_currentText->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_currentText->SetBold( true );
|
||||
m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentText->SetBold( false );
|
||||
m_currentText->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_currentText->SetBold( m_bold->IsChecked() );
|
||||
m_currentText->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_currentText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_hAlignRight->IsChecked() )
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user