Class XbpHTMLViewer() Foundation
Deprecated. Use the class XbpHTMLViewer2() instead.
The XbpHTMLViewer class encapsulates the Windows Internet Explorer ActiveX control.
This class is deprecated. A swap-in replacement is provided with the XbpHTMLViewer2() class.
//
// Example for using the XbpHTMLViewer Xbase Part
// to browse a Web site
//
#include "XBP.CH"
#include "AppEvent.CH"
PROCEDURE Main()
LOCAL oDlg
LOCAL oHTML
LOCAL nEvent, mp1, mp2, oXbp
LOCAL oDA
//
// Create application's main dialog
//
oDlg := XbpDialog():new( Appdesktop() )
oDlg:title := "HTML Viewer Example"
oDlg:taskList := .T.
oDlg:close := {|| PostAppEvent(xbeP_Quit,,, oDlg) }
oDA := oDlg:drawingArea
oDlg:create( ,, {50,50}, {640,480},, .F. )
oDA:resize := {|| ResizeControl(oHTML)}
//
// Create the XbpHTMLViewer object
//
oHTML := XbpHTMLViewer():new( oDA )
oHTML:create( ,, {10,10},{450,300} )
//
// Navigate to "www.alaska-software.com"
//
oHTML:navigate( "www.alaska-software.com" )
//
// Display the main dialog and process
// application events until the dialog
// is closed
//
ResizeControl( oHTML )
oDlg:show()
SetAppWindow( oDlg )
SetAppFocus( oHTML )
nEvent := xbeP_Quit
DO WHILE nEvent != xbeP_Close
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
oDlg:destroy()
RETURN
// Resize HTML viewer object to always span the
// whole of the dialog's drawing area.
PROCEDURE ResizeControl( oHTML )
LOCAL oParent := oHTML:setParent()
oHTML:setPosAndSize( {0,0}, oParent:currentSize() )
RETURN
// Overloaded AppSys() procedure to prevent
// creation of the default XbpCrt window
PROCEDURE AppSys()
RETURN
//
// Example for using the XbpHTMLViewer Xbase Part
// to browse a folder
//
#include "XBP.CH"
#include "AppEvent.CH"
PROCEDURE Main()
LOCAL oDlg
LOCAL oHTML
LOCAL nEvent, mp1, mp2, oXbp
LOCAL oDA
//
// Create application's main dialog
//
oDlg := XbpDialog():new( Appdesktop() )
oDlg:title := "HTML Viewer Example"
oDlg:taskList := .T.
oDlg:close := {|| PostAppEvent(xbeP_Quit,,, oDlg) }
oDA := oDlg:drawingArea
oDlg:create( ,, {50,50}, {640,480},, .F. )
oDA:resize := {|| ResizeControl(oHTML)}
//
// Create the XbpHTMLViewer object
//
oHTML := XbpHTMLViewer():new( oDA )
oHTML:create( ,, {10,10},{450,300} )
//
// Navigate to folder "C:\".
//
//
oHTML:navigate( "C:\" )
//
// Display the main dialog and process
// application events until the dialog
// is closed
//
ResizeControl( oHTML )
oDlg:show()
SetAppWindow( oDlg )
SetAppFocus( oHTML )
nEvent := xbeP_Quit
DO WHILE nEvent != xbeP_Close
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
oDlg:destroy()
RETURN
// Resize HTML viewer object to always span the
// whole of the dialog's drawing area.
PROCEDURE ResizeControl( oHTML )
LOCAL oParent := oHTML:setParent()
oHTML:setPosAndSize( {0,0}, oParent:currentSize() )
RETURN
// Overloaded AppSys() procedure to prevent
// creation of the default XbpCrt window
PROCEDURE AppSys()
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.