[Gambas-user] Set cursor position on a webview editable.
Jorge Carrión
shordi at ...626...
Wed Dec 7 11:08:58 CET 2016
Gianluigi
I've tried, but doesn't work. The webview doesn't seem respond to
setfocus() after the spelling... so, the desktop.sendkeys doesn't work on
it.
I'm doing a control compound of a exported class, and a form with a webview
and a toolbar inside. When I push te spelling button the work is done
(higlighting the wrongs words) but I'm not able to return the focus on the
webview.
I suppouse thar I'm missing something... but can't figure what is it. I
give up yet in doing the spelling while writing (keyrelease event) because
the same issue of return the keyboard cursor at the origin point. I'm
resigned to do it only with a button... and the user must do a click on
webview to return the focus on it...
*(I attach the source code (at the moment only spell spanish) so you can
see what I'm trying to do.)*
*Sorry the message with the attached project has been rejected by the list.
No attached, then... *
Best Regards
2016-12-07 10:51 GMT+01:00 Gianluigi <bagonergi at ...626...>:
> Something like this, about your example on the Spanish forum:
> '-----------------------------
> Public Sub Button1_Click()
>
> Dim ar As String[]
> Dim i As Integer
>
> ar = Split(WebView1.Text, " ", Null, True)
> WebView1.html = Replace(WebView1.html, ar[ar.max], "<span
> style=\"background-color: rgb(254, 254, 126);\">" & ar[ar.max] & "</span>")
> WebView1.SetFocus
> 'Aquí el cursor queda al principo del texto. Lo queremos al final
> Print ar.Max, " words"
> For i = 0 To ar.Max
> Desktop.SendKeys("{[Control_L][Right]}")
> Next
>
> End
> '----------------------------------
>
> Regards
> Gianluigi
>
> 2016-12-06 21:44 GMT+01:00 Gianluigi <bagonergi at ...626...>:
>
> > Have You tried to use Desktop.SendKeys?
> >
> > Regards
> > Gianluigi
> >
> > 2016-12-04 18:06 GMT+01:00 Jorge Carrión <shordi at ...626...>:
> >
> >> Hi
> >> I'm doing a spelling checker for a webview. When you write a wrong word
> it
> >> is highlited. That's done, but I can't set the cursor again after the
> >> word.
> >> It always remains at begin of webview text...
> >>
> >> Is it possible to do that?
> >>
> >> Best Regards
> >> ------------------------------------------------------------
> >> ------------------
> >> Check out the vibrant tech community on one of the world's most
> >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> >> _______________________________________________
> >> Gambas-user mailing list
> >> Gambas-user at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >
> >
> ------------------------------------------------------------
> ------------------
> 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
>
More information about the User
mailing list