laurent_H Contributor


Joined: 30 Jun 2001 Posts: 60
|
Posted: Sun Feb 03, 2002 4:32 pm Post subject: Indent and unindent text in a edit box... |
|
|
Hi,
I have problem with a little function Indent text and Unindent text..
when I paste the indented text I lost my highlight text.
| Code: |
:XPERT_INDENTBUTTON
rem highlight text properties
%%HL_lenght = @sendmsg(@win(~XPERT_QUERY),$0301,0,0)
rem cursor position
%A = @sendmsg(@winexists(~XPERT_QUERY),$0B0,0,0)
%%cursor_position = @succ(@diff(%A,@prod(@div(%A,65536),65536)))
if @not(@zero(%%HL_lenght))
rem stock in a list highlighting text
list create,1
list paste,1
rem add tab key
%i = 0
repeat
%%cur_item = @item(1,%i)
list put,1," "%%cur_item
%i = @succ(%i)
until @equal(%i,@count(1))
rem clipbard and paste
clipboard set,@text(1)
%P = @sendmsg(@win(~XPERT_QUERY),$0302,0,0)
%P = @sendmsg(@win(~XPERT_QUERY),$0B1,%%cursor_position,@len(@text(1)))
list close,1
end
goto evloop
|
_________________ Thanks |
|