Fp editor: allow internal layers in footprint keep-out zones Especially: Enable one internal layer to manage keep-out areas only on internal layers Allowing one internal layer is a trick to manage these keep-out areas (visibility and selection) In fact this internal layer groups all internal layers enabled is these keep-out areas.

This commit is contained in:
jean-pierre charras 2019-10-28 10:15:03 +01:00
parent bc5dcf182f
commit 1c2891e6d4
11 changed files with 146 additions and 413 deletions

View File

@ -67,14 +67,14 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent, bool aInModule )
SetLocalFlags( 0 ); // flags tempoarry used in zone calculations
m_Poly = new SHAPE_POLY_SET(); // Outlines
m_FilledPolysUseThickness = true; // set the "old" way to build filled polygon areas (before 6.0.x)
aParent->GetZoneSettings().ExportSetting( *this );
aParent->GetZoneSettings().ExportSetting( *this );
m_needRefill = false; // True only after some edition.
}
ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone )
: BOARD_CONNECTED_ITEM( aZone.GetParent(), PCB_ZONE_AREA_T )
ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone )
: BOARD_CONNECTED_ITEM( aZone.GetParent(), PCB_ZONE_AREA_T )
{
copyDataFromSrc( aZone );
}
@ -246,8 +246,16 @@ void ZONE_CONTAINER::SetLayerSet( LSET aLayerSet )
m_layerSet = aLayerSet;
// Set the single layer to the first selected layer
// Set the single layer parameter.
// For keepout zones that can be on many layers, this parameter does not have
// really meaning and is a bit arbitrary if more than one layer is set.
// But many functions are using it.
// So we need to initialize it to a reasonable value.
// Priority is F_Cu then B_Cu then to the first selected layer
m_Layer = aLayerSet.Seq()[0];
if( m_Layer != F_Cu && aLayerSet[B_Cu] )
m_Layer = B_Cu;
}
@ -1325,3 +1333,25 @@ EDA_ITEM* MODULE_ZONE_CONTAINER::Clone() const
{
return new MODULE_ZONE_CONTAINER( *this );
}
unsigned int MODULE_ZONE_CONTAINER::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{
//
const int HIDE = std::numeric_limits<unsigned int>::max();
if( !aView )
return 0;
bool flipped = GetParent() && GetParent()->GetLayer() == B_Cu;
// Handle Render tab switches
if( !flipped && !aView->IsLayerVisible( LAYER_MOD_FR ) )
return HIDE;
if( flipped && !aView->IsLayerVisible( LAYER_MOD_BK ) )
return HIDE;
// Other layers are shown without any conditions
return 0;
}

View File

@ -821,6 +821,7 @@ protected:
* MODULE_ZONE_CONTAINER is living in a footprint
* althougt the are similar, these items need a specific type to be easily managed
* in many functions using the type id in switches
* A few virtual methods are different
*/
class MODULE_ZONE_CONTAINER : public ZONE_CONTAINER
{
@ -832,9 +833,9 @@ public:
MODULE_ZONE_CONTAINER( const MODULE_ZONE_CONTAINER& aZone );
MODULE_ZONE_CONTAINER& operator=( const MODULE_ZONE_CONTAINER &aOther );
// ~MODULE_ZONE_CONTAINER();
EDA_ITEM* Clone() const override;
unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
};
#endif // CLASS_ZONE_H_

View File

