Hi Elizabeth,

I have a very similar project that involves the use of two column tables
that can expand beyond a single screen of information. I use a custom draw
routine for the column entries. Each row entry is set so that is is a custom
table entry and then set the record entry to be drawn in that location.

        {
                ...
                TblSetItemStyle(ptrTable, wRow, 0, customTableItem);
                TblSetItemInt(ptrTable, wRow, 0, uintRecord);
                ...
        }

        TblSetCustomDrawProcedure(ptrTable, 0, MainFormDrawRecord);

Then within the custom draw procedure do somthing along the lines for right
alignment:

        // Determine the length of text that will fit within the bounds.

        intWidth     = ptrBounds->extent.x - 2;
        intAreaWidth = intWidth;
        intTextLen   = StrLen(strText);

        if (intTextLen > 0)
        {
                FntCharsInWidth(strText, &intWidth, &intTextLen, &boolFits);

                intStringWidth = FntCharsWidth(strText, intTextLen);

                intOffset = 0;

                if (intStringWidth < intAreaWidth)
                        intOffset = intAreaWidth - intStringWidth;

                // Now draw the text

                WinDrawChars(strText, intTextLen, (ptrBounds->topLeft.x + intOffset),
ptrBounds->topLeft.y);
        }
        else
                WinEraseRectangle(ptrBounds, 0);

This can easily be adjusted for left or centre alignment.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: 08 March 2000 19:31
To: Palm Developer Forum
Subject: Left Justify Label Column in a Table




I want to make the labels left justified in a two-column Table; for example:

Employee Info
   Date of Hire          10/1/1999
   Salary           50000
Company Info
   Office Location  San Francisco
   Manager          John
(these labels can expand to more than one Palm screen)

I am currently using
     TblSetItemStyle (table, row, editLabelColumn, labelTableItem);
     TblSetItemPtr(table, row, editLabelColumn,
appInfoPtr->fieldLabels[FieldMap[fieldIndex]]);
to show the labels from the Application Info Block.

Thanks in advance.


-Elizabeth



--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to