start of the great grid folding: introduce wxGridOperations class and use it to avoid duplicating the same code for rows and columns in a couple of methods

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-09-16 08:32:12 +00:00
parent d41f34403c
commit bec7026270
3 changed files with 428 additions and 251 deletions

View File

@@ -21,10 +21,16 @@
class WXDLLIMPEXP_ADV wxGridSelection
{
public:
wxGridSelection( wxGrid * grid, wxGrid::wxGridSelectionModes sel =
wxGrid::wxGridSelectCells );
wxGridSelection(wxGrid *grid,
wxGrid::wxGridSelectionModes sel = wxGrid::wxGridSelectCells);
bool IsSelection();
bool IsInSelection ( int row, int col );
bool IsInSelection(int row, int col);
bool IsInSelection(const wxGridCellCoords& coords)
{
return IsInSelection(coords.GetRow(), coords.GetCol());
}
void SetSelectionMode(wxGrid::wxGridSelectionModes selmode);
wxGrid::wxGridSelectionModes GetSelectionMode() { return m_selectionMode; }
void SelectRow( int row,
@@ -46,6 +52,15 @@ public:
bool ControlDown = false,
bool ShiftDown = false,
bool AltDown = false, bool MetaDown = false );
void ToggleCellSelection( const wxGridCellCoords& coords,
bool ControlDown = false,
bool ShiftDown = false,
bool AltDown = false, bool MetaDown = false )
{
ToggleCellSelection(coords.GetRow(), coords.GetCol(),
ControlDown, ShiftDown, AltDown, MetaDown);
}
void ClearSelection();
void UpdateRows( size_t pos, int numRows );