@ -263,6 +263,9 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
goto exit;
break;
case PCB_MODULE_ZONE_AREA_T:
module = static_cast<MODULE*>( item->GetParent() );
// Fall through
case PCB_ZONE_AREA_T:
zone = static_cast<ZONE_CONTAINER*>( item );
break;
@ -425,7 +428,6 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
}
}
if( m_Guide->IncludeSecondary() )
{
// for now, "secondary" means "tolerate any layer". It has
@ -439,7 +441,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
// controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
// text in module *is* sensitive to layer visibility but that was already handled.
if( via || module || pad || m_Guide->IsLayerVisible( layer )
if( via || module || pad || zone || m_Guide->IsLayerVisible( layer )
|| !m_Guide->IgnoreNonVisibleLayers() )
{
if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )

View File

@ -32,6 +32,10 @@
#include <zone_settings.h>
#include <dialog_keepout_area_properties_base.h>
#define LAYER_LIST_COLUMN_CHECK 0
#define LAYER_LIST_COLUMN_ICON 1
#define LAYER_LIST_COLUMN_NAME 2
#define LAYER_LIST_ROW_ALL_INNER_LAYERS 1
class DIALOG_KEEPOUT_AREA_PROPERTIES : public DIALOG_KEEPOUT_AREA_PROPERTIES_BASE
{
@ -69,7 +73,9 @@ DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME*
m_ptr = aSettings;
m_zonesettings = *aSettings;
m_zonesettings.SetupLayersList( m_layers, m_parent, true );
bool fpEditorMode = m_parent->IsType( FRAME_FOOTPRINT_EDITOR );
m_zonesettings.SetupLayersList( m_layers, m_parent, true, fpEditorMode );
m_sdbSizerButtonsOK->SetDefault();
@ -106,10 +112,18 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::OnLayerSelection( wxDataViewEvent& event )
int row = m_layers->ItemToRow( event.GetItem() );
wxVariant layerID;
m_layers->GetValue( layerID, row, 2 );
bool selected = m_layers->GetToggleValue( row, 0 );
m_layers->GetValue( layerID, row, LAYER_LIST_COLUMN_NAME );
bool selected = m_layers->GetToggleValue( row, LAYER_LIST_COLUMN_CHECK );
m_zonesettings.m_Layers.set( ToLAYER_ID( layerID.GetInteger() ), selected );
if( row == LAYER_LIST_ROW_ALL_INNER_LAYERS )
{
if( selected )
m_zonesettings.m_Layers |= LSET::InternalCuMask();
else
m_zonesettings.m_Layers &= ~LSET::InternalCuMask();
}
else
m_zonesettings.m_Layers.set( ToLAYER_ID( layerID.GetInteger() ), selected );
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 2 2018)
// C++ code generated with wxFormBuilder (version Jul 10 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -12,87 +12,91 @@
DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLayersListSizer;
bLayersListSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layers:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextLayerSelection->Wrap( -1 );
bLayersListSizer->Add( m_staticTextLayerSelection, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_layers = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER|wxBORDER_SIMPLE );
bLayersListSizer->Add( m_layers, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bUpperSizer->Add( bLayersListSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL );
m_cbTracksCtrl = new wxCheckBox( this, wxID_ANY, _("Keep out tracks"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_cbTracksCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("Keep out vias"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_cbCopperPourCtrl = new wxCheckBox( this, wxID_ANY, _("Keep out copper pours"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_cbCopperPourCtrl, 0, wxALL|wxEXPAND, 5 );
bSizerRight->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_cbConstrainCtrl = new wxCheckBox( this, wxID_ANY, _("Constrain outline to H, V and 45 deg"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_cbConstrainCtrl, 0, wxALL, 5 );
bSizerRight->Add( 0, 0, 0, wxTOP|wxBOTTOM, 5 );
wxBoxSizer* bSizerLowerRight;
bSizerLowerRight = new wxBoxSizer( wxHORIZONTAL );
m_staticTextStyle = new wxStaticText( this, wxID_ANY, _("Outline display:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextStyle->Wrap( -1 );
bSizerLowerRight->Add( m_staticTextStyle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched"), _("Fully hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 0 );
m_OutlineAppearanceCtrl->SetSelection( 0 );
bSizerLowerRight->Add( m_OutlineAppearanceCtrl, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizerRight->Add( bSizerLowerRight, 1, wxEXPAND, 5 );
bUpperSizer->Add( bSizerRight, 0, wxEXPAND|wxALL, 10 );
bSizerLowerRight->Add( m_OutlineAppearanceCtrl, 0, wxALL, 5 );
bSizerRight->Add( bSizerLowerRight, 0, wxEXPAND, 5 );
bUpperSizer->Add( bSizerRight, 0, wxALL|wxEXPAND, 10 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_sdbSizerButtons = new wxStdDialogButtonSizer();
m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
m_sdbSizerButtons->Realize();
bMainSizer->Add( m_sdbSizerButtons, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_layers->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::OnLayerSelection ), NULL, this );
m_layers->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::onLayerListRightDown ), NULL, this );
m_layers->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::OnSizeLayersList ), NULL, this );
}
@ -100,6 +104,7 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::~DIALOG_KEEPOUT_AREA_PROPERTIES_BASE()
{
// Disconnect Events
m_layers->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::OnLayerSelection ), NULL, this );
m_layers->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::onLayerListRightDown ), NULL, this );
m_layers->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::OnSizeLayersList ), NULL, this );
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="14" />
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,6 +14,7 @@
<property name="file">dialog_keepout_area_properties_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_keepout_areas_properties_base</property>
@ -25,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -53,55 +55,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxBORDER_SUNKEN</property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiPaneActivated"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMaximize"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnMove"></event>
<event name="OnMoveEnd"></event>
<event name="OnMoveStart"></event>
<event name="OnMoving"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnShow"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
@ -184,36 +137,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@ -241,61 +164,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxBORDER_SIMPLE</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnDataViewListCtrlColumnHeaderClick"></event>
<event name="OnDataViewListCtrlColumnHeaderRightClick"></event>
<event name="OnDataViewListCtrlColumnReordered"></event>
<event name="OnDataViewListCtrlColumnSorted"></event>
<event name="OnDataViewListCtrlItemActivated"></event>
<event name="OnDataViewListCtrlItemBeginDrag"></event>
<event name="OnDataViewListCtrlItemCollapsed"></event>
<event name="OnDataViewListCtrlItemCollapsing"></event>
<event name="OnDataViewListCtrlItemContextMenu"></event>
<event name="OnDataViewListCtrlItemDrop"></event>
<event name="OnDataViewListCtrlItemDropPossible"></event>
<event name="OnDataViewListCtrlItemEditingDone"></event>
<event name="OnDataViewListCtrlItemEditingStarted"></event>
<event name="OnDataViewListCtrlItemExpanded"></event>
<event name="OnDataViewListCtrlItemExpanding"></event>
<event name="OnDataViewListCtrlItemStartEditing"></event>
<event name="OnDataViewListCtrlItemValueChanged">OnLayerSelection</event>
<event name="OnDataViewListCtrlSelectionChanged"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnRightDown">onLayerListRightDown</event>
<event name="OnSize">OnSizeLayersList</event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@ -364,37 +242,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@ -459,37 +306,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@ -554,37 +370,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@ -659,43 +444,22 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM</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">wxEXPAND</property>
<property name="proportion">1</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerLowerRight</property>
@ -760,41 +524,11 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
@ -854,37 +588,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnChoice"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
@ -949,36 +652,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@ -997,14 +670,6 @@
<property name="minimum_size"></property>
<property name="name">m_sdbSizerButtons</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>

View File

@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 2 2018)
// C++ code generated with wxFormBuilder (version Jul 10 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_KEEPOUT_AREA_PROPERTIES_BASE_H__
#define __DIALOG_KEEPOUT_AREA_PROPERTIES_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@ -35,7 +34,7 @@
class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_staticTextLayerSelection;
wxDataViewListCtrl* m_layers;
@ -49,17 +48,17 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizerButtons;
wxButton* m_sdbSizerButtonsOK;
wxButton* m_sdbSizerButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnLayerSelection( wxDataViewEvent& event ) { event.Skip(); }
virtual void onLayerListRightDown( wxMouseEvent& event ) { event.Skip(); }
virtual void OnSizeLayersList( wxSizeEvent& event ) { event.Skip(); }
public:
DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Keepout Area Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxBORDER_SUNKEN );
DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Keepout Area Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxBORDER_SUNKEN );
~DIALOG_KEEPOUT_AREA_PROPERTIES_BASE();
};
#endif //__DIALOG_KEEPOUT_AREA_PROPERTIES_BASE_H__

