rem ' inputd.txt -- demonstrate inputd control sysgui = unt open (sysgui)"X0" sysgui! = bbjapi().getSysGui() window! = sysgui!.addWindow(100,100,300,180,"BBjInputD",$00090083$,$00E3F007CD$) window!.addStaticText(200,0,20,100,25,"Locale:",$8000$) window!.addListButton(100,110,20,180,300,"") window!.addStaticText(201,0,60,100,25,"Date:",$8000$) inputd! = window!.addInputD(101,110,60,130,25) window!.addToolButton(301,250,50,40,40,"BITMAP=calendar.png") window!.addStaticText(400,0,100,100,25,"Mask:",$8000$) window!.addStaticText(401,110,100,120,25,"",$$) window!.addStaticText(202,0,130,100,30,"Show Weeks?",$8000$) window!.addCheckBox(102,110,125,30,30,"") gosub setup_locale gosub locale dim event$:tmpl(sysgui),generic$:noticetpl(0,0) repeat readrecord(sysgui,siz=10)event$ if event.id=100 and event.code$="N" and event.flags=2 then gosub locale if event.id=102 and event.code$="c" then inputd!.setShowWeeks(event.flags) if event.id=101 and event.code$="r" then inputd!.calendar() if event.id=301 and event.code$="b" then inputd!.calendar() if event.id=101 and event.code$="N" and event.flags=1 then : generic$=notice(sysgui,event.x); : dim notice$:noticetpl(generic.objtype,event.flags); : notice$=generic$; : if notice.key$=$014c$ then : inputd!.calendar() until event.code$="X" release setup_locale: locales$=stbl("!LOCALES") count=pos($0a$=locales$,1,0) pos=pos(stbl("!LOCALE")=locales$) index=pos($0a$=locales$(1,pos),1,0) print (sysgui)'listadd'(100,-1,count),locales$,'listsel'(100,index) dim locale$:"code["+str(count)+"]:c(1*=10)" locale$=stbl("!LOCALES") return locale: l$=stbl("!LOCALE",locale.code$[dec(ctrl(sysgui,100,2,context))+1]) token! = new java.util.StringTokenizer(L$,"_") tokens = token!.countTokens() languageCode$="",countryCode$="",variantCode$="" if (tokens > 0) then languageCode$ = token!.nextToken().toLowerCase() if (tokens > 1) then countryCode$ = token!.nextToken().toUpperCase() if (tokens > 2) then variantCode$ = token!.nextToken().toUpperCase() L! = new java.util.Locale(languageCode$, countryCode$, variantCode$) print (sysgui)'title'(0,L!.getDisplayName()+" - INPUTD") Mask$=stbl("!DATE"),Mask=pos($00$=Mask$),Mask$=Mask$(1,Mask-1) inputd!.setLocale(L$) inputd!.setMask(Mask$) print (sysgui)'title'(401,Mask$) return