I wrote a little demostration example to solve this problem (see
http://www.ctmap.com/mapinfo/files1.htm#layout.zip) that includes
mapbasic source code. The trick involves putting the text string
down on the layout window without regard to placement, then
picking it back up again (and NOW the text object limits will
contain its exact size), then putting it where you like. 

- Bill Thoen


> Daniel Mack wrote:
> 
> Hi all,
> 
> Before I attempt to use a Windows API function, does anyone
> know how to center a text object in a layout window using
> MapBasic. The "create text" statement allows the placement
> point to be only in the upper left corner of the text object. I
> have tried to use objectGeography function to calculate the
> extents of the text object, but it gives incorrect results.
> Next, I tried to calculate the length of the string based on
> the number of characters, but failed due to the variable
> character size of Windows fonts.
> 
> Thanks to anyone who can help.
> 
> Daniel Mack
> Cave Creek Systems
> Box 641 Nelson, B.C. V1L 5R4
> (250)352-3085
> [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to