Re: Does anyone know how to get PIXEL locations of text in a field?

Scott Raney ((no email))
Thu, 29 Sep 94 15:55:49 MDT

>
>
> I want to set the tabstops of a field based upon some text in the
> field ("edit tab stops"). Its driving me crazy just trying to GUESS
> where the tabs should be set to make my table look right.

There are two types of solutions I can think of. The first would be
to create a UI which would make it easy to set the position of the tab
stops. The basic idea would be to put a button someplace that would
wait until you clicked someplace, then compute which field you clicked
in, then compute what the offset from the left edge of the field was.
Set the tabStops property of the field to this coordinate and you've
got a bare-bones version of the ruler found in most GUI word
processors.

The second solution would be to try to compute the positions
automatically. By putting the text of each "cell" in your table into
a field and then getting the formattedWidth of the field, you could
compute the maximum space used by the "cells" in each column which
would be used to set the tabStops property.
Scott

> Thanks,
> -sp-
>

-- 
***********************************************************************
* Scott Raney  303-447-3936            Remember: the better you look, *
* raney@metacard.com                   the more you'll see -- Lidia   *
***********************************************************************