1. How insert to Edit Text
- Posted by aku at inbox.as Aug 10, 2001
- 419 views
How can I insert text at cursor position into an edittext control? Thanks!
2. Re: How insert to Edit Text
- Posted by Derek Parnell <ddparnell at bigpond.com> Aug 10, 2001
- 407 views
----- Original Message ----- From: <aku at inbox.as> To: "EUforum" <EUforum at topica.com> Subject: How insert to Edit Text > > How can I insert text at cursor position into an edittext control? > Hi Aku, here is a sample program you could try... ---------------- include win32lib.ew constant win = create(Window, "", 0, 0, 0, 400, 300, 0), fld1 = create(EditText, "", win, 5, 5, 300, 25, 0), fld2 = create(EditText, "", win, 5, 35, 300, 25, 0), btn = create(Button, "Insert", win, 5, 75, 56, 40, 0) procedure ins() integer where sequence newtext sequence oldtext sequence updtext where = getIndex(fld1) newtext = getText(fld2) oldtext = getText(fld1) updtext = oldtext[1 .. where-1] & newtext & oldtext[where .. length(oldtext)] setText(fld1, updtext) setIndex(fld1, where + length(newtext)) end procedure onClick[btn] = routine_id("ins") WinMain(win, 0) ----------------