Well that didn't work...

Jan Schenkel janschenkel at yahoo.com
Tue Jun 21 01:52:14 EDT 2005


--- Todd Geist <todd at geistinteractive.com> wrote:
> 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
> 

Hi Todd,

Not throughly tested, but the script below should do
what you want, or get you closer to a solution anyway.

For feature 1, you will want to trap the 'tabKey'
message, like this:
--
on tabKey
  put tab into the selectedChunk
end tabKey
--

For feature 2, you will want to trap the
'returnInField' message, like this:
--
on returnInField
  put value(the selectedLine of me) into tPrevLine
  put return into the selectedChunk
  repeat while char 1 of tPrevLine is tab
    put tab into the selectedChunk
    delete char 1 of tPrevLine
  end repeat
end returnInField
--

Hope this helped,

Jan Schenkel.

Quartam - Tools for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 



More information about the use-livecode mailing list