10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Event-based <strong>Programming</strong>By default, when the event is being executed, all open frames are blocked sothat the user cannot select ahead and trigger more events. However, you canchange this behavior by setting the BlocksFrames attribute to FALSE. For moreinformation about the BlocksFrames attribute, see How You Can Block an OpenFrame (see page 106).Example:The following sample event block from the video_detail frame includes theSendUserEvent method, which triggers the specified user event. WhenOpenROAD executes this method, the following happens:1. It sends the UpdateTitle user event to the application event queue andfinishes executing the SetValue event block.2. When the UpdateTitle event reaches the top of the application eventqueue, it places this event on the frame queue for the graphic_frameframe.3. It executes the code associated with the UpdateTitle user event only afterthat event reaches the top of the frame queue.on setvalue video.title =beginCurFrame.WindowTitle = video.title;if graphic_frame is not null thengraphic_frame.SendUserEvent(eventname = 'UpdateTitle',messagevarchar = video.title);endif;endTo force the current event block to wait until a specified user event hasarrived, you can use the WaitFor method (for more information about userevents and the WaitFor method, see Inter-Frame Communication Techniques(see page 333) and WaitFor Method (see page 345)).Note: Using the WaitFor method to wait for events sent to the current framecauses the wait to last forever.How You Can Examine and Manipulate Event QueuesWhen you are debugging an application, you can manipulate an event before itoccurs. The OpenROAD Debugger lets you set break conditions on events,causing the application to pass control to the Debugger immediately beforeexecuting the specified event. For more information, see Debugging YourApplication (see page 441).You can also examine the sequence of events in the Debugger's Event Queuewindow. This window displays the contents of a given frame's event queue. Formore information about debugging events and the event queue, seeDebugging Your Application (see page 441).320 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!