Consultor Eletrônico



Kbase 21658: How to emulate overstrike in Progress® 4GL FILL-IN widget
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How to emulate overstrike in Progress 4GL FILL-IN widget

FACT(s) (Environment):

Progress 4GL

FIX:

Although the Progress® 4GL FILL-IN widget does not support the type over / replace mode ( where the text you type replaces the text already there ) you can write 4GL code to programmatically emulate this support and add this functionality to your application.

The following code has been tested under 8.3B, 8.3D 9.1B and 9.1C. It also has been tested using smart windows as well as regular windows in a windows based GUI environment.
In all the above platform variations, A session wide trigger was defined and placed in the main block to achieve this overtype mode emulation functionality.

With regular windows, the code below may be inserted in the main block after the " RUN enable_UI. " statement. Similarly, with Smart Windows, the code may also be inserted in the main block after the "{src/adm2/windowmn.i} " statement.

ON "ANY-PRINTABLE", "ENTRY" ANYWHERE DO:
IF SELF:TYPE = "FILL-IN" THEN DO:
DEFINE VARIABLE iCursorPosition AS INTEGER no-undo.
ASSIGN
iCursorPosition = SELF:CURSOR-OFFSET
SELF:SCREEN-VALUE = SUBSTRING(SELF:SCREEN-VALUE, 1, iCursorPosition - 1) +
SUBSTRING(SELF:SCREEN-VALUE, iCursorPosition + 1, LENGTH(SELF:SCREEN-VALUE) - iCursorPosition)
SELF:CURSOR-OFFSET = iCursorPosition.
END.
END.