Class XbpHTMLViewer() Foundation

Deprecated. Use the class XbpHTMLViewer2() instead.

Superclass
Description

The XbpHTMLViewer class encapsulates the Windows Internet Explorer ActiveX control.

This class is deprecated. A swap-in replacement is provided with the XbpHTMLViewer2() class.

Class methods
:new()
Creates an instance of the XbpHTMLViewer class.
Life cycle
:create()
Requests system resources for the object.
:configure()
Reconfigures the XbpHTMLViewer object after :create() has been executed.
:destroy()
Releases the system resources of the object.
Display methods
:setHTML()
Assigns HTML-formatted text to the object.
Navigation methods
:back()
Navigates to the previous location stored in the history.
:forward()
Navigates to the next location stored in the history.
:home()
Navigates to the Home page.
:isBusy()
Indicates if a document or HTML page is currenly being loaded.
:navigate()
Navigates to the specified URL.
:refresh()
Reloads the current document.
:search()
Navigates to the default search page.
:stop()
Aborts loading of a HTML page.
Event handling
:beforeNavigate
Indicates that a navigation is about to commence.
:documentComplete
Indicates that a document is completely loaded.
:navigateComplete
Indicates that a navigation is complete.
:progressChange
Indicates a change in progress of the current operation.
:statusTextChange
Indicates a changed status text of the XbpHTMLViewer object.
:titleChange
Indicates that the title of the current document has changed.
Examples
Example for using XbpHTMLViewer to browse a Web site

 // 
 // 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 XbpHTMLViewer to browse a folder
 // 
 // 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 
Feedback

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.