1package ui23import (4 "src.rest/cat/012/internal/sheet"5 "src.rest/cat/012/internal/ui/rowtext"6)78// grid is the sheet as the window shows it: which sheet, the active cell,9// the scroll position, the window size and the selection. Its methods map10// rows and columns to the screen and back (panes.go), move around the11// sheet and select (selection.go); they know nothing of modes, overlays12// or input, which belong to Model. Model embeds it, so m.sheet and m.cur13// read as the model's own.14type grid struct {15 sheet *sheet.Sheet // the sheet shown; its workbook is the file16 cur sheet.Addr // the active cell17 top, left int // first visible scrolling row and column18 width, height int // the window19 shapes rowtext.Shapes // how the rows drawn are laid out; see bands.go2021 // The selection: see selection.go.22 selecting bool23 ext sheet.Addr // the moving corner of the selection24 whole wholeKind2526 // entered is the cell of a merge the active cell last moved or was27 // clicked into, before it moved to the merge's top-left: stepping28 // off the merge sideways goes on along its row, and up or down along29 // its column, as in Sheets.30 entered sheet.Addr3132 // named is set on an output's grid (nbgrid.go): its columns are33 // headed by the names in its first row rather than letters, and its34 // rows counted from the row under it.35 named bool36}3738func (g *grid) book() *sheet.Workbook { return g.sheet.Book() }