Add missing settings to ModEdit's preferences.
Fixes: lp:1768477 * https://bugs.launchpad.net/kicad/+bug/1768477
This commit is contained in:
parent
d0d9bb25c0
commit
a2448cf4a5
|
@ -79,6 +79,7 @@ bool InvokeFPEditorPrefsDlg( FOOTPRINT_EDIT_FRAME* aCaller )
|
|||
void DIALOG_MODEDIT_OPTIONS::initValues()
|
||||
{
|
||||
EDA_UNITS_T units = g_UserUnit;
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_parent->GetDisplayOptions();
|
||||
|
||||
// Modules: graphic lines width:
|
||||
m_staticTextGrLineUnit->SetLabel( GetAbbreviatedUnitsLabel( units ) );
|
||||
|
@ -107,6 +108,15 @@ void DIALOG_MODEDIT_OPTIONS::initValues()
|
|||
m_choiceLayerValue->SetSelection( sel );
|
||||
sel = m_brdSettings.m_ValueDefaultVisibility ? 0 : 1;
|
||||
m_choiceVisibleValue->SetSelection( sel );
|
||||
|
||||
// Display options
|
||||
m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 );
|
||||
m_UnitsSelection->SetSelection( g_UserUnit == INCHES ? 0 : 1 );
|
||||
|
||||
// Editing options
|
||||
m_Segments_45_Only_Ctrl->SetValue( m_parent->Settings().m_use45DegreeGraphicSegments );
|
||||
m_MagneticPads->SetValue( m_parent->Settings().m_magneticPads == CAPTURE_ALWAYS );
|
||||
m_dragSelects->SetValue( m_parent->Settings().m_dragSelects );
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,7 +142,22 @@ void DIALOG_MODEDIT_OPTIONS::OnOkClick( wxCommandEvent& event )
|
|||
m_brdSettings.m_ValueDefaultVisibility = sel != 1;
|
||||
|
||||
m_parent->SetDesignSettings( m_brdSettings );
|
||||
m_parent->OnModify();
|
||||
|
||||
// Display options
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_parent->GetDisplayOptions();
|
||||
displ_opts->m_DisplayPolarCood = m_PolarDisplay->GetSelection() != 0;
|
||||
|
||||
EDA_UNITS_T units = ( m_UnitsSelection->GetSelection() == 0 ) ? INCHES : MILLIMETRES;
|
||||
if( units != g_UserUnit )
|
||||
{
|
||||
g_UserUnit = units;
|
||||
m_parent->ReCreateAuxiliaryToolbar();
|
||||
}
|
||||
|
||||
// Editing options
|
||||
m_parent->Settings().m_use45DegreeGraphicSegments = m_Segments_45_Only_Ctrl->GetValue();
|
||||
m_parent->Settings().m_magneticPads = m_MagneticPads->GetValue() ? CAPTURE_ALWAYS : NO_EFFECT;
|
||||
m_parent->Settings().m_dragSelects = m_dragSelects->GetValue();
|
||||
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -18,14 +18,14 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi
|
|||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizerUpper;
|
||||
bSizerUpper = new wxBoxSizer( wxVERTICAL );
|
||||
wxFlexGridSizer* fgSizer3;
|
||||
fgSizer3 = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
fgSizer3->AddGrowableCol( 0 );
|
||||
fgSizer3->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticText281 = new wxStaticText( this, wxID_ANY, _("On new graphic item creation:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText281->Wrap( -1 );
|
||||
m_staticText281->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
|
||||
bSizerUpper->Add( m_staticText281, 0, wxALL, 5 );
|
||||
wxStaticBoxSizer* sbSizerNewGraphicItems;
|
||||
sbSizerNewGraphicItems = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Values for New Graphic Items") ), wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizer1;
|
||||
fgSizer1 = new wxFlexGridSizer( 0, 3, 0, 0 );
|
||||
|
@ -33,137 +33,169 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi
|
|||
fgSizer1->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_EdgeModEWidthTitle = new wxStaticText( this, wxID_ANY, _("&Graphic line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_EdgeModEWidthTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("&Graphic line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_EdgeModEWidthTitle->Wrap( -1 );
|
||||
fgSizer1->Add( m_EdgeModEWidthTitle, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
fgSizer1->Add( m_EdgeModEWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_OptModuleGrLineWidth = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleGrLineWidth, 0, wxEXPAND|wxALL, 5 );
|
||||
m_OptModuleGrLineWidth = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleGrLineWidth, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_staticTextGrLineUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextGrLineUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextGrLineUnit->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticTextGrLineUnit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
fgSizer1->Add( m_staticTextGrLineUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_TextModWidthTitle = new wxStaticText( this, wxID_ANY, _("&Text line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextModWidthTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("&Text line width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextModWidthTitle->Wrap( -1 );
|
||||
fgSizer1->Add( m_TextModWidthTitle, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
fgSizer1->Add( m_TextModWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_OptModuleTextWidth = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleTextWidth, 0, wxEXPAND|wxALL, 5 );
|
||||
m_OptModuleTextWidth = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleTextWidth, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_staticTextTextWidthUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextTextWidthUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextTextWidthUnit->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticTextTextWidthUnit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
fgSizer1->Add( m_staticTextTextWidthUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_TextModSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text &height:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextModSizeVTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("Text &height:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextModSizeVTitle->Wrap( -1 );
|
||||
fgSizer1->Add( m_TextModSizeVTitle, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
fgSizer1->Add( m_TextModSizeVTitle, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_OptModuleTextVSize = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleTextVSize, 0, wxEXPAND|wxALL, 5 );
|
||||
m_OptModuleTextVSize = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleTextVSize, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_staticTextTextVSizeUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextTextVSizeUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextTextVSizeUnit->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticTextTextVSizeUnit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
fgSizer1->Add( m_staticTextTextVSizeUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_TextModSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text &width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextModSizeHTitle = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("Text &width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TextModSizeHTitle->Wrap( -1 );
|
||||
fgSizer1->Add( m_TextModSizeHTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
fgSizer1->Add( m_TextModSizeHTitle, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_OptModuleTextHSize = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleTextHSize, 0, wxEXPAND|wxALL, 5 );
|
||||
m_OptModuleTextHSize = new TEXT_CTRL_EVAL( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer1->Add( m_OptModuleTextHSize, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_staticTextTextHSizeUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextTextHSizeUnit = new wxStaticText( sbSizerNewGraphicItems->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextTextHSizeUnit->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticTextTextHSizeUnit, 0, wxALL, 5 );
|
||||
fgSizer1->Add( m_staticTextTextHSizeUnit, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bSizerUpper->Add( fgSizer1, 0, wxEXPAND|wxLEFT, 20 );
|
||||
sbSizerNewGraphicItems->Add( fgSizer1, 0, wxEXPAND, 20 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerUpper->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_staticText28 = new wxStaticText( this, wxID_ANY, _("Default values on new footprint creation:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText28->Wrap( -1 );
|
||||
m_staticText28->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
fgSizer3->Add( sbSizerNewGraphicItems, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
bSizerUpper->Add( m_staticText28, 0, wxALL, 5 );
|
||||
wxBoxSizer* bSizerDisplayOptions;
|
||||
bSizerDisplayOptions = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Leave reference or value blank to use the footprint name as default text"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextInfo->Wrap( -1 );
|
||||
bSizerUpper->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
wxString m_PolarDisplayChoices[] = { _("Cartesian coordinates"), _("Polar coordinates") };
|
||||
int m_PolarDisplayNChoices = sizeof( m_PolarDisplayChoices ) / sizeof( wxString );
|
||||
m_PolarDisplay = new wxRadioBox( this, wxID_POLAR_CTRL, _("Coordinates"), wxDefaultPosition, wxDefaultSize, m_PolarDisplayNChoices, m_PolarDisplayChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_PolarDisplay->SetSelection( 0 );
|
||||
m_PolarDisplay->SetToolTip( _("Set display of relative (dx/dy) coordinates to Cartesian (rectangular) or polar (angle/distance).") );
|
||||
|
||||
bSizerDisplayOptions->Add( m_PolarDisplay, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxString m_UnitsSelectionChoices[] = { _("Inches"), _("Millimeters") };
|
||||
int m_UnitsSelectionNChoices = sizeof( m_UnitsSelectionChoices ) / sizeof( wxString );
|
||||
m_UnitsSelection = new wxRadioBox( this, wxID_UNITS, _("Units"), wxDefaultPosition, wxDefaultSize, m_UnitsSelectionNChoices, m_UnitsSelectionChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_UnitsSelection->SetSelection( 0 );
|
||||
m_UnitsSelection->SetToolTip( _("Set units used to display dimensions and positions.") );
|
||||
|
||||
bSizerDisplayOptions->Add( m_UnitsSelection, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer3->Add( bSizerDisplayOptions, 0, wxEXPAND, 5 );
|
||||
|
||||
wxStaticBoxSizer* sbSizerNewFootprints;
|
||||
sbSizerNewFootprints = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default Values for New Footprints") ), wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizer2;
|
||||
fgSizer2 = new wxFlexGridSizer( 0, 6, 0, 0 );
|
||||
fgSizer2 = new wxFlexGridSizer( 0, 4, 0, 0 );
|
||||
fgSizer2->AddGrowableCol( 1 );
|
||||
fgSizer2->AddGrowableCol( 3 );
|
||||
fgSizer2->AddGrowableCol( 5 );
|
||||
fgSizer2->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticTextRef = new wxStaticText( this, wxID_ANY, _("&Reference:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextRef = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("&Reference:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextRef->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticTextRef, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
fgSizer2->Add( m_staticTextRef, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_textCtrlRefText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textCtrlRefText = new wxTextCtrl( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textCtrlRefText->SetToolTip( _("Default text for reference\nLeave blank to use the footprint name") );
|
||||
|
||||
fgSizer2->Add( m_textCtrlRefText, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextRefLayer = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextRefLayer->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticTextRefLayer, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
fgSizer2->Add( m_textCtrlRefText, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_choiceLayerReferenceChoices[] = { _("SilkScreen"), _("Fab. Layer") };
|
||||
int m_choiceLayerReferenceNChoices = sizeof( m_choiceLayerReferenceChoices ) / sizeof( wxString );
|
||||
m_choiceLayerReference = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerReferenceNChoices, m_choiceLayerReferenceChoices, 0 );
|
||||
m_choiceLayerReference = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerReferenceNChoices, m_choiceLayerReferenceChoices, 0 );
|
||||
m_choiceLayerReference->SetSelection( 0 );
|
||||
fgSizer2->Add( m_choiceLayerReference, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_staticText32 = new wxStaticText( this, wxID_ANY, _("Visibility:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText32->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText32, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
fgSizer2->Add( m_choiceLayerReference, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_choiceVisibleReferenceChoices[] = { _("Visible"), _("Invisible") };
|
||||
int m_choiceVisibleReferenceNChoices = sizeof( m_choiceVisibleReferenceChoices ) / sizeof( wxString );
|
||||
m_choiceVisibleReference = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleReferenceNChoices, m_choiceVisibleReferenceChoices, 0 );
|
||||
m_choiceVisibleReference = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleReferenceNChoices, m_choiceVisibleReferenceChoices, 0 );
|
||||
m_choiceVisibleReference->SetSelection( 0 );
|
||||
fgSizer2->Add( m_choiceVisibleReference, 0, wxALL|wxEXPAND, 5 );
|
||||
fgSizer2->Add( m_choiceVisibleReference, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextValue = new wxStaticText( this, wxID_ANY, _("V&alue:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextValue = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("V&alue:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextValue->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticTextValue, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_textCtrlValueText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textCtrlValueText = new wxTextCtrl( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textCtrlValueText->SetToolTip( _("Default text for value\nLeave blank to use the footprint name") );
|
||||
|
||||
fgSizer2->Add( m_textCtrlValueText, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextValLayer = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextValLayer->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticTextValLayer, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
wxString m_choiceLayerValueChoices[] = { _("SilkScreen"), _("Fab. Layer") };
|
||||
int m_choiceLayerValueNChoices = sizeof( m_choiceLayerValueChoices ) / sizeof( wxString );
|
||||
m_choiceLayerValue = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerValueNChoices, m_choiceLayerValueChoices, 0 );
|
||||
m_choiceLayerValue = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLayerValueNChoices, m_choiceLayerValueChoices, 0 );
|
||||
m_choiceLayerValue->SetSelection( 1 );
|
||||
fgSizer2->Add( m_choiceLayerValue, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextValVisibility = new wxStaticText( this, wxID_ANY, _("Visibility:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextValVisibility->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticTextValVisibility, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
wxString m_choiceVisibleValueChoices[] = { _("Visible"), _("Invisible") };
|
||||
int m_choiceVisibleValueNChoices = sizeof( m_choiceVisibleValueChoices ) / sizeof( wxString );
|
||||
m_choiceVisibleValue = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleValueNChoices, m_choiceVisibleValueChoices, 0 );
|
||||
m_choiceVisibleValue = new wxChoice( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVisibleValueNChoices, m_choiceVisibleValueChoices, 0 );
|
||||
m_choiceVisibleValue->SetSelection( 0 );
|
||||
fgSizer2->Add( m_choiceVisibleValue, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerUpper->Add( fgSizer2, 0, wxEXPAND|wxLEFT, 20 );
|
||||
sbSizerNewFootprints->Add( fgSizer2, 0, wxEXPAND, 20 );
|
||||
|
||||
m_staticTextInfo = new wxStaticText( sbSizerNewFootprints->GetStaticBox(), wxID_ANY, _("Leave reference and/or value blank to use footprint name."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextInfo->Wrap( -1 );
|
||||
sbSizerNewFootprints->Add( m_staticTextInfo, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerUpper, 1, wxALL|wxEXPAND, 5 );
|
||||
fgSizer3->Add( sbSizerNewFootprints, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxStaticBoxSizer* sbSizerEditOptions;
|
||||
sbSizerEditOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing Options") ), wxVERTICAL );
|
||||
|
||||
m_MagneticPads = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_ANY, _("Magnetic pads"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizerEditOptions->Add( m_MagneticPads, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
sbSizerEditOptions->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
m_Segments_45_Only_Ctrl = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_Segments_45_Only_Ctrl->SetToolTip( _("Force line segment directions to H, V or 45 degrees when drawing on technical layers.") );
|
||||
|
||||
sbSizerEditOptions->Add( m_Segments_45_Only_Ctrl, 0, wxALL, 5 );
|
||||
|
||||
m_dragSelects = new wxCheckBox( sbSizerEditOptions->GetStaticBox(), wxID_ANY, _("Prefer selection to dragging"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_dragSelects->SetToolTip( _("When enabled and nothing is selected, drag gesture will draw a selection box, even if there are items under the cursor that could be immediately dragged.") );
|
||||
|
||||
sbSizerEditOptions->Add( m_dragSelects, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
fgSizer3->Add( sbSizerEditOptions, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( fgSizer3, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bSizerColumns;
|
||||
bSizerColumns = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerColumns, 1, wxEXPAND, 5 );
|
||||
|
||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
||||
|
@ -172,7 +204,7 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi
|
|||
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
|
||||
m_sdbSizer1->Realize();
|
||||
|
||||
bSizerMain->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
bSizerMain->Add( m_sdbSizer1, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -22,13 +22,18 @@ class TEXT_CTRL_EVAL;
|
|||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define wxID_POLAR_CTRL 1000
|
||||
#define wxID_UNITS 1001
|
||||
#define wxID_SEGMENTS45 1002
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_MODEDIT_OPTIONS_BASE
|
||||
|
@ -38,7 +43,6 @@ class DIALOG_MODEDIT_OPTIONS_BASE : public DIALOG_SHIM
|
|||
private:
|
||||
|
||||
protected:
|
||||
wxStaticText* m_staticText281;
|
||||
wxStaticText* m_EdgeModEWidthTitle;
|
||||
TEXT_CTRL_EVAL* m_OptModuleGrLineWidth;
|
||||
wxStaticText* m_staticTextGrLineUnit;
|
||||
|
@ -51,21 +55,20 @@ class DIALOG_MODEDIT_OPTIONS_BASE : public DIALOG_SHIM
|
|||
wxStaticText* m_TextModSizeHTitle;
|
||||
TEXT_CTRL_EVAL* m_OptModuleTextHSize;
|
||||
wxStaticText* m_staticTextTextHSizeUnit;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStaticText* m_staticText28;
|
||||
wxStaticText* m_staticTextInfo;
|
||||
wxRadioBox* m_PolarDisplay;
|
||||
wxRadioBox* m_UnitsSelection;
|
||||
wxStaticText* m_staticTextRef;
|
||||
wxTextCtrl* m_textCtrlRefText;
|
||||
wxStaticText* m_staticTextRefLayer;
|
||||
wxChoice* m_choiceLayerReference;
|
||||
wxStaticText* m_staticText32;
|
||||
wxChoice* m_choiceVisibleReference;
|
||||
wxStaticText* m_staticTextValue;
|
||||
wxTextCtrl* m_textCtrlValueText;
|
||||
wxStaticText* m_staticTextValLayer;
|
||||
wxChoice* m_choiceLayerValue;
|
||||
wxStaticText* m_staticTextValVisibility;
|
||||
wxChoice* m_choiceVisibleValue;
|
||||
wxStaticText* m_staticTextInfo;
|
||||
wxCheckBox* m_MagneticPads;
|
||||
wxCheckBox* m_Segments_45_Only_Ctrl;
|
||||
wxCheckBox* m_dragSelects;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
wxButton* m_sdbSizer1Cancel;
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
///@{
|
||||
/// \ingroup config
|
||||
|
||||
static const wxString IconScaleEntry = "ModIconScale";
|
||||
static const wxString IconScaleEntry = "PcbIconScale";
|
||||
|
||||
///@}
|
||||
|
||||
|
@ -269,14 +269,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
|
||||
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), true );
|
||||
|
||||
// We should probably allow editing of these in the Footprint Editor's preferences, but
|
||||
// that's not the case at present so copy them from Pcbnew.
|
||||
m_configSettings.m_use45DegreeGraphicSegments = pcbFrame->Settings().m_use45DegreeGraphicSegments;
|
||||
m_configSettings.m_magneticPads = pcbFrame->Settings().m_magneticPads;
|
||||
|
||||
// And this one needs to move to a suite-wide setting.
|
||||
m_configSettings.m_dragSelects = pcbFrame->Settings().m_dragSelects;
|
||||
|
||||
// LoadSettings() *after* creating m_LayersManager, because LoadSettings()
|
||||
// initialize parameters in m_LayersManager
|
||||
LoadSettings( config() );
|
||||
|
@ -534,9 +526,9 @@ double FOOTPRINT_EDIT_FRAME::BestZoom()
|
|||
|
||||
void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
{
|
||||
if( GetScreen()->IsModify() )
|
||||
if( GetScreen()->IsModify() && GetBoard()->m_Modules )
|
||||
{
|
||||
int ii = DisplayExitDialog( this, _( "Save the changes to the footprint before closing?" ) );
|
||||
int ii = DisplayExitDialog( this, _( "Save changes to footprint before closing?" ) );
|
||||
|
||||
switch( ii )
|
||||
{
|
||||
|
@ -544,18 +536,12 @@ void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
break;
|
||||
|
||||
case wxID_YES:
|
||||
// code from FOOTPRINT_EDIT_FRAME::Process_Special_Functions,
|
||||
// at case ID_MODEDIT_SAVE_LIBMODULE
|
||||
if( GetBoard()->m_Modules )
|
||||
if( !SaveFootprintInLibrary( GetCurrentLib(), GetBoard()->m_Modules ) )
|
||||
{
|
||||
if( SaveFootprintInLibrary( GetCurrentLib(), GetBoard()->m_Modules ) )
|
||||
{
|
||||
// save was correct
|
||||
GetScreen()->ClrModify();
|
||||
break;
|
||||
}
|
||||
Event.Veto();
|
||||
return;
|
||||
}
|
||||
// fall through: cancel the close because of an error
|
||||
break;
|
||||
|
||||
case wxID_CANCEL:
|
||||
Event.Veto();
|
||||
|
@ -1012,19 +998,9 @@ void FOOTPRINT_EDIT_FRAME::UseGalCanvas( bool aEnable )
|
|||
|
||||
int FOOTPRINT_EDIT_FRAME::GetIconScale()
|
||||
{
|
||||
// All environmental settings will move to app for 6.0, so just inherit from pcbnew
|
||||
// for now.
|
||||
if( m_iconScale == -1 )
|
||||
{
|
||||
bool isBoardEditorRunning = Kiway().Player( FRAME_PCB, false ) != nullptr;
|
||||
PCB_BASE_FRAME* pcbFrame = static_cast<PCB_BASE_FRAME*>( Kiway().Player( FRAME_PCB, true ) );
|
||||
m_iconScale = pcbFrame->GetIconScale();
|
||||
|
||||
if( !isBoardEditorRunning )
|
||||
pcbFrame->Destroy();
|
||||
}
|
||||
|
||||
return m_iconScale;
|
||||
int scale = 0;
|
||||
Kiface().KifaceSettings()->Read( IconScaleEntry, &scale, 0 );
|
||||
return scale;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2018 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
|
||||
|
|
|
@ -40,12 +40,9 @@ PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType )
|
|||
break;
|
||||
|
||||
case FRAME_PCB_MODULE_EDITOR:
|
||||
/* No point in reading/writing these when the user can't edit them. Fetch them from
|
||||
* Pcbnew for now.
|
||||
Add( "Use45DegreeGraphicSegments", &m_use45DegreeGraphicSegments, false);
|
||||
Add( "MagneticPads", reinterpret_cast<int*>( &m_magneticPads ), CAPTURE_CURSOR_IN_TRACK_TOOL );
|
||||
Add( "DragSelects", &m_dragSelects, true );
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue