Opened 13 years ago

Last modified 12 years ago

#2955 closed task

layout(), resize(), onResized() refactor — at Initial Version

Reported by: bill Owned by: koranteng
Priority: high Milestone: 0.9beta
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


Concerning sizing:

There are two categories of widgets: children, and top level. Child widgets (ex: a split container inside a tabcontainer) get their size set by the parent widget. Top level widgets need to monitor when their size changes because (for example) the window has changed size.

The onResized() call from 0.4 is inefficient because it tells each widget "your size changed" without telling it what the new size is; widgets should be changed to implement and call resize({w: 500, h: 500}) which sets the margin box of the widget. There should be no onResized() method. Maybe we can also get rid of all the calls to getContentBox(), since the margin box size is passed to resize().

This brings up the problem with layout() and resize(). After all widgets are created, layout() is called on each widget, to let it "hook up" to other widgets such as it's parent/children/widgets it references. The problem is that, given a parent and child widget, parent.layout() wants to size itself and then call child.resize(), but that's not really valid until after child.layout() is called. Have to rethink the lifecycle.

Change History (0)

Note: See TracTickets for help on using tickets.