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.
This commit is contained in:
parent
05185ec81a
commit
923f386f08
|
@ -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…
Reference in New Issue