sysgui = unt
open (sysgui)"X0"
status = 0
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,500,500,"Nominal Window Size",$8009008f$)
window!.setSize(200,200)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
info! = window!.addButton(1,25,25,150,25,"Get Size")
info!.setCallback(info!.ON_BUTTON_PUSH,"info")
setSize! = window!.addButton(2,25,75,150,25,"Set Size")
setSize!.setCallback(setSize!.ON_BUTTON_PUSH,"setSize")
setNominalSize! = window!.addButton(3,25,125,150,25,"Set Nominal Size")
setNominalSize!.setCallback(setNominalSize!.ON_BUTTON_PUSH,"setNominalSize")
if status then status! = window!.addStatusBar(99)
process_events
eoj:
release
info:
width = window!.getWidth()
height = window!.getHeight()
info$ = "BBjWindow: " + str(width) + "," + str(height) + $0a$
width = window!.getNominalWidth()
height = window!.getNominalHeight()
info$ = info$ + "BBjWindow nominal: " + str(width) + "," + str(height) + $0a$
i = msgbox(info$)
return
resize:
event! = sysgui!.getLastEvent()
info$ = event!.getEventName()+" "+str(event!.getWidth())+","+str(event!.getHeight())
print info$
if status then status!.setText(info$)
return
setSize:
width = window!.getWidth()
height = window!.getHeight()
window!.setSize(width,height)
info$ = "setSize "+str(width)+","+str(height)
print info$
if status then status!.setText(info$)
return
setNominalSize:
width = window!.getNominalWidth()
height = window!.getNominalHeight()
window!.setSize(width,height)
info$ = "setNominalSize "+str(width)+","+str(height)
print info$
if status then status!.setText(info$)
return
|