Consultor Eletrônico



Kbase P118732: In a Browse - how to display/update a logical field as a check box.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

In a Browse - how to display/update a logical field as a check box.

FIX:

To achieve this follow the steps:
1) Define a font number in progress.ini or Registry to use the "Wingdings" font (e.g. size = 9)

One good point is this font is standard on Windows, so no need to install it.
To use it and define it, just choose an unused font number (>7 or > 8) in the AppBuilder Property Sheet of any widget, and choose Edit (then SAVE)
2) For the logical field browse column, use the above FONT, and the FORMAT "þ/¨" (Type Alt-0254 / Alt-0168)
At the end of the day, the A4BGL code looks like this:
/* Browse definitions */
DEFINE BROWSE BROWSE-2
QUERY BROWSE-2 SHARE-LOCK NO-WAIT DISPLAY
myTable.myCharField FORMAT "X(10)":U
myTable.myLogicalField FORMAT "þ/¨":U
COLUMN-FONT 10
ENABLE
myTable.myLogicalField
WITH NO-ROW-MARKERS SEPARATORS SIZE 42 BY 13.81 FIT-LAST-COLUMN.
3) Use the following trigger to toggle the value on DoubleClick, Space or Return:
ON LEFT-MOUSE-DBLCLICK OF myTable.myLogicalField IN BROWSE BROWSE-2
OR " " OF myTable.myLogicalField OR RETURN OFmyTable.myLogicalField DO:
SELF:SCREEN-VALUE = STRING(NOT SELF:INPUT-VALUE).
END.