Browse Source

Drop cell editor when selecting column.

Fixes: lp:1828222
* https://bugs.launchpad.net/kicad/+bug/1828222
pull/15/head
Jeff Young 7 years ago
parent
commit
f8776f72ac
  1. 9
      common/grid_tricks.cpp
  2. 1
      include/grid_tricks.h

9
common/grid_tricks.cpp

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

1
include/grid_tricks.h

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

Loading…
Cancel
Save