>At 12:00am -0700 00-04-17, Palm Developer Forum digest wrote:
>  >When I define an underlined field and enter text in it, the underlines only
>  >appear under each new character as it is entered.
>  >
>  >In contrast, the built in apps show a complete line of underlines before any
>  >text entry takes place.
>  >
>  >Am I doing something wrong or is there some trick I am missing?
>  >
>  >Here is my code:
>  >
>  >   FldSetTextHandle(getObject(formP, SOUND_FIELD), soundH); 
>//getObject: does
>  >FrmGettObjectPtr
>  >   FldSetSelection(getObject(formP, SOUND_FIELD), 0, StrLen(soundStr));
>  >   FrmSetFocus(formP, FrmGetObjectIndex(formP, SOUND_FIELD));// Set the
>  >insertion point blinking in field
>  >
>  >Here is my .rcp file entry (PilRC/gcc)
>  >
>  >  FIELD ID SOUND_FIELD AT (80 PREVTOP 90 10) MAXCHARS 12 UNDERLINED FONT 1
>  >USABLE
>
>At 12:00am -0700 00-04-19, Palm Developer Forum digest wrote:
>  >Subject: re: Underline in forms (must be 11 high)
>  >From: "revcom" <[EMAIL PROTECTED]>
>  >Date: Wed, 19 Apr 2000 06:34:24 +1000
>  >X-Message-Number: 90
>  >
>  >
>  >Ole,
>  >
>  >Thank you very much for your reply to my posting.
>  >
>  >You are indeed correct, all my fields were 10 in height (perfectly adequate
>  >for the font I was using) but not high enough for underlining, obviously.
>  >
>  >Changing the height to 12 fixed everything.
>  >
>  >Surely a trap for young players.
>  >
>  >Attnetion, Palm - this behavious is a little inconsistent isn't it? It
>  >should either underline the field always (if >=11) or never underline it.
>  >The current behaviour to not underline when drawing the field, but to
>  >underline as the text is entered seems inconsistent to me. Is this a bug, or
>  >a feature???

Actually a field which isn't tall enough to contain a single line of 
text (e.g. height of 10, using the bold font, as per your example) is 
invalid. In fact, if you tried to use such a field on a recent debug 
ROM (3.1 or later, I believe) you'd get a fatal alert that said 
something like "Field.c, Line: 132, Invalid insertion point 
position". A confusing message, but one that's triggered by the field 
code calculating that zero lines will fit vertically.

Having said that, you're right that there's a minor clipping problem. 
When the field is drawn, the underline is correctly clipped, but when 
text is drawn, the underline winds up being beneath the bottom of the 
field.

-- Ken

Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

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

Reply via email to