Index: lams_common/src/flash/org/lamsfoundation/lams/common/ui/LFWindow.as =================================================================== diff -u -rab0b4279bc984db7babe904d91e4fd4b3c97f884 -r7a70a67701416fb436889e1d99c980f955cc43e4 --- lams_common/src/flash/org/lamsfoundation/lams/common/ui/LFWindow.as (.../LFWindow.as) (revision ab0b4279bc984db7babe904d91e4fd4b3c97f884) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ui/LFWindow.as (.../LFWindow.as) (revision 7a70a67701416fb436889e1d99c980f955cc43e4) @@ -41,6 +41,8 @@ public var centred:Boolean=false; private var setUpFinished:Boolean = false; + private var _initObj:Object; + //Constructor function LFWindow() { } @@ -64,20 +66,21 @@ * Fired by Window when content has loaded i.e. ScrollPane */ public function scrollLoaded(){ - //trace('scrollLoaded'); + Debugger.log('--',Debugger.GEN,'scrollLoaded','org.lamsfoundation.lams.LFWindow'); //Assign scroll pane content content.contentPath = _scrollContentPath; //Assign reference to container (this) acessible in dialog - content.content.container=this; - + content.content.container = this; + + //Set the size of the window to be greater than the content by the margin width and height setSize(content.content._width+MARGIN_WIDTH,content.content._height+MARGIN_HEIGHT); centre(); this._visible = true; - setUpFinished =true; - //this.removeEventListener('complete',scrollLoaded); + setUpFinished = true; + this.removeEventListener('complete',scrollLoaded); } public function createChildren(Void):Void { @@ -189,13 +192,20 @@ } } + /** + * method called by content of scrollpane when it is loaded + */ + public function contentLoaded() { + //dispatch an onContentLoaded event to listeners + dispatchEvent({type:'contentLoaded',target:this}); + } + //Getters+Setters /** * Sets the content of the scrollpane child. Allows content to be set from outside LFWindow */ [Inspectable(defaultValue='')] function set scrollContentPath (path:String){ - //trace('setting scrollContentPath-'+content); _scrollContentPath = path; } @@ -220,12 +230,10 @@ } */ - /** * Returns content inside the scrollPane */ function get scrollContent():Object{ return content.content; } - } \ No newline at end of file