+ // redraw the grid lines, should be called after changing their attributes
+ void RedrawGridLines();
+
+ // draw all grid lines in the given cell region (unlike the public
+ // DrawAllGridLines() which just draws all of them)
+ void DrawRangeGridLines(wxDC& dc, const wxRegion& reg,
+ const wxGridCellCoords& topLeft,
+ const wxGridCellCoords& bottomRight);
+
+ // draw all lines from top to bottom row and left to right column in the
+ // rectangle determined by (top, left)-(bottom, right) -- but notice that
+ // the caller must have set up the clipping correctly, this rectangle is
+ // only used here for optimization
+ void DoDrawGridLines(wxDC& dc,
+ int top, int left,
+ int bottom, int right,
+ int topRow, int leftCol,
+ int bottomRight, int rightCol);
+
+ // common part of Clip{Horz,Vert}GridLines
+ void DoClipGridLines(bool& var, bool clip);
+
+ // update the sorting indicator shown in the specified column (whose index
+ // must be valid)
+ //
+ // this will use GetSortingColumn() and IsSortOrderAscending() to determine
+ // the sorting indicator to effectively show
+ void UpdateColumnSortingIndicator(int col);
+
+ // update the grid after changing the columns order (common part of
+ // SetColPos() and ResetColPos())
+ void RefreshAfterColPosChange();
+
+
+ // return the position (not index) of the column at the given logical pixel
+ // position
+ //
+ // this always returns a valid position, even if the coordinate is out of
+ // bounds (in which case first/last column is returned)
+ int XToPos(int x) const;
+
+
+ // event handlers and their helpers
+ // --------------------------------
+
+ // process mouse drag event in WXGRID_CURSOR_SELECT_CELL mode
+ bool DoGridCellDrag(wxMouseEvent& event,
+ const wxGridCellCoords& coords,
+ bool isFirstDrag);
+
+ // process row/column resizing drag event
+ void DoGridLineDrag(wxMouseEvent& event, const wxGridOperations& oper);
+
+ // process mouse drag event in the grid window
+ void DoGridDragEvent(wxMouseEvent& event, const wxGridCellCoords& coords);
+
+ // process different clicks on grid cells
+ void DoGridCellLeftDown(wxMouseEvent& event,
+ const wxGridCellCoords& coords,
+ const wxPoint& pos);
+ void DoGridCellLeftDClick(wxMouseEvent& event,
+ const wxGridCellCoords& coords,
+ const wxPoint& pos);
+ void DoGridCellLeftUp(wxMouseEvent& event, const wxGridCellCoords& coords);
+
+ // process movement (but not dragging) event in the grid cell area
+ void DoGridMouseMoveEvent(wxMouseEvent& event,
+ const wxGridCellCoords& coords,
+ const wxPoint& pos);
+
+ // process mouse events in the grid window
+ void ProcessGridCellMouseEvent(wxMouseEvent& event);
+
+ // process mouse events in the row/column labels/corner windows
+ void ProcessRowLabelMouseEvent(wxMouseEvent& event);
+ void ProcessColLabelMouseEvent(wxMouseEvent& event);
+ void ProcessCornerLabelMouseEvent(wxMouseEvent& event);
+
+ void DoColHeaderClick(int col);
+
+ void DoStartResizeCol(int col);
+ void DoUpdateResizeCol(int x);
+ void DoUpdateResizeColWidth(int w);
+ void DoStartMoveCol(int col);
+
+ void DoEndDragResizeRow(const wxMouseEvent& event);
+ void DoEndDragResizeCol(const wxMouseEvent& event);
+ void DoEndMoveCol(int pos);
+