FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Webview class into Resource Dialog?
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Webview class into Resource Dialog?
Posted: Fri Feb 17, 2023 08:31 AM

Hi

I saw FWH\sample use TWindow way, how to use WebView into Resource Dialog

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Webview class into Resource Dialog?
Posted: Fri Feb 17, 2023 08:49 AM
Dear Richard,
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oWebView

   DEFINE DIALOG oDlg SIZE 500, 400

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ), .T. )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: Webview class into Resource Dialog?
Posted: Fri Feb 17, 2023 09:30 AM
Antonio Linares wrote:Dear Richard,
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oWebView

   DEFINE DIALOG oDlg SIZE 500, 400

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ), .T. )

return nil
Dear Antonio,

Thanks for your help.

I open my Main Window and call TestWebview() function below:
Code (fw): Select all Collapse
FUNCTION TestWebView()

LOCAL oDlg, oWebView 

      DEFINE DIALOG oDlg RESOURCE "TestWebView" 
      
      ACTIVATE DIALOG oDlg CENTER ;
               ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ) , .T. )
                      
return nil
I found My Main Windows small ( I think my laptop 4K screen ), but I close Dialog, Main Window close together.
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Webview class into Resource Dialog?
Posted: Fri Feb 17, 2023 10:07 AM

Dear Richard,

Yes, I just confirmed what you said

No idea why this is happening, sorry

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Webview class into Resource Dialog?
Posted: Fri Feb 17, 2023 10:11 AM

It seems as WebView is closing the whole app

I don't know how we can avoid this behavior.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Webview class into Resource Dialog?
Posted: Fri Feb 17, 2023 11:12 AM
In this example, we can check that when the dialog that holds the WebView closes, it closes the main Window but the app properly exits:
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oWnd 

   DEFINE WINDOW oWnd 

   ACTIVATE WINDOW oWnd ;
      ON CLICK Test()

   MsgInfo( "ok" )

return nil   

function Test()

   local oDlg, oWebView

   DEFINE DIALOG oDlg SIZE 500, 400

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oWebView := TWebView():New(), oWebView:SetParent( oDlg ), oWebView:Navigate( "http://www.google.com" ), .T. )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion