Re: Text Widget Confession [message #26730 is a reply to message #26626] |
Tue, 25 September 2001 08:57   |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Ok. Version 2.01-1723-b01.67, beta release. Bugs fixed: one letter
selections and wierd combinations of such will not confuse the program.
Changes: One line change, but was very hard, because you gotta know
which line to change.
Disclaimer: if works as promised or does not, the author bears no
responsibility. Use with caution, may cause amazement and dizziness due
to unbelievable reliability. Do not acknowledge the author for the fear
of overwhelming response and eternal admiration.
PRO Example_Event, event
Widget_Control, event.top, Get_UValue=textID
Widget_Control, textID, Get_Value=selectText, /Use_Text_Select
Widget_Control, textID, Get_Value=theText
; Added line
loc = (Widget_Info(textID, /Text_Select))[0]
; End added line
jt = strjoin(thetext, string(1b))
js = strjoin(selecttext, string(1b))
rs = jt
; Modified line
strput, rs, string( byte(js) < 2b), strpos(jt, js, loc)
; End modified line
junk = where(strsplit(rs, string(1b), /extract) $
ne theText, comp=good_rows, ncomp=count)
if count ne 0 then theText = theText[good_rows]
Widget_Control, textID, Set_Value=theText
END; -----------------------------------
Cheers,
Pavel
|
|
|