I am trying to use some code from Neil Rhodes book where he obtains a field
pointer from a focus object, no matter whether it is a field or a table that
has the focus. I'm getting some wierd results when the focus is on a table
and I am thinking it's because my table uses customTableItem to define it's
items.
Here is the sequence leading up the the "Clipboard limit exceeded"
1) I tap on an item in my table; item gets highlighted.
2) call the function I wrote (borrowed from Rhodes) GetFocusObjectPtr().
Code snippet follows.
3) call FldCopy (pfld) where pfld is the field pointer returned by
GetFocusObjectPtr().
4) "Clipboard limit exceeded"
Question: How do I get a field pointer to the table item in my case?
static FieldPtr GetFocusObjectPtr (void)
{
FormPtr pfrm;
Word wFocus;
FormObjectKind fobjType;
pfrm = FrmGetActiveForm ();
wFocus = FrmGetFocus (pfrm);
if (wFocus == noFocus)
return (NULL);
fobjType = FrmGetObjectType (pfrm, wFocus);
if (fobjType == frmFieldObj)
{
return (FrmGetObjectPtr (pfrm, wFocus));
}
else if (fobjType == frmTableObj)
{
return (TblGetCurrentField (FrmGetObjectPtr (pfrm, wFocus)));
}
return NULL;
}