As followup to this thread:  I tried tnn's suggestion, and it worked the
same as FrmHideObject.  When I looked at the rectangle returned by
WinGetObjectBounds, it was too short -- it only covered about 2/3 of the
actual label string that was displayed.  This is probably why FrmHideObject
doesn't work -- it's using the same, incorrect, bounds.

I also tried this with different fonts in the label, thinking that maybe the
bold font I was using was throwing off the calculation of field size.  But
there was no difference depending on the font.

My circumvention is to use a selector trigger instead of a label.  It looks
the same, except for the box it draws around the text... I disable it so
don't get any events.  But I sure wonder what's wrong with those same
functions applied against a label.  It's even more mysterious because there
are two different labels on the same form; both are created with the same
PiLRC syntax, and the same code (literally the same functions) are applied
to each.  One works correctly, the other does not.

Is there a knowledgebase somewhere of known bugs and fixes in various
releases of PalmOS?  I didn't see such a database on the Palm site.
-don

"Don Heitzmann" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi, Thanks! I'll use your model and I believe that you've solved my
problem.
> And no, it is my fault for being imprecise in my language, but I'm not
> trying to do this with a "Field" but rather with a "Label"... I guess I
> sometimes think of everthing on a form as a "field," but I know that in
> Palm-speak, that's wrong... Thanks again.
> -don
>
> "ThuNguyet Nguyen" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > Hi Don,
> >
> > > I apply the same code to yet another label object on the form, and for
> some
> > > reason, the FrmHideObject only clears a portion of the label field,
> leaving
> > > garbage (the old string) in roughly the last half.  It's as if the
> > > WinEraseRectangle that (I'm guessing) is done inside FrmHideObject
> doesn't
> > > see the entire length of the field.
> > >
> > I did use FrmHideObject() when I wanted to change the text in the label
> but I don't use it
> > anymore, I read something about it & I had the same problem as you have.
> So, now, I use
> >
> > // some code to make sure that labelText is shorter than
> > // the original string in the label (or cut it)
> > // ...
> >       FrmGetObjectBounds(frmP,objIndex, &r);
> >       WinEraseRectangle(&r, 0);
> >       FrmCopyLabel(frmP,objID,labelText);
> >
> > This code works every time for me (different OS version)
> >
> > > I'd do the WinEraseRectangle, but how do I know the
> > > real, current, area of the field?
> > >
> > When you mention "field", I don't know if you still talk about label or
> you also talk about text
> > field. I use SetTextField(), GetTextField(), FreeTextField() to
manipulate
> text fields. These
> > functions are mentioned a lot in Palm books, in this forum and I can
send
> you my code if you want.
> >
> > HTH,
> >
> > tnn
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> > http://calendar.yahoo.com
> >
> >
>
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to