Implements row heights and a command-line option `-F nn` for fteapot to set the general font size.
Also improves documentation and uniformizes key bindings somewhat between teapot and fteapot.
Resolves#57.
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #77
This change gets teapot to compile without warnings on OpenSUSE Tumbleweed
with the extended warnings flags that were recently added. It also represents
a more thoroughly (but not exhaustively) tested and debugged version of the
expression-controlled style settings from an earlier commit. The facility
should be ready for use.
It also adds a better pretty-printer for Token values in gdb and extensive
edits to the documentation. It fixes a bug in max/min introduced by the
addition of the Bool type and the switchover to comparisons returning Bool.
It modifies the display of values too long to fit in their cells to show an
initial segment of their contents with a continuation mark rather than
obscuring the contents completely.
Closes#54.
Closes#55.
Closes#44.
Closes#22.
Closes#13.
There turned out to be one blocking technical issue for full adpotion of
tpa format, and that was the fact that the printed representation of
floating values inside the tpa file might not reproduce the same double
when read. This change therefore introduces the "hexact" floating point
format, based on the the %La format string, which produces a hex
representation with exact round trips. While working on this, it was
convenient to add a new representation "compact" which is basically the
shorter of decimal and scientific representations, without trailing zeros.
This is now the default float format, but of course one can select decimal
or scientific formats to restore prior appearance. However, full-precision
compact format is now the (only) format for editing cell contents, as it
is accurate and efficient. Of course you can enter floating point values
in any format you like when typing in a formula.
The addition of several new floating point options overloaded the menus
in terminal teapot, so this change also revamps those menus slightly,
including eliminating the unused MenuChoice struct, and just specifying menus
with an array of strings.
Closes#63.
The primary change is to add a “funcall” token, so that an entire expression
can be encapsulated as a single token. This change is used to allow a cell to
include simply a selection of appropriate semantic tokens. I.e., the content
and iterative content are now each a single token like the value and the
result value. Token vectors are used only as intermediate results in scanning
and parsing.
Not this means the cells are now in effect storing parse trees, so
computation should be slightly faster and future extensions (like #56) should
be facilitated.
This commit also takes the opportunity while internals are being altered to
add another token to a cell for future use for computed attributes, cf #22,
and to change the internal numerical values from double and ints to long
doubles and long longs. However, the change attempts to encapsulate that
choice so it would be easy to change back or change to another representation.
Note that these changes break savexdr(), as the internal binary format of
a cell is now different. Rather than reimplement it, it is deprecated as
the world does not need another binary spreadsheet format. Hence, the
ascii format for teapot spreadsheets becomes the primary file format.
Loading of old xdr files is still supported for backward compatibility.
Closes#59.
Also along the way, various other slight fixes and enhancements crept in,
a partial but probably not exhaustive list of which follows:
Fixes#31.
Further revisions and improvements to documentation.
Make the approximate comparison of floating point values scale more
accurately with the size of the doubles being compared.
Further extensions of absolute and relative cell addressing.
Addition of (circle constant) tau function/constant.
Modified string conversion to simply use internal printing routines, and
to take "scientific" and "decimal" keywords.
Allowed n() function to take a list of values, or just a single location
defaulting to the current location.
Added floor, ceil, trunc, and round functions, and allowed them to be
keywords controlling the int() integer conversion function as well.
Allowed substr() to drop its last argument to go to the end of the string.
Provided an enum of built-in functions to preserve legacy function
identifiers, allowing the large table inside func.c to be reorganized
in a clearer fashion.
Added additional annotation of properties of the built-in functions,
including precedence.
All operators are now also accessible as built-in functions.
Made precedence of unary - lower than ^ to match python.
Avoided inadvertently using FLTK @symbol abbreviations for formulas with
"@" in them.
This change does away with separate attributes foreground and background,
opting for an array of color "aspects", where the aspect can vary
over an enum which can either be FOREGROUND or BACKGROUND. This will allow
writing a single set of color-editing code which can work either on the
foreground or background color of a cell.
Now palettes are allocated and deallocated in fteapot as well as teapot;
both executables have some color rendering, with fteapot using the cell
foreground and background (there's just no way to set them at the moment).
teapot is so far only using color in the header.
Implements #39.
Now in fteapot you can select any one of the buttons in a modal dialog
with the cursor keys and hit enter and it will be selected.
Fixes#17.
In addition, I clarified that the block attribute options will either set
every cell to bold (say), or unset every cell, or you can cancel to not
actually go through with the block operation.
These changes required adding a custom FLTK dialog, tpt_choose.{h,cxx}.
Along the way, I reflowed fteapot.fl to make it more readable for further
coding.
Finally, there is a small amount of additional prep for color support
that (unfortunately) got mixed in with these changes.
So far, this jst consists of initializing color in curses mode, and making
the display start and end part of intializing and freeing a sheet (so that
it can control allocating the palette, for example, where the data structure
used depends on what kind of display it is.
Next up will be to allocate and destroy the color palette, and set up the
default colors for cells to use (0 for foreground,
TEAPOT_WHITE for background.) The outline beyond that is to allow setting of
the cell colors, then actually display those colors, and finally edit the
palette.