From 4eefbc78155c76217809bed3c1013ad518c5e482 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 20 Jan 2024 17:05:21 +0000 Subject: [PATCH] ADDED: textbox and tablecell margins. Fixes https://gitlab.com/kicad/code/kicad/-/issues/10672 Fixes https://gitlab.com/kicad/code/kicad/-/issues/6806 --- common/pcb.keywords | 1 + .../dialogs/dialog_tablecell_properties.cpp | 14 + .../dialogs/dialog_tablecell_properties.h | 4 + .../dialog_tablecell_properties_base.cpp | 62 +- .../dialog_tablecell_properties_base.fbp | 484 +- .../dialog_tablecell_properties_base.h | 6 + .../dialogs/dialog_text_properties_base.cpp | 4 +- .../dialogs/dialog_text_properties_base.fbp | 6180 +++++++++-------- .../dialogs/dialog_text_properties_base.h | 2 +- eeschema/lib_textbox.cpp | 95 +- eeschema/lib_textbox.h | 21 +- .../sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp | 8 +- .../sch_io_kicad_sexpr_lib_cache.cpp | 8 +- .../kicad_sexpr/sch_io_kicad_sexpr_parser.cpp | 57 +- .../kicad_sexpr/sch_io_kicad_sexpr_parser.h | 8 + eeschema/sch_table.cpp | 8 +- eeschema/sch_table.h | 6 + eeschema/sch_textbox.cpp | 106 +- eeschema/sch_textbox.h | 16 +- eeschema/schematic.keywords | 1 + eeschema/tools/sch_edit_tool.cpp | 13 +- .../dialogs/dialog_tablecell_properties.cpp | 14 + pcbnew/dialogs/dialog_tablecell_properties.h | 4 + .../dialog_tablecell_properties_base.cpp | 56 +- .../dialog_tablecell_properties_base.fbp | 464 +- .../dialog_tablecell_properties_base.h | 6 + .../pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp | 6 + .../kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp | 33 + .../kicad_sexpr/pcb_io_kicad_sexpr_parser.h | 2 + pcbnew/pcb_textbox.cpp | 69 +- pcbnew/pcb_textbox.h | 18 +- 31 files changed, 4632 insertions(+), 3144 deletions(-) diff --git a/common/pcb.keywords b/common/pcb.keywords index 915c8b3fab..ae4e2f61e5 100644 --- a/common/pcb.keywords +++ b/common/pcb.keywords @@ -194,6 +194,7 @@ line_spacing links locked loss_tangent +margins max_error max_length max_width diff --git a/eeschema/dialogs/dialog_tablecell_properties.cpp b/eeschema/dialogs/dialog_tablecell_properties.cpp index 7a9fced636..34e005e6eb 100644 --- a/eeschema/dialogs/dialog_tablecell_properties.cpp +++ b/eeschema/dialogs/dialog_tablecell_properties.cpp @@ -67,6 +67,10 @@ DIALOG_TABLECELL_PROPERTIES::DIALOG_TABLECELL_PROPERTIES( SCH_EDIT_FRAME* aFrame m_borderWidth( aFrame, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits ), m_separatorsWidth( aFrame, m_separatorsWidthLabel, m_separatorsWidthCtrl, m_separatorsWidthUnits ), m_textSize( aFrame, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits ), + m_marginLeft( aFrame, nullptr, m_marginLeftCtrl, nullptr ), + m_marginTop( aFrame, nullptr, m_marginTopCtrl, m_marginTopUnits ), + m_marginRight( aFrame, nullptr, m_marginRightCtrl, nullptr ), + m_marginBottom( aFrame, nullptr, m_marginBottomCtrl, nullptr ), m_scintillaTricks( nullptr ) { m_table = static_cast( m_cell->GetParent() ); @@ -245,6 +249,11 @@ bool DIALOG_TABLECELL_PROPERTIES::TransferDataToWindow() else m_fillColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false ); + m_marginLeft.SetValue( m_cell->GetMarginLeft() ); + m_marginTop.SetValue( m_cell->GetMarginTop() ); + m_marginRight.SetValue( m_cell->GetMarginRight() ); + m_marginBottom.SetValue( m_cell->GetMarginBottom() ); + return true; } @@ -458,6 +467,11 @@ bool DIALOG_TABLECELL_PROPERTIES::TransferDataFromWindow() m_cell->SetFillColor( fillColor ); } + m_cell->SetMarginLeft( m_marginLeft.GetIntValue() ); + m_cell->SetMarginTop( m_marginTop.GetIntValue() ); + m_cell->SetMarginRight( m_marginRight.GetIntValue() ); + m_cell->SetMarginBottom( m_marginBottom.GetIntValue() ); + if( !commit.Empty() ) commit.Push( _( "Edit Table Cell" ), SKIP_CONNECTIVITY ); diff --git a/eeschema/dialogs/dialog_tablecell_properties.h b/eeschema/dialogs/dialog_tablecell_properties.h index 6ac8e0b3dd..b9a4d377ae 100644 --- a/eeschema/dialogs/dialog_tablecell_properties.h +++ b/eeschema/dialogs/dialog_tablecell_properties.h @@ -58,6 +58,10 @@ private: UNIT_BINDER m_borderWidth; UNIT_BINDER m_separatorsWidth; UNIT_BINDER m_textSize; + UNIT_BINDER m_marginLeft; + UNIT_BINDER m_marginTop; + UNIT_BINDER m_marginRight; + UNIT_BINDER m_marginBottom; SCINTILLA_TRICKS* m_scintillaTricks; }; diff --git a/eeschema/dialogs/dialog_tablecell_properties_base.cpp b/eeschema/dialogs/dialog_tablecell_properties_base.cpp index 0ec8835f81..f675c51bd2 100644 --- a/eeschema/dialogs/dialog_tablecell_properties_base.cpp +++ b/eeschema/dialogs/dialog_tablecell_properties_base.cpp @@ -269,7 +269,7 @@ DIALOG_TABLECELL_PROPERTIES_BASE::DIALOG_TABLECELL_PROPERTIES_BASE( wxWindow* pa bSizeCtrlSizer->Add( m_separator4, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bMargins->Add( bSizeCtrlSizer, 0, wxBOTTOM, 10 ); + bMargins->Add( bSizeCtrlSizer, 0, wxBOTTOM, 5 ); wxGridBagSizer* gbSizer2; gbSizer2 = new wxGridBagSizer( 4, 5 ); @@ -309,6 +309,9 @@ DIALOG_TABLECELL_PROPERTIES_BASE::DIALOG_TABLECELL_PROPERTIES_BASE( wxWindow* pa bMargins->Add( gbSizer2, 0, wxEXPAND|wxBOTTOM, 5 ); + + bMargins->Add( 0, 5, 0, wxEXPAND, 5 ); + wxFlexGridSizer* fgSizer1; fgSizer1 = new wxFlexGridSizer( 0, 2, 6, 5 ); fgSizer1->SetFlexibleDirection( wxBOTH ); @@ -349,7 +352,62 @@ DIALOG_TABLECELL_PROPERTIES_BASE::DIALOG_TABLECELL_PROPERTIES_BASE( wxWindow* pa fgSizer1->Add( m_panelFillColor, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bMargins->Add( fgSizer1, 1, wxEXPAND|wxTOP, 5 ); + bMargins->Add( fgSizer1, 0, wxEXPAND|wxTOP, 5 ); + + + bMargins->Add( 0, 10, 0, wxEXPAND, 5 ); + + wxGridBagSizer* gbSizer3; + gbSizer3 = new wxGridBagSizer( 1, 0 ); + gbSizer3->SetFlexibleDirection( wxBOTH ); + gbSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_marginsLable = new wxStaticText( m_cellPage, wxID_ANY, _("Margins:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_marginsLable->Wrap( -1 ); + gbSizer3->Add( m_marginsLable, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 35 ); + + wxBoxSizer* marginTopSizer; + marginTopSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_marginTopCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + marginTopSizer->Add( m_marginTopCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_marginTopUnits = new wxStaticText( m_cellPage, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_marginTopUnits->Wrap( -1 ); + marginTopSizer->Add( m_marginTopUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); + + + gbSizer3->Add( marginTopSizer, wxGBPosition( 0, 2 ), wxGBSpan( 1, 4 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* marginLeftSizer; + marginLeftSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_marginLeftCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + marginLeftSizer->Add( m_marginLeftCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizer3->Add( marginLeftSizer, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxEXPAND|wxRIGHT|wxLEFT, 25 ); + + wxBoxSizer* marginRightSizer; + marginRightSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_marginRightCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + marginRightSizer->Add( m_marginRightCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizer3->Add( marginRightSizer, wxGBPosition( 1, 3 ), wxGBSpan( 1, 3 ), wxEXPAND, 5 ); + + wxBoxSizer* bSizer19; + bSizer19 = new wxBoxSizer( wxHORIZONTAL ); + + m_marginBottomCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer19->Add( m_marginBottomCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizer3->Add( bSizer19, wxGBPosition( 2, 2 ), wxGBSpan( 1, 4 ), wxEXPAND, 5 ); + + + bMargins->Add( gbSizer3, 1, wxEXPAND|wxTOP, 5 ); bSizer13->Add( bMargins, 1, wxEXPAND|wxALL, 5 ); diff --git a/eeschema/dialogs/dialog_tablecell_properties_base.fbp b/eeschema/dialogs/dialog_tablecell_properties_base.fbp index 2bb1251531..a440abff89 100644 --- a/eeschema/dialogs/dialog_tablecell_properties_base.fbp +++ b/eeschema/dialogs/dialog_tablecell_properties_base.fbp @@ -1788,7 +1788,7 @@ wxVERTICAL none - 10 + 5 wxBOTTOM 0 @@ -3042,10 +3042,20 @@ + + 5 + wxEXPAND + 0 + + 5 + protected + 0 + + 5 wxEXPAND|wxTOP - 1 + 0 2 wxBOTH @@ -3438,6 +3448,476 @@ + + 5 + wxEXPAND + 0 + + 10 + protected + 0 + + + + 5 + wxEXPAND|wxTOP + 1 + + + wxBOTH + + + 0 + + gbSizer3 + wxFLEX_GROWMODE_SPECIFIED + none + 1 + + 35 + 2 + 0 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Margins: + 0 + + 0 + + + 0 + + 1 + m_marginsLable + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 4 + 2 + wxEXPAND|wxALIGN_CENTER_VERTICAL + 0 + 1 + + + marginTopSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginTopCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_marginTopUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + + + 25 + 3 + 0 + wxEXPAND|wxRIGHT|wxLEFT + 1 + 1 + + + marginLeftSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginLeftCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 5 + 3 + 3 + wxEXPAND + 1 + 1 + + + marginRightSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginRightCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 5 + 4 + 2 + wxEXPAND + 2 + 1 + + + bSizer19 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginBottomCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_tablecell_properties_base.h b/eeschema/dialogs/dialog_tablecell_properties_base.h index 65720fb484..7443d18c7b 100644 --- a/eeschema/dialogs/dialog_tablecell_properties_base.h +++ b/eeschema/dialogs/dialog_tablecell_properties_base.h @@ -98,6 +98,12 @@ class DIALOG_TABLECELL_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_fillColorLabel; wxPanel* m_panelFillColor; COLOR_SWATCH* m_fillColorSwatch; + wxStaticText* m_marginsLable; + wxTextCtrl* m_marginTopCtrl; + wxStaticText* m_marginTopUnits; + wxTextCtrl* m_marginLeftCtrl; + wxTextCtrl* m_marginRightCtrl; + wxTextCtrl* m_marginBottomCtrl; wxButton* m_applyButton; wxStaticText* m_hotkeyHint; wxStdDialogButtonSizer* m_sdbSizer1; diff --git a/eeschema/dialogs/dialog_text_properties_base.cpp b/eeschema/dialogs/dialog_text_properties_base.cpp index 0793fb237f..fcd4fc3670 100644 --- a/eeschema/dialogs/dialog_text_properties_base.cpp +++ b/eeschema/dialogs/dialog_text_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -175,7 +175,7 @@ DIALOG_TEXT_PROPERTIES_BASE::DIALOG_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWi bSizeCtrlSizer->Add( m_separator5, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_textEntrySizer->Add( bSizeCtrlSizer, wxGBPosition( 3, 3 ), wxGBSpan( 1, 2 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + m_textEntrySizer->Add( bSizeCtrlSizer, wxGBPosition( 3, 3 ), wxGBSpan( 1, 3 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_textSizeLabel->Wrap( -1 ); diff --git a/eeschema/dialogs/dialog_text_properties_base.fbp b/eeschema/dialogs/dialog_text_properties_base.fbp index 01865a0711..a015f8a7d3 100644 --- a/eeschema/dialogs/dialog_text_properties_base.fbp +++ b/eeschema/dialogs/dialog_text_properties_base.fbp @@ -1,3097 +1,3141 @@ - + - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_text_properties_base - 1000 - none - - - 1 - dialog_text_properties_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_text_properties_base + 1000 + none + + + 1 + dialog_text_properties_base + + . + + 1 + 1 + 1 + 1 + UI + 0 + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 0 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_TEXT_PROPERTIES_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Text Properties + + 0 + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + - + + 1 + 0 + 1 1 + 0 + Dock + 0 + Left + 0 + 500 1 - impl_virtual - + 1 - 0 + 0 + 1 + wxSHOW_EFFECT_NONE wxID_ANY + + 0 + + 0 - DIALOG_TEXT_PROPERTIES_BASE + 1 + m_infoBar + 1 + + + protected + 1 - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Text Properties + Resizable + 1 + wxSHOW_EFFECT_NONE + + WX_INFOBAR; widgets/wx_infobar.h; forward_declare + 0 - 0 - + + + + 10 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 1 + + 0,12 + wxBOTH + 3 + + 3 + + m_textEntrySizer + wxFLEX_GROWMODE_SPECIFIED + protected + 2 + + 5 + 1 + 0 + wxRIGHT + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Text: + 0 + + 0 + + + 0 + + 1 + m_textLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + 5 + 5 + 1 + wxEXPAND + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + 0 + + 0 + 0 + wxID_ANY + 0 + 0 + + 0 + + + 0 + 500,140 + 1 + m_textCtrl + 1 + + + protected + 1 + + 0 + Resizable + 1 + + ; forward_declare + 0 + 4 + 0 + + 1 + 0 + 0 + + + wxBORDER_SUNKEN + onMultiLineTCLostFocus + + + + 5 + 1 + 5 + wxEXPAND|wxALIGN_RIGHT|wxLEFT + 1 + 1 + - bMainSizer + bSizer41 wxVERTICAL none - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 500 - 1 - - 1 - - 0 - 1 - wxSHOW_EFFECT_NONE - wxID_ANY - - 0 - - - 0 - - 1 - m_infoBar - 1 - - - protected - 1 - - Resizable - 1 - wxSHOW_EFFECT_NONE - - WX_INFOBAR; widgets/wx_infobar.h; forward_declare - 0 - - - - - + + 6 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + + wxID_ANY + Syntax help + + 0 + + + 0 + + 1 + m_syntaxHelp + + 1 + + + protected + 1 + + Resizable + 1 + + wxHL_DEFAULT_STYLE + ; ; forward_declare + 0 + Show syntax help window + + + + + + OnFormattingHelp + - - 10 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 1 - - 0,12 - wxBOTH - 3 - - 3 - - m_textEntrySizer - wxFLEX_GROWMODE_SPECIFIED - protected - 2 - - 5 - 1 - 0 - wxRIGHT - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text: - 0 - - 0 - - - 0 - - 1 - m_textLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 5 - 5 - 1 - wxEXPAND - 0 - 1 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - 0 - - 0 - 0 - wxID_ANY - 0 - 0 - - 0 - - - 0 - 500,140 - 1 - m_textCtrl - 1 - - - protected - 1 - - 0 - Resizable - 1 - - ; forward_declare - 0 - 4 - 0 - - 1 - 0 - 0 - - - wxBORDER_SUNKEN - onMultiLineTCLostFocus - - - - 5 - 1 - 5 - wxEXPAND|wxALIGN_RIGHT|wxLEFT - 1 - 1 - - - bSizer41 - wxVERTICAL - none - - 6 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - - wxID_ANY - Syntax help - - 0 - - - 0 - - 1 - m_syntaxHelp - - 1 - - - protected - 1 - - Resizable - 1 - - wxHL_DEFAULT_STYLE - ; ; forward_declare - 0 - Show syntax help window - - - - - - OnFormattingHelp - - - - - - 10 - 2 - 0 - wxTOP - 1 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Exclude from simulation - - 0 - - - 0 - - 1 - m_excludeFromSim - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Font: - 0 - - 0 - - - 0 - - 1 - m_fontLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 2 - 1 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Default Font" "KiCad Font" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_fontCtrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - FONT_CHOICE; widgets/font_choice.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 2 - 3 - wxEXPAND|wxALIGN_CENTER_VERTICAL - 3 - 1 - - - bSizeCtrlSizer - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - - - 0 - - 0 - - - 0 - - 1 - m_separator1 - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Bold - - 0 - - 0 - - - 0 - - 1 - m_bold - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Bold - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Italic - - 0 - - 0 - - - 0 - - 1 - m_italic - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Italic - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - - - 0 - - 0 - - - 0 - - 1 - m_separator2 - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align left - - 0 - - 0 - - - 0 - - 1 - m_hAlignLeft - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Align left - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align center - - 0 - - 0 - - - 0 - - 1 - m_hAlignCenter - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Align horizontal center - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align right - - 0 - - 0 - - - 0 - - 1 - m_hAlignRight - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Align right - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - - - 0 - - 0 - - - 0 - - 1 - m_separator3 - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align top - - 0 - - 0 - - - 0 - - 1 - m_vAlignTop - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Align top - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align middle - - 0 - - 0 - - - 0 - - 1 - m_vAlignCenter - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Align vertical center - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align bottom - - 0 - - 0 - - - 0 - - 1 - m_vAlignBottom - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Align bottom - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - - - 0 - - 0 - - - 0 - - 1 - m_separator4 - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align top - - 0 - - 0 - - - 0 - - 1 - m_horizontal - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Horizontal text - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Align middle - - 0 - - 0 - - - 0 - - 1 - m_vertical - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - Vertical text - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 0 - - 1 - - - 0 - 0 - wxID_ANY - - - 0 - - 0 - - - 0 - - 1 - m_separator5 - 1 - - - protected - 1 - - - - Resizable - 1 - 21,21 - wxBORDER_NONE - BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL - 4 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Text size: - 0 - - 0 - - - 0 - - 1 - m_textSizeLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - 1 - 1 - wxEXPAND - 4 - 1 - - - bSizer71 - wxHORIZONTAL - none - - 5 - wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - -1,-1 - 0 - -1,-1 - 1 - m_textSizeCtrl - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - -1,-1 - 1 - m_textSizeUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 15 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Color: - 0 - - 0 - - - 0 - - 1 - m_textColorLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; Not forward_declare - 0 - - - - - -1 - - - - 5 - - 0 - - 0 - protected - 5 - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelBorderColor1 - 1 - - - protected - 1 - - Resizable - 1 - - ; ; forward_declare - 0 - - - - wxBORDER_SIMPLE|wxTAB_TRAVERSAL - - - bSizer22 - wxVERTICAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_textColorSwatch - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - - - - - - 2 - 2 - 0 - wxBOTTOM - 6 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Border - - 0 - - - 0 - - 1 - m_borderCheckbox - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onBorderChecked - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL - 7 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Width: - 0 - - 0 - - - 0 - - 1 - m_borderWidthLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 2 - 1 - wxEXPAND - 7 - 1 - - - bSizer7 - wxHORIZONTAL - none - - 5 - wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - -1,-1 - 0 - -1,-1 - 1 - m_borderWidthCtrl - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - -1,-1 - 1 - m_borderWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 15 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Color: - 0 - - 0 - - - 0 - - 1 - m_borderColorLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; Not forward_declare - 0 - - - - - -1 - - - - 5 - - 0 - - 0 - protected - 5 - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelBorderColor - 1 - - - protected - 1 - - Resizable - 1 - - ; ; forward_declare - 0 - - - - wxBORDER_SIMPLE|wxTAB_TRAVERSAL - - - bSizer2 - wxVERTICAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_borderColorSwatch - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL - 8 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Style: - 0 - - 0 - - - 0 - - 1 - m_borderStyleLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - 2 - 1 - wxEXPAND - 8 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - 240,-1 - 1 - m_borderStyleCombo - 1 - - - protected - 1 - - Resizable - -1 - 1 - - wxCB_READONLY - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 80 - 2 - 4 - wxRIGHT - 6 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Background fill - - 0 - - - 0 - - 1 - m_filledCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onFillChecked - - - - 5 - 2 - 4 - wxEXPAND - 7 - 1 - - - bSizer8 - wxHORIZONTAL - none - - 5 - wxRIGHT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Fill color: - 0 - - 0 - - - 0 - - 1 - m_fillColorLabel - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panelFillColor - 1 - - - protected - 1 - - Resizable - 1 - - ; ; forward_declare - 0 - - - - wxBORDER_SIMPLE|wxTAB_TRAVERSAL - - - bSizer21 - wxVERTICAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - COLOR_SWATCH - 1 - - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_fillColorSwatch - 1 - - - protected - 1 - - Resizable - - 1 - - COLOR_SWATCH; widgets/color_swatch.h; forward_declare - 0 - - - - - - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM - 10 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Link: - - 0 - - - 0 - - 1 - m_hyperlinkCb - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Make this text item a clickable hyperlink - - wxFILTER_NONE - wxDefaultValidator - - - - - onHyperlinkChecked - + + + + 10 + 2 + 0 + wxTOP + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Exclude from simulation + + 0 + + + 0 + + 1 + m_excludeFromSim + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Font: + 0 + + 0 + + + 0 + + 1 + m_fontLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 2 + 1 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Default Font" "KiCad Font" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_fontCtrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + FONT_CHOICE; widgets/font_choice.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 3 + 3 + wxEXPAND|wxALIGN_CENTER_VERTICAL + 3 + 1 + + + bSizeCtrlSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + m_separator1 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Bold + + 0 + + 0 + + + 0 + + 1 + m_bold + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Bold + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Italic + + 0 + + 0 + + + 0 + + 1 + m_italic + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Italic + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + m_separator2 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align left + + 0 + + 0 + + + 0 + + 1 + m_hAlignLeft + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Align left + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align center + + 0 + + 0 + + + 0 + + 1 + m_hAlignCenter + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Align horizontal center + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align right + + 0 + + 0 + + + 0 + + 1 + m_hAlignRight + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Align right + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + m_separator3 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align top + + 0 + + 0 + + + 0 + + 1 + m_vAlignTop + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Align top + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align middle + + 0 + + 0 + + + 0 + + 1 + m_vAlignCenter + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Align vertical center + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align bottom + + 0 + + 0 + + + 0 + + 1 + m_vAlignBottom + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Align bottom + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + m_separator4 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align top + + 0 + + 0 + + + 0 + + 1 + m_horizontal + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Horizontal text + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Align middle + + 0 + + 0 + + + 0 + + 1 + m_vertical + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + Vertical text + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 0 + + 1 + + + 0 + 0 + wxID_ANY + + + 0 + + 0 + + + 0 + + 1 + m_separator5 + 1 + + + protected + 1 + + + + Resizable + 1 + 21,21 + wxBORDER_NONE + BITMAP_BUTTON; widgets/bitmap_button.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Text size: + 0 + + 0 + + + 0 + + 1 + m_textSizeLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxEXPAND + 4 + 1 + + + bSizer71 + wxHORIZONTAL + none + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + -1,-1 + 0 + -1,-1 + 1 + m_textSizeCtrl + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + -1,-1 + 1 + m_textSizeUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 15 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Color: + 0 + + 0 + + + 0 + + 1 + m_textColorLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; Not forward_declare + 0 + + + + + -1 + + + + 5 + + 0 + + 0 + protected + 5 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelBorderColor1 + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxBORDER_SIMPLE|wxTAB_TRAVERSAL + + + bSizer22 + wxVERTICAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + COLOR_SWATCH + 1 + + + 1 + + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_textColorSwatch + 1 + + + protected + 1 + + Resizable + + 1 + + COLOR_SWATCH; widgets/color_swatch.h; forward_declare + 0 + + + + - - 5 - 5 - 1 - wxEXPAND|wxBOTTOM|wxALIGN_CENTER_VERTICAL - 10 - 1 - - - bSizer11 - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxFIXED_MINSIZE - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_hyperlinkCombo - 1 - - - protected - 1 - - Resizable - -1 - 1 - - - WX_COMBOBOX; widgets/wx_combobox.h; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - onHyperlinkCombo - onHyperlinkText - - - + + + + + + + + 2 + 2 + 0 + wxBOTTOM + 6 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Border + + 0 + + + 0 + + 1 + m_borderCheckbox + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onBorderChecked + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL + 7 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Width: + 0 + + 0 + + + 0 + + 1 + m_borderWidthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 2 + 1 + wxEXPAND + 7 + 1 + + + bSizer7 + wxHORIZONTAL + none + + 5 + wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + -1,-1 + 0 + -1,-1 + 1 + m_borderWidthCtrl + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + -1,-1 + 1 + m_borderWidthUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 15 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Color: + 0 + + 0 + + + 0 + + 1 + m_borderColorLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; Not forward_declare + 0 + + + + + -1 + + + + 5 + + 0 + + 0 + protected + 5 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelBorderColor + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxBORDER_SIMPLE|wxTAB_TRAVERSAL + + + bSizer2 + wxVERTICAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + COLOR_SWATCH + 1 + + + 1 + + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_borderColorSwatch + 1 + + + protected + 1 + + Resizable + + 1 + + COLOR_SWATCH; widgets/color_swatch.h; forward_declare + 0 + + + + + + - - 5 - wxALL|wxEXPAND - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL + 8 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Style: + 0 + + 0 + + + 0 + + 1 + m_borderStyleLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 2 + 1 + wxEXPAND + 8 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 240,-1 + 1 + m_borderStyleCombo + 1 + + + protected + 1 + + Resizable + -1 + 1 + + wxCB_READONLY + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 80 + 2 + 4 + wxRIGHT + 6 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Background fill + + 0 + + + 0 + + 1 + m_filledCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onFillChecked + + + + 5 + 2 + 4 + wxEXPAND + 7 + 1 + + + bSizer8 + wxHORIZONTAL + none + + 5 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Fill color: + 0 + + 0 + + + 0 + + 1 + m_fillColorLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelFillColor + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxBORDER_SIMPLE|wxTAB_TRAVERSAL + + + bSizer21 + wxVERTICAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + COLOR_SWATCH + 1 + + + 1 + + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_fillColorSwatch + 1 + + + protected + 1 + + Resizable + + 1 + + COLOR_SWATCH; widgets/color_swatch.h; forward_declare + 0 + + + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM + 10 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Link: + + 0 + + + 0 + + 1 + m_hyperlinkCb + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Make this text item a clickable hyperlink + + wxFILTER_NONE + wxDefaultValidator + + + + + onHyperlinkChecked + + + + 5 + 5 + 1 + wxEXPAND|wxBOTTOM|wxALIGN_CENTER_VERTICAL + 10 + 1 + + + bSizer11 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxFIXED_MINSIZE + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_hyperlinkCombo + 1 + + + protected + 1 + + Resizable + -1 + 1 + + + WX_COMBOBOX; widgets/wx_combobox.h; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + onHyperlinkCombo + onHyperlinkText + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + + diff --git a/eeschema/dialogs/dialog_text_properties_base.h b/eeschema/dialogs/dialog_text_properties_base.h index b33f3ea1ec..b3d0fc482d 100644 --- a/eeschema/dialogs/dialog_text_properties_base.h +++ b/eeschema/dialogs/dialog_text_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/eeschema/lib_textbox.cpp b/eeschema/lib_textbox.cpp index 077ffa8e44..4a87fccd75 100644 --- a/eeschema/lib_textbox.cpp +++ b/eeschema/lib_textbox.cpp @@ -52,16 +52,27 @@ LIB_TEXTBOX::LIB_TEXTBOX( LIB_SYMBOL* aParent, int aLineWidth, FILL_T aFillType, SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); SetVertJustify( GR_TEXT_V_ALIGN_TOP ); SetMultilineAllowed( true ); + + int defaultMargin = GetLegacyTextMargin(); + m_marginLeft = defaultMargin; + m_marginTop = defaultMargin; + m_marginRight = defaultMargin; + m_marginBottom = defaultMargin; } LIB_TEXTBOX::LIB_TEXTBOX( const LIB_TEXTBOX& aText ) : LIB_SHAPE( aText ), EDA_TEXT( aText ) -{ } +{ + m_marginLeft = aText.m_marginLeft; + m_marginTop = aText.m_marginTop; + m_marginRight = aText.m_marginRight; + m_marginBottom = aText.m_marginBottom; +} -int LIB_TEXTBOX::GetTextMargin() const +int LIB_TEXTBOX::GetLegacyTextMargin() const { return KiROUND( GetTextSize().y * 0.8 ); } @@ -106,37 +117,36 @@ void LIB_TEXTBOX::Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) VECTOR2I LIB_TEXTBOX::GetDrawPos() const { - int margin = GetTextMargin(); BOX2I bbox( VECTOR2I( std::min( m_start.x, m_end.x ), std::min( -m_start.y, -m_end.y ) ), VECTOR2I( abs( m_end.x - m_start.x ), abs( m_end.y - m_start.y ) ) ); - VECTOR2I pos( bbox.GetLeft() + margin, bbox.GetBottom() - margin ); + VECTOR2I pos( bbox.GetLeft() + m_marginLeft, bbox.GetBottom() - m_marginBottom ); - if( GetTextAngle() == ANGLE_VERTICAL ) + if( GetTextAngle().IsVertical() ) { switch( GetHorizJustify() ) { case GR_TEXT_H_ALIGN_LEFT: - pos.y = bbox.GetBottom() - margin; + pos.y = bbox.GetBottom() - m_marginBottom; break; case GR_TEXT_H_ALIGN_CENTER: pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2; break; case GR_TEXT_H_ALIGN_RIGHT: - pos.y = bbox.GetTop() + margin; + pos.y = bbox.GetTop() + m_marginTop; break; } switch( GetVertJustify() ) { case GR_TEXT_V_ALIGN_TOP: - pos.x = bbox.GetLeft() + margin; + pos.x = bbox.GetLeft() + m_marginLeft; break; case GR_TEXT_V_ALIGN_CENTER: pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2; break; case GR_TEXT_V_ALIGN_BOTTOM: - pos.x = bbox.GetRight() - margin; + pos.x = bbox.GetRight() - m_marginRight; break; } } @@ -145,26 +155,26 @@ VECTOR2I LIB_TEXTBOX::GetDrawPos() const switch( GetHorizJustify() ) { case GR_TEXT_H_ALIGN_LEFT: - pos.x = bbox.GetLeft() + margin; + pos.x = bbox.GetLeft() + m_marginLeft; break; case GR_TEXT_H_ALIGN_CENTER: pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2; break; case GR_TEXT_H_ALIGN_RIGHT: - pos.x = bbox.GetRight() - margin; + pos.x = bbox.GetRight() - m_marginRight; break; } switch( GetVertJustify() ) { case GR_TEXT_V_ALIGN_TOP: - pos.y = bbox.GetTop() + margin; + pos.y = bbox.GetTop() + m_marginTop; break; case GR_TEXT_V_ALIGN_CENTER: pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2; break; case GR_TEXT_V_ALIGN_BOTTOM: - pos.y = bbox.GetBottom() - margin; + pos.y = bbox.GetBottom() - m_marginBottom; break; } } @@ -207,6 +217,18 @@ int LIB_TEXTBOX::compare( const LIB_ITEM& aOther, int aCompareFlags ) const if( GetTextAngle().AsTenthsOfADegree() != tmp->GetTextAngle().AsTenthsOfADegree() ) return GetTextAngle().AsTenthsOfADegree() - tmp->GetTextAngle().AsTenthsOfADegree(); + if( GetMarginLeft() != tmp->GetMarginLeft() ) + return GetMarginLeft() - tmp->GetMarginLeft(); + + if( GetMarginTop() != tmp->GetMarginTop() ) + return GetMarginTop() - tmp->GetMarginTop(); + + if( GetMarginRight() != tmp->GetMarginRight() ) + return GetMarginRight() - tmp->GetMarginRight(); + + if( GetMarginBottom() != tmp->GetMarginBottom() ) + return GetMarginBottom() - tmp->GetMarginBottom(); + return EDA_SHAPE::Compare( &static_cast( aOther ) ); } @@ -333,12 +355,16 @@ wxString LIB_TEXTBOX::GetShownText( bool aAllowExtraText, int aDepth ) const KIFONT::FONT* font = GetFont(); VECTOR2D size = GetEnd() - GetStart(); - int colWidth = GetTextAngle() == ANGLE_HORIZONTAL ? size.x : size.y; + int colWidth; + + if( GetTextAngle().IsVertical() ) + colWidth = abs( size.y ) - ( GetMarginTop() + GetMarginBottom() ); + else + colWidth = abs( size.x ) - ( GetMarginLeft() + GetMarginRight() ); if( !font ) font = KIFONT::FONT::GetFont( GetDefaultFont(), IsBold(), IsItalic() ); - colWidth = abs( colWidth ) - GetTextMargin() * 2; font->LinebreakText( text, colWidth, GetTextSize(), GetTextThickness(), IsBold(), IsItalic() ); return text; @@ -537,3 +563,42 @@ void LIB_TEXTBOX::ViewGetLayers( int aLayers[], int& aCount ) const aLayers[1] = IsPrivate() ? LAYER_NOTES_BACKGROUND : LAYER_DEVICE_BACKGROUND; aLayers[2] = LAYER_SELECTION_SHADOWS; } + + +static struct LIB_TEXTBOX_DESC +{ + LIB_TEXTBOX_DESC() + { + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + REGISTER_TYPE( LIB_TEXTBOX ); + + propMgr.AddTypeCast( new TYPE_CAST ); + propMgr.AddTypeCast( new TYPE_CAST ); + propMgr.AddTypeCast( new TYPE_CAST ); + propMgr.InheritsAfter( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( LIB_SHAPE ) ); + propMgr.InheritsAfter( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_SHAPE ) ); + propMgr.InheritsAfter( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_TEXT ) ); + + propMgr.Mask( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_SHAPE ), _HKI( "Shape" ) ); + + propMgr.Mask( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Visible" ) ); + propMgr.Mask( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Width" ) ); + propMgr.Mask( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Height" ) ); + propMgr.Mask( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Thickness" ) ); + + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Left" ), + &LIB_TEXTBOX::SetMarginLeft, &LIB_TEXTBOX::GetMarginLeft, PROPERTY_DISPLAY::PT_SIZE ) ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Top" ), + &LIB_TEXTBOX::SetMarginTop, &LIB_TEXTBOX::GetMarginTop, PROPERTY_DISPLAY::PT_SIZE ) ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Right" ), + &LIB_TEXTBOX::SetMarginRight, &LIB_TEXTBOX::GetMarginRight, PROPERTY_DISPLAY::PT_SIZE ) ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Bottom" ), + &LIB_TEXTBOX::SetMarginBottom, &LIB_TEXTBOX::GetMarginBottom, PROPERTY_DISPLAY::PT_SIZE ) ); + + propMgr.AddProperty( new PROPERTY( _HKI( "Text Size" ), + &LIB_TEXTBOX::SetLibTextSize, &LIB_TEXTBOX::GetLibTextSize, PROPERTY_DISPLAY::PT_SIZE ), + _( "Text Properties" ) ); + + propMgr.Mask( TYPE_HASH( LIB_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Orientation" ) ); + } +} _LIB_TEXTBOX_DESC; diff --git a/eeschema/lib_textbox.h b/eeschema/lib_textbox.h index 4df451e445..a7eec129e0 100644 --- a/eeschema/lib_textbox.h +++ b/eeschema/lib_textbox.h @@ -51,7 +51,20 @@ public: return wxT( "LIB_TEXTBOX" ); } - int GetTextMargin() const; + int GetLegacyTextMargin() const; + + void SetMarginLeft( int aLeft ) { m_marginLeft = aLeft; } + void SetMarginTop( int aTop ) { m_marginTop = aTop; } + void SetMarginRight( int aRight ) { m_marginRight = aRight; } + void SetMarginBottom( int aBottom ) { m_marginBottom = aBottom; } + + int GetMarginLeft() const { return m_marginLeft; } + int GetMarginTop() const { return m_marginTop; } + int GetMarginRight() const { return m_marginRight; } + int GetMarginBottom() const { return m_marginBottom; } + + int GetLibTextSize() const { return GetTextWidth(); } + void SetLibTextSize( int aSize ) { SetTextSize( VECTOR2I( aSize, aSize ) ); } VECTOR2I GetDrawPos() const override; @@ -105,6 +118,12 @@ private: void print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset, void* aData, const TRANSFORM& aTransform, bool aDimmed ) override; + +private: + int m_marginLeft; + int m_marginTop; + int m_marginRight; + int m_marginBottom; }; diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp index 0e7fa0f1c2..cc514197ff 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp @@ -1349,13 +1349,17 @@ void SCH_IO_KICAD_SEXPR::saveTextBox( SCH_TEXTBOX* aTextBox, int aNestLevel ) VECTOR2I pos = aTextBox->GetStart(); VECTOR2I size = aTextBox->GetEnd() - pos; - m_out->Print( aNestLevel + 1, "(exclude_from_sim %s) (at %s %s %s) (size %s %s)", + m_out->Print( aNestLevel + 1, "(exclude_from_sim %s) (at %s %s %s) (size %s %s) (margins %s %s %s %s)", aTextBox->GetExcludedFromSim() ? "yes" : "no", EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pos.x ).c_str(), EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pos.y ).c_str(), EDA_UNIT_UTILS::FormatAngle( aTextBox->GetTextAngle() ).c_str(), EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, size.x ).c_str(), - EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, size.y ).c_str() ); + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, size.y ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginLeft() ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginTop() ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginRight() ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginBottom() ).c_str() ); if( SCH_TABLECELL* cell = dynamic_cast( aTextBox ) ) m_out->Print( 0, " (span %d %d)", cell->GetColSpan(), cell->GetRowSpan() ); diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.cpp b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.cpp index bc00e2798a..953e968c0e 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.cpp +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.cpp @@ -502,12 +502,16 @@ void SCH_IO_KICAD_SEXPR_LIB_CACHE::saveTextBox( LIB_TEXTBOX* aTextBox, OUTPUTFOR VECTOR2I pos = aTextBox->GetStart(); VECTOR2I size = aTextBox->GetEnd() - pos; - aFormatter.Print( aNestLevel + 1, "(at %s %s %s) (size %s %s)\n", + aFormatter.Print( aNestLevel + 1, "(at %s %s %s) (size %s %s) (margins %s %s %s %s)\n", EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pos.x ).c_str(), EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pos.y ).c_str(), EDA_UNIT_UTILS::FormatAngle( aTextBox->GetTextAngle() ).c_str(), EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, size.x ).c_str(), - EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, size.y ).c_str() ); + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, size.y ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginLeft() ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginTop() ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginRight() ).c_str(), + EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, aTextBox->GetMarginBottom() ).c_str() ); aTextBox->GetStroke().Format( &aFormatter, schIUScale, aNestLevel + 1 ); aFormatter.Print( 0, "\n" ); diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp index bf63ea1e12..ed4bdc33c9 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp @@ -1816,10 +1816,16 @@ LIB_TEXTBOX* SCH_IO_KICAD_SEXPR_PARSER::parseTextBox() VECTOR2I pos; VECTOR2I end; VECTOR2I size; - bool foundEnd = false; - bool foundSize = false; + int left; + int top; + int right; + int bottom; STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; + bool foundEnd = false; + bool foundSize = false; + bool foundMargins = false; + std::unique_ptr textBox = std::make_unique( nullptr ); textBox->SetUnit( m_unit ); @@ -1883,6 +1889,16 @@ LIB_TEXTBOX* SCH_IO_KICAD_SEXPR_PARSER::parseTextBox() textBox->SetFillColor( fill.m_Color ); break; + case T_margins: + parseMargins( left, top, right, bottom ); + textBox->SetMarginLeft( left ); + textBox->SetMarginTop( top ); + textBox->SetMarginRight( right ); + textBox->SetMarginBottom( bottom ); + foundMargins = true; + NeedRIGHT(); + break; + case T_effects: parseEDA_TEXT( static_cast( textBox.get() ), false ); break; @@ -1901,6 +1917,15 @@ LIB_TEXTBOX* SCH_IO_KICAD_SEXPR_PARSER::parseTextBox() else Expecting( "size" ); + if( !foundMargins ) + { + int margin = textBox->GetLegacyTextMargin(); + textBox->SetMarginLeft( margin ); + textBox->SetMarginTop( margin ); + textBox->SetMarginRight( margin ); + textBox->SetMarginBottom( margin ); + } + return textBox.release(); } @@ -4174,10 +4199,15 @@ void SCH_IO_KICAD_SEXPR_PARSER::parseSchTextBoxContent( SCH_TEXTBOX* aTextBox ) VECTOR2I pos; VECTOR2I end; VECTOR2I size; - bool foundEnd = false; - bool foundSize = false; + int left; + int top; + int right; + int bottom; STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; + bool foundEnd = false; + bool foundSize = false; + bool foundMargins = false; NeedSYMBOL(); @@ -4245,6 +4275,16 @@ void SCH_IO_KICAD_SEXPR_PARSER::parseSchTextBoxContent( SCH_TEXTBOX* aTextBox ) aTextBox->SetFillColor( fill.m_Color ); break; + case T_margins: + parseMargins( left, top, right, bottom ); + aTextBox->SetMarginLeft( left ); + aTextBox->SetMarginTop( top ); + aTextBox->SetMarginRight( right ); + aTextBox->SetMarginBottom( bottom ); + foundMargins = true; + NeedRIGHT(); + break; + case T_effects: parseEDA_TEXT( static_cast( aTextBox ), false ); break; @@ -4271,6 +4311,15 @@ void SCH_IO_KICAD_SEXPR_PARSER::parseSchTextBoxContent( SCH_TEXTBOX* aTextBox ) aTextBox->SetEnd( pos + size ); else Expecting( "size" ); + + if( !foundMargins ) + { + int margin = aTextBox->GetLegacyTextMargin(); + aTextBox->SetMarginLeft( margin ); + aTextBox->SetMarginTop( margin ); + aTextBox->SetMarginRight( margin ); + aTextBox->SetMarginBottom( margin ); + } } diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.h b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.h index 49faa40a51..55edcdc5fe 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.h +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.h @@ -182,6 +182,14 @@ private: void parseFill( FILL_PARAMS& aFill ); + void parseMargins( int& aLeft, int& aTop, int& aRight, int& aBottom ) + { + aLeft = parseInternalUnits( "left margin" ); + aTop = parseInternalUnits( "top margin" ); + aRight = parseInternalUnits( "right margin" ); + aBottom = parseInternalUnits( "bottom margin" ); + } + void parseEDA_TEXT( EDA_TEXT* aText, bool aConvertOverbarSyntax, bool aEnforceMinTextSize = true ); void parsePinNames( std::unique_ptr& aSymbol ); diff --git a/eeschema/sch_table.cpp b/eeschema/sch_table.cpp index b320aebd05..b6088b14c4 100644 --- a/eeschema/sch_table.cpp +++ b/eeschema/sch_table.cpp @@ -602,11 +602,11 @@ static struct SCH_TABLE_DESC propMgr.AddTypeCast( new TYPE_CAST ); propMgr.InheritsAfter( TYPE_HASH( SCH_TABLE ), TYPE_HASH( SCH_ITEM ) ); - propMgr.AddProperty( new PROPERTY( _HKI( "Start X" ), - &EDA_SHAPE::SetStartX, &EDA_SHAPE::GetStartX, PROPERTY_DISPLAY::PT_COORD, + propMgr.AddProperty( new PROPERTY( _HKI( "Start X" ), + &SCH_TABLE::SetPositionX, &SCH_TABLE::GetPositionX, PROPERTY_DISPLAY::PT_COORD, ORIGIN_TRANSFORMS::ABS_X_COORD ) ); - propMgr.AddProperty( new PROPERTY( _HKI( "Start Y" ), - &EDA_SHAPE::SetStartY, &EDA_SHAPE::GetStartY, PROPERTY_DISPLAY::PT_COORD, + propMgr.AddProperty( new PROPERTY( _HKI( "Start Y" ), + &SCH_TABLE::SetPositionY, &SCH_TABLE::GetPositionY, PROPERTY_DISPLAY::PT_COORD, ORIGIN_TRANSFORMS::ABS_Y_COORD ) ); const wxString tableProps = _( "Table Properties" ); diff --git a/eeschema/sch_table.h b/eeschema/sch_table.h index d0e70faf55..00ebac8472 100644 --- a/eeschema/sch_table.h +++ b/eeschema/sch_table.h @@ -96,6 +96,12 @@ public: VECTOR2I GetPosition() const override; VECTOR2I GetEnd() const; + // For property manager: + void SetPositionX( int x ) { SetPosition( VECTOR2I( x, GetPosition().y ) ); } + void SetPositionY( int y ) { SetPosition( VECTOR2I( GetPosition().x, y ) ); } + int GetPositionX() const { return GetPosition().x; } + int GetPositionY() const { return GetPosition().y; } + void SetColCount( int aCount ) { m_colCount = aCount; } int GetColCount() const { return m_colCount; } diff --git a/eeschema/sch_textbox.cpp b/eeschema/sch_textbox.cpp index ce4758728b..169aa31b42 100644 --- a/eeschema/sch_textbox.cpp +++ b/eeschema/sch_textbox.cpp @@ -54,6 +54,12 @@ SCH_TEXTBOX::SCH_TEXTBOX( int aLineWidth, FILL_T aFillType, const wxString& text SetMultilineAllowed( true ); m_excludedFromSim = false; + + int defaultMargin = GetLegacyTextMargin(); + m_marginLeft = defaultMargin; + m_marginTop = defaultMargin; + m_marginRight = defaultMargin; + m_marginBottom = defaultMargin; } @@ -62,10 +68,14 @@ SCH_TEXTBOX::SCH_TEXTBOX( const SCH_TEXTBOX& aText ) : EDA_TEXT( aText ) { m_excludedFromSim = aText.m_excludedFromSim; + m_marginLeft = aText.m_marginLeft; + m_marginTop = aText.m_marginTop; + m_marginRight = aText.m_marginRight; + m_marginBottom = aText.m_marginBottom; } -int SCH_TEXTBOX::GetTextMargin() const +int SCH_TEXTBOX::GetLegacyTextMargin() const { return KiROUND( GetStroke().GetWidth() / 2.0 ) + KiROUND( GetTextSize().y * 0.75 ); } @@ -116,38 +126,37 @@ void SCH_TEXTBOX::Rotate90( bool aClockwise ) VECTOR2I SCH_TEXTBOX::GetDrawPos() const { - int margin = GetTextMargin(); BOX2I bbox( m_start, m_end - m_start ); bbox.Normalize(); - VECTOR2I pos( bbox.GetLeft() + margin, bbox.GetBottom() - margin ); + VECTOR2I pos( bbox.GetLeft() + m_marginLeft, bbox.GetBottom() - m_marginBottom ); - if( GetTextAngle() == ANGLE_VERTICAL ) + if( GetTextAngle().IsVertical() ) { switch( GetHorizJustify() ) { case GR_TEXT_H_ALIGN_LEFT: - pos.y = bbox.GetBottom() - margin; + pos.y = bbox.GetBottom() - m_marginBottom; break; case GR_TEXT_H_ALIGN_CENTER: pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2; break; case GR_TEXT_H_ALIGN_RIGHT: - pos.y = bbox.GetTop() + margin; + pos.y = bbox.GetTop() + m_marginTop; break; } switch( GetVertJustify() ) { case GR_TEXT_V_ALIGN_TOP: - pos.x = bbox.GetLeft() + margin; + pos.x = bbox.GetLeft() + m_marginLeft; break; case GR_TEXT_V_ALIGN_CENTER: pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2; break; case GR_TEXT_V_ALIGN_BOTTOM: - pos.x = bbox.GetRight() - margin; + pos.x = bbox.GetRight() - m_marginRight; break; } } @@ -156,26 +165,26 @@ VECTOR2I SCH_TEXTBOX::GetDrawPos() const switch( GetHorizJustify() ) { case GR_TEXT_H_ALIGN_LEFT: - pos.x = bbox.GetLeft() + margin; + pos.x = bbox.GetLeft() + m_marginLeft; break; case GR_TEXT_H_ALIGN_CENTER: pos.x = ( bbox.GetLeft() + bbox.GetRight() ) / 2; break; case GR_TEXT_H_ALIGN_RIGHT: - pos.x = bbox.GetRight() - margin; + pos.x = bbox.GetRight() - m_marginRight; break; } switch( GetVertJustify() ) { case GR_TEXT_V_ALIGN_TOP: - pos.y = bbox.GetTop() + margin; + pos.y = bbox.GetTop() + m_marginTop; break; case GR_TEXT_V_ALIGN_CENTER: pos.y = ( bbox.GetTop() + bbox.GetBottom() ) / 2; break; case GR_TEXT_V_ALIGN_BOTTOM: - pos.y = bbox.GetBottom() - margin; + pos.y = bbox.GetBottom() - m_marginBottom; break; } } @@ -191,6 +200,10 @@ void SCH_TEXTBOX::SwapData( SCH_ITEM* aItem ) SCH_TEXTBOX* item = static_cast( aItem ); std::swap( m_layer, item->m_layer ); + std::swap( m_marginLeft, item->m_marginLeft ); + std::swap( m_marginTop, item->m_marginTop ); + std::swap( m_marginRight, item->m_marginRight ); + std::swap( m_marginBottom, item->m_marginBottom ); SwapText( *item ); SwapAttributes( *item ); @@ -205,7 +218,7 @@ bool SCH_TEXTBOX::operator<( const SCH_ITEM& aItem ) const auto other = static_cast( &aItem ); if( GetLayer() != other->GetLayer() ) - return GetLayer() < other->GetLayer(); + return GetLayer() < other->GetLayer(); if( GetPosition().x != other->GetPosition().x ) return GetPosition().x < other->GetPosition().x; @@ -213,6 +226,18 @@ bool SCH_TEXTBOX::operator<( const SCH_ITEM& aItem ) const if( GetPosition().y != other->GetPosition().y ) return GetPosition().y < other->GetPosition().y; + if( GetMarginLeft() != other->GetMarginLeft() ) + return GetMarginLeft() < other->GetMarginLeft(); + + if( GetMarginTop() != other->GetMarginTop() ) + return GetMarginTop() < other->GetMarginTop(); + + if( GetMarginRight() != other->GetMarginRight() ) + return GetMarginRight() < other->GetMarginRight(); + + if( GetMarginBottom() != other->GetMarginBottom() ) + return GetMarginBottom() < other->GetMarginBottom(); + if( GetExcludedFromSim() != other->GetExcludedFromSim() ) return GetExcludedFromSim() - other->GetExcludedFromSim(); @@ -319,9 +344,13 @@ wxString SCH_TEXTBOX::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtr font = KIFONT::FONT::GetFont( GetDefaultFont(), IsBold(), IsItalic() ); VECTOR2I size = GetEnd() - GetStart(); - int colWidth = GetTextAngle() == ANGLE_HORIZONTAL ? size.x : size.y; + int colWidth; + + if( GetTextAngle().IsVertical() ) + colWidth = abs( size.y ) - ( GetMarginTop() + GetMarginBottom() ); + else + colWidth = abs( size.x ) - ( GetMarginLeft() + GetMarginRight() ); - colWidth = abs( colWidth ) - GetTextMargin() * 2; font->LinebreakText( text, colWidth, GetTextSize(), GetTextThickness(), IsBold(), IsItalic() ); return text; @@ -475,6 +504,18 @@ bool SCH_TEXTBOX::operator==( const SCH_ITEM& aOther ) const if( m_excludedFromSim != other.m_excludedFromSim ) return false; + if( GetMarginLeft() != other.GetMarginLeft() ) + return false; + + if( GetMarginTop() != other.GetMarginTop() ) + return false; + + if( GetMarginRight() != other.GetMarginRight() ) + return false; + + if( GetMarginBottom() != other.GetMarginBottom() ) + return false; + return SCH_SHAPE::operator==( aOther ) && EDA_TEXT::operator==( other ); } @@ -491,6 +532,18 @@ double SCH_TEXTBOX::Similarity( const SCH_ITEM& aOther ) const if( m_excludedFromSim != other.m_excludedFromSim ) similarity *= 0.9; + if( GetMarginLeft() != other.GetMarginLeft() ) + similarity *= 0.9; + + if( GetMarginTop() != other.GetMarginTop() ) + similarity *= 0.9; + + if( GetMarginRight() != other.GetMarginRight() ) + similarity *= 0.9; + + if( GetMarginBottom() != other.GetMarginBottom() ) + similarity *= 0.9; + similarity *= SCH_SHAPE::Similarity( aOther ); similarity *= EDA_TEXT::Similarity( other ); @@ -514,12 +567,33 @@ static struct SCH_TEXTBOX_DESC propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_SHAPE ), _HKI( "Shape" ) ); + propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Visible" ) ); propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Width" ) ); propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Height" ) ); propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Thickness" ) ); + const wxString marginProps = _( "Margins" ); + + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Left" ), + &SCH_TEXTBOX::SetMarginLeft, &SCH_TEXTBOX::GetMarginLeft, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Top" ), + &SCH_TEXTBOX::SetMarginTop, &SCH_TEXTBOX::GetMarginTop, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Right" ), + &SCH_TEXTBOX::SetMarginRight, &SCH_TEXTBOX::GetMarginRight, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Bottom" ), + &SCH_TEXTBOX::SetMarginBottom, &SCH_TEXTBOX::GetMarginBottom, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + propMgr.AddProperty( new PROPERTY( _HKI( "Text Size" ), - &SCH_TEXTBOX::SetSchTextSize, &SCH_TEXTBOX::GetSchTextSize, PROPERTY_DISPLAY::PT_SIZE ), + &SCH_TEXTBOX::SetSchTextSize, &SCH_TEXTBOX::GetSchTextSize, + PROPERTY_DISPLAY::PT_SIZE ), _( "Text Properties" ) ); propMgr.Mask( TYPE_HASH( SCH_TEXTBOX ), TYPE_HASH( EDA_TEXT ), _HKI( "Orientation" ) ); diff --git a/eeschema/sch_textbox.h b/eeschema/sch_textbox.h index 83a111421a..adbb51cecf 100644 --- a/eeschema/sch_textbox.h +++ b/eeschema/sch_textbox.h @@ -52,7 +52,17 @@ public: return wxT( "SCH_TEXTBOX" ); } - int GetTextMargin() const; + int GetLegacyTextMargin() const; + + void SetMarginLeft( int aLeft ) { m_marginLeft = aLeft; } + void SetMarginTop( int aTop ) { m_marginTop = aTop; } + void SetMarginRight( int aRight ) { m_marginRight = aRight; } + void SetMarginBottom( int aBottom ) { m_marginBottom = aBottom; } + + int GetMarginLeft() const { return m_marginLeft; } + int GetMarginTop() const { return m_marginTop; } + int GetMarginRight() const { return m_marginRight; } + int GetMarginBottom() const { return m_marginBottom; } int GetSchTextSize() const { return GetTextWidth(); } void SetSchTextSize( int aSize ) { SetTextSize( VECTOR2I( aSize, aSize ) ); } @@ -141,6 +151,10 @@ protected: protected: bool m_excludedFromSim; + int m_marginLeft; + int m_marginTop; + int m_marginRight; + int m_marginBottom; }; diff --git a/eeschema/schematic.keywords b/eeschema/schematic.keywords index 955ce4c386..e00b2c68e6 100644 --- a/eeschema/schematic.keywords +++ b/eeschema/schematic.keywords @@ -80,6 +80,7 @@ lib_name lib_symbols line line_spacing +margins members mid mirror diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index d7ab697986..71b31a8117 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -2123,7 +2123,10 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) SCH_TEXTBOX* textbox = static_cast( item ); BOX2I bbox = textbox->GetBoundingBox(); - bbox.Inflate( -textbox->GetTextMargin() ); + bbox.SetOrigin( bbox.GetLeft() + textbox->GetMarginLeft(), + bbox.GetTop() + textbox->GetMarginTop() ); + bbox.SetEnd( bbox.GetRight() - textbox->GetMarginRight(), + bbox.GetBottom() - textbox->GetMarginBottom() ); if( convertTo == SCH_LABEL_T || convertTo == SCH_HIER_LABEL_T @@ -2277,14 +2280,16 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) new_textbox->SetAttributes( *sourceText, false ); - int margin = new_textbox->GetTextMargin(); - bbox.Inflate( margin ); + bbox.SetOrigin( bbox.GetLeft() - new_textbox->GetMarginLeft(), + bbox.GetTop() - new_textbox->GetMarginTop() ); + bbox.SetEnd( bbox.GetRight() + new_textbox->GetMarginRight(), + bbox.GetBottom() + new_textbox->GetMarginBottom() ); VECTOR2I topLeft = bbox.GetPosition(); VECTOR2I botRight = bbox.GetEnd(); // Add 1/20 of the margin at the end to reduce line-breaking changes. - int slop = margin / 20; + int slop = new_textbox->GetLegacyTextMargin() / 20; if( sourceText->GetTextAngle() == ANGLE_VERTICAL ) { diff --git a/pcbnew/dialogs/dialog_tablecell_properties.cpp b/pcbnew/dialogs/dialog_tablecell_properties.cpp index 0db3d90082..3ca334075e 100644 --- a/pcbnew/dialogs/dialog_tablecell_properties.cpp +++ b/pcbnew/dialogs/dialog_tablecell_properties.cpp @@ -74,6 +74,10 @@ DIALOG_TABLECELL_PROPERTIES::DIALOG_TABLECELL_PROPERTIES( PCB_BASE_EDIT_FRAME* a m_textHeight( aFrame, m_SizeYLabel, m_SizeYCtrl, m_SizeYUnits ), m_textWidth( aFrame, m_SizeXLabel, m_SizeXCtrl, m_SizeXUnits ), m_textThickness( aFrame, m_ThicknessLabel, m_ThicknessCtrl, m_ThicknessUnits ), + m_marginLeft( aFrame, nullptr, m_marginLeftCtrl, nullptr ), + m_marginTop( aFrame, nullptr, m_marginTopCtrl, m_marginTopUnits ), + m_marginRight( aFrame, nullptr, m_marginRightCtrl, nullptr ), + m_marginBottom( aFrame, nullptr, m_marginBottomCtrl, nullptr ), m_scintillaTricks( nullptr ) { m_table = static_cast( m_cell->GetParent() ); @@ -254,6 +258,11 @@ bool DIALOG_TABLECELL_PROPERTIES::TransferDataToWindow() case GR_TEXT_V_ALIGN_BOTTOM: m_vAlignBottom->Check(); break; } + m_marginLeft.SetValue( m_cell->GetMarginLeft() ); + m_marginTop.SetValue( m_cell->GetMarginTop() ); + m_marginRight.SetValue( m_cell->GetMarginRight() ); + m_marginBottom.SetValue( m_cell->GetMarginBottom() ); + return true; } @@ -459,6 +468,11 @@ bool DIALOG_TABLECELL_PROPERTIES::TransferDataFromWindow() else m_cell->SetVertJustify( GR_TEXT_V_ALIGN_TOP ); + m_cell->SetMarginLeft( m_marginLeft.GetIntValue() ); + m_cell->SetMarginTop( m_marginTop.GetIntValue() ); + m_cell->SetMarginRight( m_marginRight.GetIntValue() ); + m_cell->SetMarginBottom( m_marginBottom.GetIntValue() ); + if( !commit.Empty() ) commit.Push( _( "Edit Table Cell" ), SKIP_CONNECTIVITY ); diff --git a/pcbnew/dialogs/dialog_tablecell_properties.h b/pcbnew/dialogs/dialog_tablecell_properties.h index 068770d19c..b0b50f81a7 100644 --- a/pcbnew/dialogs/dialog_tablecell_properties.h +++ b/pcbnew/dialogs/dialog_tablecell_properties.h @@ -64,6 +64,10 @@ private: UNIT_BINDER m_textHeight; UNIT_BINDER m_textWidth; UNIT_BINDER m_textThickness; + UNIT_BINDER m_marginLeft; + UNIT_BINDER m_marginTop; + UNIT_BINDER m_marginRight; + UNIT_BINDER m_marginBottom; SCINTILLA_TRICKS* m_scintillaTricks; }; diff --git a/pcbnew/dialogs/dialog_tablecell_properties_base.cpp b/pcbnew/dialogs/dialog_tablecell_properties_base.cpp index 89797a4261..31e2bfc608 100644 --- a/pcbnew/dialogs/dialog_tablecell_properties_base.cpp +++ b/pcbnew/dialogs/dialog_tablecell_properties_base.cpp @@ -241,7 +241,7 @@ DIALOG_TABLECELL_PROPERTIES_BASE::DIALOG_TABLECELL_PROPERTIES_BASE( wxWindow* pa bSizeCtrlSizer->Add( m_separator4, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bMargins->Add( bSizeCtrlSizer, 0, wxBOTTOM, 10 ); + bMargins->Add( bSizeCtrlSizer, 0, wxBOTTOM, 5 ); wxGridBagSizer* gbSizer2; gbSizer2 = new wxGridBagSizer( 4, 5 ); @@ -262,7 +262,7 @@ DIALOG_TABLECELL_PROPERTIES_BASE::DIALOG_TABLECELL_PROPERTIES_BASE( wxWindow* pa gbSizer2->AddGrowableCol( 1 ); - bMargins->Add( gbSizer2, 0, wxEXPAND|wxBOTTOM, 5 ); + bMargins->Add( gbSizer2, 0, wxEXPAND, 5 ); wxGridBagSizer* gbSizer1; gbSizer1 = new wxGridBagSizer( 3, 5 ); @@ -312,6 +312,58 @@ DIALOG_TABLECELL_PROPERTIES_BASE::DIALOG_TABLECELL_PROPERTIES_BASE( wxWindow* pa bMargins->Add( gbSizer1, 1, wxEXPAND|wxTOP, 5 ); + wxGridBagSizer* gbSizer3; + gbSizer3 = new wxGridBagSizer( 1, 0 ); + gbSizer3->SetFlexibleDirection( wxBOTH ); + gbSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_marginsLable = new wxStaticText( m_cellPage, wxID_ANY, _("Margins:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_marginsLable->Wrap( -1 ); + gbSizer3->Add( m_marginsLable, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 35 ); + + wxBoxSizer* marginTopSizer; + marginTopSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_marginTopCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + marginTopSizer->Add( m_marginTopCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_marginTopUnits = new wxStaticText( m_cellPage, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_marginTopUnits->Wrap( -1 ); + marginTopSizer->Add( m_marginTopUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); + + + gbSizer3->Add( marginTopSizer, wxGBPosition( 0, 2 ), wxGBSpan( 1, 4 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* marginLeftSizer; + marginLeftSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_marginLeftCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + marginLeftSizer->Add( m_marginLeftCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizer3->Add( marginLeftSizer, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxEXPAND|wxRIGHT|wxLEFT, 25 ); + + wxBoxSizer* marginRightSizer; + marginRightSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_marginRightCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + marginRightSizer->Add( m_marginRightCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizer3->Add( marginRightSizer, wxGBPosition( 1, 3 ), wxGBSpan( 1, 3 ), wxEXPAND, 5 ); + + wxBoxSizer* bSizer19; + bSizer19 = new wxBoxSizer( wxHORIZONTAL ); + + m_marginBottomCtrl = new wxTextCtrl( m_cellPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer19->Add( m_marginBottomCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + gbSizer3->Add( bSizer19, wxGBPosition( 2, 2 ), wxGBSpan( 1, 4 ), wxEXPAND, 5 ); + + + bMargins->Add( gbSizer3, 1, wxEXPAND, 5 ); + bSizer13->Add( bMargins, 1, wxEXPAND|wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_tablecell_properties_base.fbp b/pcbnew/dialogs/dialog_tablecell_properties_base.fbp index 7cc79feba3..857751a0cd 100644 --- a/pcbnew/dialogs/dialog_tablecell_properties_base.fbp +++ b/pcbnew/dialogs/dialog_tablecell_properties_base.fbp @@ -1592,7 +1592,7 @@ wxVERTICAL none - 10 + 5 wxBOTTOM 0 @@ -2492,7 +2492,7 @@ 5 - wxEXPAND|wxBOTTOM + wxEXPAND 0 -1,5 @@ -3254,6 +3254,466 @@ + + 5 + wxEXPAND + 1 + + + wxBOTH + + + 0 + + gbSizer3 + wxFLEX_GROWMODE_SPECIFIED + none + 1 + + 35 + 2 + 0 + wxRIGHT|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Margins: + 0 + + 0 + + + 0 + + 1 + m_marginsLable + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + 4 + 2 + wxEXPAND|wxALIGN_CENTER_VERTICAL + 0 + 1 + + + marginTopSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginTopCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 3 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + 0 + + 0 + + + 0 + + 1 + m_marginTopUnits + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + + + 25 + 3 + 0 + wxEXPAND|wxRIGHT|wxLEFT + 1 + 1 + + + marginLeftSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginLeftCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 5 + 3 + 3 + wxEXPAND + 1 + 1 + + + marginRightSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginRightCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 5 + 4 + 2 + wxEXPAND + 2 + 1 + + + bSizer19 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_marginBottomCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_tablecell_properties_base.h b/pcbnew/dialogs/dialog_tablecell_properties_base.h index cd71ce458c..ccf8ef169a 100644 --- a/pcbnew/dialogs/dialog_tablecell_properties_base.h +++ b/pcbnew/dialogs/dialog_tablecell_properties_base.h @@ -95,6 +95,12 @@ class DIALOG_TABLECELL_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_ThicknessLabel; wxTextCtrl* m_ThicknessCtrl; wxStaticText* m_ThicknessUnits; + wxStaticText* m_marginsLable; + wxTextCtrl* m_marginTopCtrl; + wxStaticText* m_marginTopUnits; + wxTextCtrl* m_marginLeftCtrl; + wxTextCtrl* m_marginRightCtrl; + wxTextCtrl* m_marginBottomCtrl; wxButton* m_applyButton; wxStaticText* m_hotkeyHint; wxStdDialogButtonSizer* m_sdbSizer1; diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp index 2d7676f547..f2dc693c69 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp @@ -1919,6 +1919,12 @@ void PCB_IO_KICAD_SEXPR::format( const PCB_TEXTBOX* aTextBox, int aNestLevel ) c UNIMPLEMENTED_FOR( aTextBox->SHAPE_T_asString() ); } + m_out->Print( 0, " (margins %s %s %s %s)", + formatInternalUnits( aTextBox->GetMarginLeft() ).c_str(), + formatInternalUnits( aTextBox->GetMarginTop() ).c_str(), + formatInternalUnits( aTextBox->GetMarginRight() ).c_str(), + formatInternalUnits( aTextBox->GetMarginBottom() ).c_str() ); + if( const PCB_TABLECELL* cell = dynamic_cast( aTextBox ) ) m_out->Print( 0, " (span %d %d)", cell->GetColSpan(), cell->GetRowSpan() ); diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp index 8e33f5ce47..580e95e597 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp @@ -405,6 +405,15 @@ void PCB_IO_KICAD_SEXPR_PARSER::parseXY( int* aX, int* aY ) } +void PCB_IO_KICAD_SEXPR_PARSER::parseMargins( int& aLeft, int& aTop, int& aRight, int& aBottom ) +{ + aLeft = parseBoardUnits( "left margin" ); + aTop = parseBoardUnits( "top margin" ); + aRight = parseBoardUnits( "right margin" ); + aBottom = parseBoardUnits( "bottom margin" ); +} + + std::pair PCB_IO_KICAD_SEXPR_PARSER::parseBoardProperty() { wxString pName; @@ -3361,7 +3370,13 @@ PCB_TABLECELL* PCB_IO_KICAD_SEXPR_PARSER::parsePCB_TABLECELL( BOARD_ITEM* aParen void PCB_IO_KICAD_SEXPR_PARSER::parseTextBoxContent( PCB_TEXTBOX* aTextBox ) { + int left; + int top; + int right; + int bottom; STROKE_PARAMS stroke( -1, LINE_STYLE::SOLID ); + bool foundMargins = false; + T token = NextTok(); if( token == T_locked ) @@ -3441,6 +3456,16 @@ void PCB_IO_KICAD_SEXPR_PARSER::parseTextBoxContent( PCB_TEXTBOX* aTextBox ) NeedRIGHT(); break; + case T_margins: + parseMargins( left, top, right, bottom ); + aTextBox->SetMarginLeft( left ); + aTextBox->SetMarginTop( top ); + aTextBox->SetMarginRight( right ); + aTextBox->SetMarginBottom( bottom ); + foundMargins = true; + NeedRIGHT(); + break; + case T_layer: aTextBox->SetLayer( parseBoardItemLayer() ); NeedRIGHT(); @@ -3488,6 +3513,14 @@ void PCB_IO_KICAD_SEXPR_PARSER::parseTextBoxContent( PCB_TEXTBOX* aTextBox ) if( m_requiredVersion < 20230825 ) // compat, we move to an explicit flag aTextBox->SetBorderEnabled( stroke.GetWidth() >= 0 ); + if( !foundMargins ) + { + int margin = aTextBox->GetLegacyTextMargin(); + aTextBox->SetMarginLeft( margin ); + aTextBox->SetMarginTop( margin ); + aTextBox->SetMarginRight( margin ); + aTextBox->SetMarginBottom( margin ); + } if( FOOTPRINT* parentFP = dynamic_cast( aTextBox->GetParent() ) ) { diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h index 4dd20d60c8..63ea7984bc 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h @@ -283,6 +283,8 @@ private: void parseXY( int* aX, int* aY ); + void parseMargins( int& aLeft, int& aTop, int& aRight, int& aBottom ); + std::pair parseBoardProperty(); /** diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index fab742ed3a..a82bd2cd8a 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -46,6 +46,12 @@ PCB_TEXTBOX::PCB_TEXTBOX( BOARD_ITEM* aParent, KICAD_T aType ) : SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); SetVertJustify( GR_TEXT_V_ALIGN_TOP ); SetMultilineAllowed( true ); + + int defaultMargin = GetLegacyTextMargin(); + m_marginLeft = defaultMargin; + m_marginTop = defaultMargin; + m_marginRight = defaultMargin; + m_marginBottom = defaultMargin; } @@ -66,7 +72,7 @@ void PCB_TEXTBOX::StyleFromSettings( const BOARD_DESIGN_SETTINGS& settings ) } -int PCB_TEXTBOX::GetTextMargin() const +int PCB_TEXTBOX::GetLegacyTextMargin() const { return KiROUND( GetStroke().GetWidth() / 2.0 ) + KiROUND( GetTextSize().y * 0.75 ); } @@ -257,15 +263,15 @@ VECTOR2I PCB_TEXTBOX::GetDrawPos() const { case GR_TEXT_H_ALIGN_LEFT: textAnchor = corners[0]; - offset = VECTOR2I( GetTextMargin(), GetTextMargin() ); + offset = VECTOR2I( GetMarginLeft(), GetMarginTop() ); break; case GR_TEXT_H_ALIGN_CENTER: textAnchor = ( corners[0] + corners[1] ) / 2; - offset = VECTOR2I( 0, GetTextMargin() ); + offset = VECTOR2I( 0, GetMarginTop() ); break; case GR_TEXT_H_ALIGN_RIGHT: textAnchor = corners[1]; - offset = VECTOR2I( -GetTextMargin(), GetTextMargin() ); + offset = VECTOR2I( -GetMarginRight(), GetMarginTop() ); break; } @@ -339,7 +345,11 @@ wxString PCB_TEXTBOX::GetShownText( bool aAllowExtraText, int aDepth ) const std::vector corners = GetAnchorAndOppositeCorner(); int colWidth = ( corners[1] - corners[0] ).EuclideanNorm(); - colWidth -= GetTextMargin() * 2; + if( GetTextAngle().IsHorizontal() ) + colWidth -= ( GetMarginLeft() + GetMarginRight() ); + else + colWidth -= ( GetMarginTop() + GetMarginBottom() ); + font->LinebreakText( text, colWidth, GetTextSize(), GetTextThickness(), IsBold(), IsItalic() ); return text; @@ -639,6 +649,18 @@ double PCB_TEXTBOX::Similarity( const BOARD_ITEM& aBoardItem ) const if( m_borderEnabled != other.m_borderEnabled ) similarity *= 0.9; + if( GetMarginLeft() != other.GetMarginLeft() ) + similarity *= 0.9; + + if( GetMarginTop() != other.GetMarginTop() ) + similarity *= 0.9; + + if( GetMarginRight() != other.GetMarginRight() ) + similarity *= 0.9; + + if( GetMarginBottom() != other.GetMarginBottom() ) + similarity *= 0.9; + similarity *= EDA_TEXT::Similarity( other ); return similarity; @@ -684,19 +706,36 @@ static struct PCB_TEXTBOX_DESC LINE_STYLE ( PCB_TEXTBOX::*lineStyleGetter )() const = &PCB_TEXTBOX::GetLineStyle; propMgr.AddProperty( new PROPERTY( _HKI( "Border" ), - &PCB_TEXTBOX::SetBorderEnabled, - &PCB_TEXTBOX::IsBorderEnabled ), - borderProps ); + &PCB_TEXTBOX::SetBorderEnabled, &PCB_TEXTBOX::IsBorderEnabled ), + borderProps ); propMgr.AddProperty( new PROPERTY_ENUM( _HKI( "Border Style" ), - lineStyleSetter, - lineStyleGetter ), - borderProps ); + lineStyleSetter, lineStyleGetter ), + borderProps ); propMgr.AddProperty( new PROPERTY( _HKI( "Border Width" ), - &PCB_TEXTBOX::SetBorderWidth, - &PCB_TEXTBOX::GetBorderWidth, - PROPERTY_DISPLAY::PT_SIZE ), - borderProps ); + &PCB_TEXTBOX::SetBorderWidth, &PCB_TEXTBOX::GetBorderWidth, + PROPERTY_DISPLAY::PT_SIZE ), + borderProps ); + + const wxString marginProps = _( "Margins" ); + + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Left" ), + &PCB_TEXTBOX::SetMarginLeft, &PCB_TEXTBOX::GetMarginLeft, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Top" ), + &PCB_TEXTBOX::SetMarginTop, &PCB_TEXTBOX::GetMarginTop, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Right" ), + &PCB_TEXTBOX::SetMarginRight, &PCB_TEXTBOX::GetMarginRight, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + propMgr.AddProperty( new PROPERTY( _HKI( "Margin Bottom" ), + &PCB_TEXTBOX::SetMarginBottom, &PCB_TEXTBOX::GetMarginBottom, + PROPERTY_DISPLAY::PT_SIZE ), + marginProps ); + } } _PCB_TEXTBOX_DESC; diff --git a/pcbnew/pcb_textbox.h b/pcbnew/pcb_textbox.h index de5240e4c2..caf50bbc4b 100644 --- a/pcbnew/pcb_textbox.h +++ b/pcbnew/pcb_textbox.h @@ -74,7 +74,17 @@ public: void StyleFromSettings( const BOARD_DESIGN_SETTINGS& settings ) override; - int GetTextMargin() const; + int GetLegacyTextMargin() const; + + void SetMarginLeft( int aLeft ) { m_marginLeft = aLeft; } + void SetMarginTop( int aTop ) { m_marginTop = aTop; } + void SetMarginRight( int aRight ) { m_marginRight = aRight; } + void SetMarginBottom( int aBottom ) { m_marginBottom = aBottom; } + + int GetMarginLeft() const { return m_marginLeft; } + int GetMarginTop() const { return m_marginTop; } + int GetMarginRight() const { return m_marginRight; } + int GetMarginBottom() const { return m_marginBottom; } VECTOR2I GetDrawPos() const override; @@ -159,6 +169,12 @@ protected: virtual void swapData( BOARD_ITEM* aImage ) override; const KIFONT::METRICS& getFontMetrics() const override { return GetFontMetrics(); } + +private: + int m_marginLeft; + int m_marginTop; + int m_marginRight; + int m_marginBottom; }; #endif // #define PCB_TEXTBOX_H