BBjHtmlView::setUrl

Description

In BBj 7.0 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$ = "http://en.wikipedia.org"
client = 0
if info(3,6)<>"5" 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",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
htmlview! = window!.addHtmlView(101,25,50,750,525,"",$$)
htmlview!.setUrl(url$)
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,"",$$)
process_events
eoj:
release
event:
event! = sysgui!.getLastEvent()
message!.setText(event!.getEventName()+" "+event!.getUrl())
print htmlview!.getUrl()," ",event!.getEventName()," ",event!.getUrl()
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.