=== modified file 'src/com/goldencode/p2j/ui/client/gui/FrameGuiImpl.java' --- src/com/goldencode/p2j/ui/client/gui/FrameGuiImpl.java 2016-07-13 01:08:05 +0000 +++ src/com/goldencode/p2j/ui/client/gui/FrameGuiImpl.java 2016-08-18 11:23:02 +0000 @@ -75,6 +75,7 @@ ** 038 HC 20160628 Prevented unhandled exceptions when window/frame closed/destroyed. ** 039 EVL 20160622 Adding refresh dialog title after config update. ** 040 SBI 20160713 Fixed the cursor if the mouse pointer over labels. +** 041 SBI 20160818 Fixed the look and feel for empty frames according to the Progress 4GL GUI. */ package com.goldencode.p2j.ui.client.gui; @@ -102,6 +103,9 @@ public class FrameGuiImpl extends Frame { + /** The frame's default size given in pixels */ + private static final int DEFAULT_SIZE_IN_PIXELS = 16; + /** Screen driver */ private GuiDriver gd; @@ -132,6 +136,12 @@ /** Keeping track on explicit virtual height setting. */ private boolean explicitVirtualHeight = false; + /** The default width of the empty frame. */ + private final double defaultWidth; + + /** The default height of the empty frame. */ + private final double defaultHeight; + /** * Special constructor used to restore component using given configuration. *

@@ -161,6 +171,10 @@ // output manager screen = screen(); cc = screen.coordinates(); + + // calculates the frame's default size from its pixels size + defaultHeight = cc.heightFromNative(DEFAULT_SIZE_IN_PIXELS); + defaultWidth = cc.widthFromNative(DEFAULT_SIZE_IN_PIXELS); } /** @@ -467,7 +481,34 @@ new StackLayout(Direction.VERTICAL).doLayout(this); } - + + /** + * This method is invoked when frame is constructed and configuration of all widgets is set, + * but no other actions are performed. It has been overridden in order to set the default size + * for an empty frame according to the Progress 4GL GUI look and feel. + * + * @param newFrame + * true value indicates that doLayout must be processed for this frame. + * @param suppressRedraw + * true means suppress redrawing of frame. + */ + @Override + public void postprocess(boolean newFrame, boolean suppressRedraw) + { + AbstractContainer container = getContentPane(); + if (container != null) + { + // if this frame has no widgets, then set its default dimension. + if (container.widgets().length == 0) + { + setWidth(defaultWidth); + setHeight(defaultHeight); + } + } + + super.postprocess(newFrame, suppressRedraw); + } + /** * Draw the peer container. The methods calls the draw() method for * ScrollPane instance for the peer container. In addition the required