BBjHtmlView::print

Description

In BBj 19.00 and higher, this method brings up a print dialogue that enables the user to print the contents of the BBjHtmlView control.

Syntax

Return Value

Method

boolean

print()

Parameters

None.

Return Value

Returns a boolean to indicate whether the print operation completed successfully.

Remarks

None.

Example

rem ' BBjHtmlView::print

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "BBjHtmlView::print"
window!= sysgui!.addWindow(25,25,800,600,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")

text$ = "Select content, then click the print button."

htmlview!= window!.addHtmlView(100,25,25,750,500,text$,$$)

setText! = window!.addButton(101,25,550,150,25,"setText",$$)
setText!.setCallback(setText!.ON_BUTTON_PUSH,"setText")

setUrlExternal! = window!.addButton(102,200,550,150,25,"setUrlExternal",$$)
setUrlExternal!.setCallback(setUrlExternal!.ON_BUTTON_PUSH,"setUrlExternal")

setUrlInternal! = window!.addButton(103,375,550,150,25,"setUrlInternal",$$)
setUrlInternal!.setCallback(setUrlInternal!.ON_BUTTON_PUSH,"setUrlInternal")

print! = window!.addButton(1,550,550,100,25,"print",$$)
print!.setCallback(print!.ON_BUTTON_PUSH,"print")

close! = window!.addButton(2,675,550,100,25,"Close",$$)
close!.setCallback(close!.ON_BUTTON_PUSH,"eoj")

print "getClientType: ",htmlview!.getClientType()
print "getClientVersion: ",htmlview!.getClientVersion()

process_events

eoj:
  release

setUrlExternal:
  url$ = "https://en.wikipedia.org"
  htmlview!.setUrl(url$)
  htmlview!.setToolTipText(url$)
return

setUrlInternal:
  url$ = "http://localhost:8888/files/relnotes.htm"
  url$ = "http://localhost:8888/files/readme.htm"
  print url$
  htmlview!.setUrl(url$)
  htmlview!.setToolTipText(url$)
return

setText:
  text$ = "<html><head><style>p{margin:0;padding:0;}</style><title>BASIS</title></head><body>"
  img$ = "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  img$ = "https://www.basis.cloud/sites/basis.com/files/images/BusJGBetter.jpg"
  text$ = text$ + "<img src="""+img$+""">"
  url$ = "https://documentation.basis.com/BASISHelp/WebHelp/bbjobjects/Window/bbjhtmlview/bbjhtmlview.htm"
  text$ = text$ + "<p>This is a <a href="""+url$+""">BBjHtmlView</a>."
  text$ = text$ + "</body></html>"
  htmlview!.setText(text$)
return

print:
  htmlview!.print()
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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