Bug #12124
SIGNATURE Widget: Issues Found While Writing the Signature Demo
0%
History
#1 Updated by Sergey Ivanovskiy 18 days ago
- File signature_demo.p
added
SIGNATURE Widget: Issues Found While Writing the Signature Demo¶
Background¶
These issues showed up while writing the signature demo for the FWD User Meeting (#12087): abl/signature/signature_demo.p in the testcases project, which drives the FWD SIGNATURE widget (CREATE SIGNATURE, an FWD extension) through its handle methods (KeyPadAddHotSpot, LCDRefresh, ...). Both are conversion issues. They were split out of the spreadsheet demo list (spreadsheet_demo_issues.textile), where they were issues 7 and 8.
Tested on trunk rev 16821 and on 9830a rev 16821. The demo works around each issue; the workaround is given per issue.
Summary¶
| # | Issue | Where in FWD | OpenEdge result | Workaround in the demo |
|---|---|---|---|---|
| 1 | Conversion: SIDE-LABEL VIEW-AS TEXT in DEFINE FRAME fails |
conversion rules (FORMAT_PHRASE) |
Not a defect: OpenEdge error 201 as well | Frame-level SIDE-LABELS, no VIEW-AS TEXT |
| 2 | Conversion: an arithmetic argument to a SIGNATURE method converts to int64 |
conversion of widget method arguments | FWD-only widget, no OE check; FWD defect | Compute into an INTEGER variable first |
1. Conversion: SIDE-LABEL VIEW-AS TEXT in DEFINE FRAME Fails¶
Found in the first version of the demo. The frame is the demo's, but the issue is not specific to the SIGNATURE widget.
DEFINE VARIABLE cOrder AS CHARACTER NO-UNDO FORMAT "x(12)" LABEL "Order". DEFINE FRAME fMain cOrder AT ROW 1.5 COL 12 SIDE-LABEL VIEW-AS TEXT WITH SIZE 130 BY 20.5 THREE-D NO-BOX.
FWD conversion stops with Unrecognized data type WID_TEXT. [FORMAT_PHRASE ...] (throwException in a walk rule on BLOCK/STATEMENT/DEFINE_FRAME/FORM_ITEM/FORMAT_PHRASE).
OpenEdge: does not compile it either: ** Unknown Field or Variable name - SIDE-LABEL. (201). SIDE-LABEL is not a format phrase option (SIDE-LABELS is a frame phrase option). Not an FWD defect. FWD's message is just less clear than OpenEdge's.
Workaround: WITH SIDE-LABELS on the frame and no VIEW-AS TEXT.
2. Conversion: an Arithmetic Argument to a SIGNATURE Method Converts to int64¶
DEFINE VARIABLE dCharW AS DECIMAL NO-UNDO INITIAL 9.6. DEFINE VARIABLE iLineH AS INTEGER NO-UNDO INITIAL 15. hSig:KeyPadAddHotSpot(1, 1, 10, 10, INTEGER(12 * dCharW), 3 * iLineH + 2). hSig:LCDRefresh(1, 10, 10, INTEGER(12 * dCharW), 3 * iLineH + 2).
In the demo, where the key, position and width came from parameters (piKey, piX, piY, piCells), this converted to ...keypadAddHotSpot(piKey, new integer(1), piX, piY, new integer(multiply(piCells, dCharW)), plus(multiply(3, iLineH), 2)), and javac failed with incompatible types: int64 cannot be converted to integer. This happens both for INTEGER(...) wrapped in new integer(...) and for the bare plus(...).
OpenEdge: cannot be checked: CREATE SIGNATURE is an FWD extension. Handle methods with INTEGER parameters take arithmetic arguments in 4GL, so FWD should wrap the int64 results. This is an FWD defect.
Workaround: compute the values into INTEGER variables first (the demo now calls hSig:KeyPadAddHotSpot(piKey, 1, piX, piY, iW, iH) and hSig:LCDRefresh(1, piX, piY, iW, iH)).