Line styles for PCBNew shapes.

Fixes https://gitlab.com/kicad/code/kicad/issues/2150
This commit is contained in:
Jeff Young 2021-08-26 00:14:36 +01:00
parent b2dff6fa55
commit f1410f0240
38 changed files with 1853 additions and 870 deletions

View File

@ -1613,7 +1613,8 @@ static struct EDA_SHAPE_DESC
.Map( PLOT_DASH_TYPE::SOLID, _HKI( "Solid" ) )
.Map( PLOT_DASH_TYPE::DASH, _HKI( "Dashed" ) )
.Map( PLOT_DASH_TYPE::DOT, _HKI( "Dotted" ) )
.Map( PLOT_DASH_TYPE::DASHDOT, _HKI( "Dash-Dot" ) );
.Map( PLOT_DASH_TYPE::DASHDOT, _HKI( "Dash-Dot" ) )
.Map( PLOT_DASH_TYPE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) );
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
REGISTER_TYPE( EDA_SHAPE );

View File

@ -160,7 +160,6 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
{
hash_combine( ret, shape->GetCenter0().x );
hash_combine( ret, shape->GetCenter0().y );
hash_combine( ret, shape->GetArcAngle() );
}
}
else
@ -174,7 +173,6 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
{
hash_combine( ret, shape->GetCenter().x );
hash_combine( ret, shape->GetCenter().y );
hash_combine( ret, shape->GetArcAngle() );
}
}
}

View File

@ -256,6 +256,7 @@ solid
stackup
start
status
stroke
style
suffix
suppress_zeroes

View File

@ -1,4 +1,6 @@
creategerberjobfile
dashed_line_dash_ratio
dashed_line_gap_ratio
disableapertmacros
drillshape
dxfimperialunits

View File

@ -185,4 +185,10 @@ void PANEL_SETUP_FORMATTING::ImportSettingsFrom( SCHEMATIC_SETTINGS& aSettings )
wxString labelSizeRatio = wxString::Format( "%f", aSettings.m_LabelSizeRatio * 100.0 );
m_labelSizeRatioCtrl->SetValue( labelSizeRatio );
m_dashLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED,
aSettings.m_DashedLineDashRatio ) );
m_gapLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED,
aSettings.m_DashedLineGapRatio ) );
}

View File

@ -127,3 +127,4 @@ xy
x
y
yes

View File

@ -50,8 +50,8 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
m_IntersheetRefsFormatShort( false ),
m_IntersheetRefsPrefix( DEFAULT_IREF_PREFIX ),
m_IntersheetRefsSuffix( DEFAULT_IREF_SUFFIX ),
m_DashedLineDashRatio( 5 ),
m_DashedLineGapRatio( 3 ),
m_DashedLineDashRatio( 5.0 ),
m_DashedLineGapRatio( 3.0 ),
m_SpiceAdjustPassiveValues( false ),
m_NgspiceSimulatorSettings( nullptr )
{
@ -92,10 +92,10 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
&m_IntersheetRefsSuffix, defaultIntersheetsRefSuffix ) );
m_params.emplace_back( new PARAM<double>( "drawing.dashed_lines_dash_length_ratio",
&m_DashedLineDashRatio, 5 ) );
&m_DashedLineDashRatio, 5.0 ) );
m_params.emplace_back( new PARAM<double>( "drawing.dashed_lines_gap_length_ratio",
&m_DashedLineGapRatio, 3 ) );
&m_DashedLineGapRatio, 3.0 ) );
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_line_thickness",
&m_DefaultLineWidth, Mils2iu( defaultLineThickness ), Mils2iu( 5 ), Mils2iu( 1000 ),

View File

