rem ' BBjWebManager
declare BBjSysGui sysgui!
declare BBjWebManager web!
declare BBjBusyIndicator busy!
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
web! = bbjapi().getWebManager()
web!.setCallback(web!.ON_BROWSER_CLOSE,"ON_BROWSER_CLOSE",err=*next)
bbjapi().getConfig().releaseOnLostConnection(0)
setesc ON_LOST_CONNECTION
url$ = "(Not Web)"
url$ = web!.getUrl(err=*next)
appName$ = " (Not Web)"
appName$ = web!.getApplicationName(err=*next)
title$ = "BBjWebManager: " + appName$
touch = 0
touch = web!.isTouchSupported(err=*next)
if touch then title$ = title$ + " (Touch)" else title$ = title$ + " (Not Touch)"
window! = sysgui!.addWindow(25,25,450,475,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.addStaticText(99,25,25,400,25,"URL: "+url$,$$)
window!.addGroupBox(100,25,75,400,125,"End Actions")
endApp! = window!.addRadioButton(101,30,100,75,25,"App",$0020$)
endUrl! = window!.addRadioButton(102,105,100,75,25,"URL",$0020$)
endMsg! = window!.addRadioButton(103,180,100,75,25,"Msg",$0020$)
endNone! = window!.addRadioButton(104,255,100,75,25,"None",$0020$)
endDefault! = window!.addRadioButton(105,330,100,75,25,"Default",$0020$)
endGroup! = window!.addRadioGroup()
endGroup!.add(endApp!)
endGroup!.add(endUrl!)
endGroup!.add(endMsg!)
endGroup!.add(endNone!)
endGroup!.add(endDefault!)
window!.addStaticText(106,30,150,60,25,"Value:",$8000$)
endValue! = window!.addEditBox(107,100,150,225,25,$$)
setEndAction! = window!.addButton(108,340,150,75,25,"Set",$$)
setEndAction!.setCallback(setEndAction!.ON_BUTTON_PUSH,"setEndAction")
window!.addGroupBox(200,25,225,400,125,"Err Actions")
errApp! = window!.addRadioButton(201,30,250,75,25,"App",$0020$)
errUrl! = window!.addRadioButton(202,105,250,75,25,"URL",$0020$)
errMsg! = window!.addRadioButton(203,180,250,75,25,"Msg",$0020$)
errNone! = window!.addRadioButton(204,255,250,75,25,"None",$0020$)
errDefault! = window!.addRadioButton(205,330,250,75,25,"Default",$0020$)
errGroup! = window!.addRadioGroup()
errGroup!.add(errApp!)
errGroup!.add(errUrl!)
errGroup!.add(errMsg!)
errGroup!.add(errNone!)
errGroup!.add(errDefault!)
window!.addStaticText(206,30,300,60,25,"Value:",$8000$)
errValue! = window!.addEditBox(207,100,300,225,25,$$)
setErrAction! = window!.addButton(208,340,300,75,25,"Set",$$)
setErrAction!.setCallback(setEndAction!.ON_BUTTON_PUSH,"setErrAction")
title$ = "Show Confirm Close Dialog"
confirm = 0
confirm = web!.getShowConfirmCloseDialog(err=*next)
flags$ = iff(confirm,$0004$,$0000$)
setShowConfirmDialog! = window!.addCheckBox(209,25,375,300,25,title$,flags$)
setShowConfirmDialog!.setCallback(setShowConfirmDialog!.ON_CHECK_ON,"showConfirmDialogOn")
setShowConfirmDialog!.setCallback(setShowConfirmDialog!.ON_CHECK_OFF,"showConfirmDialogOff")
showBusy! = window!.addButton(1,25,425,100,25,"Busy",$$)
showBusy!.setCallback(showBusy!.ON_BUTTON_PUSH,"showBusy")
busyMessage! = window!.addEditBox(300,150,425,275,25,"Working...",$$)
gosub fetch
process_events
eoj:
release
fetch:
endAction! = web!.getEndAction(err=*return)
switch endAction!.getActionType()
case endAction!.ACTION_APP
endApp!.setSelected(1)
endValue!.setText(endAction!.getAppName())
break
case endAction!.ACTION_URL
endUrl!.setSelected(1)
endValue!.setText(endAction!.getUrl())
break
case endAction!.ACTION_MSG
endMsg!.setSelected(1)
endValue!.setText(endAction!.getMessage())
break
case endAction!.ACTION_NONE
endNone!.setSelected(1)
endValue!.setText("")
break
case endAction!.ACTION_DEFAULT
endDefault!.setSelected(1)
endValue!.setText("")
break
swend
errAction! = web!.getErrAction(err=*return)
switch errAction!.getActionType()
case errAction!.ACTION_APP
errApp!.setSelected(1)
errValue!.setText(errAction!.getAppName())
break
case errAction!.ACTION_URL
errUrl!.setSelected(1)
errValue!.setText(errAction!.getUrl())
break
case errAction!.ACTION_MSG
errMsg!.setSelected(1)
errValue!.setText(errAction!.getMessage())
break
case errAction!.ACTION_NONE
errNone!.setSelected(1)
errValue!.setText("")
break
case errAction!.ACTION_DEFAULT
errDefault!.setSelected(1)
errValue!.setText("")
break
swend
return
setEndAction:
if endApp!.isSelected() then action! = web!.appAction(endValue!.getText())
if endUrl!.isSelected() then action! = web!.urlAction(endValue!.getText())
if endMsg!.isSelected() then action! = web!.msgAction(endValue!.getText())
if endNone!.isSelected() then action! = web!.noneAction()
if endDefault!.isSelected() then action! = web!.defaultAction()
web!.setEndAction(action!,err=*return)
return
setErrAction:
if errApp!.isSelected() then action! = web!.appAction(errValue!.getText())
if errUrl!.isSelected() then action! = web!.urlAction(errValue!.getText())
if errMsg!.isSelected() then action! = web!.msgAction(errValue!.getText())
if errNone!.isSelected() then action! = web!.noneAction()
if errDefault!.isSelected() then action! = web!.defaultAction()
web!.setErrAction(action!,err=*return)
return
showConfirmDialogOn:
web!.setShowConfirmCloseDialog(1,err=*next)
return
showConfirmDialogOff:
web!.setShowConfirmCloseDialog(0,err=*next)
return
showBusy:
busy! = web!.getBusyIndicator(err=*return)
rem ' BBjBusyIndicator::setAttribute BBj 22.02+ DWC
busy!.setAttribute("spinner-clockwise","false",err=*next)
busy!.setAttribute("spinner-speed","2000",err=*next)
busy!.setAttribute("spinner-expanse","3xl",err=*next)
busy!.setAttribute("spinner-theme","info",err=*next)
busy!.setText(busyMessage!.getText())
busy!.setVisible(1)
wait 3
busy!.setVisible(0)
return
on_lost_connection:
event$ = "ON_LOST_CONNECTION"
goto terminate
on_browser_close:
event$ = "ON_BROWSER_CLOSE"
goto terminate
terminate:
seterr release
System.err.println(pgm(-2)+" "+event$+" "+str(tcb(19)))
filename$ = System.getProperty("user.home") + "/Desktop/" + event$ + ".txt"
u = unt
open (u,mode="o_create,o_trunk")filename$
print (u)date(0:"%Hz:%mz:%sz.%tz ")+event$+" "+str(tcb(19))
close (u)
release:
release -1
|