8917.p
| 1 |
// Demonstrates the FWD bug: focus change happens ON mouse UP instead OF mouse DOWN |
|---|---|
| 2 |
|
| 3 |
// Defines 2 frames with buttons: |
| 4 |
// 1. 'outerFrame' |
| 5 |
// 2. 'innerFrame' inside the 'outerFrame' |
| 6 |
|
| 7 |
DEFAULT-WINDOW:TITLE = '8917'. |
| 8 |
|
| 9 |
DEFINE BUTTON focusable1. |
| 10 |
DEFINE FRAME outerFrame focusable1 WITH SIZE 80 BY 10. |
| 11 |
|
| 12 |
DEFINE BUTTON focusable2. |
| 13 |
DEFINE FRAME innerFrame focusable2 WITH SIZE 20 BY 4 AT ROW 3 COL 1. |
| 14 |
FRAME innerFrame:FRAME = FRAME outerFrame:HANDLE. |
| 15 |
|
| 16 |
{functions.i}
|
| 17 |
|
| 18 |
{printEntryLeave.i &widget="FRAME outerFrame"}
|
| 19 |
{printEntryLeave.i &widget="FRAME innerFrame"}
|
| 20 |
{printEntryLeave.i &widget="focusable1"}
|
| 21 |
{printEntryLeave.i &widget="focusable2"}
|
| 22 |
|
| 23 |
/*ON CHOOSE OF focusable1 DO: */ |
| 24 |
/* MESSAGE 'focusable1 choose'.*/ |
| 25 |
/*END. */ |
| 26 |
|
| 27 |
ON 'b' OF focusable1 DO: |
| 28 |
MESSAGE 'focusable1 b'. |
| 29 |
END. |
| 30 |
|
| 31 |
ON 'b' OF focusable2 DO: |
| 32 |
MESSAGE 'focusable2 b'. |
| 33 |
END. |
| 34 |
|
| 35 |
ON 'a' ANYWHERE DO: |
| 36 |
IF FOCUS <> ? THEN |
| 37 |
MESSAGE 'FOCUS' FOCUS:NAME. |
| 38 |
ELSE |
| 39 |
MESSAGE "FOCUS ?". |
| 40 |
END. |
| 41 |
|
| 42 |
ENABLE ALL WITH FRAME outerFrame. |
| 43 |
ENABLE ALL WITH FRAME innerFrame. |
| 44 |
WAIT-FOR GO OF FRAME outerFrame. |
| 45 |
|