[Gambas-user] TextEdit copy&Paste and removal of hyper tags

stderr ihedenius at ...43...
Tue Sep 29 19:02:29 CEST 2009


hi, 

I wanted to make a text editor that recognized hyper links. So I used
'TextEdit'. To extract the plain text I tried to use SelectAll + Copy +
Paste like this: 

PUBLIC SUB Form_Open() 
  DIM txt AS String 

  PRINT "“abc”" 
  TextEdit1.Text = "“abc”" 
  TextEdit1.SelectAll() 
  TextEdit1.Copy() 
  txt = Clipboard.Paste() 
  PRINT txt 

END 

“abc” 
?abc? 

but noticed that while it handles some special characters (like 'ö') other
gets lost (and replaced by '?'). Above example uses 'Left & Right double
quotation mark's which are lost and replaced by '?' (code 63). 

So it seems the only option is to parse the 'TextEdit1.Text' buffer or some
special characters are lost. 

By trial and error I've noted that if I set 'TextEdit.ReadOnly=true' it will
remove all hypertext tags. Except when it doesn't. I don't know how to
predict when the 'TextEdit1.Text' buffer will contain hypertext tags and
when it will not. 

Is there a way to remove the hypertext links that always works ? Or make it
predictable (which amounts to the same thing). 

* Can the latest stable version (2.16.0) coexist with my current straight
from 'Debian lenny' repository 2.7 ? I.e. can I have both installed ? 

Gambas 2.7 on Debian Lenny.

regards,

-- 
View this message in context: http://www.nabble.com/TextEdit-copy-Paste-and-removal-of-hyper-tags-tp25666934p25666934.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list