From 83a02e18ebf99b3de577afab7d40de40b8ab8e11 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 6 Sep 2019 19:59:13 +0100 Subject: [PATCH] Mac OSX changes for new board stackup panel. Fixes: lp:1843033 * https://bugs.launchpad.net/kicad/+bug/1843033 --- .../class_board_stackup.cpp | 9 +- .../panel_board_stackup.cpp | 145 ++++++++---------- .../panel_board_stackup.h | 8 +- .../panel_board_stackup_base.cpp | 69 ++++----- .../panel_board_stackup_base.fbp | 100 ++++++------ .../panel_board_stackup_base.h | 5 +- .../stackup_predefined_prms.h | 2 + 7 files changed, 156 insertions(+), 182 deletions(-) diff --git a/pcbnew/board_stackup_manager/class_board_stackup.cpp b/pcbnew/board_stackup_manager/class_board_stackup.cpp index d13f74a30d..0a4081fb71 100644 --- a/pcbnew/board_stackup_manager/class_board_stackup.cpp +++ b/pcbnew/board_stackup_manager/class_board_stackup.cpp @@ -42,12 +42,12 @@ BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType ) switch( m_Type ) { case BS_ITEM_TYPE_COPPER: - m_TypeName = "copper"; + m_TypeName = KEY_COPPER; m_Thickness = GetCopperDefaultThickness(); break; case BS_ITEM_TYPE_DIELECTRIC: - m_TypeName = "core"; // or prepreg + m_TypeName = KEY_CORE; // or prepreg m_Material = "FR4"; // or other dielectric name m_DielectricLayerId = 1; m_Thickness = 0; // will be set later @@ -381,6 +381,7 @@ void BOARD_STACKUP::BuildDefaultStackupList( BOARD_DESIGN_SETTINGS* aSettings, { BOARD_STACKUP_ITEM* item = new BOARD_STACKUP_ITEM( BS_ITEM_TYPE_COPPER ); item->m_LayerId = ( PCB_LAYER_ID )ii; + item->m_TypeName = KEY_COPPER; Add( item ); if( ii == copperLayerCount-1 ) @@ -397,12 +398,12 @@ void BOARD_STACKUP::BuildDefaultStackupList( BOARD_DESIGN_SETTINGS* aSettings, // Display a dielectric default layer name: if( (dielectric_idx & 1) == 0 ) { - item->m_TypeName = _HKI( "core" ); + item->m_TypeName = KEY_CORE; item->m_Material = "FR4"; } else { - item->m_TypeName = _HKI( "prepreg" ); + item->m_TypeName = KEY_PREPREG; item->m_Material = "FR4"; } diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.cpp b/pcbnew/board_stackup_manager/panel_board_stackup.cpp index 5fcbf1da65..b4baf77c0f 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup.cpp @@ -54,7 +54,7 @@ enum WIDGETS_IDS // Default colors to draw icons: static wxColor copperColor( 220, 180, 30 ); -static wxColor dielectricColor( 50, 60, 20 ); +static wxColor dielectricColor( 75, 120, 75 ); static wxColor pasteColor( 200, 200, 200 ); static void drawBitmap( wxBitmap& aBitmap, wxColor aColor ); @@ -75,19 +75,20 @@ PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP( PAGED_DIALOG* aParent, PCB // Calculates a good size for color swatches (icons) in this dialog wxClientDC dc( this ); m_colorSwatchesSize = dc.GetTextExtent( "XX" ); - m_colorIconsSize = dc.GetTextExtent( "XXXXXX" ); + m_colorComboSize = dc.GetTextExtent( "XXX Undefined XXX" ); + m_colorIconsSize = dc.GetTextExtent( "XXXX" ); - // Calculates a good size for wxTextCtrl to enter Epsilon R and Loss tg + // Calculates a good size for wxTextCtrl to enter Epsilon R and Loss tan // ("0.000000" + margins) - m_numericFieldsSize = dc.GetTextExtent( "X.XXXXXXXX" ); + m_numericFieldsSize = dc.GetTextExtent( "X.XXXXXXX" ); m_numericFieldsSize.y = -1; // Use default for the vertical size // Calculates a minimal size for wxTextCtrl to enter a dim with units // ("000.0000000 mils" + margins) - m_numericTextCtrlSize = dc.GetTextExtent( "XXX.XXXXXXXX mils" ); + m_numericTextCtrlSize = dc.GetTextExtent( "XXX.XXXXXXX mils" ); m_numericTextCtrlSize.y = -1; // Use default for the vertical size - // The grid column containing the lock checkbox it kept to a minimal + // The grid column containing the lock checkbox is kept to a minimal // size. So we use a wxStaticBitmap: set the bitmap itself m_bitmapLockThickness->SetBitmap( KiScaledBitmap( locked_xpm, aFrame ) ); @@ -291,10 +292,8 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync ) if( item->IsColorEditable() ) { - wxBitmapComboBox* bm_combo = dynamic_cast - ( ui_row_item.m_ColorCtrl ); - - int color_idx = 0; + auto bm_combo = dynamic_cast( ui_row_item.m_ColorCtrl ); + int color_idx = 0; if( item->m_Color.StartsWith( "#" ) ) // User defined color { @@ -306,8 +305,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync ) { bm_combo->SetString( color_idx, color.GetAsString( wxC2S_HTML_SYNTAX ) ); wxBitmap layerbmp( m_colorSwatchesSize.x, m_colorSwatchesSize.y ); - LAYER_SELECTOR::DrawColorSwatch( layerbmp, COLOR4D( 0, 0, 0, 0 ), - COLOR4D( color ) ); + LAYER_SELECTOR::DrawColorSwatch( layerbmp, COLOR4D(), COLOR4D( color ) ); bm_combo->SetItemBitmap( color_idx, layerbmp ); } } @@ -381,6 +379,14 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync ) } +wxControl* PANEL_SETUP_BOARD_STACKUP::addSpacer() +{ + wxStaticText* emptyText = new wxStaticText( m_scGridWin, wxID_ANY, wxEmptyString ); + m_fgGridSizer->Add( emptyText, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND ); + return emptyText; +} + + void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() { // for dielectric: layer type keyword is "core" @@ -417,7 +423,7 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() // Add color swatch icon. The color will be updated later, // when all widgets are initialized wxStaticBitmap* bitmap = new wxStaticBitmap( m_scGridWin, wxID_ANY, wxNullBitmap ); - m_fgGridSizer->Add( bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1 ); + m_fgGridSizer->Add( bitmap, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT ); ui_row_item.m_Icon = bitmap; if( item->m_Type == BS_ITEM_TYPE_DIELECTRIC ) @@ -425,47 +431,37 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() wxString lname; lname.Printf( _( "Dielectric %d" ), item->m_DielectricLayerId ); wxStaticText* st_text = new wxStaticText( m_scGridWin, wxID_ANY, lname ); - m_fgGridSizer->Add( st_text, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1 ); + m_fgGridSizer->Add( st_text, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); ui_row_item.m_LayerName = st_text; wxChoice* choice = new wxChoice( m_scGridWin, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_core_prepreg_choice ); - if( item->m_TypeName == KEY_CORE ) - { - choice->SetSelection( 0 ); - m_fgGridSizer->Add( choice, 0, wxALL, 1 ); - } - else - { - choice->SetSelection( 1 ); - m_fgGridSizer->Add( choice, 0, wxALL, 1 ); - } + choice->SetSelection( item->m_TypeName == KEY_CORE ? 0 : 1 ); + m_fgGridSizer->Add( choice, 0, wxEXPAND|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); ui_row_item.m_LayerTypeCtrl = choice; } else { -// item->m_LayerName = BOARD::GetStandardLayerName( item->m_LayerId ); item->m_LayerName = m_board->GetLayerName( item->m_LayerId ); wxStaticText* st_text = new wxStaticText( m_scGridWin, wxID_ANY, item->m_LayerName ); m_fgGridSizer->Add( st_text, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1 ); st_text->Show( show_item ); ui_row_item.m_LayerName = st_text; - st_text = new wxStaticText( m_scGridWin, wxID_ANY, item->m_TypeName ); - m_fgGridSizer->Add( st_text, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1 ); + wxString lname; + + if( item->m_TypeName == KEY_COPPER ) + lname = _( "Copper" ); + else + lname = wxGetTranslation( item->m_TypeName ); + + st_text = new wxStaticText( m_scGridWin, wxID_ANY, lname ); + m_fgGridSizer->Add( st_text, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); ui_row_item.m_LayerTypeCtrl = st_text; } - if( !item->IsMaterialEditable() ) - { - // Add spacer. - wxStaticLine* staticline = new wxStaticLine( m_scGridWin, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_fgGridSizer->Add( staticline, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 1 ); - ui_row_item.m_MaterialCtrl = staticline; - } - else + if( item->IsMaterialEditable() ) { wxChoice* choice = new wxChoice( m_scGridWin, ID_ITEM_MATERIAL+row, wxDefaultPosition, wxDefaultSize, materialChoices ); @@ -477,20 +473,25 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() choice->SetSelection( ii ); } - m_fgGridSizer->Add( choice, 0, wxALL, 1 ); + m_fgGridSizer->Add( choice, 0, wxEXPAND|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); choice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onMaterialChange ), NULL, this ); + wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onMaterialChange ), + NULL, this ); m_controlItemsList.push_back( choice ); ui_row_item.m_MaterialCtrl = choice; } + else + { + ui_row_item.m_MaterialCtrl = addSpacer(); + } if( item->IsThicknessEditable() ) { wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, ID_ITEM_THICKNESS+row ); textCtrl->SetMinSize( m_numericTextCtrlSize ); textCtrl->SetValue( StringFromValue( m_units, item->m_Thickness, true, true ) ); - m_fgGridSizer->Add( textCtrl, 0, wxALL, 1 ); + m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); m_controlItemsList.push_back( textCtrl ); textCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_SETUP_BOARD_STACKUP::onThicknessChange ), @@ -500,46 +501,23 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() if( item->m_Type == BS_ITEM_TYPE_DIELECTRIC ) { wxCheckBox* cb_box = new wxCheckBox( m_scGridWin, ID_ITEM_THICKNESS_LOCKED+row, - wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + wxEmptyString ); cb_box->SetValue( item->m_ThicknessLocked ); - m_fgGridSizer->Add( cb_box, 0, - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, - 1 ); + m_fgGridSizer->Add( cb_box, 0, wxALIGN_CENTER_VERTICAL, 2 ); ui_row_item.m_ThicknessLockCtrl = cb_box; } else { - // Add spacer for lock column. - wxStaticLine* staticline = new wxStaticLine( m_scGridWin, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_fgGridSizer->Add( staticline, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 1 ); - ui_row_item.m_ThicknessLockCtrl = staticline; + ui_row_item.m_ThicknessLockCtrl = addSpacer(); } } else { - // Add spacer for thickness column. - wxStaticLine* staticline = new wxStaticLine( m_scGridWin, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_fgGridSizer->Add( staticline, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 1 ); - ui_row_item.m_ThicknessCtrl = staticline; - - // Add spacer for lock column. - staticline = new wxStaticLine( m_scGridWin, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_fgGridSizer->Add( staticline, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 1 ); - ui_row_item.m_ThicknessLockCtrl = staticline; + ui_row_item.m_ThicknessCtrl = addSpacer(); + ui_row_item.m_ThicknessLockCtrl = addSpacer(); } - if( !item->IsColorEditable() ) - { - // Add spacer. - wxStaticLine* staticline = new wxStaticLine( m_scGridWin, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_fgGridSizer->Add( staticline, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 1 ); - ui_row_item.m_ColorCtrl = staticline; - } - else + if( item->IsColorEditable() ) { int color_idx = 0; @@ -562,11 +540,16 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() } wxBitmapComboBox* bm_combo = createBmComboBox( item, row ); - m_fgGridSizer->Add( bm_combo, 0, wxALL, 1 ); + m_colorComboSize.y = bm_combo->GetSize().y; + bm_combo->SetMinSize( m_colorComboSize ); + m_fgGridSizer->Add( bm_combo, 0, wxEXPAND|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); bm_combo->SetSelection( color_idx ); ui_row_item.m_ColorCtrl = bm_combo; } - + else + { + ui_row_item.m_ColorCtrl = addSpacer(); + } if( item->HasEpsilonRValue() ) { @@ -575,16 +558,12 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString, wxDefaultPosition, m_numericFieldsSize ); textCtrl->SetValue( txt ); - m_fgGridSizer->Add( textCtrl, 0, wxALL, 1 ); + m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); ui_row_item.m_EpsilonCtrl = textCtrl; - } + } else { - // Add spacer. - wxStaticLine* staticline = new wxStaticLine( m_scGridWin, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_fgGridSizer->Add( staticline, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 1 ); - ui_row_item.m_EpsilonCtrl = staticline; + ui_row_item.m_EpsilonCtrl = addSpacer(); } if( item->HasLossTangentValue() ) @@ -594,16 +573,12 @@ void PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel() wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString, wxDefaultPosition, m_numericFieldsSize ); textCtrl->SetValue( txt ); - m_fgGridSizer->Add( textCtrl, 0, wxALL, 1 ); + m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 ); ui_row_item.m_LossTgCtrl = textCtrl; } else { - // Add spacer. - wxStaticLine* staticline = new wxStaticLine( m_scGridWin, wxID_ANY, - wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_fgGridSizer->Add( staticline, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 1 ); - ui_row_item.m_LossTgCtrl = staticline; + ui_row_item.m_LossTgCtrl = addSpacer(); } m_rowUiItemsList.push_back( ui_row_item ); @@ -1032,7 +1007,7 @@ void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow ) { wxStaticBitmap* st_bitmap = m_rowUiItemsList[aRow].m_Icon; // explicit depth important under MSW - wxBitmap bmp(m_colorIconsSize.x, m_colorIconsSize.y, 24); + wxBitmap bmp(m_colorIconsSize.x, m_colorIconsSize.y / 2, 24); drawBitmap( bmp, getColorIconItem( aRow ) ); st_bitmap->SetBitmap( bmp ); return; @@ -1041,7 +1016,7 @@ void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow ) for( unsigned row = 0; row < m_rowUiItemsList.size(); row++ ) { // explicit depth important under MSW - wxBitmap bmp(m_colorIconsSize.x, m_colorIconsSize.y, 24); + wxBitmap bmp(m_colorIconsSize.x, m_colorIconsSize.y / 2, 24); drawBitmap( bmp, getColorIconItem( row ) ); m_rowUiItemsList[row].m_Icon->SetBitmap( bmp ); } diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.h b/pcbnew/board_stackup_manager/panel_board_stackup.h index 932669ccd8..a5a9ece13a 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.h +++ b/pcbnew/board_stackup_manager/panel_board_stackup.h @@ -97,6 +97,8 @@ public: std::vector m_UserColors; // the list of user colors for each grid row // other colors are defined colors, and are not stored private: + wxControl* addSpacer(); + /** Populate m_fgGridSizer with items to handle stackup parameters * This is a full list: * all copper layers and all tech layers that are supported by the stackup @@ -173,12 +175,8 @@ private: wxSize m_numericFieldsSize; // Best size to enter double values in wxTextCtrl wxArrayString m_core_prepreg_choice; // Used to display the option list in dialog wxSize m_colorSwatchesSize; // the size of color swatches in the wxBitmapComboBox. - // this is the size of the "XX" string to give - // a reasonable size to color swatches - + wxSize m_colorComboSize; // the size of the wxBitmapComboBox. wxSize m_colorIconsSize; // the size of color swatches in grid, left column. - // this is the size of the "XXXXXX" string to give - // a reasonable size to color swatches (icons) // The list of controls (wxChoice, wxBitmapComboBox, wxTextCtrl) added to the panel // when building the BOARD_STACKUP_ITEM list editor and connected to command events diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp b/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp index 3c3009282a..e57ca4af1d 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -43,73 +43,72 @@ PANEL_SETUP_BOARD_STACKUP_BASE::PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent bSizerBrdThickness->Add( m_buttonSetDielectricThickness, 0, wxALL, 5 ); - bMainSizer->Add( bSizerBrdThickness, 0, wxEXPAND, 5 ); + bMainSizer->Add( bSizerBrdThickness, 0, wxEXPAND|wxRIGHT, 5 ); m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bMainSizer->Add( m_staticline, 0, wxALL|wxEXPAND, 5 ); - wxBoxSizer* bSizerStackup; - bSizerStackup = new wxBoxSizer( wxHORIZONTAL ); + m_sizerStackup = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* bSizer5; bSizer5 = new wxBoxSizer( wxVERTICAL ); m_scGridWin = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); m_scGridWin->SetScrollRate( 5, 5 ); - m_fgGridSizer = new wxFlexGridSizer( 0, 9, 0, 0 ); - m_fgGridSizer->SetFlexibleDirection( wxBOTH ); + m_fgGridSizer = new wxFlexGridSizer( 0, 9, 0, 3 ); + m_fgGridSizer->SetFlexibleDirection( wxHORIZONTAL ); m_fgGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticText7 = new wxStaticText( m_scGridWin, wxID_ANY, _("Layer"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText7 = new wxStaticText( m_scGridWin, wxID_ANY, _("Layer"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText7->Wrap( -1 ); m_staticText7->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText7, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_fgGridSizer->Add( m_staticText7, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 ); - m_staticText8 = new wxStaticText( m_scGridWin, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText8 = new wxStaticText( m_scGridWin, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText8->Wrap( -1 ); m_staticText8->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText8, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgGridSizer->Add( m_staticText8, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_staticText9 = new wxStaticText( m_scGridWin, wxID_ANY, _("Type"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9 = new wxStaticText( m_scGridWin, wxID_ANY, _("Type"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText9->Wrap( -1 ); m_staticText9->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText9, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgGridSizer->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 ); - m_staticText10 = new wxStaticText( m_scGridWin, wxID_ANY, _("Material"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText10 = new wxStaticText( m_scGridWin, wxID_ANY, _("Material"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText10->Wrap( -1 ); m_staticText10->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText10, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgGridSizer->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 ); - m_staticText101 = new wxStaticText( m_scGridWin, wxID_ANY, _("Thickness"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText101 = new wxStaticText( m_scGridWin, wxID_ANY, _("Thickness"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText101->Wrap( -1 ); m_staticText101->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText101, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgGridSizer->Add( m_staticText101, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 ); m_bitmapLockThickness = new wxStaticBitmap( m_scGridWin, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); m_fgGridSizer->Add( m_bitmapLockThickness, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_staticText102 = new wxStaticText( m_scGridWin, wxID_ANY, _("Color"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText102 = new wxStaticText( m_scGridWin, wxID_ANY, _("Color"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText102->Wrap( -1 ); m_staticText102->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText102, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgGridSizer->Add( m_staticText102, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 ); - m_staticText103 = new wxStaticText( m_scGridWin, wxID_ANY, _("Epsilon R"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText103 = new wxStaticText( m_scGridWin, wxID_ANY, _("Epsilon R"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText103->Wrap( -1 ); m_staticText103->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText103, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgGridSizer->Add( m_staticText103, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 ); - m_staticText104 = new wxStaticText( m_scGridWin, wxID_ANY, _("Loss tg"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText104 = new wxStaticText( m_scGridWin, wxID_ANY, _("Loss Tan"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); m_staticText104->Wrap( -1 ); m_staticText104->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_fgGridSizer->Add( m_staticText104, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgGridSizer->Add( m_staticText104, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 2 ); m_scGridWin->SetSizer( m_fgGridSizer ); @@ -118,7 +117,7 @@ PANEL_SETUP_BOARD_STACKUP_BASE::PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent bSizer5->Add( m_scGridWin, 1, wxEXPAND | wxALL, 5 ); - bSizerStackup->Add( bSizer5, 1, wxEXPAND, 5 ); + m_sizerStackup->Add( bSizer5, 1, wxEXPAND|wxRIGHT, 5 ); wxBoxSizer* bSizerRight; bSizerRight = new wxBoxSizer( wxVERTICAL ); @@ -129,29 +128,29 @@ PANEL_SETUP_BOARD_STACKUP_BASE::PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent m_rbDielectricConstraint->SetSelection( 0 ); m_rbDielectricConstraint->SetToolTip( _("If Impedance Controlled option is set,\nLoss tangent and EpsilonR will be added to constraints.") ); - bSizerRight->Add( m_rbDielectricConstraint, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bSizerRight->Add( m_rbDielectricConstraint, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); wxStaticBoxSizer* sbSizerBrdOptions; sbSizerBrdOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Board Finish") ), wxVERTICAL ); m_cbCastellatedPads = new wxCheckBox( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Has castellated pads"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerBrdOptions->Add( m_cbCastellatedPads, 0, wxALL, 5 ); + sbSizerBrdOptions->Add( m_cbCastellatedPads, 0, wxBOTTOM, 5 ); m_cbEgdesPlated = new wxCheckBox( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Plated board edge"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizerBrdOptions->Add( m_cbEgdesPlated, 0, wxALL, 5 ); + sbSizerBrdOptions->Add( m_cbEgdesPlated, 0, wxBOTTOM, 5 ); m_staticTextFinish = new wxStaticText( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Copper finish:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextFinish->Wrap( -1 ); - sbSizerBrdOptions->Add( m_staticTextFinish, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + sbSizerBrdOptions->Add( m_staticTextFinish, 0, wxTOP|wxRIGHT, 10 ); wxArrayString m_choiceFinishChoices; m_choiceFinish = new wxChoice( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceFinishChoices, 0 ); m_choiceFinish->SetSelection( 0 ); - sbSizerBrdOptions->Add( m_choiceFinish, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + sbSizerBrdOptions->Add( m_choiceFinish, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); m_staticTextEdgeConn = new wxStaticText( sbSizerBrdOptions->GetStaticBox(), wxID_ANY, _("Edge card connectors:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextEdgeConn->Wrap( -1 ); - sbSizerBrdOptions->Add( m_staticTextEdgeConn, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + sbSizerBrdOptions->Add( m_staticTextEdgeConn, 0, wxTOP, 10 ); wxString m_choiceEdgeConnChoices[] = { _("None"), _("Yes"), _("Yes, bevelled") }; int m_choiceEdgeConnNChoices = sizeof( m_choiceEdgeConnChoices ) / sizeof( wxString ); @@ -159,19 +158,19 @@ PANEL_SETUP_BOARD_STACKUP_BASE::PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent m_choiceEdgeConn->SetSelection( 0 ); m_choiceEdgeConn->SetToolTip( _("Options for edge card connectors.") ); - sbSizerBrdOptions->Add( m_choiceEdgeConn, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + sbSizerBrdOptions->Add( m_choiceEdgeConn, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); - bSizerRight->Add( sbSizerBrdOptions, 0, wxEXPAND, 5 ); + bSizerRight->Add( sbSizerBrdOptions, 1, wxEXPAND|wxRIGHT, 5 ); - m_buttonExport = new wxButton( this, wxID_ANY, _("Export in Clipboard"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerRight->Add( m_buttonExport, 0, wxALL|wxEXPAND, 5 ); + m_buttonExport = new wxButton( this, wxID_ANY, _("Export to Clipboard"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerRight->Add( m_buttonExport, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - bSizerStackup->Add( bSizerRight, 0, wxEXPAND, 5 ); + m_sizerStackup->Add( bSizerRight, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - bMainSizer->Add( bSizerStackup, 1, wxEXPAND, 5 ); + bMainSizer->Add( m_sizerStackup, 1, wxEXPAND, 5 ); this->SetSizer( bMainSizer ); diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp b/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp index 22cb4d0f62..1b1a239e0d 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp @@ -14,7 +14,6 @@ panel_board_stackup_base 1000 none - 1 PANEL_BOARD_SETUP_BASE @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -45,7 +43,7 @@ PANEL_SETUP_BOARD_STACKUP_BASE - 673,317 + 754,412 ; ; forward_declare @@ -58,10 +56,10 @@ none 5 - wxEXPAND + wxEXPAND|wxRIGHT 0 - + -1,-1 bSizerBrdThickness wxHORIZONTAL none @@ -475,12 +473,12 @@ 1 - bSizerStackup + m_sizerStackup wxHORIZONTAL - none + protected 5 - wxEXPAND + wxEXPAND|wxRIGHT 1 @@ -546,10 +544,10 @@ wxHSCROLL|wxVSCROLL 9 - wxBOTH + wxHORIZONTAL - 0 + 3 m_fgGridSizer wxFLEX_GROWMODE_SPECIFIED @@ -557,8 +555,8 @@ 0 0 - 5 - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -607,7 +605,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -619,7 +617,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + wxALL|wxALIGN_CENTER_VERTICAL 0 1 @@ -649,7 +647,7 @@ 0 0 wxID_ANY - Name + 0 0 @@ -668,7 +666,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -679,8 +677,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -729,7 +727,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -740,8 +738,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -790,7 +788,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -801,8 +799,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -851,7 +849,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -920,8 +918,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -970,7 +968,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -981,8 +979,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -1031,7 +1029,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -1042,8 +1040,8 @@ - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + 2 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 @@ -1073,7 +1071,7 @@ 0 0 wxID_ANY - Loss tg + Loss Tan 0 0 @@ -1092,7 +1090,7 @@ Resizable 1 - + wxALIGN_LEFT ; ; forward_declare 0 @@ -1109,7 +1107,7 @@ 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 0 @@ -1118,7 +1116,7 @@ none 5 - wxEXPAND|wxTOP|wxBOTTOM + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 0 1 @@ -1184,8 +1182,8 @@ 5 - wxEXPAND - 0 + wxEXPAND|wxRIGHT + 1 wxID_ANY Board Finish @@ -1196,7 +1194,7 @@ none 5 - wxALL + wxBOTTOM 0 1 @@ -1260,7 +1258,7 @@ 5 - wxALL + wxBOTTOM 0 1 @@ -1323,8 +1321,8 @@ - 5 - wxTOP|wxRIGHT|wxLEFT + 10 + wxTOP|wxRIGHT 0 1 @@ -1384,8 +1382,8 @@ - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 2 + wxEXPAND|wxTOP|wxBOTTOM 0 1 @@ -1448,8 +1446,8 @@ - 5 - wxTOP|wxRIGHT|wxLEFT + 10 + wxTOP 0 1 @@ -1509,8 +1507,8 @@ - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 2 + wxEXPAND|wxTOP|wxBOTTOM 0 1 @@ -1576,7 +1574,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 0 1 @@ -1611,7 +1609,7 @@ 0 0 wxID_ANY - Export in Clipboard + Export to Clipboard 0 diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.h b/pcbnew/board_stackup_manager/panel_board_stackup_base.h index 0aabbefd97..f534958bbc 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.h +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -48,6 +48,7 @@ class PANEL_SETUP_BOARD_STACKUP_BASE : public wxPanel wxTextCtrl* m_tcCTValue; wxButton* m_buttonSetDielectricThickness; wxStaticLine* m_staticline; + wxBoxSizer* m_sizerStackup; wxScrolledWindow* m_scGridWin; wxFlexGridSizer* m_fgGridSizer; wxStaticText* m_staticText7; @@ -76,7 +77,7 @@ class PANEL_SETUP_BOARD_STACKUP_BASE : public wxPanel public: - PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 673,317 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 754,412 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_SETUP_BOARD_STACKUP_BASE(); }; diff --git a/pcbnew/board_stackup_manager/stackup_predefined_prms.h b/pcbnew/board_stackup_manager/stackup_predefined_prms.h index 1a5f376a43..d36a9e87ed 100644 --- a/pcbnew/board_stackup_manager/stackup_predefined_prms.h +++ b/pcbnew/board_stackup_manager/stackup_predefined_prms.h @@ -37,6 +37,8 @@ #define KEY_CORE "core" #define KEY_PREPREG "prepreg" +#define KEY_COPPER "copper" + // key string used for not specified parameters #define NOT_SPECIFIED "Undefined"