Declaration:
int LastEvent(unsigned long handle);
Description
Returns the type of the latest event that occurred to the window and is accessed by the WaitWindowEvent function.
Returned value
The type of event (constants are defined in system.h):
WE_REDRAW is the window data update request, an image display request. This event is generated in all those cases, when it is necessary to update the window, for example, at the Windows task switch. This event informs you that the window wishes to redraw itself, and your script file, generally speaking, does not have to respond to this event. If the script file does not update the window data, the old picture will be drawn.
WE_MOUSEBUTTON (only the User window) - You clicked a mouse button, when the mouse cursor was in the window. Information on the click can be obtained by calling the LastEventIntx function:
•
|
LastEventInt1() and LastEventInt2() return the coordinates in pixels (x, y) for the point, where the cursor was located, when the button was clicked.
|
•
|
LastEventInt3() and LastEventInt4() return the text coordinates (x, y) for the point, where the cursor was located, when the button was clicked; x is the column number; y is the line number.
|
WE_USERBUTTON (only the User window) You clicked one of the buttons added to the window by the AddButton function. The LastEventInt1() function returns identifier of the clicked button. It equivalent to the button identifier returned by the AddButton function.
WE_TOOLBARBUTTON (only the User window) You clicked one of the 0...F buttons on the window toolbar. These buttons are particularly intended for simple interactions with the window. Using the customer buttons (see AddButton) is more complicated, although it is more flexible.
WE_CHAR - (only the I/O Stream window) You pressed an alphanumeric key on the keyboard. LastEventInt1() returns its code.
WE_CLOSE - You closed the window. After that, further window operation is useless and should be stopped.
|