On 29/11/99 9:07 am, Peter Reid at [EMAIL PROTECTED] wrote:

> I'm trying to implement a simulation of a system that displays HTML
> information with hot links.  However, the tricky 'extra' is the fact
> that each single word/phrase hot link is actually treated as two
> halves with a click on the first half of a hot word taking you
> backwards and a click on the second half taking you forwards!
> 
> 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.
> 
> I tried splitting a single word into two separate words and making
> them individual hot words, but came up with the problem of having to
> make them look like a single word whilst behaving as if there's some
> character separating them.
>
> Anyone got any good ideas for this?

Check out the clickCharChunk function.

> 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

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".)

Regards,

Kevin

> Any ideas for this?
> --------------------------------------------------------
> 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

Kevin Miller <[EMAIL PROTECTED]> <http://www.xworlds.com/>
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.

Reply via email to