Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: Ask About Longtext editor

$
0
0

Hi,

 

I don't see methods that deal explicitly with cursor position in cl_gui_textedit (it works with the selected text concept), but you could try get_selection_indexes( ) and get_selection_pos( ). If they don't return values pointing to cursor position for an empty selection, you'll have to make users to select something...

 

As for set_textstream( ) overwriting whole of text - the editing workflow would have to be:

 

1) get_textstream( ) and get_selection...( );

2) make the desired changes to textstream;

3) write the modified textstream back to editor

 

You may also need to take care of current scroll position - probably using GET_FIRST_VISIBLE_LINE( ) SET_FIRST_VISIBLE_LINE( ).

 

Please let us know how it goes - I'm very curious about the capabilities of GUI text editor

 

Edit in: yes, based on the demo Praveer Kumar Sen posted, it's the get_selection_indexes( ) you should be looking at to get the current position. Thanks, Praveer - one can learn something new on SCN every day

 

cheers

Jānis


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>