How to Get fillin handle from triggers in MFG

S.ALOK

New Member
Hi All,

I am facing a problem. I want to apply tab to all fillins in a window from a trigger in MFG.


{xxwowomt.p}

The code is like this :

{mfdtitle.i}

on go anywhere
do:

if frame-name = "a" then
do:
apply tab to (all fillins) in frame a.
value = fillin :frame-value.
end.
end.

{gprun.i ""wowomt.p""}

I am not able to get the frame handle or fillin handle so that i can apply tab.

Please suggest how to do this.

Bye,
Alok
 
The GO event is usually associated with frames and so you may be able to use the SELF handle to get access to the frame. From there, if the frame is the right one, you can cycle around all of the children in the frame and apply the TAB event to them.

So that you can process sub-frames (frames within frames) your code will probably need to be placed in a procedure that you can call recursively. So you may be able to do something like this:

on go anywhere
do:

if self:type = "frame" then
do:
if self:name = "myframe" then
do:
run apply-tab (input self:first-child).
end.
end.
end.

The following code can be in either an external procedure called "apply-tab.p" or an internal procedure called "apply-tab".

define input parameter ip-handle as handle no-undo.

do while valid-handle(ip-handle):

if can-do("window,frame,field-group",ip-handle:type) then
do:
run apply-tab (input ip-handle:first-child).
end.

else if ip-handle:type = "fill-in" then
do:
apply "tab" to ip-handle.
process events.
end.

ip-handle = ip-handle:next-sibling.
end.
 
Back
Top