@ -164,6 +164,8 @@ set( PCBNEW_DIALOGS
dialogs/panel_pcbnew_display_origin_base.cpp
dialogs/panel_setup_constraints.cpp
dialogs/panel_setup_constraints_base.cpp
dialogs/panel_setup_formatting.cpp
dialogs/panel_setup_formatting_base.cpp
dialogs/panel_setup_mask_and_paste.cpp
dialogs/panel_setup_mask_and_paste_base.cpp
dialogs/panel_setup_layers.cpp

View File

@ -220,56 +220,56 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std:
m_params.emplace_back( new PARAM<bool>( "rules.use_height_for_length_calcs",
&m_UseHeightForLengthCalcs, true ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_clearance", &m_MinClearance,
Millimeter2iu( DEFAULT_MINCLEARANCE ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_clearance",
&m_MinClearance, Millimeter2iu( DEFAULT_MINCLEARANCE ),
Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_track_width", &m_TrackMinWidth,
Millimeter2iu( DEFAULT_TRACKMINWIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_track_width",
&m_TrackMinWidth, Millimeter2iu( DEFAULT_TRACKMINWIDTH ),
Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_via_annular_width",
&m_ViasMinAnnularWidth, Millimeter2iu( DEFAULT_VIASMINSIZE ), Millimeter2iu( 0.01 ),
Millimeter2iu( 25.0 ), MM_PER_IU ) );
&m_ViasMinAnnularWidth, Millimeter2iu( DEFAULT_VIASMINSIZE ),
Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_via_diameter", &m_ViasMinSize,
Millimeter2iu( DEFAULT_VIASMINSIZE ), Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ),
MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_via_diameter",
&m_ViasMinSize, Millimeter2iu( DEFAULT_VIASMINSIZE ),
Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_through_hole_diameter",
&m_MinThroughDrill, Millimeter2iu( DEFAULT_MINTHROUGHDRILL ), Millimeter2iu( 0.01 ),
Millimeter2iu( 25.0 ), MM_PER_IU ) );
&m_MinThroughDrill, Millimeter2iu( DEFAULT_MINTHROUGHDRILL ),
Millimeter2iu( 0.01 ), Millimeter2iu( 25.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_microvia_diameter",
&m_MicroViasMinSize, Millimeter2iu( DEFAULT_MICROVIASMINSIZE ), Millimeter2iu( 0.01 ),
Millimeter2iu( 10.0 ), MM_PER_IU ) );
&m_MicroViasMinSize, Millimeter2iu( DEFAULT_MICROVIASMINSIZE ),
Millimeter2iu( 0.01 ), Millimeter2iu( 10.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_microvia_drill", &m_MicroViasMinDrill,
Millimeter2iu( DEFAULT_MICROVIASMINDRILL ), Millimeter2iu( 0.01 ),
Millimeter2iu( 10.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_microvia_drill",
&m_MicroViasMinDrill, Millimeter2iu( DEFAULT_MICROVIASMINDRILL ),
Millimeter2iu( 0.01 ), Millimeter2iu( 10.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_hole_to_hole", &m_HoleToHoleMin,
Millimeter2iu( DEFAULT_HOLETOHOLEMIN ), Millimeter2iu( 0.00 ), Millimeter2iu( 10.0 ),
MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_hole_to_hole",
&m_HoleToHoleMin, Millimeter2iu( DEFAULT_HOLETOHOLEMIN ),
Millimeter2iu( 0.00 ), Millimeter2iu( 10.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_hole_clearance", &m_HoleClearance,
Millimeter2iu( DEFAULT_HOLECLEARANCE ), Millimeter2iu( 0.00 ), Millimeter2iu( 100.0 ),
MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_hole_clearance",
&m_HoleClearance, Millimeter2iu( DEFAULT_HOLECLEARANCE ),
Millimeter2iu( 0.00 ), Millimeter2iu( 100.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_silk_clearance", &m_SilkClearance,
Millimeter2iu( DEFAULT_SILKCLEARANCE ), Millimeter2iu( 0.00 ), Millimeter2iu( 100.0 ),
MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_silk_clearance",
&m_SilkClearance, Millimeter2iu( DEFAULT_SILKCLEARANCE ),
Millimeter2iu( 0.00 ), Millimeter2iu( 100.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM<int>( "rules.min_resolved_spokes",
&m_MinResolvedSpokes, DEFAULT_MINRESOLVEDSPOKES, 0, 4 ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_text_height", &m_MinSilkTextHeight,
Millimeter2iu( DEFAULT_SILK_TEXT_SIZE * 0.8 ), Millimeter2iu( 0.00 ),
Millimeter2iu( 100.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_text_height",
&m_MinSilkTextHeight, Millimeter2iu( DEFAULT_SILK_TEXT_SIZE * 0.8 ),
Millimeter2iu( 0.00 ), Millimeter2iu( 100.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_text_thickness", &m_MinSilkTextThickness,
Millimeter2iu( DEFAULT_SILK_TEXT_WIDTH * 0.8 ), Millimeter2iu( 0.00 ),
Millimeter2iu( 25.0 ), MM_PER_IU ) );
m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_text_thickness",
&m_MinSilkTextThickness, Millimeter2iu( DEFAULT_SILK_TEXT_WIDTH * 0.8 ),
Millimeter2iu( 0.00 ), Millimeter2iu( 25.0 ), MM_PER_IU ) );
// Note: a clearance of -0.01 is a flag indicating we should use the legacy (pre-6.0) method
// based on the edge cut thicknesses.

View File

@ -53,7 +53,7 @@ PANEL_SETUP_BOARD_FINISH_BASE::PANEL_SETUP_BOARD_FINISH_BASE( wxWindow* parent,
bMargins->Add( fgSizer2, 1, wxEXPAND|wxTOP, 10 );
bMainSizer->Add( bMargins, 1, wxEXPAND, 10 );
bMainSizer->Add( bMargins, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );

View File

@ -55,8 +55,8 @@
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND</property>
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>

View File

@ -58,6 +58,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
m_layers = new PANEL_SETUP_LAYERS( this, aFrame );
m_textAndGraphics = new PANEL_SETUP_TEXT_AND_GRAPHICS( this, aFrame );
m_formatting = new PANEL_SETUP_FORMATTING( this, aFrame );
m_constraints = new PANEL_SETUP_CONSTRAINTS( this, aFrame );
m_rules = new PANEL_SETUP_RULES( this, aFrame );
m_tracksAndVias = new PANEL_SETUP_TRACKS_AND_VIAS( this, aFrame, m_constraints );
@ -99,6 +100,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
m_treebook->AddPage( new wxPanel( this ), _( "Text & Graphics" ) );
m_treebook->AddSubPage( m_textAndGraphics, _( "Defaults" ) );
m_treebook->AddSubPage( m_formatting, _( "Fomatting" ) );
m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) );
m_treebook->AddPage( new wxPanel( this ), _( "Design Rules" ) );
@ -251,11 +253,15 @@ void DIALOG_BOARD_SETUP::OnAuxiliaryAction( wxCommandEvent& event )
{
m_layers->ImportSettingsFrom( otherBoard );
m_physicalStackup->ImportSettingsFrom( otherBoard );
m_boardFinish->ImportSettingsFrom( otherBoard );
}
if( importDlg.m_TextAndGraphicsOpt->GetValue() )
m_textAndGraphics->ImportSettingsFrom( otherBoard );
if( importDlg.m_FormattingOpt->GetValue() )
m_formatting->ImportSettingsFrom( otherBoard );
if( importDlg.m_ConstraintsOpt->GetValue() )
m_constraints->ImportSettingsFrom( otherBoard );

View File

@ -22,6 +22,7 @@
#define KICAD_DIALOG_BOARD_SETUP_H
#include <widgets/paged_dialog.h>
#include "panel_setup_formatting.h"
class PCB_EDIT_FRAME;
class PANEL_SETUP_CONSTRAINTS;
@ -51,6 +52,7 @@ protected:
PANEL_SETUP_CONSTRAINTS* m_constraints;
PANEL_SETUP_LAYERS* m_layers;
PANEL_SETUP_TEXT_AND_GRAPHICS* m_textAndGraphics;
PANEL_SETUP_FORMATTING* m_formatting;
PANEL_SETUP_NETCLASSES* m_netclasses;
PANEL_SETUP_RULES* m_rules;
PANEL_SETUP_TRACKS_AND_VIAS* m_tracksAndVias;

View File

@ -78,6 +78,8 @@ private:
finishDialogSettings();
}
void onFilledCheckbox( wxCommandEvent& event ) override;
bool Validate() override;
};
@ -132,6 +134,11 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FR
m_LayerSelectionCtrl->SetNotAllowedLayerSet( forbiddenLayers );
}
for( const std::pair<const PLOT_DASH_TYPE, lineTypeStruct>& typeEntry : lineTypeNames )
m_lineStyleCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) );
m_lineStyleCombo->Append( DEFAULT_STYLE );
m_LayerSelectionCtrl->SetLayersHotkeys( false );
m_LayerSelectionCtrl->SetBoardFrame( m_parent );
m_LayerSelectionCtrl->Resync();
@ -151,6 +158,29 @@ void PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog( BOARD_ITEM* aItem )
}
void DIALOG_GRAPHIC_ITEM_PROPERTIES::onFilledCheckbox( wxCommandEvent& event )
{
if( m_filledCtrl->GetValue() )
{
m_lineStyleCombo->SetSelection( 0 );
m_lineStyleLabel->Enable( false );
m_lineStyleCombo->Enable( false );
}
else
{
int style = static_cast<int>( m_item->GetStroke().GetPlotStyle() );
if( style == -1 )
m_lineStyleCombo->SetStringSelection( DEFAULT_STYLE );
else if( style < (int) lineTypeNames.size() )
m_lineStyleCombo->SetSelection( style );
m_lineStyleLabel->Enable( true );
m_lineStyleCombo->Enable( true );
}
}
bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow()
{
if( !m_item )
@ -254,7 +284,17 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow()
m_filledCtrl->SetValue( m_item->IsFilled() );
m_locked->SetValue( m_item->IsLocked() );
m_thickness.SetValue( m_item->GetWidth() );
m_thickness.SetValue( m_item->GetStroke().GetWidth() );
int style = static_cast<int>( m_item->GetStroke().GetPlotStyle() );
if( style == -1 )
m_lineStyleCombo->SetStringSelection( DEFAULT_STYLE );
else if( style < (int) lineTypeNames.size() )
m_lineStyleCombo->SetSelection( style );
else
wxFAIL_MSG( "Line type not found in the type lookup map" );
m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() );
@ -340,7 +380,17 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
m_item->SetLocked( m_locked->GetValue() );
STROKE_PARAMS stroke = m_item->GetStroke();
stroke.SetWidth( m_thickness.GetValue() );
auto it = lineTypeNames.begin();
std::advance( it, m_lineStyleCombo->GetSelection() );
if( it == lineTypeNames.end() )
stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT );
else
stroke.SetPlotStyle( it->first );
m_item->SetStroke( stroke );
m_item->SetLayer( ToLAYER_ID( layer ) );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -21,7 +21,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxVERTICAL );
m_sizerLeft = new wxGridBagSizer( 5, 5 );
m_sizerLeft = new wxGridBagSizer( 5, 3 );
m_sizerLeft->SetFlexibleDirection( wxBOTH );
m_sizerLeft->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_sizerLeft->SetEmptyCellSize( wxSize( 5,5 ) );
@ -131,72 +131,67 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
m_sizerLeft->Add( m_BezierPointC2YUnit, wxGBPosition( 6, 5 ), wxGBSpan( 1, 1 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
bUpperSizer->Add( m_sizerLeft, 1, wxEXPAND, 20 );
bUpperSizer->Add( m_sizerLeft, 0, wxEXPAND, 20 );
wxBoxSizer* bUpperRightSizer;
bUpperRightSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bMiddleSizer;
bMiddleSizer = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgUpperRightGridSizer;
fgUpperRightGridSizer = new wxFlexGridSizer( 0, 3, 3, 0 );
fgUpperRightGridSizer->AddGrowableCol( 1 );
fgUpperRightGridSizer->SetFlexibleDirection( wxBOTH );
fgUpperRightGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxGridBagSizer* gbSizer2;
gbSizer2 = new wxGridBagSizer( 5, 0 );
gbSizer2->SetFlexibleDirection( wxBOTH );
gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_angleLabel = new wxStaticText( this, wxID_ANY, _("Arc angle:"), wxDefaultPosition, wxDefaultSize, 0 );
m_angleLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_angleLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 );
gbSizer2->Add( m_angleLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_angleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_angleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
gbSizer2->Add( m_angleCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_angleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_angleUnits->Wrap( -1 );
fgUpperRightGridSizer->Add( m_angleUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
gbSizer2->Add( m_angleUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_locked = new wxCheckBox( this, wxID_ANY, _("Locked"), wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_locked, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
fgUpperRightGridSizer->Add( 0, 0, 1, wxEXPAND, 5 );
fgUpperRightGridSizer->Add( 0, 0, 1, wxEXPAND, 5 );
gbSizer2->Add( m_locked, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT, 5 );
m_filledCtrl = new wxCheckBox( this, wxID_ANY, _("Filled shape"), wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_filledCtrl, 0, wxTOP|wxLEFT, 5 );
fgUpperRightGridSizer->Add( 0, 0, 1, wxEXPAND, 5 );
fgUpperRightGridSizer->Add( 0, 0, 1, wxEXPAND, 5 );
gbSizer2->Add( m_filledCtrl, wxGBPosition( 2, 0 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_thicknessLabel = new wxStaticText( this, wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_thicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
gbSizer2->Add( m_thicknessLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_thicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_thicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
gbSizer2->Add( m_thicknessCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP, 5 );
m_thicknessUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessUnits->Wrap( -1 );
fgUpperRightGridSizer->Add( m_thicknessUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
gbSizer2->Add( m_thicknessUnits, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_lineStyleLabel = new wxStaticText( this, wxID_ANY, _("Line style:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lineStyleLabel->Wrap( -1 );
gbSizer2->Add( m_lineStyleLabel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_lineStyleCombo = new wxBitmapComboBox( this, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
m_lineStyleCombo->SetMinSize( wxSize( 210,-1 ) );
gbSizer2->Add( m_lineStyleCombo, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND, 5 );
m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_LayerLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
gbSizer2->Add( m_LayerLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_LayerSelectionCtrl = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
fgUpperRightGridSizer->Add( m_LayerSelectionCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 );
gbSizer2->Add( m_LayerSelectionCtrl, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
fgUpperRightGridSizer->Add( 0, 0, 1, wxEXPAND, 5 );
gbSizer2->AddGrowableCol( 1 );
bMiddleSizer->Add( gbSizer2, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
bUpperRightSizer->Add( fgUpperRightGridSizer, 0, wxEXPAND|wxTOP, 5 );
bUpperSizer->Add( bUpperRightSizer, 0, wxEXPAND, 5 );
bUpperSizer->Add( bMiddleSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 );
@ -223,6 +218,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnClose ) );
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnInitDlg ) );
m_filledCtrl->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::onFilledCheckbox ), NULL, this );
}
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::~DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE()
@ -230,5 +226,6 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::~DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE()
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnClose ) );
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnInitDlg ) );
m_filledCtrl->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::onFilledCheckbox ), NULL, this );
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="16" />
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,7 +14,6 @@
<property name="file">dialog_graphic_item_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_GRAPHIC_ITEM_PROPERTIES_BASE</property>
@ -26,7 +25,6 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -52,7 +50,6 @@
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Graphic Item Properties</property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -75,13 +72,13 @@
<object class="sizeritem" expanded="1">
<property name="border">20</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<property name="proportion">0</property>
<object class="wxGridBagSizer" expanded="1">
<property name="empty_cell_size">5,5</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
<property name="growablerows"></property>
<property name="hgap">5</property>
<property name="hgap">3</property>
<property name="minimum_size"></property>
<property name="name">m_sizerLeft</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
@ -1911,29 +1908,31 @@
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bUpperRightSizer</property>
<property name="name">bMiddleSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">3</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">1</property>
<object class="wxGridBagSizer" expanded="1">
<property name="empty_cell_size"></property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgUpperRightGridSizer</property>
<property name="name">gbSizer2</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">3</property>
<object class="sizeritem" expanded="1">
<property name="vgap">5</property>
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -1991,10 +1990,13 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2055,10 +2057,13 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">2</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2116,10 +2121,13 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2180,30 +2188,13 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</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>
<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">wxTOP|wxLEFT</property>
<property name="proportion">0</property>
<property name="colspan">2</property>
<property name="column">0</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="row">2</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2262,32 +2253,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">onFilledCheckbox</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</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>
<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="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="row">3</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2345,10 +2320,13 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP</property>
<property name="row">3</property>
<property name="rowspan">1</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2409,10 +2387,13 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">2</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="row">3</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2470,10 +2451,145 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="row">4</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Line style:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_lineStyleLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; 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>
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND</property>
<property name="row">4</property>
<property name="rowspan">1</property>
<object class="wxBitmapComboBox" 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="choices"></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">210,-1</property>
<property name="moveable">1</property>
<property name="name">m_lineStyleCombo</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="selection">-1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxCB_READONLY</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value">Combo!</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="row">5</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2531,10 +2647,13 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="gbsizeritem" expanded="1">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="row">5</property>
<property name="rowspan">1</property>
<object class="wxBitmapComboBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -2596,16 +2715,6 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object>
</object>
</object>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -76,6 +76,8 @@ class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM
wxStaticText* m_thicknessLabel;
wxTextCtrl* m_thicknessCtrl;
wxStaticText* m_thicknessUnits;
wxStaticText* m_lineStyleLabel;
wxBitmapComboBox* m_lineStyleCombo;
wxStaticText* m_LayerLabel;
PCB_LAYER_BOX_SELECTOR* m_LayerSelectionCtrl;
wxStaticLine* m_staticline1;
@ -83,15 +85,15 @@ class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM
wxButton* m_StandardButtonsSizerOK;
wxButton* m_StandardButtonsSizerCancel;
// Virtual event handlers, override them in your derived class
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void onFilledCheckbox( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Graphic Item Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU );
~DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE();
};

View File

@ -84,7 +84,7 @@ bool DIALOG_IMPORT_SETTINGS::UpdateImportSettingsButton()
bool buttonEnableState = ( m_LayersOpt->IsChecked() || m_MaskAndPasteOpt->IsChecked()
|| m_ConstraintsOpt->IsChecked() || m_NetclassesOpt->IsChecked()
|| m_SeveritiesOpt->IsChecked() || m_TextAndGraphicsOpt->IsChecked()
|| m_TracksAndViasOpt->IsChecked() );
|| m_FormattingOpt->IsChecked() || m_TracksAndViasOpt->IsChecked() );
m_sdbSizer1OK->Enable( buttonEnableState );
@ -140,6 +140,7 @@ void DIALOG_IMPORT_SETTINGS::OnSelectAll( wxCommandEvent& event )
// Select or deselect all options based on internal flag
m_LayersOpt->SetValue( m_showSelectAllOnBtn );
m_TextAndGraphicsOpt->SetValue( m_showSelectAllOnBtn );
m_FormattingOpt->SetValue( m_showSelectAllOnBtn );
m_ConstraintsOpt->SetValue( m_showSelectAllOnBtn );
m_NetclassesOpt->SetValue( m_showSelectAllOnBtn );
m_TracksAndViasOpt->SetValue( m_showSelectAllOnBtn );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -46,39 +46,33 @@ DIALOG_IMPORT_SETTINGS_BASE::DIALOG_IMPORT_SETTINGS_BASE( wxWindow* parent, wxWi
importLabel->Wrap( -1 );
bLeftCol->Add( importLabel, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_LayersOpt = new wxCheckBox( this, wxID_ANY, _("Layers setup"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayersOpt = new wxCheckBox( this, wxID_ANY, _("Board layers and physical stackup"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_LayersOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TextAndGraphicsOpt = new wxCheckBox( this, wxID_ANY, _("Text and graphics default properties"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_TextAndGraphicsOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_ConstraintsOpt = new wxCheckBox( this, wxID_ANY, _("Design rules"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_ConstraintsOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TracksAndViasOpt = new wxCheckBox( this, wxID_ANY, _("Predefined track and via dimensions"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_TracksAndViasOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_MaskAndPasteOpt = new wxCheckBox( this, wxID_ANY, _("Solder mask/paste defaults"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_MaskAndPasteOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TextAndGraphicsOpt = new wxCheckBox( this, wxID_ANY, _("Text && graphics default properties"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_TextAndGraphicsOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_FormattingOpt = new wxCheckBox( this, wxID_ANY, _("Text && graphics formatting"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_FormattingOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_ConstraintsOpt = new wxCheckBox( this, wxID_ANY, _("Design rule constraints"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_ConstraintsOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TracksAndViasOpt = new wxCheckBox( this, wxID_ANY, _("Predefined track && via dimensions"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_TracksAndViasOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_NetclassesOpt = new wxCheckBox( this, wxID_ANY, _("Net classes"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_NetclassesOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_SeveritiesOpt = new wxCheckBox( this, wxID_ANY, _("Violation severities"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_SeveritiesOpt, 0, wxRIGHT|wxLEFT, 5 );
m_NetclassesOpt = new wxCheckBox( this, wxID_ANY, _("Net classes"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftCol->Add( m_NetclassesOpt, 0, wxALL, 5 );
bMiddleSizer->Add( bLeftCol, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
wxBoxSizer* bRightCol;
bRightCol = new wxBoxSizer( wxVERTICAL );
m_selectAllButton = new wxButton( this, wxID_ANY, _("Select All"), wxDefaultPosition, wxDefaultSize, 0 );
bRightCol->Add( m_selectAllButton, 0, wxALIGN_CENTER|wxALL, 10 );
bMiddleSizer->Add( bRightCol, 1, wxEXPAND|wxALL, 20 );
m_MainSizer->Add( bMiddleSizer, 1, wxEXPAND|wxBOTTOM, 5 );
@ -87,6 +81,9 @@ DIALOG_IMPORT_SETTINGS_BASE::DIALOG_IMPORT_SETTINGS_BASE( wxWindow* parent, wxWi
m_buttonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_selectAllButton = new wxButton( this, wxID_ANY, _("Select All"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonsSizer->Add( m_selectAllButton, 0, wxALIGN_CENTER|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 10 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
@ -109,12 +106,12 @@ DIALOG_IMPORT_SETTINGS_BASE::DIALOG_IMPORT_SETTINGS_BASE( wxWindow* parent, wxWi
// Connect Events
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnBrowseClicked ), NULL, this );
m_LayersOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_MaskAndPasteOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_TextAndGraphicsOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_ConstraintsOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_TracksAndViasOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_MaskAndPasteOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_SeveritiesOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_NetclassesOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_SeveritiesOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_selectAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnSelectAll ), NULL, this );
}
@ -123,12 +120,12 @@ DIALOG_IMPORT_SETTINGS_BASE::~DIALOG_IMPORT_SETTINGS_BASE()
// Disconnect Events
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnBrowseClicked ), NULL, this );
m_LayersOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_MaskAndPasteOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_TextAndGraphicsOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_ConstraintsOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_TracksAndViasOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_MaskAndPasteOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_SeveritiesOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_NetclassesOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_SeveritiesOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnCheckboxClicked ), NULL, this );
m_selectAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_SETTINGS_BASE::OnSelectAll ), NULL, this );
}

View File

@ -14,7 +14,6 @@
<property name="file">dialog_import_settings_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_import_settings_base</property>
@ -26,7 +25,6 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -207,7 +205,6 @@
<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>
@ -382,7 +379,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Layers setup</property>
<property name="label">Board layers and physical stackup</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -414,201 +411,6 @@
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Text and graphics default properties</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_TextAndGraphicsOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Design rules</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_ConstraintsOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Predefined track and via dimensions</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_TracksAndViasOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
@ -676,7 +478,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
@ -707,7 +509,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Violation severities</property>
<property name="label">Text &amp;&amp; graphics default properties</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -715,7 +517,72 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_SeveritiesOpt</property>
<property name="name">m_TextAndGraphicsOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Text &amp;&amp; graphics formatting</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_FormattingOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -736,12 +603,141 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Design rule constraints</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_ConstraintsOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Predefined track &amp;&amp; via dimensions</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_TracksAndViasOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
@ -804,22 +800,11 @@
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">20</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bRightCol</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">10</property>
<property name="flag">wxALIGN_CENTER|wxALL</property>
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -828,34 +813,27 @@
<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="checked">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">Select All</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="label">Violation severities</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -863,20 +841,18 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_selectAllButton</property>
<property name="name">m_SeveritiesOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -886,7 +862,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnSelectAll</event>
<event name="OnCheckBox">OnCheckboxClicked</event>
</object>
</object>
</object>
@ -960,6 +936,79 @@
<property name="name">m_buttonsSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="0">
<property name="border">10</property>
<property name="flag">wxALIGN_CENTER|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="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">Select All</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_selectAllButton</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">; 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">OnSelectAll</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -41,9 +41,9 @@ class DIALOG_IMPORT_SETTINGS_BASE : public DIALOG_SHIM
wxBoxSizer* m_MainSizer;
wxTextCtrl* m_filePathCtrl;
wxBitmapButton* m_browseButton;
wxButton* m_selectAllButton;
wxStaticLine* m_staticline1;
wxBoxSizer* m_buttonsSizer;
wxButton* m_selectAllButton;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
@ -56,12 +56,13 @@ class DIALOG_IMPORT_SETTINGS_BASE : public DIALOG_SHIM
public:
wxCheckBox* m_LayersOpt;
wxCheckBox* m_MaskAndPasteOpt;
wxCheckBox* m_TextAndGraphicsOpt;
wxCheckBox* m_FormattingOpt;
wxCheckBox* m_ConstraintsOpt;
wxCheckBox* m_TracksAndViasOpt;
wxCheckBox* m_MaskAndPasteOpt;
wxCheckBox* m_SeveritiesOpt;
wxCheckBox* m_NetclassesOpt;
wxCheckBox* m_SeveritiesOpt;
DIALOG_IMPORT_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Import Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_IMPORT_SETTINGS_BASE();

View File

@ -0,0 +1,84 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <pcb_edit_frame.h>
#include <pcb_painter.h>
#include <board.h>
#include <board_design_settings.h>
#include <panel_setup_formatting.h>
PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( wxWindow* aWindow, PCB_EDIT_FRAME* aFrame ) :
PANEL_SETUP_FORMATTING_BASE( aWindow ),
m_frame( aFrame )
{
}
bool PANEL_SETUP_FORMATTING::TransferDataToWindow()
{
const PCB_PLOT_PARAMS& settings = m_frame->GetBoard()->GetPlotOptions();
m_dashLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED,
settings.GetDashedLineDashRatio() ) );
m_gapLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED,
settings.GetDashedLineGapRatio() ) );
return true;
}
bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
{
PCB_PLOT_PARAMS settings = m_frame->GetBoard()->GetPlotOptions();
settings.SetDashedLineDashRatio( DoubleValueFromString( EDA_UNITS::UNSCALED,
m_dashLengthCtrl->GetValue() ) );
settings.SetDashedLineGapRatio( DoubleValueFromString( EDA_UNITS::UNSCALED,
m_gapLengthCtrl->GetValue() ) );
m_frame->GetBoard()->SetPlotOptions( settings );
KIGFX::PCB_VIEW* view = m_frame->GetCanvas()->GetView();
view->GetPainter()->GetSettings()->SetDashLengthRatio( settings.GetDashedLineDashRatio() );
view->GetPainter()->GetSettings()->SetGapLengthRatio( settings.GetDashedLineGapRatio() );
view->MarkDirty();
view->UpdateAllItems( KIGFX::REPAINT );
m_frame->GetCanvas()->Refresh();
return true;
}
void PANEL_SETUP_FORMATTING::ImportSettingsFrom( BOARD* aBoard )
{
const PCB_PLOT_PARAMS& importedSettings = aBoard->GetPlotOptions();
m_dashLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED,
importedSettings.GetDashedLineDashRatio() ) );
m_gapLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED,
importedSettings.GetDashedLineGapRatio() ) );
}

View File

@ -0,0 +1,45 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 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/>.
*/
#ifndef PANEL_SETUP_FORMATTING_H
#define PANEL_SETUP_FORMATTING_H
#include <widgets/unit_binder.h>
#include "panel_setup_formatting_base.h"
class PCB_EDIT_FRAME;
class BOARD;
class PANEL_SETUP_FORMATTING : public PANEL_SETUP_FORMATTING_BASE
{
public:
PANEL_SETUP_FORMATTING( wxWindow* aWindow, PCB_EDIT_FRAME* aFrame );
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
void ImportSettingsFrom( BOARD* aBoard );
private:
PCB_EDIT_FRAME* m_frame;
};
#endif //PANEL_SETUP_FORMATTING_H

View File

@ -0,0 +1,63 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "panel_setup_formatting_base.h"
///////////////////////////////////////////////////////////////////////////
PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
{
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bMargins;
bMargins = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer6;
sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Dashed Lines") ), wxVERTICAL );
wxFlexGridSizer* fgSizer41;
fgSizer41 = new wxFlexGridSizer( 0, 2, 5, 0 );
fgSizer41->SetFlexibleDirection( wxBOTH );
fgSizer41->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
dashLengthLabel = new wxStaticText( sbSizer6->GetStaticBox(), wxID_ANY, _("Dash length:"), wxDefaultPosition, wxDefaultSize, 0 );
dashLengthLabel->Wrap( -1 );
fgSizer41->Add( dashLengthLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_dashLengthCtrl = new wxTextCtrl( sbSizer6->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer41->Add( m_dashLengthCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
gapLengthLabel = new wxStaticText( sbSizer6->GetStaticBox(), wxID_ANY, _("Gap length:"), wxDefaultPosition, wxDefaultSize, 0 );
gapLengthLabel->Wrap( -1 );
fgSizer41->Add( gapLengthLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_gapLengthCtrl = new wxTextCtrl( sbSizer6->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer41->Add( m_gapLengthCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
sbSizer6->Add( fgSizer41, 0, wxEXPAND|wxBOTTOM, 5 );
m_dashedLineHelp = new wxStaticText( sbSizer6->GetStaticBox(), wxID_ANY, _("Dash and dot lengths are ratios of the line width."), wxDefaultPosition, wxDefaultSize, 0 );
m_dashedLineHelp->Wrap( -1 );
sbSizer6->Add( m_dashedLineHelp, 0, wxALL, 5 );
bMargins->Add( sbSizer6, 1, wxEXPAND|wxALL, 10 );
bMainSizer->Add( bMargins, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
}
PANEL_SETUP_FORMATTING_BASE::~PANEL_SETUP_FORMATTING_BASE()
{
}

View File

@ -0,0 +1,414 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_setup_formatting_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">PANEL_SETUP_FORMATTING_BASE</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_SETUP_FORMATTING_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass">; ; forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMargins</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|wxALL</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Dashed Lines</property>
<property name="minimum_size"></property>
<property name="name">sbSizer6</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">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer41</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">5</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Dash length:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">dashLengthLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; 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>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" 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="maxlength"></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_dashLengthCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; 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="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Gap length:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">gapLengthLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; 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>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" 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="maxlength"></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_gapLengthCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; 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="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Dash and dot lengths are ratios of the line width.</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_dashedLineHelp</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; 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>
<property name="wrap">-1</property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,47 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_SETUP_FORMATTING_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_SETUP_FORMATTING_BASE : public wxPanel
{
private:
protected:
wxStaticText* dashLengthLabel;
wxTextCtrl* m_dashLengthCtrl;
wxStaticText* gapLengthLabel;
wxTextCtrl* m_gapLengthCtrl;
wxStaticText* m_dashedLineHelp;
public:
PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_SETUP_FORMATTING_BASE();
};

View File

@ -129,7 +129,7 @@ PANEL_SETUP_MASK_AND_PASTE_BASE::PANEL_SETUP_MASK_AND_PASTE_BASE( wxWindow* pare
gbSizer1->Add( m_pasteMarginRatioUnits, wxGBPosition( 7, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
bSizer3->Add( gbSizer1, 1, wxEXPAND|wxTOP, 5 );
bSizer3->Add( gbSizer1, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_staticTextInfoPaste = new wxStaticText( this, wxID_ANY, _("Note: Solder paste clearances (absolute and relative) are added to determine the final clearance."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextInfoPaste->Wrap( -1 );

View File

@ -335,8 +335,8 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">1</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxGridBagSizer" expanded="1">
<property name="empty_cell_size"></property>
<property name="flexible_direction">wxBOTH</property>

View File

@ -167,6 +167,17 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
delete m_pcb;
m_pcb = aBoard;
if( GetBoard() && GetCanvas() )
{
RENDER_SETTINGS* rs = GetCanvas()->GetView()->GetPainter()->GetSettings();
if( rs )
{
rs->SetDashLengthRatio( GetBoard()->GetPlotOptions().GetDashedLineDashRatio() );
rs->SetGapLengthRatio( GetBoard()->GetPlotOptions().GetDashedLineGapRatio() );
}
}
wxCommandEvent e( BOARD_CHANGED );
ProcessEventLocally( e );
}

View File

@ -84,6 +84,9 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
for( unsigned int i = 0; i < arrayDim( m_sketchMode ); ++i )
m_sketchMode[i] = false;
SetDashLengthRatio( 5 );
SetGapLengthRatio( 3 );
update();
}
@ -1353,6 +1356,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
const COLOR4D& color = m_pcbSettings.GetColor( aShape, aShape->GetLayer() );
bool sketch = m_pcbSettings.m_sketchGraphics;
int thickness = getLineThickness( aShape->GetWidth() );
PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle();
if( sketch )
{
@ -1364,131 +1368,120 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
m_gal->SetFillColor( color );
m_gal->SetStrokeColor( color );
switch( aShape->GetShape() )
if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
{
case SHAPE_T::SEGMENT:
if( sketch )
switch( aShape->GetShape() )
{
m_gal->DrawSegment( aShape->GetStart(), aShape->GetEnd(), thickness );
}
else
case SHAPE_T::SEGMENT:
if( sketch )
{
m_gal->DrawSegment( aShape->GetStart(), aShape->GetEnd(), thickness );
}
else
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
m_gal->DrawSegment( aShape->GetStart(), aShape->GetEnd(), thickness );
}
break;
case SHAPE_T::RECT:
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
std::vector<wxPoint> pts = aShape->GetRectCorners();
m_gal->DrawSegment( aShape->GetStart(), aShape->GetEnd(), thickness );
}
break;
case SHAPE_T::RECT:
{
std::vector<wxPoint> pts = aShape->GetRectCorners();
if( sketch )
{
m_gal->DrawSegment( pts[0], pts[1], thickness );
m_gal->DrawSegment( pts[1], pts[2], thickness );
m_gal->DrawSegment( pts[2], pts[3], thickness );
m_gal->DrawSegment( pts[3], pts[0], thickness );
}
else
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
if( thickness > 0 )
if( sketch )
{
m_gal->DrawSegment( pts[0], pts[1], thickness );
m_gal->DrawSegment( pts[1], pts[2], thickness );
m_gal->DrawSegment( pts[2], pts[3], thickness );
m_gal->DrawSegment( pts[3], pts[0], thickness );
}
if( aShape->IsFilled() )
else
{
SHAPE_POLY_SET poly;
poly.NewOutline();
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
for( const wxPoint& pt : pts )
poly.Append( pt );
if( thickness > 0 )
{
m_gal->DrawSegment( pts[0], pts[1], thickness );
m_gal->DrawSegment( pts[1], pts[2], thickness );
m_gal->DrawSegment( pts[2], pts[3], thickness );
m_gal->DrawSegment( pts[3], pts[0], thickness );
}
m_gal->DrawPolygon( poly );
if( aShape->IsFilled() )
{
SHAPE_POLY_SET poly;
poly.NewOutline();
for( const wxPoint& pt : pts )
poly.Append( pt );
m_gal->DrawPolygon( poly );
}
}
break;
}
break;
}
case SHAPE_T::ARC:
{
double startAngle;
double endAngle;
aShape->CalcArcAngles( startAngle, endAngle );
if( sketch )
case SHAPE_T::ARC:
{
m_gal->DrawArcSegment( aShape->GetCenter(), aShape->GetRadius(),
DEG2RAD( startAngle ), DEG2RAD( endAngle ), thickness,
m_maxError );
double startAngle;
double endAngle;
aShape->CalcArcAngles( startAngle, endAngle );
if( sketch )
{
m_gal->DrawArcSegment( aShape->GetCenter(), aShape->GetRadius(),
DEG2RAD( startAngle ), DEG2RAD( endAngle ), thickness,
m_maxError );
}
else
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
m_gal->DrawArcSegment( aShape->GetCenter(), aShape->GetRadius(),
DEG2RAD( startAngle ), DEG2RAD( endAngle ), thickness,
m_maxError );
}
break;
}
else
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
m_gal->DrawArcSegment( aShape->GetCenter(), aShape->GetRadius(),
DEG2RAD( startAngle ), DEG2RAD( endAngle ), thickness,
m_maxError );
}
break;
}
case SHAPE_T::CIRCLE:
if( sketch )
{
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() - thickness / 2 );
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() + thickness / 2 );
}
else
{
m_gal->SetIsFill( aShape->IsFilled() );
m_gal->SetIsStroke( thickness > 0 );
m_gal->SetLineWidth( thickness );
case SHAPE_T::CIRCLE:
if( sketch )
{
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() - thickness / 2 );
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() + thickness / 2 );
}
else
{
m_gal->SetIsFill( aShape->IsFilled() );
m_gal->SetIsStroke( thickness > 0 );
m_gal->SetLineWidth( thickness );
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() );
}
break;
case SHAPE_T::POLY:
{
SHAPE_POLY_SET& shape = const_cast<PCB_SHAPE*>( aShape )->GetPolyShape();
const FOOTPRINT* parentFootprint = aShape->GetParentFootprint();
if( shape.OutlineCount() == 0 )
m_gal->DrawCircle( aShape->GetStart(), aShape->GetRadius() );
}
break;
if( parentFootprint )
case SHAPE_T::POLY:
{
m_gal->Save();
m_gal->Translate( parentFootprint->GetPosition() );
m_gal->Rotate( -parentFootprint->GetOrientationRadians() );
}
SHAPE_POLY_SET& shape = const_cast<PCB_SHAPE*>( aShape )->GetPolyShape();
const FOOTPRINT* parentFootprint = aShape->GetParentFootprint();
if( sketch )
{
for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
if( shape.OutlineCount() == 0 )
break;
if( parentFootprint )
{
SEG seg = shape.Outline( 0 ).Segment( ii );
m_gal->DrawSegment( seg.A, seg.B, thickness );
m_gal->Save();
m_gal->Translate( parentFootprint->GetPosition() );
m_gal->Rotate( -parentFootprint->GetOrientationRadians() );
}
}
else
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
if( thickness > 0 )
if( sketch )
{
for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
{
@ -1496,61 +1489,97 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer )
m_gal->DrawSegment( seg.A, seg.B, thickness );
}
}
if( aShape->IsFilled() )
else
{
// On Opengl, a not convex filled polygon is usually drawn by using triangles
// as primitives. CacheTriangulation() can create basic triangle primitives to
// draw the polygon solid shape on Opengl. GLU tessellation is much slower, so
// currently we are using our tessellation.
if( m_gal->IsOpenGlEngine() && !shape.IsTriangulationUpToDate() )
shape.CacheTriangulation();
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
m_gal->DrawPolygon( shape );
if( thickness > 0 )
{
for( int ii = 0; ii < shape.Outline( 0 ).SegmentCount(); ++ii )
{
SEG seg = shape.Outline( 0 ).Segment( ii );
m_gal->DrawSegment( seg.A, seg.B, thickness );
}
}
if( aShape->IsFilled() )
{
// On Opengl, a not convex filled polygon is usually drawn by using triangles
// as primitives. CacheTriangulation() can create basic triangle primitives to
// draw the polygon solid shape on Opengl. GLU tessellation is much slower,
// so currently we are using our tessellation.
if( m_gal->IsOpenGlEngine() && !shape.IsTriangulationUpToDate() )
shape.CacheTriangulation();
m_gal->DrawPolygon( shape );
}
}
if( parentFootprint )
m_gal->Restore();
break;
}
if( parentFootprint )
m_gal->Restore();
case SHAPE_T::BEZIER:
if( sketch )
{
std::vector<VECTOR2D> output;
std::vector<VECTOR2D> pointCtrl;
break;
}
pointCtrl.push_back( aShape->GetStart() );
pointCtrl.push_back( aShape->GetBezierC1() );
pointCtrl.push_back( aShape->GetBezierC2() );
pointCtrl.push_back( aShape->GetEnd() );
case SHAPE_T::BEZIER:
if( sketch )
{
std::vector<VECTOR2D> output;
std::vector<VECTOR2D> pointCtrl;
BEZIER_POLY converter( pointCtrl );
converter.GetPoly( output, thickness );
pointCtrl.push_back( aShape->GetStart() );
pointCtrl.push_back( aShape->GetBezierC1() );
pointCtrl.push_back( aShape->GetBezierC2() );
pointCtrl.push_back( aShape->GetEnd() );
BEZIER_POLY converter( pointCtrl );
converter.GetPoly( output, thickness );
for( unsigned ii = 0; ii + 1 < output.size(); ++ii )
m_gal->DrawSegment( output[ii], output[ii+1], thickness );
}
else
{
for( unsigned ii = 0; ii + 1 < output.size(); ++ii )
m_gal->DrawSegment( output[ii], output[ii+1], thickness );
}
else
{
m_gal->SetIsFill( aShape->IsFilled() );
m_gal->SetIsStroke( thickness > 0 );
m_gal->SetLineWidth( thickness );
// Use thickness as filter value to convert the curve to polyline when the curve
// is not supported
m_gal->DrawCurve( VECTOR2D( aShape->GetStart() ),
VECTOR2D( aShape->GetBezierC1() ),
VECTOR2D( aShape->GetBezierC2() ),
VECTOR2D( aShape->GetEnd() ), thickness );
// Use thickness as filter value to convert the curve to polyline when the curve
// is not supported
m_gal->DrawCurve( VECTOR2D( aShape->GetStart() ),
VECTOR2D( aShape->GetBezierC1() ),
VECTOR2D( aShape->GetBezierC2() ),
VECTOR2D( aShape->GetEnd() ), thickness );
}
break;
case SHAPE_T::LAST:
break;
}
}
else
{
if( !sketch )
{
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
}
break;
std::vector<SHAPE*> shapes = aShape->MakeEffectiveShapes( true );
case SHAPE_T::LAST:
break;
for( SHAPE* shape : shapes )
{
STROKE_PARAMS::Stroke( shape, lineStyle, thickness, &m_pcbSettings,
[&]( const wxPoint& a, const wxPoint& b )
{
m_gal->DrawSegment( a, b, thickness );
} );
}
for( SHAPE* shape : shapes )
delete shape;
}
}

View File

@ -96,6 +96,8 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
m_includeGerberNetlistInfo = true;
m_createGerberJobFile = true;
m_gerberPrecision = gbrDefaultPrecision;
m_dashedLineDashRatio = 5.0;
m_dashedLineGapRatio = 3.0;
// we used 0.1mils for SVG step before, but nm precision is more accurate, so we use nm
m_svgPrecision = SVG_PRECISION_DEFAULT;
@ -166,91 +168,79 @@ void PCB_PLOT_PARAMS::SetSvgPrecision( unsigned aPrecision, bool aUseInch )
void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
int aNestLevel, int aControl ) const
{
const char* falseStr = getTokenName( T_false );
const char* trueStr = getTokenName( T_true );
auto printBool =
[]( bool aBool ) -> const char*
{
return aBool ? "true" : "false";
};
aFormatter->Print( aNestLevel, "(%s\n", getTokenName( T_pcbplotparams ) );
aFormatter->Print( aNestLevel, "(pcbplotparams\n" );
aFormatter->Print( aNestLevel+1, "(%s 0x%s)\n", getTokenName( T_layerselection ),
aFormatter->Print( aNestLevel+1, "(layerselection 0x%s)\n",
m_layerSelection.FmtHex().c_str() );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_disableapertmacros ),
m_gerberDisableApertMacros ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(disableapertmacros %s)\n",
printBool( m_gerberDisableApertMacros ) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberextensions ),
m_useGerberProtelExtensions ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(usegerberextensions %s)\n",
printBool( m_useGerberProtelExtensions) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberattributes ),
GetUseGerberX2format() ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(usegerberattributes %s)\n",
printBool( GetUseGerberX2format()) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_usegerberadvancedattributes ),
GetIncludeGerberNetlistInfo() ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(usegerberadvancedattributes %s)\n",
printBool( GetIncludeGerberNetlistInfo()) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_creategerberjobfile ),
GetCreateGerberJobFile() ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(creategerberjobfile %s)\n",
printBool( GetCreateGerberJobFile()) );
// save this option only if it is not the default value,
// to avoid incompatibility with older Pcbnew version
if( m_gerberPrecision != gbrDefaultPrecision )
aFormatter->Print( aNestLevel+1, "(%s %d)\n",
getTokenName( T_gerberprecision ), m_gerberPrecision );
aFormatter->Print( aNestLevel+1, "(gerberprecision %d)\n", m_gerberPrecision );
aFormatter->Print( aNestLevel+1, "(dashed_line_dash_ratio %f)\n", GetDashedLineDashRatio() );
aFormatter->Print( aNestLevel+1, "(dashed_line_gap_ratio %f)\n", GetDashedLineGapRatio() );
// SVG options
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_svguseinch ),
m_svgUseInch ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_svgprecision ),
m_svgPrecision );
aFormatter->Print( aNestLevel+1, "(svguseinch %s)\n", printBool( m_svgUseInch ) );
aFormatter->Print( aNestLevel+1, "(svgprecision %d)\n", m_svgPrecision );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_excludeedgelayer ),
m_excludeEdgeLayer ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotframeref ),
m_plotFrameRef ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_viasonmask ),
m_plotViaOnMaskLayer ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_mode ),
GetPlotMode() == SKETCH ? 2 : 1 ); // Value 0 (LINE mode) no more used
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_useauxorigin ),
m_useAuxOrigin ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(excludeedgelayer %s)\n", printBool( m_excludeEdgeLayer ) );
aFormatter->Print( aNestLevel+1, "(plotframeref %s)\n", printBool( m_plotFrameRef ) );
aFormatter->Print( aNestLevel+1, "(viasonmask %s)\n", printBool( m_plotViaOnMaskLayer ) );
aFormatter->Print( aNestLevel+1, "(mode %d)\n", GetPlotMode() == SKETCH ? 2 : 1 );
aFormatter->Print( aNestLevel+1, "(useauxorigin %s)\n", printBool( m_useAuxOrigin ) );
// HPGL options
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpennumber ),
m_HPGLPenNum );
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
m_HPGLPenSpeed );
aFormatter->Print( aNestLevel+1, "(%s %f)\n", getTokenName( T_hpglpendiameter ),
m_HPGLPenDiam );
aFormatter->Print( aNestLevel+1, "(hpglpennumber %d)\n", m_HPGLPenNum );
aFormatter->Print( aNestLevel+1, "(hpglpenspeed %d)\n", m_HPGLPenSpeed );
aFormatter->Print( aNestLevel+1, "(hpglpendiameter %f)\n", m_HPGLPenDiam );
// DXF options
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfpolygonmode ),
m_DXFplotPolygonMode ? trueStr : falseStr );
printBool( m_DXFplotPolygonMode ) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfimperialunits ),
m_DXFplotUnits == DXF_UNITS::INCHES ? trueStr : falseStr );
printBool( m_DXFplotUnits == DXF_UNITS::INCHES ) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_dxfusepcbnewfont ),
m_textMode == PLOT_TEXT_MODE::NATIVE ? falseStr : trueStr );
printBool( m_textMode != PLOT_TEXT_MODE::NATIVE ) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psnegative ),
m_negative ? trueStr : falseStr );
printBool( m_negative ) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_psa4output ),
m_A4Output ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotreference ),
m_plotReference ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotvalue ),
m_plotValue ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ),
m_plotInvisibleText ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_sketchpadsonfab ),
m_sketchPadsOnFabLayers ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ),
m_subtractMaskFromSilk ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ),
static_cast<int>( m_format ) );
aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_mirror ),
m_mirror ? trueStr : falseStr );
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_drillshape ),
m_drillMarks );
aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_scaleselection ),
m_scaleSelection );
aFormatter->Print( aNestLevel+1, "(%s \"%s\")", getTokenName( T_outputdirectory ),
printBool( m_A4Output ) );
aFormatter->Print( aNestLevel+1, "(plotreference %s)\n", printBool( m_plotReference ) );
aFormatter->Print( aNestLevel+1, "(plotvalue %s)\n", printBool( m_plotValue ) );
aFormatter->Print( aNestLevel+1, "(plotinvisibletext %s)\n", printBool( m_plotInvisibleText ) );
aFormatter->Print( aNestLevel+1, "(sketchpadsonfab %s)\n",
printBool( m_sketchPadsOnFabLayers ) );
aFormatter->Print( aNestLevel+1, "(subtractmaskfromsilk %s)\n",
printBool( m_subtractMaskFromSilk ) );
aFormatter->Print( aNestLevel+1, "(outputformat %d)\n", static_cast<int>( m_format ) );
aFormatter->Print( aNestLevel+1, "(mirror %s)\n", printBool( m_mirror ) );
aFormatter->Print( aNestLevel+1, "(drillshape %d)\n", m_drillMarks );
aFormatter->Print( aNestLevel+1, "(scaleselection %d)\n", m_scaleSelection );
aFormatter->Print( aNestLevel+1, "(outputdirectory \"%s\")",
(const char*) m_outputDirectory.utf8_str() );
aFormatter->Print( 0, "\n" );
aFormatter->Print( aNestLevel, ")\n" );
@ -286,6 +276,12 @@ bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
if( m_gerberPrecision != aPcbPlotParams.m_gerberPrecision )
return false;
if( m_dashedLineDashRatio != aPcbPlotParams.m_dashedLineDashRatio )
return false;
if( m_dashedLineGapRatio != aPcbPlotParams.m_dashedLineGapRatio )
return false;
if( m_excludeEdgeLayer != aPcbPlotParams.m_excludeEdgeLayer )
return false;
@ -475,6 +471,14 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams )
gbrDefaultPrecision);
break;
case T_dashed_line_dash_ratio:
aPcbPlotParams->m_dashedLineDashRatio = parseDouble();
break;
case T_dashed_line_gap_ratio:
aPcbPlotParams->m_dashedLineGapRatio = parseDouble();
break;
case T_svgprecision:
aPcbPlotParams->m_svgPrecision = parseInt( SVG_PRECISION_MIN, SVG_PRECISION_MAX );
break;

