pcbnew: Do not auto edit the 3d-model grid

Auto-selecting of the first grid element is performed in the footprint
editor to facility rapid editing.  Rapid editing of the 3d-model fields
is not as useful and requires multiple esc-keys to cancel.  This limits
the auto-edit to only the reference tab.

Fixes: lp:1815456
* https://bugs.launchpad.net/kicad/+bug/1815456
This commit is contained in:
Seth Hillbrand 2019-02-14 16:26:45 -08:00
parent 1f7022cb64
commit a02f447daa
2 changed files with 16 additions and 8 deletions

View File

@ -64,6 +64,7 @@ DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR( PCB_EDIT_FRAME* aP
m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits, false, 0 ),
m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ),
m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl, m_SolderPasteMarginUnits ),
m_initialFocus( true ),
m_inSelect( false )
{
m_config = Kiface().KifaceSettings();
@ -862,8 +863,12 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::OnUpdateUI( wxUpdateUIEvent& )
grid->SetFocus();
grid->MakeCellVisible( row, col );
grid->SetGridCursor( row, col );
// Selecting the first grid item only makes sense for the
// items grid
if( !m_initialFocus || grid == m_itemsGrid )
{
grid->SetGridCursor( row, col );
grid->EnableCellEditControl( true );
grid->ShowCellEditControl();
@ -874,6 +879,8 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::OnUpdateUI( wxUpdateUIEvent& )
referenceEditor->DecRef();
}
}
m_initialFocus = false;
}
}

View File

@ -65,6 +65,7 @@ private:
wxGrid* m_delayedFocusGrid;
int m_delayedFocusRow;
int m_delayedFocusColumn;
bool m_initialFocus;
bool m_inSelect;