Expand description
Pure selection / hit-testing types and helpers. Kept separate from the stateful widget so paint, input, and copy code can all use the same predicates without circular dependencies.
Enums§
- HitResult
- What a mouse hit-test resolved to.
- Scrollbar
Axis - Selection
- What is currently selected. Stores display-row indices; after a sort the “same row” might live at a different position, so callers needing stable identities should track source rows separately.
- Sort
Direction
Functions§
- is_
cell_ selected trueif the selection visually highlights the given cell.- is_
column_ selected - is_
row_ selected - screen_
to_ content - Convert a screen pointer (in window coordinates) to its corresponding content-space (i.e. bounds-relative plus scroll offset) coordinates.
- to_
grid_ relative - Translate an absolute window-space pointer into the grid’s OWN coordinate
frame by subtracting the grid’s painted
bounds.origin. Every pointer value the widget hands to [GridState] is normalized through this at the event boundary, so all stored positions (click_pos,drag_start,last_mouse_pos, menu/prompt anchors) live in one consistent grid-relative frame regardless of where the widget is nested in the window. A grid at window origin (as in the sample app and older tests) is the identity case.