FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Using FW_SayText in WebView
Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Using FW_SayText in WebView
Posted: Fri Dec 29, 2023 09:35 AM
Good morning,

I'm using webview in a MDICHILD
Code (fw): Select all Collapse
function googlemaps(app_oWnd)

    local oWnd
    local oWebView
     
    DEFINE WINDOW oWnd MDICHILD of app_oWnd TITLE "Using a webview from an existing window" 

    oWnd:Center()
    oWebView = TWebView():New(, oWnd:hWnd )
    oWebView:Navigate( "https://www.google.es/maps/@41.9322509,-2.6522801,47269m/data=!3m1!1e3?entry=ttu" )
    oWebView:SetUserAgent( "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Mobile Safari/537.36" )

    ACTIVATE WINDOW oWnd  ;
        ON RESIZE If( nWidth != nil, oWebView:SetSize( nWidth, nHeight ), oWebView:SetSize( 800, 500 ) );
        valid(   oWebView:Destroy() , .t. )
     
return nil
Now the googlemaps API is not free, can I just place a text and a bitmap on the map using FW_SayText and FW_DrawImage ? I don't know what would be the first parameter (ownd) in FW_SayText. I have tried this and others and doesn´t work
Code (fw): Select all Collapse
FW_SayText( oWebView:GetWindow() , "Hola: ", {400,400,20,180 },"L")


Thank you and regards,

Alvaro
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Using FW_SayText in WebView
Posted: Fri Dec 29, 2023 10:12 AM

Estimado Alvaro,

Un control WebView está totalmente controlado por el motor de Chrome y por seguridad en internet no es accesible.

Lo que si podrias intentar es usar el método InjectJavascript( cScript ) de la Clase TWebView para añadir código javascript tuyo y luego

ejecutarlo llamando al método Eval() de la Clase TWebView.

Busca "webview" en *.prg en la carpeta samples para ver los ejemplos.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Re: Using FW_SayText in WebView
Posted: Fri Dec 29, 2023 07:13 PM

Lo probaré, gracias Antonio

Alvaro

Continue the discussion