+ If a block of cells was previously selected it will expand if the
+ argument is @true or be cleared if the argument is @false.
+ */
+ bool MoveCursorLeft(bool expandSelection);
+
+ /**
+ Moves the grid cursor left in the current row such that it skips to the
+ beginning or end of a block of non-empty cells.
+
+ If a block of cells was previously selected it will expand if the
+ argument is @true or be cleared if the argument is @false.
+ */
+ bool MoveCursorLeftBlock(bool expandSelection);
+
+ /**
+ Moves the grid cursor right by one column.
+
+ If a block of cells was previously selected it will expand if the
+ argument is @true or be cleared if the argument is @false.
+ */
+ bool MoveCursorRight(bool expandSelection);
+
+ /**
+ Moves the grid cursor right in the current row such that it skips to
+ the beginning or end of a block of non-empty cells.
+
+ If a block of cells was previously selected it will expand if the
+ argument is @true or be cleared if the argument is @false.
+ */
+ bool MoveCursorRightBlock(bool expandSelection);
+
+ /**
+ Moves the grid cursor up by one row.
+
+ If a block of cells was previously selected it will expand if the
+ argument is @true or be cleared if the argument is @false.
+ */
+ bool MoveCursorUp(bool expandSelection);
+
+ /**
+ Moves the grid cursor up in the current column such that it skips to
+ the beginning or end of a block of non-empty cells.
+
+ If a block of cells was previously selected it will expand if the
+ argument is @true or be cleared if the argument is @false.
+ */
+ bool MoveCursorUpBlock(bool expandSelection);
+
+ /**
+ Moves the grid cursor down by some number of rows so that the previous
+ bottom visible row becomes the top visible row.
+ */
+ bool MovePageDown();
+
+ /**
+ Moves the grid cursor up by some number of rows so that the previous
+ top visible row becomes the bottom visible row.
+ */
+ bool MovePageUp();
+
+ /**
+ Set the grid cursor to the specified cell.
+
+ 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 @c 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);
+ /**
+ Set the grid cursor to the specified cell.
+
+ 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 @c 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(const wxGridCellCoords& coords);
+
+ //@}
+
+
+ /**
+ @name User Selection
+ */
+ //@{
+
+ /**
+ Deselects all cells that are currently selected.
+ */
+ void ClearSelection();
+
+ /**
+ Returns an array of individually selected cells.
+
+ Notice that this array does @em not contain all the selected cells in
+ general as it doesn't include the cells selected as part of column, row
+ or block selection. You must use this method, GetSelectedCols(),
+ GetSelectedRows() and GetSelectionBlockTopLeft() and
+ GetSelectionBlockBottomRight() methods to obtain the entire selection
+ in general.
+
+ Please notice this behaviour is by design and is needed in order to
+ support grids of arbitrary size (when an entire column is selected in
+ a grid with a million of columns, we don't want to create an array with
+ a million of entries in this function, instead it returns an empty
+ array and GetSelectedCols() returns an array containing one element).
+ */
+ wxGridCellCoordsArray GetSelectedCells() const;
+
+ /**
+ Returns an array of selected columns.
+
+ Please notice that this method alone is not sufficient to find all the
+ selected columns as it contains only the columns which were
+ individually selected but not those being part of the block selection
+ or being selected in virtue of all of their cells being selected
+ individually, please see GetSelectedCells() for more details.
+ */
+ wxArrayInt GetSelectedCols() const;
+
+ /**
+ Returns an array of selected rows.
+
+ Please notice that this method alone is not sufficient to find all the
+ selected rows as it contains only the rows which were individually
+ selected but not those being part of the block selection or being
+ selected in virtue of all of their cells being selected individually,
+ please see GetSelectedCells() for more details.
+ */
+ wxArrayInt GetSelectedRows() const;
+
+ /**
+ Returns the colour used for drawing the selection background.
+ */
+ wxColour GetSelectionBackground() const;
+
+ /**
+ Returns an array of the bottom right corners of blocks of selected
+ cells.
+
+ Please see GetSelectedCells() for more information about the selection
+ representation in wxGrid.
+
+ @see GetSelectionBlockTopLeft()
+ */
+ wxGridCellCoordsArray GetSelectionBlockBottomRight() const;
+
+ /**
+ Returns an array of the top left corners of blocks of selected cells.
+
+ Please see GetSelectedCells() for more information about the selection
+ representation in wxGrid.
+
+ @see GetSelectionBlockBottomRight()
+ */
+ wxGridCellCoordsArray GetSelectionBlockTopLeft() const;
+
+ /**
+ Returns the colour used for drawing the selection foreground.
+ */
+ wxColour GetSelectionForeground() const;
+
+ /**
+ Returns the current selection mode.
+
+ @see SetSelectionMode().
+ */
+ wxGridSelectionModes GetSelectionMode() const;
+
+ /**
+ Returns @true if the given cell is selected.
+ */
+ bool IsInSelection(int row, int col) const;
+ /**
+ Returns @true if the given cell is selected.
+ */
+ bool IsInSelection(const wxGridCellCoords& coords) const;
+
+ /**
+ Returns @true if there are currently any selected cells, rows, columns
+ or blocks.
+ */
+ bool IsSelection() const;
+
+ /**
+ Selects all cells in the grid.
+ */
+ void SelectAll();
+
+ /**
+ Selects a rectangular block of cells.
+
+ If @a addToSelected is @false then any existing selection will be
+ deselected; if @true the column will be added to the existing
+ selection.
+ */
+ void SelectBlock(int topRow, int leftCol, int bottomRow, int rightCol,
+ bool addToSelected = false);
+ /**
+ Selects a rectangular block of cells.
+
+ If @a addToSelected is @false then any existing selection will be
+ deselected; if @true the column will be added to the existing
+ selection.
+ */
+ void SelectBlock(const wxGridCellCoords& topLeft,
+ const wxGridCellCoords& bottomRight,
+ bool addToSelected = false);
+
+ /**
+ Selects the specified column.
+
+ If @a addToSelected is @false then any existing selection will be
+ deselected; if @true the column will be added to the existing
+ selection.
+
+ This method won't select anything if the current selection mode is
+ wxGridSelectRows.
+ */
+ void SelectCol(int col, bool addToSelected = false);
+
+ /**
+ Selects the specified row.
+
+ If @a addToSelected is @false then any existing selection will be
+ deselected; if @true the row will be added to the existing selection.
+
+ This method won't select anything if the current selection mode is
+ wxGridSelectColumns.
+ */
+ void SelectRow(int row, bool addToSelected = false);
+
+ /**
+ Set the colour to be used for drawing the selection background.
+ */
+ void SetSelectionBackground(const wxColour& c);
+
+ /**
+ Set the colour to be used for drawing the selection foreground.
+ */
+ void SetSelectionForeground(const wxColour& c);
+
+ /**
+ Set the selection behaviour of the grid.
+
+ The existing selection is converted to conform to the new mode if
+ possible and discarded otherwise (e.g. any individual selected cells
+ are deselected if the new mode allows only the selection of the entire
+ rows or columns).
+ */
+ void SetSelectionMode(wxGridSelectionModes selmode);
+
+ //@}
+
+
+ /**
+ @name Scrolling
+ */
+ //@{
+
+ /**
+ Returns the number of pixels per horizontal scroll increment.
+
+ The default is 15.
+
+ @see GetScrollLineY(), SetScrollLineX(), SetScrollLineY()
+ */
+ int GetScrollLineX() const;
+
+ /**
+ Returns the number of pixels per vertical scroll increment.
+
+ The default is 15.
+
+ @see GetScrollLineX(), SetScrollLineX(), SetScrollLineY()