X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..4f47a8d0c680404c5a7f05c11c8d9fa5a6c9ade7:/include/wx/generic/gridsel.h?ds=inline diff --git a/include/wx/generic/gridsel.h b/include/wx/generic/gridsel.h index bfa1c4e038..ab83260f91 100644 --- a/include/wx/generic/gridsel.h +++ b/include/wx/generic/gridsel.h @@ -9,21 +9,28 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#ifndef _WX_GENERIC_GRIDSEL_H_ +#define _WX_GENERIC_GRIDSEL_H_ + #include "wx/defs.h" #if wxUSE_GRID -#ifndef __WXGRIDSEL_H__ -#define __WXGRIDSEL_H__ - #include "wx/grid.h" -class WXDLLIMPEXP_ADV wxGridSelection{ +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, @@ -45,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 ); @@ -78,11 +94,10 @@ private: wxGrid *m_grid; wxGrid::wxGridSelectionModes m_selectionMode; - friend class WXDLLIMPEXP_ADV wxGrid; + friend class WXDLLIMPEXP_FWD_ADV wxGrid; DECLARE_NO_COPY_CLASS(wxGridSelection) }; -#endif // #ifdef __WXGRIDSEL_H__ -#endif // #ifndef wxUSE_GRID - +#endif // wxUSE_GRID +#endif // _WX_GENERIC_GRIDSEL_H_