Finally solved this one: it turns out that the item in focus might be a text 
field, or it might also be a table field. If its a table, you just need to get 
the current item of the table, like so:

UInt16 foc = FrmGetFocus(FrmGetActiveForm());
if(foc != noFocus)
        {
        FormPtr form = FrmGetActiveForm();
        if (FrmGetObjectType(form, foc) == frmTableObj)
                field = TblGetCurrentField(FrmGetObjectPtr(form, foc));
        else if (FrmGetObjectType(form, foc) == frmFieldObj)
                field = FrmGetObjectPtr(form, foc);
        else
                field = NULL;
        }
else field = NULL;

...which will set 'field' to be the currently active text field, or NULL if the 
focus isn't on a text field.
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to