49G[+] Bug in ~Choose (ROMPTR B3 0)



The following illustrates an oversight in the otherwise
brilliant porting of the GX browser engine ROMPTR B3 0
to the 49G series (tested on 49G 1.24 and 49G+ 2.05)

The test program 'P0' alternates between current fonts
and minifont (flag -90), it randomly supplies either
a title or no title, and it generates a varying number
of items in the choose list, so that all combinations
will occur to test the browser's coping ability.

This full-screen chooser is as simple as can be;
its message handler sets up the full-screen option,
and that's all it does -- everything else reverts
to the built-in defaults of the browser.

Since this is only a test, I've also thrown out
any special handling of sublists, to focus only
on how the built-in default browser displays things.

What you will find is that when the current font
(I.e. not minifont) is used and no scrolling is needed,
the "long line" will display 21 characters (including
trailing ellipsis); when scrolling is required,
20 characters (including ellipses) are displayed instead
(because the scroll indicators need one column);
the 49G[+] (2.05) also correctly adjusts for its taller
screen -- so far so good, matey, that's absolutely perfect!

When the minifont is in effect, the scrolling indicators
still appear where they should -- all the way over
at the right edge of the screen -- but the long data line
still gets treated exactly as if a "standard" font
were being used, hence the right-hand one third
of the entire screen area is never getting used.

Looking thru the ROMPTRs of library 179, we can see
that it's extremely well thought out and thorough
in calculating the positioning, the number of data lines
which will fit, and so on, for every combination of font height,
title on/off, scrolling required or not, even 49G or 49G+

The scrolling indicator characters always match the font
(unlike the 48GX, where the constant 5x7 arrow easily
causes crashes) -- there was just one minor oversight,
which is that when making a default display of a line
in minifont, the screen should be counted as fitting
up to 33 characters, not 22 characters -- that's why
the rightmost 1/3 of the screen doesn't get used.

If we want to track down where this oversight might be,
we can do "EIGHTYONE" Nosy and then press the "N" key;
this causes Nosy to scan all of ROM for references
to this bint, which the browser has to be doing,
because that's when it asks the message handler
whether it will make the grob itself, or else
leave it up to the browser engine to do it.

Only three references in flash bank 2 (where the browser
engine resides) are found, so there's only a narrow area
in which to look for the omission; the first two
of those cases are themselves message handlers
for functions invoking the browser engine, leaving
only the remaining final match, where the browser itself
actually calls the invoking message handler --
you will see that it's deciding where to truncate the
string and whether to use an ellipsis, so that's
exactly where the correction is needed.

Pressing Nosy's "N" key again in that place,
we find that it was called from ^LEDispItem;
is any more hunting needed?

I have, following Andreas Moeller's suggestion,
been able to make a handler to make grobs myself,
but then I don't get any ellipsis -- why should
all programmers have to add so much more work anyway,
when the built-in default handler is almost correct,
having just the smallest error, which hopefully might get fixed?

By the way, "hats off" to Jurjen NE Bos
for the remarkable "Nosy" library, without which
hardly any of this exploration would have been possible:
http://www.hpcalc.org/details.php?id=4323
http://www.hpcalc.org/hp49/programming/misc/nosy.zip


Here are the programs (complete with installer and tester)
for 49G[+]:


%%HP: T(3)F(.); \<< @ file transfer header
@ (just execute the transferred program to install)

"
( Bare bones full-screen CHOOSE, everything is default )
( no special handling of lists during input or output )
::
CK3NOLASTWD
CK&DISPATCH1
# 351
::
'
::
( Message handler )
SIXTY #=casedrop :: TRUE TRUE ; ( Full Screen )
DROPFALSE ( no other messages handled )
;
4ROLL ( Title )
'
( Internal standard converter - displays item as string )
ROMPTR B3 61
5ROLL ( item list )
DUPLENCOMP
6ROLL ( initial highlight position )
COERCE
#MIN ( Assures initial position is in range )
ROMPTR B3 0 ( ~Choose )
COERCEFLAG
;
;
@" -92 SF asm 'CHOOSF' STO

@ A test program to try all possible combinations (eventually)
\<< -90 DUP IF FS? THEN CF ELSE SF END @ alternating fonts
{ FONT6 FONT7 FONT8 } RAND 3 * CEIL GET EVAL \->FONT
RAND 0.5 > "Choose" "" IFTE @ random title on/off
"----+----1----+----2----+----3----+" @ a long line
1 12 START RAND 100 * NEXT 13 \->LIST @ random list
1 13 RAND * CEIL SUB 1 CHOOSF { DROP } IFT \>> 'P0' STO

@ End
.



Relevant Pages

  • Re: Fitting the Page to Various Resolutions
    ... website CSS settings. ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... > You can't "lock" font size with CSS. ... >> Nothing you can do about it, the user can increase the font size in their browser as long as you ...
    (microsoft.public.frontpage.client)
  • Re: Recommendations for coding for Zoom Text Only
    ... Dr J R Stockton wrote: ... Two or three clicks of the wheel in Firefox, for me, as far as the font ... Those who only use a browser to read what others have written should ... with the editor open in the other half. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Setting Standards for Text
    ... > find most browser default settings to be on the ... When you're making your designs flexible enough, ... browser, whatever it may be. ... Mozilla) and setting it to disregard font settings below a certain ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: More on the Sibelius Fourth Symphony
    ... For those who are interested in the Sibelius Fourth Symphony ... (depends on the used browser). ... It's a pretty small font, ... Explorer 6) has a resizing function that is ruled out by the SF ...
    (rec.music.classical.recordings)
  • Re: Opening instruments with appletviewer vs. browser
    ... This is just a test program to demonstrate the error. ... synthesizer with getAvailableInstruments, I get a bunch of instruments ... when running it with appletviewer, but none when using a browser. ...
    (comp.lang.java.programmer)