Hi all,

I have a few questions about the cursors in the
register code.  Most of this concerns the files
cellblock.[ch] and splitreg.[ch].

First, the cell widths in a cursor are configured
in terms of characters.  For a GUI, it's necessary to
convert these into pixel widths, but there are a couple
of problems with this.  There are some naive but effective ways:
just fix the width of each column based on the maximum
character width of a cell in that column, or fix the
width of each cell individually.  The first
solution works, but one would like to have corresponding
cells in a "column" of different widths.  The second
solution isn't very good, because it produces very
haphazard looking cells.  What I currently am doing is
assigning pixel widths of a cell in a row in the same
proportion as the number of characters in that cell
to the total characters in the row.  This seems to
work fine, but still some alignment problems.
Any ideas on an intelligent way to do this?  Note
that we can't really just configure the pixel width
directly, since as the window size changes, and
as the font size changes, the width of the rows
should change too (probably within some limits).
Would it make sense to configure widths with
a percentage hint?  This would give us control
over alignment within a block, but still let
actual size change.  Other suggestions are welcome.

Second, the traversal order within a cursor is nicely
defined, but there doesn't seem to be a way to
determine which cell we should activate when the
block is first entered, say on an up or down arrow
press.  The (0,0)th cell isn't always the right
one to go to.  Could we have fields in
the CellBlock struct like first_row, first_col for this?

And finally, what about up/down movements?  If I have
a register open, and press the down arrow, what
should happen?  For a single-line cursor, we should
move to the next cursor, but what if we're in the top
line of a multiline cursor?  And to which cell in the
next line/cursor should we move?  The same cell
as we just left, or the beginning of the cursor?
This is a job for gnc_table_traverse_update, probably.

Best regards,
Heath Martin

----- %< -------------------------------------------- >% ------
The GnuCash / X-Accountant Mailing List
To unsubscribe, send mail to [EMAIL PROTECTED] and
put "unsubscribe gnucash-devel [EMAIL PROTECTED]" in the body

Reply via email to