From fe5d2b871047bb2318f4fc8fbb44cd192c13cf60 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sun, 10 Feb 2019 12:00:19 -0500 Subject: [PATCH] Pcbnew: fix footprint properties dialog 3D model visibility issue. Update 3D model panel on initial dialog load to reflect the current visibility state of the 3D model. Fix a few minor footprint properties dialog spacing issues. Fixes lp:1815184 https://bugs.launchpad.net/kicad/+bug/1815184 --- .../dialog_edit_footprint_for_BoardEditor.cpp | 21 +++++++++++-------- ...og_edit_footprint_for_BoardEditor_base.cpp | 10 ++++----- ...og_edit_footprint_for_BoardEditor_base.fbp | 8 +++---- ...alog_edit_footprint_for_BoardEditor_base.h | 2 +- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp index 4ef23c9a13..fdf683a7fe 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp @@ -287,11 +287,11 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow() m_AutoPlaceCtrl->SetSelection( 0 ); m_AutoPlaceCtrl->SetItemToolTip( 0, _( "Component can be freely moved and auto placed. User " - "can arbitrarily select and edit component's pads." ) ); + "can arbitrarily select and edit component's pads." ) ); m_AutoPlaceCtrl->SetItemToolTip( 1, _( "Component can be freely moved and auto placed, but " - "its pads cannot be selected or edited." ) ); + "its pads cannot be selected or edited." ) ); m_AutoPlaceCtrl->SetItemToolTip( 2, _( "Component is locked: it cannot be freely moved or " - "auto placed." ) ); + "auto placed." ) ); m_CostRot90Ctrl->SetValue( m_footprint->GetPlacementCost90() ); m_CostRot180Ctrl->SetValue( m_footprint->GetPlacementCost180() ); @@ -300,8 +300,8 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow() "Footprints with this option are not put in the footprint position list file" ) ); m_AttributsCtrl->SetItemToolTip( 1, _( "Use this attribute for SMD footprints.\n" "Only footprints with this option are put in the footprint position list file" ) ); - m_AttributsCtrl->SetItemToolTip( 2, _( "Use this attribute for \"virtual\" footprints drawn on board\n" - "such as an edge connector (old ISA PC bus for instance)" ) ); + m_AttributsCtrl->SetItemToolTip( 2, _( "Use this attribute for \"virtual\" footprints drawn " + "on board\nsuch as an edge connector (old ISA PC bus for instance)" ) ); switch( m_footprint->GetAttributes() & 255 ) { @@ -370,14 +370,17 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow() } select3DModel( 0 ); // will clamp idx within bounds + m_PreviewPane->UpdateDummyModule(); // Show the footprint's ID. m_staticLibraryID->SetLabel( m_footprint->GetFPID().Format() ); for( int col = 0; col < m_itemsGrid->GetNumberCols(); col++ ) { - m_itemsGrid->SetColMinimalWidth( col, m_itemsGrid->GetVisibleWidth( col, true, false, false ) ); - // Adjust the column size. The column 6 has a small bitmap, so its width must be taken in account + m_itemsGrid->SetColMinimalWidth( col, m_itemsGrid->GetVisibleWidth( col, true, false, + false ) ); + // Adjust the column size. The column 6 has a small bitmap, so its width must be + // taken in account int col_size = m_itemsGrid->GetVisibleWidth( col, true, true, false ); if( col == 6 ) @@ -490,7 +493,7 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel( wxCommandEvent& ) int filter = 0; // If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the KISYS3DMOD environment - // varaible and fall back to the project path if necessary. + // variable and fall back to the project path if necessary. if( initialpath.IsEmpty() ) { if( !wxGetEnv( "KISYS3DMOD", &initialpath ) || initialpath.IsEmpty() ) @@ -524,7 +527,7 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel( wxCommandEvent& ) filename = alias + wxT( ":" ) + shortPath; #ifdef __WINDOWS__ - // In Kicad files, filenames and paths are stored using Unix notation + // In KiCad files, filenames and paths are stored using Unix notation model.m_Filename.Replace( "\\", "/" ); #endif diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp index 2bf6225213..9a616df6b5 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Feb 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -450,12 +450,12 @@ DIALOG_FOOTPRINT_BOARD_EDITOR_BASE::DIALOG_FOOTPRINT_BOARD_EDITOR_BASE( wxWindow m_buttonAdd = new wxBitmapButton( sbSizer3->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 ); m_buttonAdd->SetMinSize( wxSize( 30,29 ) ); - bSizer3DButtons->Add( m_buttonAdd, 0, wxTOP, 5 ); + bSizer3DButtons->Add( m_buttonAdd, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_buttonBrowse = new wxBitmapButton( sbSizer3->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 ); m_buttonBrowse->SetMinSize( wxSize( 30,29 ) ); - bSizer3DButtons->Add( m_buttonBrowse, 0, wxALL, 5 ); + bSizer3DButtons->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); bSizer3DButtons->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); @@ -463,13 +463,13 @@ DIALOG_FOOTPRINT_BOARD_EDITOR_BASE::DIALOG_FOOTPRINT_BOARD_EDITOR_BASE( wxWindow m_buttonRemove = new wxBitmapButton( sbSizer3->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 ); m_buttonRemove->SetMinSize( wxSize( 30,29 ) ); - bSizer3DButtons->Add( m_buttonRemove, 0, wxTOP|wxLEFT, 5 ); + bSizer3DButtons->Add( m_buttonRemove, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); bSizer3DButtons->Add( 0, 0, 1, wxEXPAND, 5 ); m_button8 = new wxButton( sbSizer3->GetStaticBox(), wxID_ANY, _("Configure Paths..."), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer3DButtons->Add( m_button8, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizer3DButtons->Add( m_button8, 0, wxALL|wxEXPAND, 5 ); sbSizer3->Add( bSizer3DButtons, 0, wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp index 56321546bc..b77dc0652f 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.fbp @@ -3627,7 +3627,7 @@ none 5 - wxTOP + wxALIGN_CENTER_VERTICAL 0 1 @@ -3700,7 +3700,7 @@ 5 - wxALL + wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -3783,7 +3783,7 @@ 5 - wxTOP|wxLEFT + wxALIGN_CENTER_VERTICAL|wxLEFT 0 1 @@ -3866,7 +3866,7 @@ 5 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT + wxALL|wxEXPAND 0 1 diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h index 4dcfc8c40d..59172d83a2 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Feb 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE!