Hi Trevor,
watching for keyDownEvent is correct.
In my program, I have a list of entries and a search field ( much like
the list view in the Adress Book app )
My code for handling this situation is as follows:
case keyDownEvent:
if (event->data.keyDown.chr == pageUpChr) {
PageScroll(winUp);
} else if (event->data.keyDown.chr == pageDownChr) {
PageScroll(winDown);
} else {
FormType* frm = FrmGetActiveForm();
UInt16 fieldFocus = FrmGetFocus(frm);
if (fieldFocus != noFocus &&
FrmGetObjectId(frm, fieldFocus) ==
ENumListFormFindField) {
FieldType* enumField =
(FieldType*)FrmGetObjectPtr(frm,
FrmGetObjectIndex(frm,
ENumListFormFindField));
if (FldHandleEvent(enumField, event)) {
SelectFromFind(); // gets the field
content and highlights the
list/table entry accordingly
handled = true;
}
}
}
break;
Good Luck,
Juergen
Trevor MacPhail wrote:
> What event should I watch for to find when the text in a field has
> changed? I'm trying to implement a search field along with a list that
> updates as you type in the field.
>
> The closest I've come to this so far is watching for keyDownEvent and
> checking if the field has focus but unfortunately the event occurs
> before the field is updated. I would have thought fldChangedEvent would
> do it, but this is only for something to do with fields scrolling.
>
> --
> Trevor
>
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/