Guest User

Untitled

a guest
Aug 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. How can I do inverse selection in AdvStringGrid?
  2. PROCEDURE InvertSelection(Grid : TAdvStringGrid);
  3. VAR
  4. C,R : Cardinal;
  5.  
  6. BEGIN
  7. IF Grid.MouseActions.DisjunctCellSelect THEN
  8. FOR R:=Grid.FixedRows TO PRED(Grid.RowCount) DO FOR C:=Grid.FixedCols TO PRED(Grid.ColCount) DO Grid.SelectedCells[C,R]:=NOT Grid.SelectedCells[C,R]
  9. ELSE IF Grid.MouseActions.DisjunctRowSelect THEN
  10. FOR R:=Grid.FixedRows TO PRED(Grid.RowCount) DO Grid.RowSelect[R]:=NOT Grid.RowSelect[R]
  11. ELSE IF Grid.MouseActions.DisjunctColSelect THEN
  12. FOR C:=Grid.FixedCols TO PRED(Grid.ColCount) DO Grid.ColSelect[C]:=NOT Grid.ColSelect[C]
  13. END;
Add Comment
Please, Sign In to add comment