Is it possible to display HTML code in a TPanel class?
I need it to display announcements or deadlines with the ability to embed links to call for applications.
I have done it, but it only runs on an HTML page, instead I would like to insert it into a TPanel because the TPanel is in the main window and is visible to all users on the network.
So far, I have only taken a window as a control to embed it.
I have looked at the TWebView class, and it is that all controls can use hWndParent.
The WebView2 control can run inside a window control like a Tpanel in a Windows application.
METHOD New(nDebug, hWndParent)
Here is a very basic test:
Best regards,
Otto
- Code: Select all Expand view
// Testing FiveWin splitter controls
#include "FiveWin.ch"
#include "Splitter.ch"
static oWnd
static oVSplitL, oHSplitC, oVSplitR
//----------------------------------------------------------------------------//
function Main()
local oPanel1, oPanel2, oPanel3, oPanel4
local nLeftPos := 200
local nRightPos := ScreenWidth() - 200
local nMiddlePos := ScreenHeight() - 200
DEFINE WINDOW oWnd FROM 1, 1 TO 400, 600 PIXEL ;
TITLE "Splitters H layout"
oPanel1 = TPanel():New( 0, 0, oWnd:nHeight, nLeftPos - 5, oWnd )
oPanel2 = TPanel():New( 0, nLeftPos + 1, nMiddlePos - 1, nRightPos - 1, oWnd )
oPanel3 = TPanel():New( nMiddlePos + 4, nLeftPos + 1, oWnd:nHeight, nRightPos - 1, oWnd )
oPanel4 = TPanel():New( 0, nRightPos + 5, oWnd:nHeight, oWnd:nWidth, oWnd )
oPanel1:SetColor( "W/R" )
oPanel2:SetColor( "W/G" )
oPanel3:SetColor( "W/B" )
oPanel4:SetColor( "W/BG" )
oPanel1:bLClicked = { || MsgInfo( "Panel1" ) }
oPanel2:bLClicked = { || MsgInfo( "Panel2" ) }
oPanel3:bLClicked = { || MsgInfo( "Panel3" ) }
oPanel4:bLClicked = { || MsgInfo( "Panel4" ) }
@ nMiddlePos, nLeftPos + 1 SPLITTER oHSplitC ;
HORIZONTAL ;
PREVIOUS CONTROLS oVSplitL, oPanel2 ;
HINDS CONTROLS oPanel3, oVSplitR ;
TOP MARGIN 80 ;
BOTTOM MARGIN 80 ;
SIZE nRightPos - nLeftPos - 2, 4 PIXEL ;
OF oWnd ;
STYLE
@ 0, nLeftPos - 5 SPLITTER oVSplitL ;
VERTICAL ;
PREVIOUS CONTROLS oPanel1 ;
HINDS CONTROLS oPanel2, oHSplitC, oPanel3 ;
LEFT MARGIN 80 ;
RIGHT MARGIN 80 ;
SIZE 4, ScreenHeight() PIXEL ;
OF oWnd ;
STYLE
@ 0, nRightPos SPLITTER oVSplitR ;
VERTICAL ;
PREVIOUS CONTROLS oPanel2, oHSplitC, oPanel3 ;
HINDS CONTROLS oPanel4 ;
LEFT MARGIN 80 ;
RIGHT MARGIN 80 ;
SIZE 4, ScreenHeight() PIXEL ;
OF oWnd ;
STYLE
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON RESIZE ( oVSplitL:AdjLeft(), oVSplitR:Adjust(),;
oPanel3:nHeight := oWnd:nHeight - oHSplitC:nBottom ) ;
ON INIT webshow(1,oPanel2:hWnd)
return nil
//----------------------------------------------------------------------------//
function webshow(console,cAufruf)
local cHtmlOrUrl := "https://forums.fivetechsupport.com/viewforum.php?f=3&sid=bf7b6ffeb993b2f3fc02a92f7a3747a9"
oWebView := TWebView():New( 1, cAufruf)
oWebView:Bind( "SendToFWH" )
oWebView:Navigate( cHtmlOrUrl )
oWebView:SetTitle( "This is Fivewin 2024" )
Sleep( 200 )
oWebView:Run()
oWebView:Destroy()
return nil
//-----------------------------------------------------------------------------//