Each application running in JADE is executed on its own thread and each thread effectively runs as a standalone program. When an application is idle, it waits for the arrival of Windows messages generated as a result of some user action; for example, the use of the keyboard or mouse, a timer expiry, or a message such as a JADE notification posted to the application. Any window of the current application can generate messages that are to be acted upon.
When a message is received, JADE internally performs the appropriate processing and generates the required JADE event calls.
Many messages generate a sequence of actions that are executed as part of the original message; for example, a mouseDown event on an inactive form may also generate an activate event on the new form, a deactivate event and a mouseLeave event on the old form, a gotFocus event on the control gaining focus, and a lostFocus and a mouseLeave event on the control losing focus.
When a message has begun to be processed, no further messages can be executed until logic again does a read on the input message queue. (For the exceptions to this rule, see "Window, Form, and Control Events", earlier in this document.) The actions that generate a read of this message queue are as follows.
Processing of the current message, and all its resulting actions have been completed.
When JADE logic executes a form.showModal and all of the logic associated with the loading and showing of that modal form has been completed. At this point, JADE starts a new windows loop, waiting and processing further window messages for the application until the form is unloaded.
The method that executed the showModal method is suspended until that point.
A message box is displayed. This is just another modal form, but one that does not have any JADE logic associated with it.
JADE logic calls the
An exception dialog is displayed, which is just another modal form.
Timer and notification events are executed only when the application is waiting for input.
When the application is in one of the wait situations described in the previous list, any window can generate events and any notifications and timers are processed, except that when an exception box is displayed, all timer and notification events are delayed until the exception is aborted or canceled. Paint events are still executed, otherwise the forms and controls would not be repainted.
Showing a form (including a message box) as modal has the following impact only.
All other forms of that application are disabled until the modal form is unloaded. Those disabled forms can then generate timer, paint, and notification events only if specific logic makes changes to them; for example, an instance of a form is unloaded.
The method issuing the showModal method call is suspended at that point, until the modal form is unloaded.
Some JADE events are generated immediately as a result of logic, as follows.
Any logic that causes another form to be activated (including methods such as show, showModal, showHelp,
Any logic (including setFocus, show, showModal methods, and so on) that causes the focus to shift generates gotFocus and lostFocus events.
The refreshNow method causes an immediate paint and generates a paint event unless the autoRedraw property is set. Any generated paint may also cause the displayEntry events associated with a list box collection to be executed when there are insufficient entries in the list box. (The displayEntry event does not re-evaluate existing entries in the list box.)
The show and showModal methods usually generate the load event, but some other event such as a notification event can trigger the load event before the show or showModal method. (The load event is always executed before any other form event.)
The unloadForm method generates a queryUnload event and an unload event, unless the queryUnload event rejects the closure.
Unloading a form queues the window for deletion but if another window is deleted before the next idle point, previously queued deleted windows are re-evaluated for deletion. If the queued window or its children has no outstanding message, there are no incomplete event methods for that window or its children, and the method that created the window has exited or the window was deleted, the physical window is deleted.
If a queryUnload method is aborted, queryUnload is not called for any other forms affected by the unload and all affected forms are unloaded without calling the unload method. If an unload method is aborted, all other affected forms are unloaded without calling the unload method.
The popupMenu method generates the
The
Changing properties of a MultiMedia control can cause notifyMedia, notifyMode, and notifyPosition events.
Ocx events can be generated as a result of logic, but this is dependent on the control.
User-generated events on subclassed controls can be generated by logic.
The JADE events that are generated immediately as a result of logic specifically do not include the following situations.
Setting the listIndex property value of a ListBox or ComboBox control does not generate a click event.
Changing the current row or column of a Table control does not generate a rowColumnChg event.
Changing the value property of a CheckBox or OptionButton control does not generate a change or a click event.
Changing the scroll position of a control does not generate a scrolled event.
Changing the size or position of a Form or Control does not generate any event.
To reduce the complexity that can arise from generating these events immediately, it is your responsibility to handle these situations in your logic.
Call the