Consultor Eletrônico



Kbase P21814: CTRL-L or CTRL-R aligns text to left and right in a Large Ed
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/03/2003
Status: Unverified

SYMPTOM(s):

CTRL-L or CTRL-R aligns text to left and right.

Using a variable defined as a Large Editor widget.

Works fine with the default Editor widget.

Works fine with a database field defined as a Large Editor widget.

CAUSE:

The Microsoft RichEdit is used for the Large Editor widget and this behavior is a RichEdit functionality.

Further information on RichEdit shortcuts can be found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/aboutricheditcontrols.asp

FIX:

Use the EDIT-UNDO() method in a trigger to workaround the RichEdit shortcuts. See the following example.


/**********************************************/
DEF VAR h-txt AS CHAR
   VIEW-AS EDITOR INNER-LINES 10 INNER-CHARS 50 LARGE.

DEF FRAME f-txt
   h-txt.

ON CTRL-R OF h-txt IN FRAME f-txt
DO:
 SELF:EDIT-UNDO().  /* Undo RichEdit shortcut */
SELF:EDIT-CAN-UNDO = FALSE /* Prevent the previous Undo action to be undone */
 MESSAGE "ok" VIEW-AS ALERT-BOX.
 RETURN NO-APPLY.
END.

ENABLE h-txt WITH FRAME f-txt.

WAIT-FOR "GO" OF h-txt.
/**********************************************/