Make Ctrl/Shift-Space apply to all cells of the current selection
This provides a convenient way to select multiple lines and is consistent with the operation of these keys in spreadsheet programs.
This commit is contained in:
@@ -5834,21 +5834,29 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
||||
break;
|
||||
|
||||
case WXK_SPACE:
|
||||
// Ctrl-Space selects the current column, Shift-Space -- the
|
||||
// current row and Ctrl-Shift-Space -- everything
|
||||
// Ctrl-Space selects the current column or, if there is a
|
||||
// selection, all columns containing the selected cells,
|
||||
// Shift-Space -- the current row (or all selection rows) and
|
||||
// Ctrl-Shift-Space -- everything.
|
||||
{
|
||||
wxGridCellCoords selStart, selEnd;
|
||||
switch ( m_selection ? event.GetModifiers() : wxMOD_NONE )
|
||||
{
|
||||
case wxMOD_CONTROL:
|
||||
m_selection->SelectCol(m_currentCellCoords.GetCol());
|
||||
selStart.Set(0, m_currentCellCoords.GetCol());
|
||||
selEnd.Set(m_numRows - 1,
|
||||
m_selection->GetExtensionAnchor().GetCol());
|
||||
break;
|
||||
|
||||
case wxMOD_SHIFT:
|
||||
m_selection->SelectRow(m_currentCellCoords.GetRow());
|
||||
selStart.Set(m_currentCellCoords.GetRow(), 0);
|
||||
selEnd.Set(m_selection->GetExtensionAnchor().GetRow(),
|
||||
m_numCols - 1);
|
||||
break;
|
||||
|
||||
case wxMOD_CONTROL | wxMOD_SHIFT:
|
||||
m_selection->SelectBlock(0, 0,
|
||||
m_numRows - 1, m_numCols - 1);
|
||||
selStart.Set(0, 0);
|
||||
selEnd.Set(m_numRows - 1, m_numCols - 1);
|
||||
break;
|
||||
|
||||
case wxMOD_NONE:
|
||||
@@ -5862,6 +5870,10 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
||||
default:
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
if ( selStart != wxGridNoCellCoords )
|
||||
m_selection->SelectBlock(selStart, selEnd);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user