BBjHtmlView

Description

The BBjHtmlView control displays HTML files, and can act as a complete embedded web browser, with support for HTML5, CSS, and JavaScript.

The BBjHtmlView can be configured through STBL options to be either a basic container for static HTML 3.2 content, or a complete embedded Chromium-based browser. See STBL Options for BBjHtmlView below.

Access to the CHROMIUM_HTMLVIEW feature requires an active Software Asset Management (SAM) subscription. See Benefits of ‘Software Asset Management' Feature Line.

The WEBGUI_HTMLVIEW feature is only available in the WEBGUI client, and requires a WEBGUI BLS license.

Implemented Interfaces

DragSource, DropTarget, Focusable, TabTraversable

Creation

BBjAPI > BBjSysGui > BBjWindow > BBjHtmlView

A BBjHtmlView object is created through the following BBjWindow methods:

Return Value Method

BBjHtmlView

addHtmlView(int ID, number x, number y, number w, number h, string html)

BBjHtmlView

addHtmlView(int ID, number x, number y, number w, number h, string html, string flags)

BBjHtmlView

addHtmlView(int ID, number x, number y, number w, number h, string html, string flags, string chromium_switches$)

BBjHtmlView

addHtmlView(int ID, String html)

BBjHtmlView

addHtmlView(int ID, String html, string flags)

BBjHtmlView

addHtmlView(int ID, String html, string flags, string chromium_switches)

BBjHtmlView

addHtmlView(String html)

BBjHtmlView

addHtmlView(String html, string flags)

BBjHtmlView

addHtmlView(String html, string flags, string chromium_switches)

Methods of BBjHtmlView

Return Value Method
int executeAsyncScript(String script)
int executeAsyncScript(String script, boolean await)
int executeAsyncScript(String script, boolean await, boolean event)
Object executeScript(String script)
Object executeScript(String script, boolean await)

boolean

getAutoNavigate()

string

getClientType()

string

getClientVersion()

string getDownloadDirectory()

BBjImage

getImage()

string

getText()

string

getUrl()

string

getUserAgent()

void

injectScript(String script)

void

injectScript(String script, boolean top)

void

injectUrl(String url)

void

injectUrl(String url, boolean top)

boolean

print()

void

setAutoNavigate(boolean autoNavigate)

void setDownloadDirectory(String directory)

void

setUrl(String url)

void

setUrl(String url, String loader)

void

setUserAgent(String userAgent)

Methods of BBjHtmlView inherited from BBjControl

Constants inherited from BBjControl

BUI logo

Example

rem ' BBjHtmlView
url$ = "https://en.wikipedia.org"							
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,600,500,url$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
htmlview! = window!.addHtmlView(102,25,25,550,450,"",$$)
htmlview!.setUrl(url$)
htmlview!.setAutoNavigate(1)
clientType$ = htmlview!.getClientType()
clientVersion$ = htmlview!.getClientVersion()
title$ = window!.getTitle() + " " + clientType$ + " " + clientVersion$
window!.setTitle(title$)
status! = window!.addStatusBar(99)
process_events

eoj:
release

resize:
    gosub event
    width = event!.getWidth() - 50
    height = event!.getHeight() - 50
    htmlview!.setSize(width,height)
    status$ = event!.getEventName()+" width="+str(width)+",height="+str(height)
    status!.setText(status$)
return

event:
    event! = sysgui!.getLastEvent()
    status$ = event!.getEventName()
    status!.setText(status$)
return
Example Type: BBj

See Also

BBjAPI

BBjSysGui

BBjWindow

CALLBACK Verb - Register BBj Subroutine

STBL("!OPTIONS") CHROMIUM_HTMLVIEW

STBL("!OPTIONS") WEBGUI_HTMLVIEW

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.