RE: Who can write an inputbox.e?
- Posted by Liu Junfeng <rufi at 163.com> Jan 21, 2003
- 454 views
Pete Lomax wrote: > Some comments about this: > > > > > Like I say, the above works fine; if the above suggested mods cause > problems, then maybe just let sleeping dogs lie. If you intend to use > it alot in the future though, the above advice stands. > > Pete > PS maybe a destroy(inputbox) prior to each time calling input_box > would be same, no experience here Anyone? > > I got to know Euphoria only ten days ago,so I havn't much experience. Here is my modified code: -- inputbox.ew - open an inputbox -- Copyright (C) 2003 Liu Junfeng -- If you wish to contact me, send an e-mail to rufi at 163.com include win32lib.ew without warning constant Width=280,Height=120 sequence ScreenSize,Text ScreenSize = getCtlSize( Screen ) constant inputbox= ]-Width)/2,(ScreenSize[2]-Height)/2,Width,Height,{WS_CAPTION,WS_BORDER}, WS_EX_TOPMOST), label = create(LText,"",inputbox,10,10,200,20,0), entry = create( EditText, "", inputbox, 10, 30, 180, 25, 0 ), ok = create( PushButton, "OK", inputbox, 20, 65, 60, 20, 0 ), cancel = create( PushButton, "Cancel",inputbox, 120, 65, 60, 20, 0 ) procedure Click_Button(integer self, integer event, sequence parms) if self=ok then Text=getText(entry) else Text="" end if closeWindow( inputbox ) end procedure setHandler({ok,cancel}, w32HClick, routine_id( "Click_Button" )) global function input_box(sequence text,sequence title,integer parent) setText(label,text) setText(inputbox,title) openDialog(inputbox) return Text end function Euphoria has a long way to go!