Bug #10785
DIALOG-BOX height is not computed right
0%
History
#1 Updated by Andrei Iacob 9 months ago
This task represents defered work from #9676. Some changes have been done in task branch 9676b, but they did not reach trunk. Each testcase provided will contain results for OE, trunk/16246 and 9676b/16249.
Initial issue is visible when FRAME definition contains SKIP:
DEFINE FRAME red
SPACE (15.00) SKIP(10)
WITH NO-BOX BGCOLOR 4.
DEFINE FRAME green
SPACE (15.00) SKIP(1)
WITH NO-BOX BGCOLOR 2.
DEFINE FRAME D-Dialog
SPACE(30.00) SKIP(10.00)
WITH BGCOLOR 8 VIEW-AS DIALOG-BOX
size 15 by 15.
ASSIGN FRAME red:FRAME = FRAME D-Dialog:HANDLE.
ASSIGN FRAME green:FRAME = FRAME D-Dialog:HANDLE.
FRAME red:row = 2.5.
FRAME green:column = 4.
FRAME green:row = 10.
MESSAGE FRAME d-dialog:height-chars FRAME d-dialog:height-pixels.
// OE 15 315 | trunk/16246 16.1 338 | 9676b 14.91 313
FRAME d-dialog:VISIBLE = TRUE.
MESSAGE FRAME d-dialog:height-chars FRAME d-dialog:height-pixels.
// OE 15 315 | trunk/16246 16.1 338 | 9676b 14.91 313
WAIT-FOR GO OF FRAME d-dialog.
9676b/16247 intended to fix it, by conditioning the increase of height result with widget height by checking if SKIP widget was processed. This got the height frame from 16.1 to 14.91.
The remaining height difference was caused by a change introduced in #3051, where FrameGuiImpl.initialize would decrease the height only for dialog boxes.
public void initialize(WidgetId id, FrameConfig wcfg)
{
[...]
// dialog boxes with explicit size assignment needs the internal frame size to be adjusted
// because the dialog size includes enclosing window title and border values
if (isDialog() && getOriginalHeightChars() != 0)
{
DialogBoxWindow wnd = (DialogBoxWindow) topLevelWindow();
if (wnd != null)
{
Border<?> b = wnd.getBorder();
WindowTitleBar tbar = wnd.getTitleBar();
if (b != null && tbar != null)
{
Insets ins = b.insets();
FrameConfig fcfg = config();
fcfg.clientWidthChars = fcfg.widthChars;
fcfg.clientHeightChars = fcfg.heightChars;
fcfg.widthChars -= ins.left + ins.right;
fcfg.heightChars -= ins.top + ins.bottom + tbar.height(); // 12 -= 0.05 - 0.05 -
originalHeightChars = config().heightChars;
}
}
}
[...]
}
Here's the testcase that referenced that change (#3051-72):
DEFINE BUTTON b1.
DEFINE BUTTON b2.
DEFINE VARIABLE f1 as character VIEW-AS FILL-IN.
DEFINE FRAME fr
f1 AT ROW 1 col 5
b2 AT ROW 4 col 5
b1 AT ROW 3 col 5
WITH SIDE-LABELS.
enable all with frame fr.
message frame fr:height. // OE 4.14 | trunk/16246 4.14 | 9676B 4.14
wait-for close of this-procedure.
But no difference was noticed with or without that snipped for the above testcase, thus I tend to believe it can be removed.
9676b/16247 introduced a regression that was later fixed. Here are some test procedure to take into consideration:
DEFINE BUTTON b1. DEFINE VARIABLE f1 as character VIEW-AS FILL-IN. DEFINE FRAME fr skip b1 AT ROW 3 col 5 f1 AT ROW 1 col 5 WITH SIDE-LABELS. enable all with frame fr. message frame fr:height. // OE 3.14 | trunk/16246 3.14 | 9676b 3.14 wait-for close of this-procedure.
DEFINE BUTTON b1.
DEFINE VARIABLE f1 as character VIEW-AS FILL-IN.
DEFINE FRAME fr SKIP(3.5)
f1 AT ROW 1 col 5
b1 AT ROW 3 col 5
WITH SIDE-LABELS.
enable all with frame fr.
message frame fr:height. // OE 3.62 | trunk/16246 3.62 | 9676b 3.62
wait-for close of this-procedure.
DEFINE BUTTON b1.
DEFINE VARIABLE f1 as character VIEW-AS FILL-IN.
DEFINE FRAME fr skip
f1 AT ROW 1 col 5
b1 AT ROW 2 col 5
WITH SIDE-LABELS.
enable all with frame fr.
message frame fr:height. // OE 2.14 | trunk/16246 2.14 | 9676b 2.14
wait-for close of this-procedure.