DR Last event

4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next

version 6.0


DR Last event (area) Longint

ParameterTypeDescription
areaLongint4D Draw area
Function resultLongintCode of the last event that occurred in area

Description

The command DR Last event returns the code of the last event that occurred in area.

DR Last event can be used in the object method of a 4D Draw area or in an event method installed with DR ON EVENT. DR Last event identifies the event that caused the object or project method to execute. When used with the DR EVENT FILTER command, DR Last event allows you to take action based on a user's actions. See Appendix C, Event Codes, for a complete list of event codes.

Example

The following example is the object method for a 4D Draw area. It first tests to see if the object method ran because of a Command-click (or Ctrl-click in Windows) and then tests to see if only one object is selected. If both criteria are met, it passes the object's reference number to a project method.

   If (DR Last event (Area) = 64)
         `Was there a Command-Click
      If (DR Count (Area;0) = 1)
            `How many objects are selected
         PART INFO (DR GET ID(Area;0;1))
            `Pass ref number to PART INFO.
      End if 
   End if 

The following is the PART INFO method. This method searches for the part, calls a project method that opens a centered window, and then displays the record for modification.

   QUERY ([Parts];[Parts]ID=$1)   `Search for record that goes with object
   CENTER WINDOW (400;300)   `Open a centered window
   MODIFY RECORD ([Parts];*)   `Allow the user to make modifications
   CLOSE WINDOW   `Close the window

See Also

DR EVENT FILTER, DR ON ERROR.


4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next