[Gambas-user] Set cursor position on a webview editable.

Jorge Carrión shordi at ...626...
Thu Dec 8 19:31:42 CET 2016


Well I think I've find a solution (a tricky solution) that works: Add a
"strange string" at the end of html, search it and replace with nothing.

Teh code is something like this:

  WebView1.SetFocus()
  WebView1.html &= "··" 'two "middle points" is something I have no seen in
my life.
  WebView1.Eval("document.execCommand('findString',false,'··')") 'search
and select it...
  WebView1.Eval("document.execCommand('insertText',false,'')") 'and delete
it. The cursor remains at the end of text.

This opens the possibility for me to do the spelling "on the fly" and more
things...
If you know a better way I'll very happy to know it.

Best Regards.



2016-12-08 14:42 GMT+01:00 Jorge Carrión <shordi at ...626...>:

> Hi:
> Gianluigi, your "me.setfocus / webview.setfocus/desktop.sendey", works!
> thanks a lot.
>
> But this seem a little "tricky". I like to the work with JavaScript
> because that would the way of spelling "at the fly" as the user types.
> I've follow the Moviga advices and found some functions that do the
> work... with editing objects of the html.
>
> I attach here a little project that shows wat I mean. It works with a
> textArea, but doesn't work out of it.
>
>
>> I hope Moviga or any other member of the list could help with this Issue.
>
> Best Regards
>
>
> 2016-12-08 10:58 GMT+01:00 Moviga Technologies <moviga at ...3488...>:
>
>> Google this: javascript move caret
>>
>> or
>>
>> javascript move text cursor
>>
>> There should be a lot of examples that you can modify to suit your case.
>> Use the .Eval() function.
>>
>> ------------------------------------------------------------
>> ------------------
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today.http://sdm.link/xeonphi
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: movingcursor.png
Type: image/png
Size: 13813 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20161208/3101fa3d/attachment.png>


More information about the User mailing list