#include "FiveWin.ch"
function Main()
local oWnd, oActiveX
local cEvents := ""
DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"
@ 0, 0 ACTIVEX oActiveX PROGID "Shell.Explorer" OF oWnd
oWnd:oClient = oActiveX // To fill the entire window surface
oActiveX : Navigate( hb_CurDrive() + ":\"+CurDir()+"\test.svg" )
oActiveX : bOnEvent = { | event, aParams, pParams | cEvents += EventInfo( event, aParams, pParams, oActiveX ) }
ACTIVATE WINDOW oWnd ;
VALID ( MemoEdit( cEvents ), .t. )
return nil
function EventInfo( event, aParams, pParams, oActiveX )
local cMsg := "Event: " + cValToChar( event ) + CRLF
local n
cMsg += "Params: " + CRLF
for n = 1 to Len( aParams )
cMsg += cValToChar( aParams[ n ] ) + CRLF
next
if event == "BeforeNavigate2"
// MsgInfo( aParams[ 2 ] )
// SetEventParam( pParams, 7, .t. ) // Comment this to allow navigation
endif
return cMsg + CRLF
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="10" y="10" height="100" width="100"
style="stroke:#ff0000; fill: #0000ff"/>
</svg>
#include "FiveWin.ch"
function Main()
local oWnd, oActiveX
local lCompleted := nil
local cEvents := ""
local nTimes := 0
DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"
@ 0, 0 ACTIVEX oActiveX PROGID "Shell.Explorer" OF oWnd
// oActiveX:bLClicked = { || MsgInfo( "onclick" ) }
oWnd:oClient = oActiveX // To fill the entire window surface
oActiveX:Navigate( hb_CurDrive() + ":\" + CurDir() + "\test.svg" )
oActiveX:bOnEvent = { | event, aParams, pParams | cEvents += EventInfo( event, aParams, pParams, oActiveX ),;
If( event == "StatusTextChange" .and. ;
Left( aParams[ 1 ], 5 ) == "file:", MsgInfo( aParams[ 1 ] ),) }
ACTIVATE WINDOW oWnd ;
VALID ( MemoEdit( cEvents ), .t. )
return nil
function EventInfo( event, aParams, pParams, oActiveX )
local cMsg := "Event: " + cValToChar( event ) + CRLF
local n
cMsg += "Params: " + CRLF
for n = 1 to Len( aParams )
cMsg += cValToChar( aParams[ n ] ) + CRLF
next
if event == "BeforeNavigate2"
// MsgInfo( aParams[ 2 ] )
// SetEventParam( pParams, 7, .t. ) // Comment this to allow navigation
endif
return cMsg + CRLF
static sLoaded
static sURL := ''
oActiveX:bOnEvent = { | event, aParams, pParams | cEvents += EventInfo( event, aParams, pParams, oActiveX ),;
If( event == "StatusTextChange" .and. ;
Left( aParams[ 1 ], 5 ) == "file:", sURL := aParams[ 1 ] ,), ;
If( event == "DocumentComplete" , sLoaded := .t.,),;
If( event == "NavigateComplete2" .and. sLoaded, oWnd:end(),) }
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 66 guests