mirror of
https://github.com/audacity/wxWidgets.git
synced 2025-12-11 19:57:24 -06:00
Implement wxGrid cells selection for Home and End keys
Select cells if Shift is pressed when handling Home and End keys
This commit is contained in:
parent
a2d7c7210b
commit
9076d9186c
@ -5479,7 +5479,10 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
|||||||
if ( m_currentCellCoords == wxGridNoCellCoords )
|
if ( m_currentCellCoords == wxGridNoCellCoords )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int row = m_currentCellCoords.GetRow();
|
const bool useSelectedBlockCorner =
|
||||||
|
event.ShiftDown() && m_selectedBlockCorner != wxGridNoCellCoords;
|
||||||
|
int row = useSelectedBlockCorner ? m_selectedBlockCorner.GetRow()
|
||||||
|
: m_currentCellCoords.GetRow();
|
||||||
if ( event.ControlDown() )
|
if ( event.ControlDown() )
|
||||||
{
|
{
|
||||||
row = 0;
|
row = 0;
|
||||||
@ -5500,8 +5503,17 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearSelection();
|
if ( event.ShiftDown() )
|
||||||
GoToCell(row, GetColAt(col));
|
{
|
||||||
|
UpdateBlockBeingSelected(m_currentCellCoords,
|
||||||
|
wxGridCellCoords(row, col));
|
||||||
|
MakeCellVisible(row, col);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearSelection();
|
||||||
|
GoToCell(row, GetColAt(col));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -5510,7 +5522,10 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
|||||||
if ( m_currentCellCoords == wxGridNoCellCoords )
|
if ( m_currentCellCoords == wxGridNoCellCoords )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int row = m_currentCellCoords.GetRow();
|
const bool useSelectedBlockCorner =
|
||||||
|
event.ShiftDown() && m_selectedBlockCorner != wxGridNoCellCoords;
|
||||||
|
int row = useSelectedBlockCorner ? m_selectedBlockCorner.GetRow()
|
||||||
|
: m_currentCellCoords.GetRow();
|
||||||
if ( event.ControlDown() )
|
if ( event.ControlDown() )
|
||||||
{
|
{
|
||||||
row = m_numRows - 1;
|
row = m_numRows - 1;
|
||||||
@ -5531,8 +5546,17 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearSelection();
|
if ( event.ShiftDown() )
|
||||||
GoToCell(row, GetColAt(col));
|
{
|
||||||
|
UpdateBlockBeingSelected(m_currentCellCoords,
|
||||||
|
wxGridCellCoords(row, col));
|
||||||
|
MakeCellVisible(row, col);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearSelection();
|
||||||
|
GoToCell(row, GetColAt(col));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user