Edit the current wxGrid selection block

Really edit the current selection block instead of storing the temporary
information about the current selection and applying it on releasing Shift
key or LKM.
This commit is contained in:
Ilya Sinitsyn
2020-03-04 20:12:09 +07:00
committed by Vadim Zeitlin
parent 72e7bde306
commit e1b9ece9a4
5 changed files with 227 additions and 222 deletions

View File

@@ -61,6 +61,28 @@ public:
void UpdateRows( size_t pos, int numRows );
void UpdateCols( size_t pos, int numCols );
// Extend (or shrink) the current selection block or select a new one.
// blockStart and blockEnd specifies the opposite corners of the currently
// edited selection block. In almost all cases blockStart equals to
// wxGrid::m_currentCellCoords (the exception is when we scrolled out from
// the top of the grid and select a column or scrolled right and select
// a row: in this case the lowest visible row/column will be set as
// current, not the first one). If the row or the column component of
// blockEnd parametr has value of -1, it means that the corresponding
// component of the current block should not be changed.
// Return true if the current block was actually changed or created.
bool ExtendOrCreateCurrentBlock(const wxGridCellCoords& blockStart,
const wxGridCellCoords& blockEnd,
const wxKeyboardState& kbd);
// Return the row of the current selection block if it exists and we can
// edit the block vertically. Otherwise return -1.
int GetCurrentBlockCornerRow() const;
// Return the column of the current selection block if it exists and we can
// edit the block horizontally. Otherwise return -1.
int GetCurrentBlockCornerCol() const;
wxGridCellCoordsArray GetCellSelection() const;
wxGridCellCoordsArray GetBlockSelectionTopLeft() const;
wxGridCellCoordsArray GetBlockSelectionBottomRight() const;