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
This commit is contained in:
Wayne Stambaugh 2019-02-10 12:00:19 -05:00
parent a703c53312
commit fe5d2b8710
4 changed files with 22 additions and 19 deletions

View File

@ -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

View File

@ -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 );

View File

@ -3627,7 +3627,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="0">
<property name="BottomDockable">1</property>
@ -3700,7 +3700,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<property name="BottomDockable">1</property>
@ -3783,7 +3783,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxTOP|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="0">
<property name="BottomDockable">1</property>
@ -3866,7 +3866,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>

View File

@ -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!