From a76ddb52a0651bb8e7bafbf05094defeee419ff3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 2 Apr 2020 13:57:07 +0100 Subject: [PATCH] Add sheet borders and backgrounds to Edit Text & Graphics. Also moves sheet border and sheet background colours to preferences so it's clearer they're just for newly-created items. Fixes https://gitlab.com/kicad/code/kicad/issues/4144 --- common/settings/color_settings.cpp | 1 + .../dialog_global_edit_text_and_graphics.cpp | 63 +- ...log_global_edit_text_and_graphics_base.cpp | 87 +- ...log_global_edit_text_and_graphics_base.fbp | 680 +++++-- ...ialog_global_edit_text_and_graphics_base.h | 11 +- .../dialogs/panel_eeschema_color_settings.cpp | 34 +- .../dialogs/panel_eeschema_color_settings.h | 6 +- eeschema/dialogs/panel_eeschema_settings.cpp | 21 +- .../dialogs/panel_eeschema_settings_base.cpp | 189 +- .../dialogs/panel_eeschema_settings_base.fbp | 1751 ++++++++++------- .../dialogs/panel_eeschema_settings_base.h | 29 +- eeschema/eeschema_config.cpp | 30 + eeschema/general.h | 8 + eeschema/sch_sheet.cpp | 4 +- 14 files changed, 1875 insertions(+), 1039 deletions(-) diff --git a/common/settings/color_settings.cpp b/common/settings/color_settings.cpp index df1d5f6736..a408130934 100644 --- a/common/settings/color_settings.cpp +++ b/common/settings/color_settings.cpp @@ -88,6 +88,7 @@ COLOR_SETTINGS::COLOR_SETTINGS( std::string aFilename ) : CLR( "schematic.shadow", LAYER_SELECTION_SHADOWS, COLOR4D( .4, .7, 1.0, 0.8 ) ); #endif CLR( "schematic.sheet", LAYER_SHEET, COLOR4D( MAGENTA ) ); + CLR( "schematic.sheet_background", LAYER_SHEET_BACKGROUND, COLOR4D( WHITE ) ); CLR( "schematic.sheet_filename", LAYER_SHEETFILENAME, COLOR4D( BROWN ) ); CLR( "schematic.sheet_fields", LAYER_SHEETFIELDS, COLOR4D( MAGENTA ) ); CLR( "schematic.sheet_label", LAYER_SHEETLABEL, COLOR4D( CYAN ) ); diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp index 2d4d653e65..ccc5b2c324 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -44,7 +44,9 @@ static bool g_modifyBusses; static bool g_modifyGlobalLabels; static bool g_modifyHierLabels; static bool g_modifySheetTitles; +static bool g_modifyOtherSheetFields; static bool g_modifySheetPins; +static bool g_modifySheetBorders; static bool g_modifySchTextAndGraphics; static bool g_filterByFieldname; @@ -117,7 +119,9 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::~DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS() g_modifyGlobalLabels = m_globalLabels->GetValue(); g_modifyHierLabels = m_hierLabels->GetValue(); g_modifySheetTitles = m_sheetTitles->GetValue(); + g_modifyOtherSheetFields = m_sheetFields->GetValue(); g_modifySheetPins = m_sheetPins->GetValue(); + g_modifySheetBorders = m_sheetBorders->GetValue(); g_modifySchTextAndGraphics = m_schTextAndGraphics->GetValue(); g_filterByFieldname = m_fieldnameFilterOpt->GetValue(); @@ -144,7 +148,9 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() m_globalLabels->SetValue( g_modifyGlobalLabels ); m_hierLabels->SetValue( g_modifyHierLabels ); m_sheetTitles->SetValue( g_modifySheetTitles ); + m_sheetFields->SetValue( g_modifyOtherSheetFields ); m_sheetPins->SetValue( g_modifySheetPins ); + m_sheetBorders->SetValue( g_modifySheetBorders ); m_schTextAndGraphics->SetValue( g_modifySchTextAndGraphics ); // SetValue() generates events, ChangeValue() does not @@ -185,6 +191,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() m_lineWidth.SetValue( INDETERMINATE ); m_lineStyle->SetStringSelection( INDETERMINATE ); m_setColor->SetValue( false ); + m_setBgColor->SetValue( false ); return true; } @@ -269,7 +276,7 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( const SCH_SHEET_PATH& aS if( m_setColor->GetValue() ) { - lineItem->SetLineColor( m_color->GetColour() ); + lineItem->SetLineColor( m_colorSwatch->GetSwatchColor() ); m_hasChange = true; } } @@ -341,6 +348,51 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( const SCH_SHEET_PATH& aShe } } } + else if( aItem->Type() == SCH_SHEET_T ) + { + SCH_SHEET* sheet = static_cast( aItem ); + + if( m_sheetTitles->GetValue() ) + processItem( aSheetPath, &sheet->GetFields()[ SHEETNAME ] ); + + if( m_sheetFields->GetValue() ) + { + for( SCH_FIELD& field : sheet->GetFields() ) + { + if( field.GetId() == SHEETNAME ) + continue; + + const wxString& fieldName = field.GetName(); + + if( !m_fieldnameFilterOpt->GetValue() || m_fieldnameFilter->GetValue().IsEmpty() + || WildCompareString( m_fieldnameFilter->GetValue(), fieldName, false ) ) + { + processItem( aSheetPath, &field ); + } + } + } + + if( m_sheetBorders->GetValue() ) + { + if( !m_lineWidth.IsIndeterminate() ) + { + sheet->SetBorderWidth( m_lineWidth.GetValue() ); + m_hasChange = true; + } + + if( m_setColor->GetValue() ) + { + sheet->SetBorderColor( m_colorSwatch->GetSwatchColor() ); + m_hasChange = true; + } + + if( m_setBgColor->GetValue() ) + { + sheet->SetBackgroundColor( m_bgColorSwatch->GetSwatchColor() ); + m_hasChange = true; + } + } + } else if( m_wires->GetValue() && aItem->IsType( wireTypes ) ) processItem( aSheetPath, aItem ); else if( m_busses->GetValue() && aItem->IsType( busTypes ) ) @@ -349,15 +401,6 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( const SCH_SHEET_PATH& aShe processItem( aSheetPath, aItem ); else if( m_hierLabels->GetValue() && aItem->Type() == SCH_HIER_LABEL_T ) processItem( aSheetPath, aItem ); - else if( m_sheetTitles->GetValue() && aItem->Type() == SCH_SHEET_T ) - { - if( !m_textSize.IsIndeterminate() ) - { - SCH_SHEET* sheet = static_cast( aItem ); - wxSize size( (int) m_textSize.GetValue(), (int) m_textSize.GetValue() ); - sheet->GetFields()[SHEETNAME].SetTextSize( size ); - } - } else if( m_sheetPins->GetValue() && aItem->Type() == SCH_SHEET_PIN_T ) processItem( aSheetPath, aItem ); else if( m_schTextAndGraphics->GetValue() && aItem->IsType( schTextAndGraphics ) ) diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.cpp b/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.cpp index 9d2748727c..ea3ee6156e 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.cpp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.cpp @@ -43,18 +43,24 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ m_globalLabels = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Global labels"), wxDefaultPosition, wxDefaultSize, 0 ); sbScope->Add( m_globalLabels, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 ); - - sbScope->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_hierLabels = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Hierarchical labels"), wxDefaultPosition, wxDefaultSize, 0 ); sbScope->Add( m_hierLabels, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 ); + + sbScope->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + m_sheetTitles = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Sheet titles"), wxDefaultPosition, wxDefaultSize, 0 ); sbScope->Add( m_sheetTitles, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 ); + m_sheetFields = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Other sheet fields"), wxDefaultPosition, wxDefaultSize, 0 ); + sbScope->Add( m_sheetFields, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 ); + m_sheetPins = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Sheet pins"), wxDefaultPosition, wxDefaultSize, 0 ); sbScope->Add( m_sheetPins, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 ); + m_sheetBorders = new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY, _("Sheet borders && backgrounds"), wxDefaultPosition, wxDefaultSize, 0 ); + sbScope->Add( m_sheetBorders, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 ); + sbScope->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); @@ -134,29 +140,32 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ bSizer2 = new wxBoxSizer( wxVERTICAL ); wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 0, 5, 0, 0 ); - fgSizer1->AddGrowableCol( 4 ); + fgSizer1 = new wxFlexGridSizer( 0, 6, 4, 0 ); + fgSizer1->AddGrowableCol( 3 ); fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_textSizeLabel = new wxStaticText( m_specifiedValues, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_textSizeLabel->Wrap( -1 ); - fgSizer1->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + fgSizer1->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_textSizeCtrl = new wxTextCtrl( m_specifiedValues, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textSizeCtrl->SetMinSize( wxSize( 120,-1 ) ); - fgSizer1->Add( m_textSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + fgSizer1->Add( m_textSizeCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_textSizeUnits = new wxStaticText( m_specifiedValues, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_textSizeUnits->Wrap( -1 ); - fgSizer1->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + fgSizer1->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - fgSizer1->Add( 10, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 20 ); + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); m_Bold = new wxCheckBox( m_specifiedValues, wxID_ANY, _("Bold"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER ); - fgSizer1->Add( m_Bold, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_Bold, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); orientationLabel = new wxStaticText( m_specifiedValues, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 ); orientationLabel->Wrap( -1 ); @@ -178,6 +187,12 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ fgSizer1->Add( m_Italic, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + + fgSizer1->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); @@ -194,13 +209,13 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ hAlignLabel = new wxStaticText( m_specifiedValues, wxID_ANY, _("H Alignment (fields only):"), wxDefaultPosition, wxDefaultSize, 0 ); hAlignLabel->Wrap( -1 ); - fgSizer1->Add( hAlignLabel, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( hAlignLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); wxString m_hAlignChoices[] = { _("Left"), _("Center"), _("Right"), _("...") }; int m_hAlignNChoices = sizeof( m_hAlignChoices ) / sizeof( wxString ); m_hAlign = new wxChoice( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_hAlignNChoices, m_hAlignChoices, 0 ); m_hAlign->SetSelection( 0 ); - fgSizer1->Add( m_hAlign, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + fgSizer1->Add( m_hAlign, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -209,17 +224,23 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); m_Visible = new wxCheckBox( m_specifiedValues, wxID_ANY, _("Visible (fields only)"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER ); - fgSizer1->Add( m_Visible, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + fgSizer1->Add( m_Visible, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); vAlignLabel = new wxStaticText( m_specifiedValues, wxID_ANY, _("V Alignment (fields only):"), wxDefaultPosition, wxDefaultSize, 0 ); vAlignLabel->Wrap( -1 ); - fgSizer1->Add( vAlignLabel, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( vAlignLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); wxString m_vAlignChoices[] = { _("Top"), _("Center"), _("Bottom"), _("...") }; int m_vAlignNChoices = sizeof( m_vAlignChoices ) / sizeof( wxString ); m_vAlign = new wxChoice( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_vAlignNChoices, m_vAlignChoices, 0 ); m_vAlign->SetSelection( 0 ); - fgSizer1->Add( m_vAlign, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + fgSizer1->Add( m_vAlign, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -236,6 +257,9 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ m_staticline2 = new wxStaticLine( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); fgSizer1->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 7 ); + m_staticline21 = new wxStaticLine( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + fgSizer1->Add( m_staticline21, 0, wxEXPAND|wxTOP|wxBOTTOM, 7 ); + m_staticline3 = new wxStaticLine( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); fgSizer1->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 7 ); @@ -247,30 +271,36 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ m_lineWidthLabel = new wxStaticText( m_specifiedValues, wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_lineWidthLabel->Wrap( -1 ); - fgSizer1->Add( m_lineWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + fgSizer1->Add( m_lineWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_LineWidthCtrl = new wxTextCtrl( m_specifiedValues, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_LineWidthCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + fgSizer1->Add( m_LineWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_lineWidthUnits = new wxStaticText( m_specifiedValues, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_lineWidthUnits->Wrap( -1 ); - fgSizer1->Add( m_lineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + fgSizer1->Add( m_lineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + m_setColor = new wxCheckBox( m_specifiedValues, wxID_ANY, _("Line color (sheets && graphics):"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_setColor, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); + m_colorSwatch = new COLOR_SWATCH( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_colorSwatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_colorSwatch->SetMinSize( wxSize( 48,24 ) ); + + fgSizer1->Add( m_colorSwatch, 0, wxRIGHT|wxLEFT, 5 ); lineStyleLabel = new wxStaticText( m_specifiedValues, wxID_ANY, _("Line style (graphics only):"), wxDefaultPosition, wxDefaultSize, 0 ); lineStyleLabel->Wrap( -1 ); - fgSizer1->Add( lineStyleLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + fgSizer1->Add( lineStyleLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); wxString m_lineStyleChoices[] = { _("Solid"), _("Dashed"), _("Dotted"), _("Dash-Dot"), _("...") }; int m_lineStyleNChoices = sizeof( m_lineStyleChoices ) / sizeof( wxString ); m_lineStyle = new wxChoice( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_lineStyleNChoices, m_lineStyleChoices, 0 ); m_lineStyle->SetSelection( 0 ); - fgSizer1->Add( m_lineStyle, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + fgSizer1->Add( m_lineStyle, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -278,17 +308,14 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_ fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - wxBoxSizer* bSizer4; - bSizer4 = new wxBoxSizer( wxHORIZONTAL ); + m_setBgColor = new wxCheckBox( m_specifiedValues, wxID_ANY, _("Background color (sheets only):"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_setBgColor, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_setColor = new wxCheckBox( m_specifiedValues, wxID_ANY, _("Color (graphics only):"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_setColor, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + m_bgColorSwatch = new COLOR_SWATCH( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_bgColorSwatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_bgColorSwatch->SetMinSize( wxSize( 48,24 ) ); - m_color = new wxColourPickerCtrl( m_specifiedValues, wxID_ANY, *wxBLACK, wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE ); - bSizer4->Add( m_color, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - - fgSizer1->Add( bSizer4, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_bgColorSwatch, 0, wxRIGHT|wxLEFT, 5 ); bSizer2->Add( fgSizer1, 1, wxEXPAND|wxTOP, 2 ); diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.fbp b/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.fbp index b7ed5d9b20..a6882626a8 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.fbp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.fbp @@ -474,16 +474,6 @@ - - 5 - wxEXPAND|wxTOP|wxBOTTOM - 1 - - 0 - protected - 0 - - 4 wxBOTTOM|wxRIGHT|wxLEFT @@ -548,6 +538,16 @@ + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + 0 + protected + 0 + + 4 wxBOTTOM|wxRIGHT|wxLEFT @@ -612,6 +612,70 @@ + + 4 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Other sheet fields + + 0 + + + 0 + + 1 + m_sheetFields + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 4 wxBOTTOM|wxRIGHT|wxLEFT @@ -676,6 +740,70 @@ + + 4 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Sheet borders && backgrounds + + 0 + + + 0 + + 1 + m_sheetBorders + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 wxEXPAND|wxTOP|wxBOTTOM @@ -1438,9 +1566,9 @@ wxEXPAND|wxTOP 1 - 5 + 6 wxBOTH - 4 + 3 0 @@ -1448,10 +1576,10 @@ wxFLEX_GROWMODE_SPECIFIED none 0 - 0 + 4 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1512,7 +1640,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1576,7 +1704,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -1635,19 +1763,19 @@ -1 - - 20 - wxEXPAND|wxRIGHT|wxLEFT - 0 - + + 5 + wxEXPAND + 1 + 0 protected - 10 + 0 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -1709,6 +1837,16 @@ + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + 5 wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL @@ -1918,6 +2056,26 @@ + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + 5 wxEXPAND|wxTOP|wxBOTTOM @@ -1970,7 +2128,7 @@ 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2031,7 +2189,7 @@ 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT 0 1 @@ -2115,7 +2273,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2179,7 +2337,17 @@ 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2240,7 +2408,7 @@ 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT 0 1 @@ -2332,6 +2500,16 @@ 0 + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + 7 wxEXPAND|wxTOP|wxBOTTOM|wxLEFT @@ -2448,6 +2626,64 @@ + + 7 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline21 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; forward_declare + 0 + + + + + + 7 wxEXPAND|wxTOP|wxBOTTOM @@ -2624,7 +2860,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2685,7 +2921,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT 0 1 @@ -2749,7 +2985,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT + wxALIGN_CENTER_VERTICAL|wxRIGHT 0 1 @@ -2820,17 +3056,133 @@ 5 - wxEXPAND - 1 - - 0 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Line color (sheets && graphics): + + 0 + + + 0 + + 1 + m_setColor + 1 + + protected - 0 + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + 5 - wxALIGN_CENTER_VERTICAL|wxALL + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + COLOR_SWATCH + 1 + + + 1 + + 0 + Dock + 0 + Left + 1 + wxSYS_COLOUR_WINDOW + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + 48,24 + 1 + m_colorSwatch + 1 + + + protected + 1 + + Resizable + + 1 + + COLOR_SWATCH; widgets/color_swatch.h; Not forward_declare + 0 + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2891,7 +3243,7 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -2975,140 +3327,128 @@ 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Background color (sheets only): + + 0 + + + 0 - bSizer4 - wxHORIZONTAL - none - - 5 - wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Color (graphics only): - - 0 - - - 0 - - 1 - m_setColor - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxRIGHT|wxLEFT|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_color - 1 - - - protected - 1 - - Resizable - 1 - - wxCLRP_DEFAULT_STYLE - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - + 1 + m_setBgColor + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + COLOR_SWATCH + 1 + + + 1 + + 0 + Dock + 0 + Left + 1 + wxSYS_COLOUR_WINDOW + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + 48,24 + 1 + m_bgColorSwatch + 1 + + + protected + 1 + + Resizable + + 1 + + COLOR_SWATCH; widgets/color_swatch.h; Not forward_declare + 0 + + + + diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.h b/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.h index 5a4a377767..72fe669221 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.h +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics_base.h @@ -10,6 +10,7 @@ #include #include #include +#include "widgets/color_swatch.h" #include "dialog_shim.h" #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -47,7 +47,9 @@ class DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE : public DIALOG_SHIM wxCheckBox* m_globalLabels; wxCheckBox* m_hierLabels; wxCheckBox* m_sheetTitles; + wxCheckBox* m_sheetFields; wxCheckBox* m_sheetPins; + wxCheckBox* m_sheetBorders; wxCheckBox* m_schTextAndGraphics; wxCheckBox* m_fieldnameFilterOpt; wxTextCtrl* m_fieldnameFilter; @@ -72,16 +74,19 @@ class DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE : public DIALOG_SHIM wxChoice* m_vAlign; wxStaticLine* m_staticline1; wxStaticLine* m_staticline2; + wxStaticLine* m_staticline21; wxStaticLine* m_staticline3; wxStaticLine* m_staticline4; wxStaticLine* m_staticline5; wxStaticText* m_lineWidthLabel; wxTextCtrl* m_LineWidthCtrl; wxStaticText* m_lineWidthUnits; + wxCheckBox* m_setColor; + COLOR_SWATCH* m_colorSwatch; wxStaticText* lineStyleLabel; wxChoice* m_lineStyle; - wxCheckBox* m_setColor; - wxColourPickerCtrl* m_color; + wxCheckBox* m_setBgColor; + COLOR_SWATCH* m_bgColorSwatch; wxStdDialogButtonSizer* m_sdbSizerButtons; wxButton* m_sdbSizerButtonsOK; wxButton* m_sdbSizerButtonsCancel; diff --git a/eeschema/dialogs/panel_eeschema_color_settings.cpp b/eeschema/dialogs/panel_eeschema_color_settings.cpp index 40142c0be4..ed989be061 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_color_settings.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -45,6 +44,7 @@ #include #include #include +#include // Width and height of every (color-displaying / bitmap) button in dialog units const wxSize BUTTON_SIZE( 24, 12 ); @@ -54,7 +54,7 @@ const wxSize BUTTON_BORDER( 4, 4 ); constexpr int FIRST_BUTTON_ID = 1800; -PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS( EDA_DRAW_FRAME* aFrame, +PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS( SCH_BASE_FRAME* aFrame, wxWindow* aParent ) : PANEL_COLOR_SETTINGS( aParent ), m_frame( aFrame ), @@ -143,9 +143,10 @@ bool PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme() SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager(); COLOR4D bgcolor = m_currentSettings->GetColor( LAYER_SCHEMATIC_BACKGROUND ); - for( SCH_LAYER_ID clyr = SCH_LAYER_ID_START; clyr < SCH_LAYER_ID_END; ++clyr ) + for( SCH_LAYER_ID layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; ++layer ) { - if( bgcolor == m_currentSettings->GetColor( clyr ) && clyr != LAYER_SCHEMATIC_BACKGROUND ) + if( bgcolor == m_currentSettings->GetColor( layer ) + && layer != LAYER_SCHEMATIC_BACKGROUND && layer != LAYER_SHEET_BACKGROUND ) { wxString msg = _( "Some items have the same color as the background\n" "and they will not be seen on the screen. Are you\n" @@ -181,18 +182,29 @@ bool PANEL_EESCHEMA_COLOR_SETTINGS::saveCurrentTheme() static_cast( selected ) ) ); } - for( SCH_LAYER_ID clyr = SCH_LAYER_ID_START; clyr < SCH_LAYER_ID_END; ++clyr ) + for( SCH_LAYER_ID layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; ++layer ) { - COLOR4D color = m_currentSettings->GetColor( clyr ); + COLOR4D color; + + if( layer == LAYER_SHEET ) + color = GetDefaultSheetBorderColor(); + else if( layer == LAYER_SHEET_BACKGROUND ) + color = GetDefaultSheetBackgroundColor(); + else + color = m_currentSettings->GetColor( layer ); + // Do not allow non-background layers to be completely white. // This ensures the BW printing recognizes that the colors should be printed black. - if( color == COLOR4D::WHITE && clyr != LAYER_SCHEMATIC_BACKGROUND ) + if( color == COLOR4D::WHITE + && layer != LAYER_SCHEMATIC_BACKGROUND && layer != LAYER_SHEET_BACKGROUND ) + { color.Darken( 0.01 ); + } - if( !dirty && selected->GetColor( clyr ) != color ) + if( !dirty && selected->GetColor( layer ) != color ) dirty = true; - selected->SetColor( clyr, color ); + selected->SetColor( layer, color ); } KIGFX::RENDER_SETTINGS* settings = m_frame->GetCanvas()->GetView()->GetPainter()->GetSettings(); @@ -230,8 +242,8 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createButtons() for( SCH_LAYER_ID layer : layers ) { - // LAYER_SHEET_BACKGROUND doesn't currently allow changing settings - if( layer == LAYER_SHEET_BACKGROUND ) + // Sheet borders and backgrounds are now sheet-specific + if( layer == LAYER_SHEET || layer == LAYER_SHEET_BACKGROUND ) continue; wxString name = LayerName( layer ); diff --git a/eeschema/dialogs/panel_eeschema_color_settings.h b/eeschema/dialogs/panel_eeschema_color_settings.h index 6169705150..bcb5c044c8 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.h +++ b/eeschema/dialogs/panel_eeschema_color_settings.h @@ -26,7 +26,7 @@ #include class COLOR_SETTINGS; -class EDA_DRAW_FRAME; +class SCH_BASE_FRAME; class PAGE_INFO; class SCH_ITEM; class SCH_PREVIEW_PANEL; @@ -40,7 +40,7 @@ namespace KIGFX class PANEL_EESCHEMA_COLOR_SETTINGS : public PANEL_COLOR_SETTINGS { public: - PANEL_EESCHEMA_COLOR_SETTINGS( EDA_DRAW_FRAME* aFrame, wxWindow* aParent ); + PANEL_EESCHEMA_COLOR_SETTINGS( SCH_BASE_FRAME* aFrame, wxWindow* aParent ); ~PANEL_EESCHEMA_COLOR_SETTINGS() override; @@ -79,7 +79,7 @@ protected: }; private: - EDA_DRAW_FRAME* m_frame; + SCH_BASE_FRAME* m_frame; SCH_PREVIEW_PANEL* m_preview; diff --git a/eeschema/dialogs/panel_eeschema_settings.cpp b/eeschema/dialogs/panel_eeschema_settings.cpp index c7c3d53227..3ff6281f46 100644 --- a/eeschema/dialogs/panel_eeschema_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_settings.cpp @@ -25,7 +25,10 @@ #include #include #include - +#include +#include +#include +#include #include "panel_eeschema_settings.h" @@ -45,7 +48,16 @@ bool PANEL_EESCHEMA_SETTINGS::TransferDataToWindow() StringFromValue( EDA_UNITS::INCHES, m_frame->GetRepeatStep().x, false, true ) ); m_vPitchCtrl->SetValue( StringFromValue( EDA_UNITS::INCHES, m_frame->GetRepeatStep().y, false, true ) ); - m_spinRepeatLabel->SetValue( m_frame->GetRepeatDeltaLabel() ); + m_spinLabelRepeatStep->SetValue( m_frame->GetRepeatDeltaLabel() ); + + COLOR_SETTINGS* settings = m_frame->GetColorSettings(); + COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND ); + + m_borderColorSwatch->SetSwatchBackground( schematicBackground ); + m_borderColorSwatch->SetSwatchColor( GetDefaultSheetBorderColor(), false ); + + m_backgroundColorSwatch->SetSwatchBackground( schematicBackground ); + m_backgroundColorSwatch->SetSwatchColor( GetDefaultSheetBackgroundColor(), false ); m_checkHVOrientation->SetValue( m_frame->GetForceHVLines() ); m_footprintPreview->SetValue( m_frame->GetShowFootprintPreviews() ); @@ -76,10 +88,13 @@ bool PANEL_EESCHEMA_SETTINGS::TransferDataFromWindow() m_frame->SaveProjectSettings(); } + SetDefaultSheetBorderColor( m_borderColorSwatch->GetSwatchColor() ); + SetDefaultSheetBackgroundColor( m_backgroundColorSwatch->GetSwatchColor() ); + m_frame->SetRepeatStep( wxPoint( (int) ValueFromString( EDA_UNITS::INCHES, m_hPitchCtrl->GetValue(), true ), (int) ValueFromString( EDA_UNITS::INCHES, m_vPitchCtrl->GetValue(), true ) ) ); - m_frame->SetRepeatDeltaLabel( m_spinRepeatLabel->GetValue() ); + m_frame->SetRepeatDeltaLabel( m_spinLabelRepeatStep->GetValue() ); m_frame->SetForceHVLines( m_checkHVOrientation->GetValue() ); m_frame->SetShowFootprintPreviews( m_footprintPreview->GetValue() ); diff --git a/eeschema/dialogs/panel_eeschema_settings_base.cpp b/eeschema/dialogs/panel_eeschema_settings_base.cpp index 954221ec8a..9c4211dba2 100644 --- a/eeschema/dialogs/panel_eeschema_settings_base.cpp +++ b/eeschema/dialogs/panel_eeschema_settings_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version v3.8.0) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -21,72 +21,21 @@ PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wx wxBoxSizer* bLeftColumn; bLeftColumn = new wxBoxSizer( wxVERTICAL ); - wxFlexGridSizer* fgSizerRepeatOpt; - fgSizerRepeatOpt = new wxFlexGridSizer( 0, 3, 5, 5 ); - fgSizerRepeatOpt->AddGrowableCol( 0 ); - fgSizerRepeatOpt->AddGrowableCol( 1 ); - fgSizerRepeatOpt->AddGrowableCol( 2 ); - fgSizerRepeatOpt->SetFlexibleDirection( wxBOTH ); - fgSizerRepeatOpt->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + wxStaticBoxSizer* sbSizer7; + sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Units") ), wxHORIZONTAL ); - m_staticText2 = new wxStaticText( this, wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText2 = new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY, _("&Measurement units:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + sbSizer7->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxString m_choiceUnitsChoices[] = { _("inches"), _("millimeters") }; int m_choiceUnitsNChoices = sizeof( m_choiceUnitsChoices ) / sizeof( wxString ); - m_choiceUnits = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsNChoices, m_choiceUnitsChoices, 0 ); + m_choiceUnits = new wxChoice( sbSizer7->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsNChoices, m_choiceUnitsChoices, 0 ); m_choiceUnits->SetSelection( 0 ); - fgSizerRepeatOpt->Add( m_choiceUnits, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + sbSizer7->Add( m_choiceUnits, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT, 5 ); - fgSizerRepeatOpt->Add( 0, 0, 1, wxEXPAND, 3 ); - - m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Default schematic text size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_textSizeLabel->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_textSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizerRepeatOpt->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 10 ); - - m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_textSizeUnits->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_hPitchLabel = new wxStaticText( this, wxID_ANY, _("&Horizontal pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_hPitchLabel->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_hPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_hPitchCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizerRepeatOpt->Add( m_hPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_hPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_hPitchUnits->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_hPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_vPitchLabel = new wxStaticText( this, wxID_ANY, _("&Vertical pitch of repeated items:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_vPitchLabel->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_vPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_vPitchCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); - fgSizerRepeatOpt->Add( m_vPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_vPitchUnits = new wxStaticText( this, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); - m_vPitchUnits->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_vPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText16 = new wxStaticText( this, wxID_ANY, _("&Increment of repeated labels:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText16->Wrap( -1 ); - fgSizerRepeatOpt->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_spinRepeatLabel = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 ); - fgSizerRepeatOpt->Add( m_spinRepeatLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - - fgSizerRepeatOpt->Add( 0, 0, 1, wxEXPAND, 3 ); - - - bLeftColumn->Add( fgSizerRepeatOpt, 0, wxLEFT|wxRIGHT, 5 ); + bLeftColumn->Add( sbSizer7, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxStaticBoxSizer* sbSizerEditOpt; sbSizerEditOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing") ), wxVERTICAL ); @@ -101,7 +50,56 @@ PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wx sbSizerEditOpt->Add( m_mouseDragIsDrag, 0, wxALL, 5 ); - bLeftColumn->Add( sbSizerEditOpt, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bLeftColumn->Add( sbSizerEditOpt, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxStaticBoxSizer* sbSizer5; + sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Defaults for New Objects") ), wxVERTICAL ); + + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer( wxHORIZONTAL ); + + m_textSizeLabel = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("Schematic text size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeLabel->Wrap( -1 ); + bSizer5->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_textSizeCtrl = new wxTextCtrl( sbSizer5->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + bSizer5->Add( m_textSizeCtrl, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_textSizeUnits = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textSizeUnits->Wrap( -1 ); + bSizer5->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + sbSizer5->Add( bSizer5, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer6; + bSizer6 = new wxBoxSizer( wxHORIZONTAL ); + + m_borderColorLabel = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("Sheet border:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_borderColorLabel->Wrap( -1 ); + bSizer6->Add( m_borderColorLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_borderColorSwatch = new COLOR_SWATCH( sbSizer5->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_borderColorSwatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_borderColorSwatch->SetMinSize( wxSize( 48,24 ) ); + + bSizer6->Add( m_borderColorSwatch, 1, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_backgroundColorLabel = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, _("Sheet background:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_backgroundColorLabel->Wrap( -1 ); + bSizer6->Add( m_backgroundColorLabel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_backgroundColorSwatch = new COLOR_SWATCH( sbSizer5->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_backgroundColorSwatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_backgroundColorSwatch->SetMinSize( wxSize( 48,24 ) ); + + bSizer6->Add( m_backgroundColorSwatch, 1, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + + sbSizer5->Add( bSizer6, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + + bLeftColumn->Add( sbSizer5, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxStaticBoxSizer* sbSizerPinSel; sbSizerPinSel = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Selection") ), wxVERTICAL ); @@ -112,10 +110,10 @@ PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wx sbSizerPinSel->Add( m_cbPinSelectionOpt, 0, wxALL, 5 ); - bLeftColumn->Add( sbSizerPinSel, 0, wxEXPAND, 5 ); + bLeftColumn->Add( sbSizerPinSel, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - bPanelSizer->Add( bLeftColumn, 0, wxRIGHT|wxLEFT, 5 ); + bPanelSizer->Add( bLeftColumn, 1, wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bRightColumn; bRightColumn = new wxBoxSizer( wxVERTICAL ); @@ -133,23 +131,72 @@ PANEL_EESCHEMA_SETTINGS_BASE::PANEL_EESCHEMA_SETTINGS_BASE( wxWindow* parent, wx sbSizerFieldAutoPlace->Add( m_checkAutoplaceAlign, 0, wxEXPAND|wxALL, 5 ); - bRightColumn->Add( sbSizerFieldAutoPlace, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bRightColumn->Add( sbSizerFieldAutoPlace, 0, wxEXPAND|wxALL, 5 ); - wxBoxSizer* bSizerPreviewOpt; - bSizerPreviewOpt = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* repeatSizer; + repeatSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Repeated Items") ), wxVERTICAL ); - m_footprintPreview = new wxCheckBox( this, wxID_ANY, _("Show footprint previews in symbol chooser"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerPreviewOpt->Add( m_footprintPreview, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + wxFlexGridSizer* fgSizerRepeatOpt1; + fgSizerRepeatOpt1 = new wxFlexGridSizer( 0, 3, 5, 5 ); + fgSizerRepeatOpt1->AddGrowableCol( 0 ); + fgSizerRepeatOpt1->AddGrowableCol( 1 ); + fgSizerRepeatOpt1->AddGrowableCol( 2 ); + fgSizerRepeatOpt1->SetFlexibleDirection( wxBOTH ); + fgSizerRepeatOpt1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_navigatorStaysOpen = new wxCheckBox( this, wxID_ANY, _("Keep hierarchy navigator open"), wxDefaultPosition, wxDefaultSize, 0 ); + m_hPitchLabel = new wxStaticText( repeatSizer->GetStaticBox(), wxID_ANY, _("&Horizontal pitch:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_hPitchLabel->Wrap( -1 ); + fgSizerRepeatOpt1->Add( m_hPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_hPitchCtrl = new wxTextCtrl( repeatSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizerRepeatOpt1->Add( m_hPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_hPitchUnits = new wxStaticText( repeatSizer->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_hPitchUnits->Wrap( -1 ); + fgSizerRepeatOpt1->Add( m_hPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_vPitchLabel = new wxStaticText( repeatSizer->GetStaticBox(), wxID_ANY, _("&Vertical pitch:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_vPitchLabel->Wrap( -1 ); + fgSizerRepeatOpt1->Add( m_vPitchLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_vPitchCtrl = new wxTextCtrl( repeatSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP ); + fgSizerRepeatOpt1->Add( m_vPitchCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_vPitchUnits = new wxStaticText( repeatSizer->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); + m_vPitchUnits->Wrap( -1 ); + fgSizerRepeatOpt1->Add( m_vPitchUnits, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelIncrementLabel = new wxStaticText( repeatSizer->GetStaticBox(), wxID_ANY, _("Label increment:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelIncrementLabel->Wrap( -1 ); + fgSizerRepeatOpt1->Add( m_labelIncrementLabel, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT, 5 ); + + m_spinLabelRepeatStep = new wxSpinCtrl( repeatSizer->GetStaticBox(), wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -10, 10, 1 ); + fgSizerRepeatOpt1->Add( m_spinLabelRepeatStep, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 ); + + + fgSizerRepeatOpt1->Add( 0, 0, 1, wxEXPAND, 3 ); + + + repeatSizer->Add( fgSizerRepeatOpt1, 1, wxEXPAND, 5 ); + + + bRightColumn->Add( repeatSizer, 0, wxEXPAND|wxALL, 5 ); + + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Dialog Preferences") ), wxVERTICAL ); + + m_footprintPreview = new wxCheckBox( sbSizer6->GetStaticBox(), wxID_ANY, _("Show footprint previews in Symbol Chooser"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer6->Add( m_footprintPreview, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + + m_navigatorStaysOpen = new wxCheckBox( sbSizer6->GetStaticBox(), wxID_ANY, _("Keep hierarchy navigator open"), wxDefaultPosition, wxDefaultSize, 0 ); m_navigatorStaysOpen->SetValue(true); - bSizerPreviewOpt->Add( m_navigatorStaysOpen, 0, wxALL, 5 ); + sbSizer6->Add( m_navigatorStaysOpen, 0, wxALL, 5 ); - bRightColumn->Add( bSizerPreviewOpt, 0, wxALL, 5 ); + bRightColumn->Add( sbSizer6, 0, wxEXPAND|wxALL, 5 ); - bPanelSizer->Add( bRightColumn, 1, wxEXPAND, 5 ); + bPanelSizer->Add( bRightColumn, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); this->SetSizer( bPanelSizer ); diff --git a/eeschema/dialogs/panel_eeschema_settings_base.fbp b/eeschema/dialogs/panel_eeschema_settings_base.fbp index 04baa858a6..0300ca167d 100644 --- a/eeschema/dialogs/panel_eeschema_settings_base.fbp +++ b/eeschema/dialogs/panel_eeschema_settings_base.fbp @@ -57,7 +57,7 @@ 5 wxRIGHT|wxLEFT - 0 + 1 bLeftColumn @@ -65,23 +65,19 @@ none 5 - wxLEFT|wxRIGHT - 0 - - 3 - wxBOTH - 0,1,2 - - 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + wxID_ANY + Units - fgSizerRepeatOpt - wxFLEX_GROWMODE_SPECIFIED + sbSizer7 + wxHORIZONTAL + 1 none - 0 - 5 5 - wxALIGN_CENTER_VERTICAL|wxLEFT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -142,7 +138,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT 0 1 @@ -205,713 +201,12 @@ OnChooseUnits - - 3 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Default schematic text size: - 0 - - 0 - - - 0 - - 1 - m_textSizeLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 10 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_textSizeCtrl - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - 0 - - 0 - - - 0 - - 1 - m_textSizeUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Horizontal pitch of repeated items: - 0 - - 0 - - - 0 - - 1 - m_hPitchLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_hPitchCtrl - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - 0 - - 0 - - - 0 - - 1 - m_hPitchUnits - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Vertical pitch of repeated items: - 0 - - 0 - - - 0 - - 1 - m_vPitchLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_vPitchCtrl - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mils - 0 - - 0 - - - 0 - - 1 - m_vPitchUnits - 1 - - - protected - 1 - - Fixed - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Increment of repeated labels: - 0 - - 0 - - - 0 - - 1 - m_staticText16 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - 1 - 10 - - 0 - - -10 - - 0 - - 1 - m_spinRepeatLabel - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS|wxSP_WRAP - - 0 - - 1 - - - - - - - 3 - wxEXPAND - 1 - - 0 - protected - 0 - - 5 wxEXPAND|wxTOP|wxBOTTOM - 1 + 0 wxID_ANY Editing @@ -1052,7 +347,475 @@ 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM + 0 + + wxID_ANY + Defaults for New Objects + + sbSizer5 + wxVERTICAL + 1 + none + + 5 + wxEXPAND + 0 + + + bSizer5 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Schematic text size: + 0 + + 0 + + + 0 + + 1 + m_textSizeLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textSizeCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + 0 + + 0 + + + 0 + + 1 + m_textSizeUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + + bSizer6 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Sheet border: + 0 + + 0 + + + 0 + + 1 + m_borderColorLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + COLOR_SWATCH + 1 + + + 1 + + 0 + Dock + 0 + Left + 1 + wxSYS_COLOUR_WINDOW + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + 48,24 + 1 + m_borderColorSwatch + 1 + + + protected + 1 + + Resizable + + 1 + + COLOR_SWATCH; widgets/color_swatch.h; Not forward_declare + 0 + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Sheet background: + 0 + + 0 + + + 0 + + 1 + m_backgroundColorLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + COLOR_SWATCH + 1 + + + 1 + + 0 + Dock + 0 + Left + 1 + wxSYS_COLOUR_WINDOW + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + 48,24 + 1 + m_backgroundColorSwatch + 1 + + + protected + 1 + + Resizable + + 1 + + COLOR_SWATCH; widgets/color_swatch.h; Not forward_declare + 0 + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM 0 wxID_ANY @@ -1132,7 +895,7 @@ 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 1 @@ -1141,7 +904,7 @@ none 5 - wxEXPAND|wxTOP|wxBOTTOM + wxEXPAND|wxALL 0 wxID_ANY @@ -1347,12 +1110,552 @@ 5 - wxALL + wxEXPAND|wxALL 0 - + + wxID_ANY + Repeated Items - bSizerPreviewOpt + repeatSizer wxVERTICAL + 1 + none + + 5 + wxEXPAND + 1 + + 3 + wxBOTH + 0,1,2 + + 5 + + fgSizerRepeatOpt1 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Horizontal pitch: + 0 + + 0 + + + 0 + + 1 + m_hPitchLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_hPitchCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + 0 + + 0 + + + 0 + + 1 + m_hPitchUnits + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Vertical pitch: + 0 + + 0 + + + 0 + + 1 + m_vPitchLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_vPitchCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mils + 0 + + 0 + + + 0 + + 1 + m_vPitchUnits + 1 + + + protected + 1 + + Fixed + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Label increment: + 0 + + 0 + + + 0 + + 1 + m_labelIncrementLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxALIGN_CENTER_VERTICAL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 1 + 10 + + 0 + + -10 + + 0 + + 1 + m_spinLabelRepeatStep + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS|wxSP_WRAP + + 0 + + 1 + + + + + + + 3 + wxEXPAND + 1 + + 0 + protected + 0 + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + Dialog Preferences + + sbSizer6 + wxVERTICAL + 1 none 5 @@ -1387,7 +1690,7 @@ 0 0 wxID_ANY - Show footprint previews in symbol chooser + Show footprint previews in Symbol Chooser 0 diff --git a/eeschema/dialogs/panel_eeschema_settings_base.h b/eeschema/dialogs/panel_eeschema_settings_base.h index f6dd9287d0..50967607a4 100644 --- a/eeschema/dialogs/panel_eeschema_settings_base.h +++ b/eeschema/dialogs/panel_eeschema_settings_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version v3.8.0) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -10,6 +10,7 @@ #include #include #include +#include "widgets/color_swatch.h" #include #include #include @@ -17,11 +18,11 @@ #include #include #include +#include +#include +#include #include #include -#include -#include -#include #include /////////////////////////////////////////////////////////////////////////// @@ -41,23 +42,27 @@ class PANEL_EESCHEMA_SETTINGS_BASE : public wxPanel protected: wxStaticText* m_staticText2; wxChoice* m_choiceUnits; + wxCheckBox* m_checkHVOrientation; + wxCheckBox* m_mouseDragIsDrag; wxStaticText* m_textSizeLabel; wxTextCtrl* m_textSizeCtrl; wxStaticText* m_textSizeUnits; + wxStaticText* m_borderColorLabel; + COLOR_SWATCH* m_borderColorSwatch; + wxStaticText* m_backgroundColorLabel; + COLOR_SWATCH* m_backgroundColorSwatch; + wxCheckBox* m_cbPinSelectionOpt; + wxCheckBox* m_checkAutoplaceFields; + wxCheckBox* m_checkAutoplaceJustify; + wxCheckBox* m_checkAutoplaceAlign; wxStaticText* m_hPitchLabel; wxTextCtrl* m_hPitchCtrl; wxStaticText* m_hPitchUnits; wxStaticText* m_vPitchLabel; wxTextCtrl* m_vPitchCtrl; wxStaticText* m_vPitchUnits; - wxStaticText* m_staticText16; - wxSpinCtrl* m_spinRepeatLabel; - wxCheckBox* m_checkHVOrientation; - wxCheckBox* m_mouseDragIsDrag; - wxCheckBox* m_cbPinSelectionOpt; - wxCheckBox* m_checkAutoplaceFields; - wxCheckBox* m_checkAutoplaceJustify; - wxCheckBox* m_checkAutoplaceAlign; + wxStaticText* m_labelIncrementLabel; + wxSpinCtrl* m_spinLabelRepeatStep; wxCheckBox* m_footprintPreview; wxCheckBox* m_navigatorStaysOpen; diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 99f1308819..7f840672f6 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -58,6 +58,8 @@ static int s_defaultBusThickness = Mils2iu( DEFAULTBUSTHICKNESS ); static int s_defaultWireThickness = Mils2iu( DEFAULTDRAWLINETHICKNESS ); static int s_defaultTextSize = Mils2iu( DEFAULT_SIZE_TEXT ); static int s_drawDefaultLineThickness = -1; +static COLOR4D s_defaultSheetBorderColor = MAGENTA; +static COLOR4D s_defaultSheetBackgroundColor = WHITE; static double s_textOffsetRatio = 0.08; static bool s_selectTextAsBox = false; static bool s_selectDrawChildren = true; @@ -269,6 +271,30 @@ int GetDefaultLineThickness() } +COLOR4D GetDefaultSheetBorderColor() +{ + return s_defaultSheetBorderColor; +} + + +void SetDefaultSheetBorderColor( COLOR4D aColor ) +{ + s_defaultSheetBorderColor = aColor; +} + + +COLOR4D GetDefaultSheetBackgroundColor() +{ + return s_defaultSheetBackgroundColor; +} + + +void SetDefaultSheetBackgroundColor( COLOR4D aColor ) +{ + s_defaultSheetBackgroundColor = aColor; +} + + void SetDefaultLineThickness( int aThickness ) { s_drawDefaultLineThickness = std::max( 1, aThickness ); @@ -545,6 +571,10 @@ void SCH_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) settings->m_ShowHiddenPins = m_showAllPins; settings->SetShowPageLimits( m_showPageLimits ); settings->m_ShowUmbilicals = true; + + COLOR_SETTINGS* colorSettings = GetColorSettings(); + SetDefaultSheetBorderColor( colorSettings->GetColor( LAYER_SHEET ) ); + SetDefaultSheetBackgroundColor( colorSettings->GetColor( LAYER_SHEET_BACKGROUND ) ); } diff --git a/eeschema/general.h b/eeschema/general.h index cceb4ee9d9..707d264b6a 100644 --- a/eeschema/general.h +++ b/eeschema/general.h @@ -108,6 +108,14 @@ void SetSeverity( int aErrorCode, int aSeverity ); int GetDefaultLineThickness(); void SetDefaultLineThickness( int aThickness ); +/** + * Defaults for new sheets. + */ +COLOR4D GetDefaultSheetBorderColor(); +void SetDefaultSheetBorderColor( COLOR4D aColor ); +COLOR4D GetDefaultSheetBackgroundColor(); +void SetDefaultSheetBackgroundColor( COLOR4D aColor ); + /** * Default size for text in general */ diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 9f8c42ce05..52d3d244e1 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -91,8 +91,8 @@ SCH_SHEET::SCH_SHEET( const wxPoint& pos ) : m_fieldsAutoplaced = FIELDS_AUTOPLACED_AUTO; m_borderWidth = GetDefaultLineThickness(); - m_borderColor = KIGFX::COLOR4D::UNSPECIFIED; - m_backgroundColor = KIGFX::COLOR4D::UNSPECIFIED; + m_borderColor = GetDefaultSheetBorderColor(); + m_backgroundColor = GetDefaultSheetBackgroundColor(); }