Safe Haskell | None |
---|
Calculates cells that grow to fit. These cells grow to fit the widest cell in the column. No information is ever truncated from these cells (what use is a truncated dollar amount?)
- data GrowOpts = GrowOpts {}
- growCells :: Changers -> GrowOpts -> [(PostMeta, Posting)] -> Fields (Maybe ([ColumnSpec], Int))
- data Fields a = Fields {
- globalTransaction :: a
- revGlobalTransaction :: a
- globalPosting :: a
- revGlobalPosting :: a
- fileTransaction :: a
- revFileTransaction :: a
- filePosting :: a
- revFilePosting :: a
- filtered :: a
- revFiltered :: a
- sorted :: a
- revSorted :: a
- visible :: a
- revVisible :: a
- lineNum :: a
- date :: a
- flag :: a
- number :: a
- postingDrCr :: a
- postingCmdty :: a
- postingQty :: a
- totalDrCr :: a
- totalCmdty :: a
- totalQty :: a
- grownWidth :: Fields (Maybe Int) -> Spacers Int -> Int
- eFields :: Fields EFields
- data EFields
- = EGlobalTransaction
- | ERevGlobalTransaction
- | EGlobalPosting
- | ERevGlobalPosting
- | EFileTransaction
- | ERevFileTransaction
- | EFilePosting
- | ERevFilePosting
- | EFiltered
- | ERevFiltered
- | ESorted
- | ERevSorted
- | EVisible
- | ERevVisible
- | ELineNum
- | EDate
- | EFlag
- | ENumber
- | EPostingDrCr
- | EPostingCmdty
- | EPostingQty
- | ETotalDrCr
- | ETotalCmdty
- | ETotalQty
- pairWithSpacer :: Fields a -> Spacers b -> Fields (a, Maybe b)
Documentation
All the options needed to grow the cells.
growCells :: Changers -> GrowOpts -> [(PostMeta, Posting)] -> Fields (Maybe ([ColumnSpec], Int))Source
Grows the cells that will be GrowToFit cells in the report. First this function fills in all visible cells with text, but leaves the width undetermined. Then it determines the widest line in each column. Finally it adjusts each cell in the column so that it is that maximum width.
Returns a list of rows, and a Fields holding the width of each cell. Each of these widths will be at least 1; fields that were in the report but that ended up having no width are changed to Nothing.
All growing fields.
Fields | |
|
grownWidth :: Fields (Maybe Int) -> Spacers Int -> IntSource
Compute the width of all Grown cells, including any applicable spacer cells.
All growing fields, as an ADT.