panel that implements RequiresResize

229 views
Skip to first unread message

tong123123

unread,
Jun 14, 2012, 12:18:20 AM6/14/12
to google-we...@googlegroups.com
if a panel that implements RequiresResize add a widget, the panel always cannot be visible.
is it a necessary that a panel implements RequiresResize need called setSize() explicitly?

in the developer guide
RequiresResize provides a single method, onResize(), which is called by the widget's parent whenever the child's size has changed.
it is difficult to understand, it is called by the widget's parent, so it should be called whenever the PARENT's size has changed, not whenever the CHILD's size has changed.?

in the developer guide
The panels described above are best used for defining your application's outer structure — that is, the parts that are the least "document-like". You should continue to use basic widgets and HTML structure for those parts for which the HTML/CSS layout algorithm works well.
this part is also difficult to understand, is it means the outer structure should use layout panel, but then in inner part, we can still use some fixed sized panel like horizontalPanel, flextable or something like panel.setSize() (the size is fixed)?

Thomas Broyer

unread,
Jun 14, 2012, 5:31:21 AM6/14/12
to google-we...@googlegroups.com


On Thursday, June 14, 2012 6:18:20 AM UTC+2, tong123123 wrote:
if a panel that implements RequiresResize add a widget, the panel always cannot be visible.
is it a necessary that a panel implements RequiresResize need called setSize() explicitly?

See the “Using a LayoutPanel without RootLayoutPanel” recipe in the developer guide.
 
in the developer guide
RequiresResize provides a single method, onResize(), which is called by the widget's parent whenever the child's size has changed.
it is difficult to understand, it is called by the widget's parent, so it should be called whenever the PARENT's size has changed, not whenever the CHILD's size has changed.?

It's understood that the parent widget controls the layout of its children, so if it resizes a RequiresResize child, it should call its onResize() (provided the parent is a ProvidesResize, other there's no such guarantee).
If you put a Requiresresize widget within a LayoutPanel, its onResize() will be called whenever you call setLeftWidget, setLeftRight, setTopHeight, setTopBottom, etc.  on the LayoutPanel for that child widget?
 
in the developer guide
The panels described above are best used for defining your application's outer structure — that is, the parts that are the least "document-like". You should continue to use basic widgets and HTML structure for those parts for which the HTML/CSS layout algorithm works well.
this part is also difficult to understand, is it means the outer structure should use layout panel, but then in inner part, we can still use some fixed sized panel like horizontalPanel, flextable or something like panel.setSize() (the size is fixed)?

Yes (except I'd nuance the "outer structure should use layout panels": it's only a "should" if you use layout panels in your app, feel free not not use them at all). 
Reply all
Reply to author
Forward
0 new messages