Class XbpHTMLWindow() Foundation

Class function of the XbpHTMLWindow class.


The XbpHTMLWindow class provides a windowed container which can display HTML pages using the HTMLayout lightweight HTML/CSS renderer. Instances of the XbpHTMLWindow class are intended for usage in conjunction with other Xbase Parts.

Unlike the XbpHTMLViewer() class which wraps an instance of Internet Explorer, HTML window objects do not require specific operating system components to be installed. Instead, all the required components ship as a part of Xbase++ and hence can be deployed along with the Xbase++ application.

Once the HTML window is created, the application can interact with the elements defined in the HTML markup. This is done through XbpHTMLElement() objects which represent individual elements in the HTML markup. The method :childFromId()can be used to retrieve an XbpHTMLElement object for a certain HTML element. This allows registering event handlers for reacting to the user clicking the mouse over a certain HTML element, for example.

The HTML markup displayed by the object.
Changes the HTML markup displayed by the object.
Methods for accessing view elements
Retrieves an HTML element given its identifier.
Retrieves an HTML element given its name.
Retrieves the HTML elements matching a specified CSS selector.
Retrieves an HTML element given its identifier.
Creating a simple HTML window

// In the example, an HTML window object is 
// created. An event handler is registered 
// for handling mouse clicks on an <div> 
// element which is defined in the HTML 
// markup. 

#pragma library( "xppwui.lib" ) 

 LOCAL oXbp 
 LOCAL oElem 

   // Define the HTML markup to be displayed 
   // in the HTML window. Note the HTML 
   // <div> element with the id "mydiv" 
       <div id="mydiv">Click me!</div> 

   // Create the HTML window object 
   // and assign the HTML markup 
   oXbp := XbpHTMLWindow():new() 
   oXbp:HTML := cHTML 
   oXbp:create( , , {10,20}, {200,200} ) 

   // Retrieve the HTML element which 
   // represents the <div> in the HTML 
   // markup and register a callback 
   // code block for handling mouse 
   // events 
   oElem := oXbp:mydiv 
   oElem:lbDown := {|| MsgBox("<div> was clicked!") } 

   // Process events until the application 
   // window is closed 

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.