Set trigger for all FILL-IN objects

hkeskin

New Member
Hi,

I changed fill-in back color by enter and leave triggers. But I have more than one fill-in object. and I want to set my triggers for all fill-in objects. is it possible?

Thanks in advance,
 
I'll take it that you define the widgets statically by dropping them onto a frame in the development environment ...

You can pick up the handles to that widgets by doing a widget-tree walk on the frame they are located on. As soon as you have the handle you can "dynamically" assign triggers on specific events to that handle calling an internal procedure passing in the handle of the widget.

This might give you an idea (coded in Firefox IDE, therefore not syntax checked):
Code:
 DEFINE VARIABLE hHandle AS WIDGET-HANDLE      NO-UNDO.  /* Your code to determine the handle to the FILL-IN widget */  ON 'LEAVE':U OF hHandle PERSISTENT RUN "myInternalProcedure" ( INPUT hHandle ).

Heavy Regards, RealHeavyDude.
 
Thanks for your answer. I'm newbe on progress.
Ihave two fill in object, txtCode,txtName.

I used your code(below) in definition section. and It thrown an error: Invalid widget-handle. Not initialised or points to a deleted widget. after this message it says could not attach trigger.....

DEFINE VARIABLE hHandle AS WIDGET-HANDLE NO-UNDO.
/* Your code to determine the handle to the FILL-IN widget */
ON 'LEAVE':U OF hHandle
PERSISTENT RUN "myProcedure" ( INPUT hHandle ).

PROCEDURE myProcedure:
SELF:BGCOLOR=14.
END PROCEDURE.
 
My code example was meant to serve as an example to give you an idea - it was never meant to be fully working because how would I have known about your widgets and therefore how to code the widget-walk.

Furthermore, you internal procedure needs the handle to the widget as input parameter as specified with persistent run and in your internal procedure you need to set the BGCOLOR on the handle, _NOT_ on the SELF system handle.

If you want to get fully working code samples you need to post your code first. If you do, please wrap it in CODE tags so that your post become better readable. Then if somebody devotes time you will probably get a working sample as a response.

Heavy Regards, RealHeavyDude.
 
Back
Top