diff --git a/eeschema/dialogs/dialog_lib_textbox_properties.cpp b/eeschema/dialogs/dialog_lib_textbox_properties.cpp
index b507dbb72c..8b2fbb95a5 100644
--- a/eeschema/dialogs/dialog_lib_textbox_properties.cpp
+++ b/eeschema/dialogs/dialog_lib_textbox_properties.cpp
@@ -128,10 +128,21 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataToWindow()
m_bold->Check( m_currentText->IsBold() );
m_italic->Check( m_currentText->IsItalic() );
- m_borderCheckbox->SetValue( m_currentText->GetWidth() >= 0 );
-
if( m_currentText->GetWidth() >= 0 )
+ {
+ m_borderCheckbox->SetValue( true );
m_borderWidth.SetValue( m_currentText->GetWidth() );
+ }
+ else
+ {
+ m_borderCheckbox->SetValue( false );
+
+ m_borderWidth.Enable( false );
+ m_borderColorLabel->Enable( false );
+ m_borderColorSwatch->Enable( false );
+ m_borderStyleLabel->Enable( false );
+ m_borderStyleCombo->Enable( false );
+ }
m_borderColorSwatch->SetSwatchColor( m_currentText->GetStroke().GetColor(), false );
@@ -144,12 +155,6 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataToWindow()
else
wxFAIL_MSG( "Line type not found in the type lookup map" );
- m_borderWidth.Enable( m_currentText->GetWidth() >= 0 );
- m_borderColorLabel->Enable( m_currentText->GetWidth() >= 0 );
- m_borderColorSwatch->Enable( m_currentText->GetWidth() >= 0 );
- m_borderStyleLabel->Enable( m_currentText->GetWidth() >= 0 );
- m_borderStyleCombo->Enable( m_currentText->GetWidth() >= 0 );
-
m_filledCtrl->SetValue( m_currentText->IsFilled() );
m_fillColorSwatch->SetSwatchColor( m_currentText->GetFillColor(), false );
@@ -198,10 +203,6 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow()
if( !wxDialog::TransferDataFromWindow() )
return false;
- // Don't allow text to disappear; it can be difficult to correct if you can't select it
- if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
- return false;
-
wxString text = m_textCtrl->GetValue();
#ifdef __WXMAC__
@@ -274,14 +275,9 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow()
STROKE_PARAMS stroke = m_currentText->GetStroke();
if( m_borderCheckbox->GetValue() )
- {
- if( !m_borderWidth.IsIndeterminate() )
- stroke.SetWidth( m_borderWidth.GetValue() );
- }
+ stroke.SetWidth( std::max( (long long int) 0, m_borderWidth.GetValue() ) );
else
- {
stroke.SetWidth( -1 );
- }
auto it = lineTypeNames.begin();
std::advance( it, m_borderStyleCombo->GetSelection() );
diff --git a/eeschema/dialogs/dialog_line_properties.cpp b/eeschema/dialogs/dialog_line_properties.cpp
index 97a9242712..f4b936386d 100644
--- a/eeschema/dialogs/dialog_line_properties.cpp
+++ b/eeschema/dialogs/dialog_line_properties.cpp
@@ -135,7 +135,7 @@ bool DIALOG_LINE_PROPERTIES::TransferDataFromWindow()
for( SCH_LINE* line : m_lines )
{
if( !m_width.IsIndeterminate() )
- line->SetLineWidth( m_width.GetValue() );
+ line->SetLineWidth( std::max( (long long int) 0, m_width.GetValue() ) );
auto it = lineTypeNames.begin();
std::advance( it, m_typeCombo->GetSelection() );
diff --git a/eeschema/dialogs/dialog_line_properties_base.cpp b/eeschema/dialogs/dialog_line_properties_base.cpp
index e3a11762ac..0035844a5e 100644
--- a/eeschema/dialogs/dialog_line_properties_base.cpp
+++ b/eeschema/dialogs/dialog_line_properties_base.cpp
@@ -23,27 +23,27 @@ DIALOG_LINE_PROPERTIES_BASE::DIALOG_LINE_PROPERTIES_BASE( wxWindow* parent, wxWi
mainSizer = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizerGeneral;
- fgSizerGeneral = new wxFlexGridSizer( 0, 3, 0, 0 );
+ fgSizerGeneral = new wxFlexGridSizer( 0, 3, 3, 0 );
fgSizerGeneral->AddGrowableCol( 1 );
fgSizerGeneral->SetFlexibleDirection( wxBOTH );
fgSizerGeneral->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextWidth = new wxStaticText( this, wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextWidth->Wrap( -1 );
- fgSizerGeneral->Add( m_staticTextWidth, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 3 );
+ fgSizerGeneral->Add( m_staticTextWidth, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 );
m_lineWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
- fgSizerGeneral->Add( m_lineWidth, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 3 );
+ fgSizerGeneral->Add( m_lineWidth, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 3 );
m_staticWidthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticWidthUnits->Wrap( -1 );
m_staticWidthUnits->SetMinSize( wxSize( 40,-1 ) );
- fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 3 );
+ fgSizerGeneral->Add( m_staticWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 );
m_staticTextColor = new wxStaticText( this, wxID_ANY, _("Color:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextColor->Wrap( -1 );
- fgSizerGeneral->Add( m_staticTextColor, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
+ fgSizerGeneral->Add( m_staticTextColor, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_panel1 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
wxBoxSizer* bSizer2;
@@ -56,30 +56,36 @@ DIALOG_LINE_PROPERTIES_BASE::DIALOG_LINE_PROPERTIES_BASE( wxWindow* parent, wxWi
m_panel1->SetSizer( bSizer2 );
m_panel1->Layout();
bSizer2->Fit( m_panel1 );
- fgSizerGeneral->Add( m_panel1, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 2 );
+ fgSizerGeneral->Add( m_panel1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 2 );
fgSizerGeneral->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticTextStyle = new wxStaticText( this, wxID_ANY, _("Style:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextStyle->Wrap( -1 );
- fgSizerGeneral->Add( m_staticTextStyle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
+ fgSizerGeneral->Add( m_staticTextStyle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_typeCombo = new wxBitmapComboBox( this, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
m_typeCombo->SetMinSize( wxSize( 240,-1 ) );
- fgSizerGeneral->Add( m_typeCombo, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 3 );
+ fgSizerGeneral->Add( m_typeCombo, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 3 );
mainSizer->Add( fgSizerGeneral, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 10 );
- m_helpLabel1 = new wxStaticText( this, wxID_ANY, _("Set width to 0 to use Schematic default line width."), wxDefaultPosition, wxDefaultSize, 0 );
- m_helpLabel1->Wrap( 333 );
- mainSizer->Add( m_helpLabel1, 0, wxRIGHT|wxLEFT, 10 );
+ wxBoxSizer* bSizer3;
+ bSizer3 = new wxBoxSizer( wxVERTICAL );
+
+ m_helpLabel1 = new wxStaticText( this, wxID_ANY, _("Set width to 0 to use schematic default line width."), wxDefaultPosition, wxDefaultSize, 0 );
+ m_helpLabel1->Wrap( -1 );
+ bSizer3->Add( m_helpLabel1, 0, wxRIGHT|wxLEFT, 10 );
m_helpLabel2 = new wxStaticText( this, wxID_ANY, _("Set color to transparent to use Schematic Editor colors."), wxDefaultPosition, wxDefaultSize, 0 );
m_helpLabel2->Wrap( -1 );
- mainSizer->Add( m_helpLabel2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 10 );
+ bSizer3->Add( m_helpLabel2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 10 );
+
+
+ mainSizer->Add( bSizer3, 0, wxEXPAND|wxTOP, 5 );
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
mainSizer->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
diff --git a/eeschema/dialogs/dialog_line_properties_base.fbp b/eeschema/dialogs/dialog_line_properties_base.fbp
index 500c1329c6..b83daa1b18 100644
--- a/eeschema/dialogs/dialog_line_properties_base.fbp
+++ b/eeschema/dialogs/dialog_line_properties_base.fbp
@@ -73,10 +73,10 @@
wxFLEX_GROWMODE_SPECIFIED
none
0
- 0
+ 3