rem ' BBjWebManager::setTitle
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
browser! = bbjapi().getWebManager()
window! = sysgui!.addWindow(25,25,550,300,"setTitle",$00090083$)
window!.setCallback(window!.ON_RESIZE,"resize")
window!.setCallback(window!.ON_CLOSE,"eoj")
setWindowTitle! = window!.addButton(101,25,25,150,25,"Set Window Title",$$)
setWindowTitle!.setCallback(setWindowTitle!.ON_BUTTON_PUSH,"setWindowTitle")
windowTitle! = window!.addEditBox(102,200,25,300,25,window!.getTitle(),$$)
setBrowserTitle! = window!.addButton(103,25,75,150,25,"Set Browser Title",$$)
setBrowserTitle!.setCallback(setBrowserTitle!.ON_BUTTON_PUSH,"setBrowserTitle")
browserTitle! = window!.addEditBox(104,200,75,300,25,browser!.getTitle(),$$)
window!.addStaticText(105,25,125,150,25,"Title Format:",$8000$)
format$ = "" + $0a$
format$ = format$ + "{BrowserTitle} - {WindowTitle}" + $0a$
format$ = format$ + "{WindowTitle} - {BrowserTitle}" + $0a$
format$ = format$ + "{BrowserTitle} {WindowTitle ? '- ' + WindowTitle : ''}" + $0a$
format$ = format$ + "{BrowserTitle} - {WindowTitle} - {a}" + $0a$
format$ = format$ + "{BrowserTitle} - {WindowTitle} - {a} {b}" + $0a$
format$ = format$ + "{BrowserTitle} - {WindowTitle} - {a} {b} {c}" + $0a$
titleFormat! = window!.addListEdit(106,200,125,300,200,format$,$$)
getBrowserTitle! = window!.addButton(107,25,175,150,25,"Get Browser Title",$$)
getBrowserTitle!.setCallback(getBrowserTitle!.ON_BUTTON_PUSH,"getBrowserTitle")
title! = window!.addEditBox(108,200,175,300,25,browser!.getTitle(),$0200$)
showDialog! = window!.addButton(109,25,225,150,25,"Show Dialog",$$)
showDialog!.setCallback(showDialog!.ON_BUTTON_PUSH,"showDialog")
context = window!.getContextID()
sysgui!.setContext(sysgui!.getAvailableContext())
dialog! = sysgui!.addWindow(100,100,150,100,"Dialog",$00090093$)
dialog!.setCallback(dialog!.ON_CLOSE,"hideDialog")
sysgui!.setContext(context)
process_events
eoj:
release
resize:
event! = sysgui!.getLastEvent()
width = event!.getWidth() - 225
height = event!.getHeight()
windowTitle!.setSize(width,windowTitle!.getHeight())
browserTitle!.setSize(width,browserTitle!.getHeight())
titleFormat!.setSize(width,titleFormat!.getHeight())
title!.setSize(width,title!.getHeight())
return
setWindowTitle:
window!.setTitle(windowTitle!.getText())
return
setBrowserTitle:
format$ = titleFormat!.getText().trim()
map! = new java.util.HashMap()
map!.put("a","1")
map!.put("b","2")
map!.put("c","3")
browser!.setTitle(browserTitle!.getText(),format$,map!)
return
getBrowserTitle:
title!.setText(browser!.getTitle())
return
showDialog:
dialog!.setVisible(1)
return
hideDialog:
dialog!.setVisible(0)
window!.focus()
return
|