No response when applying 'RETURN' to an editor widget

Hi all

No doubt a simple one for you Progress gurus.

I am trapping the RETURN event globally (ON RETURN ANYWHERE) in the main procedure block but then want to actually apply it when the user is inside an editor widget.

I am finding the right widget ok in the RETURN trigger by using
IF FOCUS:TYPE = 'browse'

but then trying to
APPLY 'RETURN' TO FOCUS
RETURN NO-APPLY

doesn't give me a new line in the editor widget as I would expect.

(Note if I remove the ON RETURN ANYWHERE statement then pressing RETURN in the editor gives me a new line as I would expect)

I have just tried a quick window with an editor widget in it and when I APPLY 'RETURN' TO editor-1. Nothing seems to happen.

Any suggestions?

Cheers
 
I don't know if this will work, and there's probably a simpler way, but I haven't done what you are trying to do before:

[Old knowledgebase entry, can't find it online]

Using ON RETURN ANYWHERE trigger in every widget but EDITOR

If you wish to implement an ON RETURN ANYWHERE trigger for every
widget on a frame *except* an EDITOR widget, use the following:


DEF VAR log AS LOGICAL.
DEF VAR ret AS CHAR INITIAL "~r".


ON "RETURN" ANYWHERE DO:

IF SELF:TYPE = "editor" THEN DO:
log = SELF:INSERT-STRING(ret).
RETURN NO-APPLY.
END.

/* the rest of your ON ANYWHERE processing */

END.
 
Works a treat Lee thanks!!!

IF FOCUS:TYPE = 'editor' THEN
DO:
FOCUS:INSERT-STRING("~r").
RETURN NO-APPLY.
END.

Cheers :biggrin:
Chris
 
Back
Top