Fix making the wrong wxGrid cell visible when selecting
We should make visible the cell of the corner of the current selected block. Also fix names of the wxGrid::UpdateBlockBeingSelected parameters because actually passed сщщквы are of any opposite selection block corners.
This commit is contained in:
committed by
Vadim Zeitlin
parent
55efc9e607
commit
d455c5b99e
@@ -2325,13 +2325,13 @@ protected:
|
|||||||
|
|
||||||
// this function is called to extend the block being currently selected
|
// this function is called to extend the block being currently selected
|
||||||
// from mouse and keyboard event handlers
|
// from mouse and keyboard event handlers
|
||||||
void UpdateBlockBeingSelected(int topRow, int leftCol,
|
void UpdateBlockBeingSelected(int blockStartRow, int blockStartCol,
|
||||||
int bottomRow, int rightCol);
|
int blockEndRow, int blockEndCol);
|
||||||
|
|
||||||
void UpdateBlockBeingSelected(const wxGridCellCoords& topLeft,
|
void UpdateBlockBeingSelected(const wxGridCellCoords& blockStart,
|
||||||
const wxGridCellCoords& bottomRight)
|
const wxGridCellCoords& blockEnd)
|
||||||
{ UpdateBlockBeingSelected(topLeft.GetRow(), topLeft.GetCol(),
|
{ UpdateBlockBeingSelected(blockStart.GetRow(), blockStart.GetCol(),
|
||||||
bottomRight.GetRow(), bottomRight.GetCol()); }
|
blockEnd.GetRow(), blockEnd.GetCol()); }
|
||||||
|
|
||||||
virtual bool ShouldScrollToChildOnFocus(wxWindow* WXUNUSED(win)) wxOVERRIDE
|
virtual bool ShouldScrollToChildOnFocus(wxWindow* WXUNUSED(win)) wxOVERRIDE
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
@@ -5822,11 +5822,16 @@ bool wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol,
|
wxGrid::UpdateBlockBeingSelected(int blockStartRow, int blockStartCol,
|
||||||
int bottomRow, int rightCol)
|
int blockEndRow, int blockEndCol)
|
||||||
{
|
{
|
||||||
|
m_selectedBlockCorner = wxGridCellCoords(blockEndRow, blockEndCol);
|
||||||
MakeCellVisible(m_selectedBlockCorner);
|
MakeCellVisible(m_selectedBlockCorner);
|
||||||
m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol);
|
|
||||||
|
int topRow = wxMin(blockStartRow, blockEndRow);
|
||||||
|
int leftCol = wxMin(blockStartCol, blockEndCol);
|
||||||
|
int bottomRow = wxMax(blockStartRow, blockEndRow);
|
||||||
|
int rightCol = wxMax(blockStartCol, blockEndCol);
|
||||||
|
|
||||||
if ( m_selection )
|
if ( m_selection )
|
||||||
{
|
{
|
||||||
@@ -5864,9 +5869,6 @@ wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureFirstLessThanSecond(topRow, bottomRow);
|
|
||||||
EnsureFirstLessThanSecond(leftCol, rightCol);
|
|
||||||
|
|
||||||
wxGridCellCoords updateTopLeft = wxGridCellCoords(topRow, leftCol),
|
wxGridCellCoords updateTopLeft = wxGridCellCoords(topRow, leftCol),
|
||||||
updateBottomRight = wxGridCellCoords(bottomRow, rightCol);
|
updateBottomRight = wxGridCellCoords(bottomRow, rightCol);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user