Page 1 of 1

TextEditor Marked Content

Posted: Sun Nov 03, 2013 7:54 pm
by djrikki
Hi,

I want to be able to create a 'Make Uppercase' function on any marked text the user may select.. however I have no idea how to obtain the content of the marked text?

'hello' becomes 'HELLO'

Code: Select all

Local ucase = UpperStr( ??? )
mui.DoMethod("textarea","replace",ucase)

Re: TextEditor Marked Content

Posted: Mon Nov 04, 2013 3:30 pm
by airsoftsoftwair
Use Texteditor.GetSelection for that.

Re: TextEditor Marked Content

Posted: Sun Nov 17, 2013 1:08 pm
by djrikki
This only returns the X and Y coordinates of the selected block. I could use Copy to clipboard, but of course that overrides what is in the clipboard which is pretty lame.

Re: TextEditor Marked Content

Posted: Sun Nov 17, 2013 11:18 pm
by airsoftsoftwair
True, seems like I forgot to implement a method for getting partial text contents. I've now implemented the Texteditor.GetText method that allows you to do just that, i.e. pass x1,y1,x2,y2 to it and get the text described by these coordinates back.