Change sequence of Triggers

Hi,

We have an old Chui program (progress 9.1E under windows - see cut down example below) that needs to be changed, but have a problem that the Leave trigger takes prescedence over the Abort button.
(ie if in Customer field and abort button pressed then Leave action fires first).

Is there any way to override this?

Regards
Mike


def var xcustomer like cashcheque.customer NO-UNDO.
def var xchequeno like cashcheque.chequeno NO-UNDO.
DEFINE BUTTON btn-exit LABEL "Abort".
DEFINE BUTTON btn-ok LABEL "Accept".

FORM
SPACE(2) " Customer: " xcustomer SPACE(2)
SKIP
SPACE(2) " Cheque No: " xchequeno SKIP
btn-exit btn-ok skip
WITH FRAME custframe CENTERED row 2 NO-LABELS OVERLAY
TITLE " Test Screen".
ON CHOOSE of btn-exit
DO:
MESSAGE "button exit" view-as alert-box.
END.


ON CHOOSE of btn-ok
DO:
MESSAGE "button ok" view-as alert-box.
APPLY "ENTRY" to xcustomer.
END.

ON ENTRY OF xcustomer
DO:
display xcustomer with frame custframe.
message "on entry to xcustomer " xcustomer
view-as alert-box.
END.

ON LEAVE OF xcustomer
DO:
ASSIGN xcustomer.
message "on leave from xcustomer " xcustomer skip
view-as alert-box.
END.

INNER:
DO ON endkey UNDO , LEAVE :

message "in Inner "
view-as alert-box.
color display value("white/black") btn-exit with frame custframe.
ENABLE xcustomer xchequeno btn-exit btn-ok WITH FRAME custframe.

WAIT-FOR CHOOSE of btn-exit IN FRAME custframe OR
CHOOSE of btn-ok IN FRAME custframe
FOCUS xcustomer.
message " after Wait for " skip
view-as alert-box.


END. /* of INNER */
 

jongpau

Member
Logic says that you leave the field before you click the button. But, I reckon you can get around your little problem like this:
Code:
ON LEAVE OF xcustomer
DO:
    IF LAST-EVENT:WIDGET-ENTER:NAME NE "btn-exit":U THEN
    DO:
        ASSIGN xcustomer.
        message "on leave from xcustomer " xcustomer skip
        view-as alert-box.
    END.
END.

Hope this helps

Paul
 
Top