10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Communicating Between OpenROAD FramesFor example, if the user is in the process of entering data into a field onWindow 1 and then selects Window 2, the input focus for Window 1 stays onthe field where the user was entering the data. Because the field on the firstframe still has the input focus, the data validation code for the field is nottriggered, even though the user has left the window. (Typically, the datavalidation code for a field is contained in the SetValue or Exit event blocks forthe field, so data validation takes place when the user changes or leaves thefield.) The SendUserEvent method provides a focusbehavior parameter toenable you to deal with this situation.The focusbehavior parameter of the SendUserEvent method lets you triggerthe SetValue event or both SetValue and Exit events for the field with the inputfocus before the user event is triggered. The values for the focusbehaviorparameter are:FT_SETVALUETriggers the SetValue event for current fieldFT_TAKEFOCUSTriggers the SetValue and Exit events for current fieldFT_NOSETVALUESpecifies no forced processingDefault: FT_NOSETVALUENote: Setting the focusbehavior parameter to FT_SETVALUE orFT_TAKEFOCUS can cause the receiving frame to discard the user event thatyou sent. This happens when the SetValue or Exit event block for the currentfield in the receiving frame executes a resume statement. (For moreinformation about the resume statement, see the Language Reference <strong>Guide</strong>online help). The user event is also discarded if a data type conversion erroroccurs when OpenROAD attempts to execute the SetValue event.The following example uses the focusbehavior parameter to trigger theSetValue event in its child frames before they close:vlist[i].details_frame.SendUserEvent(eventname='Cleanup',focusbehavior = FT_SETVALUE);Delay ParameterWhen you want to repeat a task at regular intervals, such as polling thedatabase for changes or updating the time on a clock, you can trigger a userevent after a specified amount of time. The delay parameter of theSendUserEvent lets you specify a number of seconds to wait before triggeringthe user event.342 <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!