> To anyone who has used fields in a table:
>
>
> While trying to get familiar with tables, I created one with a couple of columns of
>text fields, and then tried them out. To my surprise, when my text went over the size
>of the field, a second line appeared, as in the field-within-a-form fields. But this
>completely upsets the appearance of the whole table, esepcially by moving all the
>lower rows downwards.
>
>
>
> Questions:
> 1. Is this intentional behaviour of fields-in tables?
>
Yes, the fields are normal Palm OS fields... you need to set the field
up so it is *not* dynamic sized
> 2. Is there some way to specify that a field in a table
> shall be single-line?
>
Yes.
We cover this in our book (Palm OS Programming For Dummies, due out in
July) Here's the basic idea:
1) when you load the form with the table, you need to establish a Load
Data procedure for the column containing the field:
TblSetLoadDataProcedure(table, 3, DescriptionBlock); // assumes column
3 is the desired column
2) Then you code the Load Data procedure (in this example,
DescriptionBlock())
static Err DescriptionBlock (VoidPtr table,
Word row, Word column, Boolean editable,
VoidHand *dataH, WordPtr dataOffset,
WordPtr dataSize, FieldPtr fld) {
FieldAttrType attr;
// Set table field attributes
FldGetAttributes (fld, &attr);
attr.dynamicSize = 0; // don't resize as text is entered
FldSetAttributes(fld, &attr);
return 0;
}
That will do it ;)
--
John Schettino - http://members.tripod.com/schettino/
Palm OS Programming For Dummies, CORBA For Dummies, AppleScript
Applications, and more.