Subject: Re: changing field property at runtime! From: Ben Combee <[EMAIL PROTECTED]> Date: Wed, 20 Oct 2004 14:17:50 -0500
At 01:00 PM 10/20/2004, you wrote:
>Hi there, > >I have created an empty (no text) Field on a form. >And at the runtime I am loading value to that field using the FldInsert() >function. By default the string that I display on that field is left aligned >and I want to make it center aligned. > >I have gone through the field.h file but couldn't find any function for >this. > >Does anyone has any idea about how I can solve this problem?
Fields on Palm OS do not support center-alignment. You'll need to draw your own string to do this.
If the field is editable (as implied) then you might be best served by leaving it left justified and taking advantage of the standard support for fields in the Palm OS.
However, if the field is non-editable, then you can use the Palm OS API to get the pixel width of the field contents, and then change the "bounds" of the field to center it, and this is quite easy to do.
If the field is sometimes editable, such as a field within a table, then you could center it when non-editable and left-justify when editable (such as when the cell is selected by the operator).
Roger Stringer Marietta Systems, Inc. (www.rf-tp.com)
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
