BBjHtmlView::setUrl

Description

In BBj 7.00 and higher, this method sets the URL associated with this BBjHtmlView.

Syntax

Return Value

Method

void

setUrl(string url)

void

setUrl(string url, boolean reload)

Parameters

Variable

Description

url

The URL the BBjHtmlView control will load.

reload

Boolean value specifying whether this URL should be reloaded. This may be necessary if this URL has been previously loaded with different content.

Return Value

None.

Remarks

Sets the name of current URL of the BBjHtmlView control.

Example

rem ' BBjHtmlView::setUrl

url$ = "https://en.wikipedia.org"
client = 0
if (info(3,6)<>"5" and info(3,6)<>"6") then
    client = msgbox("BBjHtmlView Client",7+32+512,"BBjHtmlView","Swing","JavaFX","Chromium")
    switch client
        case 1; rem ' Swing
            print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=FALSE",ERR=*NEXT)
            print stbl("!OPTIONS","JAVAFX_HTMLVIEW=FALSE",ERR=*NEXT)
            break
        case 2; rem ' JavaFX
            print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=FALSE",ERR=*NEXT)
            print stbl("!OPTIONS","JAVAFX_HTMLVIEW=TRUE",ERR=*NEXT)
            break
        case 3; rem ' Chromium
            print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=TRUE",ERR=*NEXT)
            print stbl("!OPTIONS","JAVAFX_HTMLVIEW=TRUE",ERR=*NEXT)
            break
    swend
endif
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(50,50,800,600,"BBjHtmlView::setUrl",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
htmlview! = window!.addHtmlView(101,25,50,750,525,"",$$)
htmlview!.setCallback(htmlview!.ON_PAGE_LOADED,"event")
htmlview!.setCallback(htmlview!.ON_HYPERLINK_ENTER,"event")
htmlview!.setCallback(htmlview!.ON_HYPERLINK_EXIT,"event")
htmlview!.setCallback(htmlview!.ON_HYPERLINK_ACTIVATE,"event")
message! = window!.addStaticText(102,25,10,750,30,"",$$)
htmlview!.setUrl(url$)
process_events

eoj:
release

resize:
    event! = sysgui!.getLastEvent()
    htmlview!.setSize(event!.getWidth()-50,event!.getHeight()-75)
return

event:
    event! = sysgui!.getLastEvent()
    msg$ = event!.getEventName()+" "+event!.getUrl()
    message!.setText(msg$)
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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