Indenting Challenge

Dave Cragg dave.cragg at lacscentre.co.uk
Tue Nov 9 14:21:48 EST 2010


On 9 Nov 2010, at 18:39, Scott Rossi wrote:

> <snip>

>  I've been asked to implement two levels
> bulleting/indenting, something like the following (hope it comes across):
> 
> • Main Bullet Item 1 that spans
>   multiple lines
> • Main Bullet Item 2
>   - Secondary Bullet 1
>   - Secondary Bullet 2 which
>      spans multiple lines
>   - Secondary Bullet 3
> • Main Bullet Item 3
> 
> I can accomplish the first level bullet/indenting using a combination of
> margins and firstIndent, but I can't figure out a way to handle second
> level.  To date I've been using HTMLtext and non-breaking spaces to pad the
> secondary level lines, but arbitrarily adding spaces to live editable text
> is messy, and I can't find a way to align a padded+wrapped line with the
> line above it.  It occurred to me maybe there's some non-typeable,
> non-selectable character I could use for padding, but I only know of
> formFeed/lineFeed characters which wouldn't help here.
> 
> And the thing that really makes this difficult is the fact that the text
> needs to be directly editable by users (cannot be in a locked field).
> 
> Any suggestions on how I might tackle this?

Is it feasible to dynamically create separate text fields for the different levels? I've done it before for display purposes, but I'm sure managing live editing adds a lot of problems.

But if you could define a routine that dynamically lays out the text fields vertically as you type (so that if one field grows/shrinks by a line, the fields below dynamically adjust their positions), and clearly define which actions require creating a new text field or deleting an existing one, it might be feasible.

Or you could wait for improved field formatting. :-) 

Cheers
Dave


More information about the use-livecode mailing list