View File

@ -125,6 +125,14 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
SetCanvas( drawPanel );
SetBoard( new BOARD() );
// Enable one internal layer, because footprints support keepout areas that
// can be on internal layers only (therefore on the first internal layer)
// This is needed to handle these keepout in internal layers only
GetBoard()->SetEnabledLayers( GetBoard()->GetEnabledLayers().set( In1_Cu ) );
GetBoard()->SetVisibleLayers( GetBoard()->GetEnabledLayers() );
GetBoard()->SetLayerName( In1_Cu, _( "Inner layers" ) );
// In modedit, the default net clearance is not known.
// (it depends on the actual board)
// So we do not show the default clearance, by setting it to 0

View File

@ -1145,6 +1145,9 @@ void PNS_KICAD_IFACE::SyncWorld( PNS::NODE *aWorld )
syncTextItem( aWorld, &module->Reference(), module->Reference().GetLayer() );
syncTextItem( aWorld, &module->Value(), module->Value().GetLayer() );
for( MODULE_ZONE_CONTAINER* zone : module->Zones() )
syncZone( aWorld, zone );
if( module->IsNetTie() )
continue;

View File

@ -170,7 +170,7 @@ const static wxSize LAYER_BITMAP_SIZE( 24, 16 );
// A helper for setting up a dialog list for specifying zone layers. Used by all three
// zone settings dialogs.
void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame,
bool aShowCopper )
bool aShowCopper, bool aFpEditorMode )
{
BOARD* board = aFrame->GetBoard();
COLOR4D backgroundColor = aFrame->Settings().Colors().GetLayerColor( LAYER_PCB_BACKGROUND );
@ -187,7 +187,9 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME*
for( LSEQ layer = layers.UIOrder(); layer; ++layer )
{
PCB_LAYER_ID layerID = *layer;
wxString layerName = board->GetLayerName( layerID );
wxString layerName = board->GetLayerName( layerID );
if( aFpEditorMode && layerID == In1_Cu )
layerName = _( "Inner layers" );
// wxCOL_WIDTH_AUTOSIZE doesn't work on all platforms, so we calculate width here
textWidth = std::max( textWidth, GetTextSize( layerName, aList ).x );

View File

@ -116,9 +116,13 @@ public:
/**
* A helper routine for the various zone dialogs (copper, non-copper, keepout).
* @param aList the wxDataViewListCtrl to populate
* @param aFrame the parent editor frame
* @param aShowCopper indicates whether copper or technical layers should be shown
* @param aFpEditorMode true to show (when aShowCopper = true) the option: all inner layers
*/
void SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame, bool aShowCopper );
void SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame,
bool aShowCopper, bool aFpEditorMode = false );
/**
* Function ExportSetting