user interface for line insertion

erik hansen erikhans08 at yahoo.com
Mon Jun 16 16:45:00 EDT 2003



Klaus Major <klaus at major-k.de> wrote:
<<<
> Is it possible by a command to insert a line just before or after a 
> selected ine in a List Field?

Yes, at no extra cost :-)
>>>
 
i can now ID a Klausi Mausi reply on sight.

<<<
objects used in this example:

fld "list", which will have line selected
(NO multiple hilites, please ;-)

fld "to add", which holds the string to add :-)
can also be a variable, of course...

btn "insert", with one of these scripts:

1. to add a line before the selected line:

on mouseup
put the hilitedlines of fld "list" into hl
if hl = empty then exit mouseup
put fld "to add" & CR before line hl of fld "list"
end mouseUp

2. to add a line after the selected line:

on mouseup
put the hilitedlines of fld "list" into hl
if hl = empty then exit mouseup
put CR & fld "to add" after line hl of fld "list"
end mouseUp

Tested and works ;-)

You might want to use the alt-key to combine
these scripts a la:

if the altkey is down then
## before...
else
## after...
end if
>>>
 
after 'rasslin' (Sie Mittel-europear haben die Kaubois gern, nit?)
with the user interface for line insertion conundrum, the most
intuitive approach seems to be mimicking a word processor.
 
that means trapping for mouseClicks before, on, or after the
(linked) text on a given line.
of course you need some spaces before and after
the text on each line. 
you need to allow for a single mouseClick or a second 
mouseClick bracketing a line.
 
then you can easily use the data to 
copy, paste, or cut a line. all on an "Edit..."  list button.
it gets really challenging if the contents of the lineS of text have to be adjusted relationally.
 
the satisfaction inbuilding a real editor,
however primitive,  is enormous.
 
Erik




erik at erikhansen.org    http://www.erikhansen.org

---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20030616/6227d625/attachment.html>


More information about the use-livecode mailing list