Well that didn't work...
MisterX
b.xavier at internet.lu
Tue Jun 21 02:12:36 EDT 2005
Hi Todd,
It's part of learning the event queue and what events you can catch.
when you type
in your field's script for example you can add something like this...
sorry not tested. But it should do the trick or get you there...
cheers
Xavier
on tabkey
get the selectedchunk
if it is empty then pass keyup
put the number of lines in char 1 to char (word 2 of it) of me into
thisline
if word 4 of it is a number and word 4 of it 4 word 2 of it then
put thisline + the number of lines in the selectedtext of me into
tothisline
else put thisline into tothisline
if the shiftkey is down
then unindent thisline,tothisline
else indentLines thisline,tothisline
-- optional
if it is not empty then
select line thisline to tothisline of me
end if
end tabkey
on unindentLines a,b
lock screen
repeat with x = a to b
if char 1 of line x of me is tab then delete char 1 of line x of me
end repeat
end unindentLines
on indentLines a,b
lock screen
repeat with x = a to b
put tab before line x of me
end repeat
end indentLines
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
> Todd Geist
> Sent: Tuesday, June 21, 2005 07:39
> To: use-revolution at lists.runrev.com
> Subject: Well that didn't work...
>
> Hello,
>
> I have been trying to figure out how to create a little
> simple text editor. Basically I want to add two features to
> a regular scrolling field.
>
> Feature 1
>
> Pressing tab while the insertion point is on a line of
> text needs to INDENT the line
> pressing shift_tab needs to OUTDENT it.
>
> Feature 2
>
> A new Line created by pressing "return" needs to line up
> with the previous line
> Like this...
>
> So far I am getting lost. Does anybody have any ideas, or
> some code I can look at.
>
> Thanks
>
> Todd
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list