Field Question

A PocketC native palm library offering native forms and assorted utilities

Postby Dave F on Fri Feb 08, 2002 1:53 pm

Just a couple (probably stupid) questions about fields:

(1) When I'm using Fctl(INSERT, &char) to insert characters into a field, I'm trying to make the field act more like a user would expect a Windows single line text field to act. When the field is defined as multilined, when the insertion point reaches the right edge of the field, adding one more char forces a line feed and the appearance is to push the full displayed text off the left side of the field and move the insertion point all the way to the left. I believe that actually what is happening is the full text displayed in the field was pushed up and wordwrap created a new line and set the insertion point at the beginning. But to a user, it appears that the text "disappeared", rather than scrolling the text off the left side of the field char by char as more are added. Is there any way to make char by char scrolling happen and leave the insertion point at the right edge? This would be consistent with what most users are accustomed to from Windows text boxes. I tried setting the field mode to single line, and when the chars fill the field display, the insertion point stays at the right edge, but added chars do not display (even though they are stored in the field string), i.e. the text does not scroll to the left.

(2) Is there any way to tell when a field has lost focus, similar to the Windows event which reports this. This would be useful for screens with large numbers of fields since the programmer could read field inputs from users as they occur and not have to read and update data from all the fields in the form before moving to a new form.
Dave F
Posts: 24
Joined: Fri Nov 30, 2001 11:42 am
Location: USA

Postby jstadolnik on Fri Feb 08, 2002 4:35 pm

1) The INSERT problem you describe only effects Fields with the single-line bit set. Due to the way the palm OS handles these fields it is not possible to scroll them them to the left. There's nothing I can do about it. (Right anchoring the field does help a bit, but the palmOS ends up screwing up the insertion point position.)

2) Yes. Setup a handler function with the Fctl REPEAT command. See the field_demo.c file for an example of this.


The PToolboxLib guy.
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 3 guests