> > The problem I'm having is that I can't easily work out which half of
> > a hot word the user has clicked into.  I can get the ClickText() for
> > the whole word and the ClickChunk() tells me the chars of the whole
> > word. The ClickLoc() gives me a coordinate pair, but I can't see how
> > to relate this to the characters in the hot word.  What makes life
> > difficult is the fact that the HTML has variable size text as well as
> > some mixed plain and bold text.
>
>Check out the clickCharChunk function.

Thanks Kevin, this works as well as mouseCharChunk() suggested by Phil Davis.

>
> > Also, once I've detected a hot word, I need to jump to another line
> > within the field.  How do I reliably reposition a field with variable
> > height lines on a line boundary?  I tried adding the textHeight of
> > all lines from top to required line, multiplying the total by 4/3 and
> > then setting the vScroll accordingly.  Unfortunately, this isn't
> > reliable, especially if there is a blank line as this returns an
> > empty textHeight.
>
>Use the formattedHeight function to determine how far down you need to go.
>You can ask for the formattedHeight of a chunk of text, e.g.:
>
>the formattedHeight of line 1 to 60 of fld 1

This fails (I'm using MC 2.2.5 on a Mac) with an error message saying 
"bad text attributes, can't get object attributes" which implies that 
the function doesn't work with a text chunk!  I tried this with:

    put the formattedHeight of line 1 to 31 of field doctext1

>Note that selecting the text by script will also scroll the field.  (If you
>have any trouble putting together a script that scrolls exactly as you want
>with formattedHeight, please let me know: we've got one "somewhere".)

I tried  "select line theLine of field theField"  and it selected it 
ok but didn't cause any scrolling or realignment?!

Best regards
Peter

--------------------------------------------------------
Peter Reid
Reid-IT Limited, Loughborough, Leics., UK
Tel: +44 (0)1509 268843 Fax: +44 (0)1509 264986
E-mail: [EMAIL PROTECTED]
Web: http://www.reidit.co.uk

Reply via email to