At 12:00am -0800 01-02-13, Palm Developer Forum digest wrote:
>Subject: RE: How to display numeric data in the right alignment in the Table
>From: "Nicolas Raitman" <[EMAIL PROTECTED]>
>Date: Mon, 12 Feb 2001 11:09:44 -0300
>X-Message-Number: 63
>
>Hi, I had the same problem once, and what you have to do is the following.
>Set the numericTableItem to customTableItem. In the drawing routine do the
>following:
>
>...
> for (i = 0; i < StrLen(Factura.Saldo); i++)
> iWidth += TxtCharWidth(Factura.Saldo[i]);
>
>WinDrawChars(Factura.Saldo, StrLen(Factura.Saldo), bounds->topLeft.x +
>(COL_WIDTH_TOTAL - iWidth), bounds->topLeft.y);
This would work for single-byte encodings, but it would fail with
Japanese. Plus, the loop to determine the width of the string is
functionally the same as:
iWidth = FntCharsWidth(Factura.Saldo, StrLen(Factura.Saldo);
Which is faster, smaller, and works properly for all character encodings.
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/