View File

@ -195,6 +195,12 @@ public:
void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; }
int GetHPGLPenNum() const { return m_HPGLPenNum; }
void SetDashedLineDashRatio( double aVal ) { m_dashedLineDashRatio = aVal; }
double GetDashedLineDashRatio() const { return m_dashedLineDashRatio; }
void SetDashedLineGapRatio( double aVal ) { m_dashedLineGapRatio = aVal; }
double GetDashedLineGapRatio() const { return m_dashedLineGapRatio; }
private:
friend class PCB_PLOT_PARAMS_PARSER;
@ -337,6 +343,9 @@ private:
double m_HPGLPenDiam; ///< HPGL only: pen diameter in MILS, useful to fill areas
///< However, it is in mm in hpgl files.
double m_dashedLineDashRatio;
double m_dashedLineGapRatio;
/// Pointer to active color settings to be used for plotting
COLOR_SETTINGS* m_colors;

View File

@ -253,18 +253,5 @@ static struct PCB_SHAPE_DESC
propMgr.AddTypeCast( new TYPE_CAST<PCB_SHAPE, EDA_SHAPE> );
propMgr.InheritsAfter( TYPE_HASH( PCB_SHAPE ), TYPE_HASH( BOARD_ITEM ) );
propMgr.InheritsAfter( TYPE_HASH( PCB_SHAPE ), TYPE_HASH( EDA_SHAPE ) );
// JEY TODO:
//propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Thickness" ),
// &EDA_SHAPE::SetWidth, &EDA_SHAPE::GetWidth, PROPERTY_DISPLAY::DISTANCE ) );
// TODO show certain properties depending on the shape
//propMgr.AddProperty( new PROPERTY<PCB_SHAPE, double>( _HKI( "Angle" ),
// &PCB_SHAPE::SetArcAngle, &PCB_SHAPE::GetAngle, PROPERTY_DISPLAY::DECIDEGREE ) );
// TODO or may have different names (arcs)
// TODO type?
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "End X" ),
&EDA_SHAPE::SetEndX, &EDA_SHAPE::GetEndX, PROPERTY_DISPLAY::DISTANCE ) );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "End Y" ),
&EDA_SHAPE::SetEndY, &EDA_SHAPE::GetEndY, PROPERTY_DISPLAY::DISTANCE ) );
}
} _PCB_SHAPE_DESC;

