BBjHtmlView::setAutoNavigate

Description

In BBj 19.00 and higher, this method tells the BBjHtmlView control whether it should automatically navigate to anchor links that the user clicks on.

Syntax

Return Value

Method

void

setAutoNavigate(boolean AutoNavigate)

Parameters

Variable

Description

void

This boolean value specifies whether the control should automatically navigate to anchor links when the user clicks on them.

Return Value

None.

Remarks

By default, this value is false; the browser will not automatically navigate to clicked anchor links.

Example

rem ' BBjHtmlView::setAutoNavigate

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(50,50,600,400,"BBjHtmlView::setAutoNavigate",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
autoNavigate = msgbox("Auto-navigate on anchor clicks?",4+256,"setAutoNavigate")=6
hyperlinkEvents = msgbox("Register for hyperlink events?",4,"Hyperlink Events")=6
html$ = "<html><a href='anchor1'>anchor1</a><br><a href='anchor2' onclick='return false;'>"
html$ = html$ + "anchor2 (cancel)</a><br><a href='https://en.wikipedia.org'>en.wikipedia.org</a></html>"
htmlview! = window!.addHtmlView(101,25,25,550,350,html$)
htmlview!.setAutoNavigate(autoNavigate)
htmlview!.setCallback(htmlview!.ON_PAGE_LOADED,"event")
if hyperlinkEvents then
  htmlview!.setCallback(htmlview!.ON_HYPERLINK_ENTER,"event")
  htmlview!.setCallback(htmlview!.ON_HYPERLINK_EXIT,"event")
  htmlview!.setCallback(htmlview!.ON_HYPERLINK_ACTIVATE,"event")
endif
info$ = "getAutoNavigate: "+Boolean.toString(htmlview!.getAutoNavigate())
info$ = info$ + " " + htmlview!.getClientType()
info$ = info$ + " " + htmlview!.getClientVersion()
status! = window!.addStatusBar(99)
status!.setText(info$)

process_events

eoj:
  release

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

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

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjHtmlView

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