Hi,
    I have been trying endlessly to debug a number of problems with
tables and OS 3.5.  First off, if a form has coordinates other than 0,
0, 160, 160, there appears to be a bug in the 3.5 table routines such
that it will initially draw the fields within the table at an offset
equal to the distance from 0, 0, 160, 160 that the form begins.  That
is easily worked around by setting the forms params to 0, 0, 160, 160.
Thought I might throw that out there for others who encounter the same
oddity in the future.

   The problem I can't figure out is as follows:
In this app, I'd like to highlight the first text field within the
table.  For some reason, while the code I am using works fine for
editing, copying, pasting, etc., the keyboard dialog will not pop up
for the text field, and my pull down menu command does not work
either, though it will work fine on pre OS 3.5 devices.  I have some
code that was taken from the address book, almost directly, yet
doesn't seem to do the trick.   Here's what I do:
   TblReleaseFocus(table);
   frm = FrmGetActiveForm();
   FrmSetFocus(frm, FrmGetOjbectIndex(frm, DataScreenFieldsTable);
   TblGrabFocus(table, row, 1);   
   field = TblGetCurrentField(table);
   FldMakeFullyVisible(field);
   FldSetInsPtPosition(field, 0);
   FldGrabFocus(field);

The strange part of all of this, is that while I can edit this field
automatically using the above code, if I tap the very same field
again, the keyboard dialog works fine.  I looked at the old table.c
code and could see that a pendownevent would be all that was needed to
generate this sort of initialization, so I attempted to kludge the
following just to see what happens:
   FldGetBounds(field, &rect);
   MemSet(&event, sizeof(EventType), 0);
   event.eType = penDownEvent;
   event.screenX = rect.topLeft.x+1;
   event.screenY = rect.topLeft.y+1;
   EvtAddEventToQueue(&event);

But to no avail.  I have tried several dozen different things ranging
from frmUpdateEvents with updatecodes, to unselecting the table, to
generating a button that would call the above code (which actually
worked, but I can't expect users to press a button in order to
automatically highlight the first field), to automatically calling
penDownEvents on the above button to make it happen programmatically-
what a kludge that would be if it actually worked!

Again, this only effects users running OS 3.5.  Any ideas?  Thanks in
advance!

Thanks,
Dave Haupert
DDH Software, Inc
[EMAIL PROTECTED]    http://www.ddhsoftware.com


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to