Project

General

Profile

6013-mouse-up.p

Vladimir Tsichevski, 03/14/2022 11:35 AM

Download (1.54 KB)

 
1
// Test for #6013 issue scenario FOR MOUSE-UP events.
2

    
3
// In this program two rectangle widgets are DEFINEd: 'outerRect' and 'innerRect'.
4
// The 'innerRect' is located inside the 'outerRect' and overlaps it almost entirely.
5
// The 'innerRect' is initially hidden (innerRect:HIDDEN = TRUE).
6
// When 'outerRect' receives a mouse down event, the 'innerRect' becomes visible.
7
// When 'innerRect' receives a mouse down event, the 'innerRect' becomes hidden again.
8

    
9
// MOUSE-DOWN and MOUSE-UP events are reported with corresponding MESSAGEs for both widgets.
10

    
11
// The expected behavior (as observed in OE) is as follows:
12

    
13
// When the user click the mouse:
14

    
15
// 1. 'outerRect' receives mouse down
16
// 2. 'innerRect' receives the MOUSE-UP event.
17

    
18
// When the user click the mouse second time (above the 'innerRect'):
19

    
20
// 1. 'innerRect' receives mouse down
21
// 2. 'outerRect' receives the MOUSE-UP event.
22

    
23
DEFINE RECTANGLE outerRect
24
   SIZE-PIXELS 300 BY 300.
25

    
26
DEFINE RECTANGLE innerRect
27
   SIZE-PIXELS 280 BY 280.
28

    
29
DEFINE FRAME f
30
   outerRect AT X 0 Y 0
31
   innerRect AT X 10 Y 10
32
   WITH SIZE 500 BY 500 TITLE "MOUSE-UP event routing test"
33
   .
34

    
35
ON LEFT-MOUSE-DOWN OF outerRect DO:
36
   MESSAGE "Outer Down, un-hiding inner".
37
   innerRect:VISIBLE = TRUE.
38
END.
39

    
40
ON LEFT-MOUSE-UP OF outerRect DO:
41
   MESSAGE "Outer Up".
42
END.
43

    
44
ON LEFT-MOUSE-DOWN OF innerRect DO:
45
   MESSAGE "Inner Down, hiding inner...".
46
   innerRect:VISIBLE = FALSE.
47
END.
48

    
49
ON LEFT-MOUSE-UP OF innerRect DO:
50
   MESSAGE "Inner Up".
51
END.
52

    
53
ENABLE ALL WITH FRAME f.
54

    
55
innerRect:HIDDEN = TRUE.
56

    
57
WAIT-FOR CLOSE OF THIS-PROCEDURE.