Drop cell editor when selecting column.

Fixes: lp:1828222
* https://bugs.launchpad.net/kicad/+bug/1828222
This commit is contained in:
Jeff Young 2019-05-10 23:47:50 +01:00
parent 7200f4d7b5
commit f8776f72ac
2 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,7 @@ GRID_TRICKS::GRID_TRICKS( WX_GRID* aGrid ):
aGrid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( GRID_TRICKS::onGridCellLeftDClick ), NULL, this );
aGrid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( GRID_TRICKS::onGridCellRightClick ), NULL, this );
aGrid->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( GRID_TRICKS::onGridLabelRightClick ), NULL, this );
aGrid->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( GRID_TRICKS::onGridLabelLeftClick ), NULL, this );
aGrid->Connect( GRIDTRICKS_FIRST_ID, GRIDTRICKS_LAST_ID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GRID_TRICKS::onPopupSelection ), NULL, this );
aGrid->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( GRID_TRICKS::onKeyDown ), NULL, this );
aGrid->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( GRID_TRICKS::onUpdateUI ), NULL, this );
@ -208,6 +209,14 @@ void GRID_TRICKS::onGridCellRightClick( wxGridEvent& )
}
void GRID_TRICKS::onGridLabelLeftClick( wxGridEvent& aEvent )
{
m_grid->CommitPendingChanges();
aEvent.Skip();
}
void GRID_TRICKS::onGridLabelRightClick( wxGridEvent& )
{
wxMenu menu;

View File

@ -75,6 +75,7 @@ protected:
void onGridCellLeftClick( wxGridEvent& event );
void onGridCellLeftDClick( wxGridEvent& event );
void onGridCellRightClick( wxGridEvent& event );
void onGridLabelLeftClick( wxGridEvent& event );
void onGridLabelRightClick( wxGridEvent& event );
void onPopupSelection( wxCommandEvent& event );
void onKeyDown( wxKeyEvent& ev );