Do you know VB? VB's object has an attribute locked, but set to true, the input box can't be updated. But it remains enabled and can receive focus. That's why I want to do.
So, what we're looking for is a fill in that will receive focus, but not respond to any attempts to change the contents? I'm assuming there's a good reason why you're not just setting the widget to 'View as text' or something.
Try trapping the ANY-KEY event. You want to stop all printable input, plus key functions like 'DELETE' etc. but not things like 'TAB'.
See if you can build this into something re-usable like...
Code:
{lkfill.i &LOCK="FILL-IN-1,FILL-IN-2"}
/* lkfill.i */
ON ANY-KEY OF {&LOCK}:
..
IF KEYFUNCTION(LASTKEY) ....
..
RETURN NO-APPLY.
..
END.
You could set the attribute for that field by doing this..
=====================
def var v-1 as char.
def var v-2 as char.
form
v-1
v-2
with frame f1.
enable all with frame f1.
v-2:read-only = true.
wait-for window-close of this-procedure.
=======================
In this example, v-1 and v-2 are enabled and recieve focus, but no input can be recieved by v-2.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.