View File

@ -566,139 +566,160 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( const FP_SHAPE* aShape )
gbr_metadata.SetCopper( true );
}
int radius; // Circle/arc radius.
int radius; // Circle/arc radius.
PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle();
switch( aShape->GetShape() )
if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
{
case SHAPE_T::SEGMENT:
m_plotter->ThickSegment( aShape->GetStart(), aShape->GetEnd(), thickness, GetPlotMode(),
&gbr_metadata );
break;
case SHAPE_T::RECT:
{
std::vector<wxPoint> pts = aShape->GetRectCorners();
if( sketch || thickness > 0 )
switch( aShape->GetShape() )
{
m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
}
if( !sketch && aShape->IsFilled() )
{
SHAPE_LINE_CHAIN poly;
for( const wxPoint& pt : pts )
poly.Append( pt );
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, -1, &gbr_metadata );
}
}
break;
case SHAPE_T::CIRCLE:
radius = KiROUND( GetLineLength( aShape->GetStart(), aShape->GetEnd() ) );
if( aShape->IsFilled() )
{
m_plotter->FilledCircle( aShape->GetStart(), radius * 2 + thickness, GetPlotMode(),
case SHAPE_T::SEGMENT:
m_plotter->ThickSegment( aShape->GetStart(), aShape->GetEnd(), thickness, GetPlotMode(),
&gbr_metadata );
}
else
break;
case SHAPE_T::RECT:
{
m_plotter->ThickCircle( aShape->GetStart(), radius * 2, thickness, GetPlotMode(),
&gbr_metadata );
}
break;
case SHAPE_T::ARC:
{
radius = KiROUND( GetLineLength( aShape->GetCenter(), aShape->GetStart() ) );
double startAngle = ArcTangente( aShape->GetStart().y - aShape->GetCenter().y,
aShape->GetStart().x - aShape->GetCenter().x );
double endAngle = startAngle + aShape->GetArcAngle();
// when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
if( std::abs( aShape->GetArcAngle() ) == 3600.0 )
{
m_plotter->ThickCircle( aShape->GetCenter(), radius * 2, thickness, GetPlotMode(),
&gbr_metadata );
}
else
{
m_plotter->ThickArc( aShape->GetCenter(), -endAngle, -startAngle, radius, thickness,
GetPlotMode(), &gbr_metadata );
}
}
break;
case SHAPE_T::POLY:
if( aShape->IsPolyShapeValid() )
{
std::vector<wxPoint> cornerList;
aShape->DupPolyPointsList( cornerList );
// We must compute board coordinates from m_PolyList which are relative to the parent
// position at orientation 0
const FOOTPRINT *parentFootprint = aShape->GetParentFootprint();
if( parentFootprint )
{
for( unsigned ii = 0; ii < cornerList.size(); ++ii )
{
wxPoint* corner = &cornerList[ii];
RotatePoint( corner, parentFootprint->GetOrientation() );
*corner += parentFootprint->GetPosition();
}
}
std::vector<wxPoint> pts = aShape->GetRectCorners();
if( sketch || thickness > 0 )
{
for( size_t i = 1; i < cornerList.size(); i++ )
{
m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
GetPlotMode(), &gbr_metadata );
}
m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
}
if( !sketch && aShape->IsFilled() )
{
// This must be simplified and fractured to prevent overlapping polygons
// from generating invalid Gerber files
SHAPE_LINE_CHAIN poly;
SHAPE_LINE_CHAIN line( cornerList );
SHAPE_POLY_SET tmpPoly;
for( const wxPoint& pt : pts )
poly.Append( pt );
line.SetClosed( true );
tmpPoly.AddOutline( line );
tmpPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
{
SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, thickness, &gbr_metadata );
}
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, -1, &gbr_metadata );
}
}
break;
break;
case SHAPE_T::CIRCLE:
radius = KiROUND( GetLineLength( aShape->GetStart(), aShape->GetEnd() ) );
case SHAPE_T::BEZIER:
m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezierC1(),
aShape->GetBezierC2(), aShape->GetEnd(), 0, thickness );
break;
if( aShape->IsFilled() )
{
m_plotter->FilledCircle( aShape->GetStart(), radius * 2 + thickness, GetPlotMode(),
&gbr_metadata );
}
else
{
m_plotter->ThickCircle( aShape->GetStart(), radius * 2, thickness, GetPlotMode(),
&gbr_metadata );
}
default:
wxASSERT_MSG( false, "Unhandled FP_SHAPE shape" );
break;
break;
case SHAPE_T::ARC:
{
radius = KiROUND( GetLineLength( aShape->GetCenter(), aShape->GetStart() ) );
double startAngle = ArcTangente( aShape->GetStart().y - aShape->GetCenter().y,
aShape->GetStart().x - aShape->GetCenter().x );
double endAngle = startAngle + aShape->GetArcAngle();
// when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
if( std::abs( aShape->GetArcAngle() ) == 3600.0 )
{
m_plotter->ThickCircle( aShape->GetCenter(), radius * 2, thickness, GetPlotMode(),
&gbr_metadata );
}
else
{
m_plotter->ThickArc( aShape->GetCenter(), -endAngle, -startAngle, radius, thickness,
GetPlotMode(), &gbr_metadata );
}
}
break;
case SHAPE_T::POLY:
if( aShape->IsPolyShapeValid() )
{
std::vector<wxPoint> cornerList;
aShape->DupPolyPointsList( cornerList );
// We must compute board coordinates from m_PolyList which are relative to the parent
// position at orientation 0
const FOOTPRINT *parentFootprint = aShape->GetParentFootprint();
if( parentFootprint )
{
for( unsigned ii = 0; ii < cornerList.size(); ++ii )
{
wxPoint* corner = &cornerList[ii];
RotatePoint( corner, parentFootprint->GetOrientation() );
*corner += parentFootprint->GetPosition();
}
}
if( sketch || thickness > 0 )
{
for( size_t i = 1; i < cornerList.size(); i++ )
{
m_plotter->ThickSegment( cornerList[i - 1], cornerList[i], thickness,
GetPlotMode(), &gbr_metadata );
}
m_plotter->ThickSegment( cornerList.back(), cornerList.front(), thickness,
GetPlotMode(), &gbr_metadata );
}
if( !sketch && aShape->IsFilled() )
{
// This must be simplified and fractured to prevent overlapping polygons
// from generating invalid Gerber files
SHAPE_LINE_CHAIN line( cornerList );
SHAPE_POLY_SET tmpPoly;
line.SetClosed( true );
tmpPoly.AddOutline( line );
tmpPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
{
SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj );
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, thickness, &gbr_metadata );
}
}
}
break;
case SHAPE_T::BEZIER:
m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezierC1(),
aShape->GetBezierC2(), aShape->GetEnd(), 0, thickness );
break;
default:
wxASSERT_MSG( false, "Unhandled FP_SHAPE shape" );
break;
}
}
else
{
std::vector<SHAPE*> shapes = aShape->MakeEffectiveShapes( true );
for( SHAPE* shape : shapes )
{
STROKE_PARAMS::Stroke( shape, lineStyle, thickness, m_plotter->RenderSettings(),
[&]( const wxPoint& a, const wxPoint& b )
{
m_plotter->ThickSegment( a, b, thickness, GetPlotMode(),
&gbr_metadata );
} );
}
for( SHAPE* shape : shapes )
delete shape;
}
}
@ -876,8 +897,9 @@ void BRDITEMS_PLOTTER::PlotPcbShape( const PCB_SHAPE* aShape )
if( !m_layerMask[aShape->GetLayer()] )
return;
bool sketch = GetPlotMode() == SKETCH;
int thickness = aShape->GetWidth();
bool sketch = GetPlotMode() == SKETCH;
int thickness = aShape->GetWidth();
PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle();
m_plotter->SetColor( getColor( aShape->GetLayer() ) );
@ -892,113 +914,135 @@ void BRDITEMS_PLOTTER::PlotPcbShape( const PCB_SHAPE* aShape )
// supported in Pcbnew
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
switch( aShape->GetShape() )
if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
{
case SHAPE_T::SEGMENT:
m_plotter->ThickSegment( aShape->GetStart(), aShape->GetEnd(), thickness, GetPlotMode(),
&gbr_metadata );
break;
switch( aShape->GetShape() )
{
case SHAPE_T::SEGMENT:
m_plotter->ThickSegment( aShape->GetStart(), aShape->GetEnd(), thickness, GetPlotMode(),
&gbr_metadata );
break;
case SHAPE_T::CIRCLE:
if( aShape->IsFilled() )
case SHAPE_T::CIRCLE:
if( aShape->IsFilled() )
{
m_plotter->FilledCircle( aShape->GetStart(), aShape->GetRadius() * 2 + thickness,
GetPlotMode(), &gbr_metadata );
}
else
{
m_plotter->ThickCircle( aShape->GetStart(), aShape->GetRadius() * 2, thickness,
GetPlotMode(), &gbr_metadata );
}
break;
case SHAPE_T::ARC:
{
m_plotter->FilledCircle( aShape->GetStart(), aShape->GetRadius() * 2 + thickness,
GetPlotMode(), &gbr_metadata );
}
else
{
m_plotter->ThickCircle( aShape->GetStart(), aShape->GetRadius() * 2, thickness,
GetPlotMode(), &gbr_metadata );
double startAngle = ArcTangente( aShape->GetStart().y - aShape->GetCenter().y,
aShape->GetStart().x - aShape->GetCenter().x );
double endAngle = startAngle + aShape->GetArcAngle();
// when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
if( std::abs( aShape->GetArcAngle() ) == 3600.0 )
{
m_plotter->ThickCircle( aShape->GetCenter(), aShape->GetRadius() * 2, thickness,
GetPlotMode(), &gbr_metadata );
}
else
{
m_plotter->ThickArc( aShape->GetCenter(), -endAngle, -startAngle,
aShape->GetRadius(), thickness, GetPlotMode(), &gbr_metadata );
}
break;
}
break;
case SHAPE_T::BEZIER:
m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezierC1(),
aShape->GetBezierC2(), aShape->GetEnd(), 0, thickness );
break;
case SHAPE_T::ARC:
{
double startAngle = ArcTangente( aShape->GetStart().y - aShape->GetCenter().y,
aShape->GetStart().x - aShape->GetCenter().x );
double endAngle = startAngle + aShape->GetArcAngle();
case SHAPE_T::POLY:
if( aShape->IsPolyShapeValid() )
{
if( sketch || thickness > 0 )
{
for( auto it = aShape->GetPolyShape().CIterateSegments( 0 ); it; it++ )
{
auto seg = it.Get();
m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
thickness, GetPlotMode(), &gbr_metadata );
}
}
// when startAngle == endAngle ThickArc() doesn't know whether it's 0 deg and 360 deg
if( std::abs( aShape->GetArcAngle() ) == 3600.0 )
if( !sketch && aShape->IsFilled() )
{
m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
// Draw the polygon: only one polygon is expected
// However we provide a multi polygon shape drawing
// ( for the future or to show a non expected shape )
// This must be simplified and fractured to prevent overlapping polygons
// from generating invalid Gerber files
auto tmpPoly = SHAPE_POLY_SET( aShape->GetPolyShape() );
tmpPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
{
SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, thickness, &gbr_metadata );
}
}
}
break;
case SHAPE_T::RECT:
{
m_plotter->ThickCircle( aShape->GetCenter(), aShape->GetRadius() * 2, thickness,
GetPlotMode(), &gbr_metadata );
}
else
{
m_plotter->ThickArc( aShape->GetCenter(), -endAngle, -startAngle, aShape->GetRadius(),
thickness, GetPlotMode(), &gbr_metadata );
}
}
break;
std::vector<wxPoint> pts = aShape->GetRectCorners();
case SHAPE_T::BEZIER:
m_plotter->BezierCurve( aShape->GetStart(), aShape->GetBezierC1(),
aShape->GetBezierC2(), aShape->GetEnd(), 0, thickness );
break;
case SHAPE_T::POLY:
if( aShape->IsPolyShapeValid() )
{
if( sketch || thickness > 0 )
{
for( auto it = aShape->GetPolyShape().CIterateSegments( 0 ); it; it++ )
{
auto seg = it.Get();
m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ),
thickness, GetPlotMode(), &gbr_metadata );
}
m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
}
if( !sketch && aShape->IsFilled() )
{
m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
SHAPE_LINE_CHAIN poly;
// Draw the polygon: only one polygon is expected
// However we provide a multi polygon shape drawing
// ( for the future or to show a non expected shape )
// This must be simplified and fractured to prevent overlapping polygons
// from generating invalid Gerber files
auto tmpPoly = SHAPE_POLY_SET( aShape->GetPolyShape() );
tmpPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
for( const wxPoint& pt : pts )
poly.Append( pt );
for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj )
{
SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj );
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, thickness, &gbr_metadata );
}
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, -1, &gbr_metadata );
}
}
break;
case SHAPE_T::RECT:
{
std::vector<wxPoint> pts = aShape->GetRectCorners();
if( sketch || thickness > 0 )
{
m_plotter->ThickSegment( pts[0], pts[1], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[1], pts[2], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[2], pts[3], thickness, GetPlotMode(), &gbr_metadata );
m_plotter->ThickSegment( pts[3], pts[0], thickness, GetPlotMode(), &gbr_metadata );
break;
}
if( !sketch && aShape->IsFilled() )
{
SHAPE_LINE_CHAIN poly;
for( const wxPoint& pt : pts )
poly.Append( pt );
m_plotter->PlotPoly( poly, FILL_T::FILLED_SHAPE, -1, &gbr_metadata );
default:
UNIMPLEMENTED_FOR( aShape->SHAPE_T_asString() );
}
break;
}
else
{
std::vector<SHAPE*> shapes = aShape->MakeEffectiveShapes( true );
default:
UNIMPLEMENTED_FOR( aShape->SHAPE_T_asString() );
for( SHAPE* shape : shapes )
{
STROKE_PARAMS::Stroke( shape, lineStyle, thickness, m_plotter->RenderSettings(),
[&]( const wxPoint& a, const wxPoint& b )
{
m_plotter->ThickSegment( a, b, thickness, GetPlotMode(),
&gbr_metadata );
} );
}
for( SHAPE* shape : shapes )
delete shape;
}
}

