- Main change is the addition of wxGridSelectRowsOrColumns selection mode

(which is still probably buggy, wxGridSelection needs to be reviewed)
- Add XYToCell() overloads returning wxGridCellCoords (instead of modifying the
  argument passed by reference -- where did this come from?) and document them.
- Added GoToCell() which does make the new current cell visible unlike
  SetGridCursor() (which was documented as doing it, but wasn't)
- Changed SetCurrentCell() to only not change the cell if wxEVT_GRID_SELECT_CELL
  it generates is vetoed, not just processed as this seems to make more sense
- Split jumbo (~400 lines) ProcessGridCellMouseEvent() function into chunks
- Add many more comments to make reading this code seem less like puzzle
  solving for the next unfortunate soul to do it


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-09-19 23:33:04 +00:00
parent 0e0977894a
commit 8a3e536cd5
8 changed files with 717 additions and 502 deletions

View File

@@ -2130,6 +2130,19 @@ public:
*/
wxGridTableBase *GetTable() const;
//@{
/**
Make the given cell current and ensure it is visible.
This method is equivalent to calling MakeCellVisible() and
SetGridCursor() and so, as with the latter, a wxEVT_GRID_SELECT_CELL
event is generated by it and the selected cell doesn't change if the
event is vetoed.
*/
void GoToCell(int row, int col);
void GoToCell(const wxGridCellCoords& coords);
//@}
/**
Returns @true if drawing of grid lines is turned on, @false otherwise.
*/
@@ -2693,12 +2706,22 @@ public:
*/
void SetDefaultRowSize(int height, bool resizeExistingRows = false);
//@{
/**
Set the grid cursor to the specified cell.
This function calls MakeCellVisible().
The grid cursor indicates the current cell and can be moved by the user
using the arrow keys or the mouse.
Calling this function generates a wxEVT_GRID_SELECT_CELL event and if
the event handler vetoes this event, the cursor is not moved.
This function doesn't make the target call visible, use GoToCell() to
do this.
*/
void SetGridCursor(int row, int col);
void SetGridCursor(const wxGridCellCoords& coords);
//@}
/**
Sets the colour used to draw grid lines.
@@ -2883,6 +2906,27 @@ public:
*/
int XToEdgeOfCol(int x) const;
//@{
/**
Translates logical pixel coordinates to the grid cell coordinates.
Notice that this function expects logical coordinates on input so if
you use this function in a mouse event handler you need to translate
the mouse position, which is expressed in device coordinates, to
logical ones.
@see XToCol(), YToRow()
*/
// XYToCell(int, int, wxGridCellCoords&) overload is intentionally
// undocumented, using it is ugly and non-const reference parameters are
// not used in wxWidgets API
wxGridCellCoords XYToCell(int x, int y) const;
wxGridCellCoords XYToCell(const wxPoint& pos) const;
//@}
/**
Returns the row whose bottom edge is close to the given logical y
position.