Date: Fri, 26 Oct 2001 22:36:23 +0200 (CEST)
From: Helge Oldach <pilrc@oldach.net>
To: Aaron Ardiri <aaron@ardiri.com>
Cc: bill@32768.com
Subject: Re: pilrc bug

Aaron,

> > I forgot to add that the recent 2.8p7 behaves identical to 2.8. The bug
> > is apparently still there.
>
>   heh :) ok. probably a small bug.. your welcome to take a look

Always...

--- pilrc-2.8/pilrc.c.ORIG	Tue May  1 19:55:32 2001
+++ pilrc-2.8/pilrc.c	Fri Oct 26 22:27:07 2001
@@ -2453,8 +2453,6 @@
             (PBAFIELD(obj.list, font) == largeFont ? 14 : 11) * itm.cvis;
           if (height >= 160)
             height = 160;
-          if (itm.rc.topLeft.y + height >= 160)
-            height = 160 - itm.rc.topLeft.y;
           SETPBAFIELD(obj.list, bounds.extent.y, height);
           rcPrev.extent.y = height;
         }

Deleting these two lines (unchanged until 2.8p7) of code fixes the
problem. I think the problem is that the height of a LIST is not related
to it's initial location. The system will move the list up or down
automatically. itm.rc.topLeft.y is the *top* location of the initial
location. If this object is on the bottom of the display (say - as in
this case - row 147) the list can still extend to the very last row of
the display. Hence the height of the displayed list is irrespective of
the location.

Well, the story is probably somehow similar to that... I understand far
too little about PalmOS to provide a decent explanation. Apologies if
I'm wrong.

Date: Thu, 8 Nov 2001 15:24:50 +0100 (CET)
From: Helge Oldach <pilrc@oldach.net>
To: Aaron Ardiri <aaron@ardiri.com>
Subject: pilrc LIST width fix

Aaron,

I think that

LIST "short" "long-long-longer" ID 2701 AT (81 66 AUTO AUTO) NONUSABLE FONT 0

does the wrong thing: The width AUTO receives the width of the first
list element ("short" in this case) while it actually should become the
width of the longest of all elements ("long-long-longer" in this case).
Otherwise, if this list is being used as a POPUPLIST the longer elements
will be truncated to the width of the first one.

Here's a fix (applies to 2.8p7):

--- pilrc.c.orig	Sat May 26 15:51:43 2001
+++ pilrc.c	Thu Nov  8 14:58:57 2001
@@ -1128,7 +1128,18 @@
     case ktAuto:
       if (fHoriz)
       {
-        wVal = DxCalcExtent((unsigned char *)pitm->text, pitm->font);
+        if (pitm->grif & ifMultText) {
+          char *text = pitm->text;
+          wVal = 0;
+          while (text < pitm->text + pitm->cbText) {
+            int extlen = DxCalcExtent((unsigned char *)text, pitm->font);
+            text += strlen(text) + 1;
+            if (extlen > wVal)
+              wVal = extlen;
+          }
+        } else {
+          wVal = DxCalcExtent((unsigned char *)pitm->text, pitm->font);
+        }
         if (pitm->grif & ifSmallMargin)
           wVal += 2 * dxObjSmallMargin;
         if (pitm->grif & ifBigMargin)
