Project

General

Profile

6028.p

Vladimir Tsichevski, 01/31/2022 03:44 PM

Download (1.41 KB)

 
1
// Rectangle issues #6028 demo
2

    
3
// Two similar rectangles are defined in a frame with similar event
4
// triggers. For the first rectangle, the triggers are defined in the
5
// TRIGGERS: part of DEFINE RECTANGLE statement. For the second
6
// rectangle a similar trigger set is defined as a series of ON...
7
// statements. In OE both rectangles behave similarly. In FWD only
8
// the second rectangle responds to mouse events.
9

    
10
DEFINE RECTANGLE rectWithTriggers
11
   SIZE-PIXELS 150 BY 150
12
   TRIGGERS:
13
      ON LEFT-MOUSE-DOWN
14
         PERSISTENT RUN onLeftMouseDown IN THIS-PROCEDURE.
15
      ON LEFT-MOUSE-UP
16
         PERSISTENT RUN onLeftMouseUp IN THIS-PROCEDURE.
17
      ON LEFT-MOUSE-CLICK
18
         PERSISTENT RUN onLeftMouseClick IN THIS-PROCEDURE.
19
   END TRIGGERS.
20

    
21
DEFINE RECTANGLE rectNoTriggers
22
   SIZE-PIXELS 150 BY 150.
23

    
24
DEFINE FRAME f
25
   rectWithTriggers
26
   rectNoTriggers
27
   WITH SIZE 500 BY 500 TITLE "Rectangle event triggers test"
28
   .
29

    
30
ON LEFT-MOUSE-DOWN OF rectNoTriggers DO:
31
   MESSAGE "ON LeftMouseDown".
32
END.
33

    
34
ON LEFT-MOUSE-UP OF rectNoTriggers DO:
35
   MESSAGE "ON LeftMouseUp".
36
END.
37

    
38
ON LEFT-MOUSE-CLICK OF rectNoTriggers DO:
39
   MESSAGE "ON LeftMouseClick".
40
END.
41

    
42
PROCEDURE onLeftMouseDown:
43
   MESSAGE "trigger Down".
44
END PROCEDURE.
45

    
46
PROCEDURE onLeftMouseUp:
47
   MESSAGE "trigger Up".
48
END PROCEDURE.
49

    
50
PROCEDURE onLeftMouseClick:
51
   MESSAGE "trigger Click".
52
END PROCEDURE.
53

    
54
ENABLE ALL WITH FRAME f.
55

    
56
WAIT-FOR CLOSE OF THIS-PROCEDURE.