Browse Source

Dont' create new cell if editing one

Return key is used to change cell line. If cell was in edition, the edition is saved before changing line.

Before this change using return key in the last row, if edited, both saved the change and create new row.

After this change, it'll just save the just, and will need a second key press to create a new row.
newinvert
Lucas Dumont 3 years ago
committed by jean-pierre charras
parent
commit
923f386f08
  1. 7
      common/grid_tricks.cpp

7
common/grid_tricks.cpp

@ -462,7 +462,12 @@ void GRID_TRICKS::onCharHook( wxKeyEvent& ev )
if( ( ev.GetKeyCode() == WXK_RETURN || ev.GetKeyCode() == WXK_NUMPAD_ENTER )
&& m_grid->GetGridCursorRow() == m_grid->GetNumberRows() - 1 )
{
if( m_grid->CommitPendingChanges() )
if( m_grid->IsCellEditControlShown() )
{
if( m_grid->CommitPendingChanges() )
handled = true;
}
else
{
wxCommandEvent dummy;
m_addHandler( dummy );

Loading…
Cancel
Save