View File

@ -114,7 +114,7 @@ void PCB_PARSER::checkpoint()
if( m_progressReporter )
{
TIME_PT curTime = CLOCK::now();
unsigned curLine = m_lineReader->LineNumber();
unsigned curLine = reader->LineNumber();
auto delta = std::chrono::duration_cast<TIMEOUT>( curTime - m_lastProgressTime );
if( delta > std::chrono::milliseconds( 100 ) )
@ -2639,11 +2639,21 @@ PCB_SHAPE* PCB_PARSER::parsePCB_SHAPE()
NeedRIGHT();
break;
case T_width:
case T_width: // legacy token
stroke.SetWidth( parseBoardUnits( T_width ) );
NeedRIGHT();
break;
case T_stroke:
{
STROKE_PARAMS_PARSER strokeParser( reader, IU_PER_MM );
strokeParser.SyncLineReaderWith( *this );
strokeParser.ParseStroke( stroke );
SyncLineReaderWith( strokeParser );
break;
}
case T_tstamp:
NextTok();
const_cast<KIID&>( shape->m_Uuid ) = CurStrToKIID();
@ -3936,11 +3946,21 @@ FP_SHAPE* PCB_PARSER::parseFP_SHAPE()
NeedRIGHT();
break;
case T_width:
case T_width: // legacy token
stroke.SetWidth( parseBoardUnits( T_width ) );
NeedRIGHT();
break;
case T_stroke:
{
STROKE_PARAMS_PARSER strokeParser( reader, IU_PER_MM );
strokeParser.SyncLineReaderWith( *this );
strokeParser.ParseStroke( stroke );
SyncLineReaderWith( strokeParser );
break;
}
case T_tstamp:
NextTok();
const_cast<KIID&>( shape->m_Uuid ) = CurStrToKIID();

View File

@ -77,7 +77,6 @@ public:
m_board( nullptr ),
m_resetKIIDs( false ),
m_progressReporter( nullptr ),
m_lineReader( nullptr ),
m_lastProgressTime( std::chrono::steady_clock::now() ),
m_lineCount( 0 )
{
@ -108,11 +107,9 @@ public:
m_resetKIIDs = true;
}
void SetProgressReporter( PROGRESS_REPORTER* aProgressReporter, const LINE_READER* aLineReader,
unsigned aLineCount )
void SetProgressReporter( PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount )
{
m_progressReporter = aProgressReporter;
m_lineReader = aLineReader;
m_lastProgressTime = std::chrono::steady_clock::now();
m_lineCount = aLineCount;
}
@ -389,7 +386,6 @@ private:
bool m_showLegacyZoneWarning;
PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr
const LINE_READER* m_lineReader; ///< for progress reporting
TIME_PT m_lastProgressTime; ///< for progress reporting
unsigned m_lineCount; ///< for progress reporting

View File

@ -925,9 +925,9 @@ void PCB_PLUGIN::format( const PCB_SHAPE* aShape, int aNestLevel ) const
return;
};
formatLayer( aShape );
m_out->Print( 0, "\n" );
m_out->Print( 0, " (width %s)", FormatInternalUnits( aShape->GetWidth() ).c_str() );
aShape->GetStroke().Format( m_out, aNestLevel + 1 );
// The filled flag represents if a solid fill is present on circles, rectangles and polygons
if( ( aShape->GetShape() == SHAPE_T::POLY )
@ -940,6 +940,8 @@ void PCB_PLUGIN::format( const PCB_SHAPE* aShape, int aNestLevel ) const
m_out->Print( 0, " (fill none)" );
}
formatLayer( aShape );
m_out->Print( 0, " (tstamp %s)", TO_UTF8( aShape->m_Uuid.AsString() ) );
m_out->Print( 0, ")\n" );
@ -1058,9 +1060,9 @@ void PCB_PLUGIN::format( const FP_SHAPE* aFPShape, int aNestLevel ) const
return;
};
formatLayer( aFPShape );
m_out->Print( 0, "\n" );
m_out->Print( 0, " (width %s)", FormatInternalUnits( aFPShape->GetWidth() ).c_str() );
aFPShape->GetStroke().Format( m_out, aNestLevel + 1 );
// The filled flag represents if a solid fill is present on circles, rectangles and polygons
if( ( aFPShape->GetShape() == SHAPE_T::POLY )
@ -1073,6 +1075,8 @@ void PCB_PLUGIN::format( const FP_SHAPE* aFPShape, int aNestLevel ) const
m_out->Print( 0, " (fill none)" );
}
formatLayer( aFPShape );
m_out->Print( 0, " (tstamp %s)", TO_UTF8( aFPShape->m_Uuid.AsString() ) );
m_out->Print( 0, ")\n" );
@ -2334,7 +2338,7 @@ BOARD* PCB_PLUGIN::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const PROPE
m_parser->SetLineReader( &aReader );
m_parser->SetBoard( aAppendToMe );
m_parser->SetProgressReporter( aProgressReporter, &aReader, aLineCount );
m_parser->SetProgressReporter( aProgressReporter, aLineCount );
BOARD* board;

View File

@ -105,7 +105,8 @@ class PCB_TEXT;
//#define SEXPR_BOARD_FILE_VERSION 20211014 // Arc formatting
//#define SEXPR_BOARD_FILE_VERSION 20211226 // Add radial dimension
//#define SEXPR_BOARD_FILE_VERSION 20211227 // Add thermal relief spoke angle overrides
#define SEXPR_BOARD_FILE_VERSION 20211228 // Add allow_soldermask_bridges footprint attribute
//#define SEXPR_BOARD_FILE_VERSION 20211228 // Add allow_soldermask_bridges footprint attribute
#define SEXPR_BOARD_FILE_VERSION 20211229 // Stroke formatting
#define BOARD_FILE_HOST_VERSION 20200825 ///< Earlier files than this include the host tag
#define LEGACY_ARC_FORMATTING 20210925 ///< These were the last to use old arc formatting