Index: lams_common/src/flash/org/lamsfoundation/lams/common/ui/LFWindow.as =================================================================== diff -u -rdc4dc4644e05f9f37145ea7e4de9792e48e67bcf -r1bbb544a0561892b2332aeb2827b7c863a82b798 --- lams_common/src/flash/org/lamsfoundation/lams/common/ui/LFWindow.as (.../LFWindow.as) (revision dc4dc4644e05f9f37145ea7e4de9792e48e67bcf) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ui/LFWindow.as (.../LFWindow.as) (revision 1bbb544a0561892b2332aeb2827b7c863a82b798) @@ -1,21 +1,21 @@ -/** +import mx.containers.* +import mx.managers.* +import org.lamsfoundation.lams.util.* + +/** * LFWindow - Extends the MM Window class and will be used for all LAMS windows + dialogs * @author DI * */ -import mx.containers.* -import mx.managers.* -import org.lamsfoundation.lams.util.* - class org.lamsfoundation.lams.common.ui.LFWindow extends Window{ //Declarations //Static vars public static var symbolOwner:Object = Window; private static var MIN_WIDTH = 80; //Minimum window dimensions private static var MIN_HEIGHT = 60; - private static var RESIZE_WIDTH_OFFSET = 15; //Offset to place resize clip from bottom rhs of window - private static var RESIZE_HEIGHT_OFFSET = 15; + private static var RESIZE_WIDTH_OFFSET = 10; //Offset to place resize clip from bottom rhs of window + private static var RESIZE_HEIGHT_OFFSET = 10; private static var SCROLL_X_OFFSET = 3; private static var SCROLL_Y_OFFSET = 30; @@ -29,8 +29,8 @@ private var resize_mc:MovieClip; private var scrollPane:MovieClip; private var _scrollContentPath:String; + private var _helpButtonHandler:Function; //Called when help button clicked - //Constructor function LFWindow() { } @@ -39,20 +39,20 @@ super.init(); //set up skin - skinCloseOver = 'LFCloseButtonOver'; skinCloseDown = 'LFCloseButtonDown'; - } - public function createChildren(Void):Void { super.createChildren(); //Add the scrollpane scrollPane = createClassObject(mx.containers.ScrollPane,"scrollPane", getNextHighestDepth(),{contentPath:_scrollContentPath,_x:SCROLL_X_OFFSET,_y:SCROLL_Y_OFFSET}); - + //Pass in a reference to the Window (this) to the content of the scrollpane + scrollPane.content.container=this; + //Dynamically add extra buttons + //Attach resize and set up resize handling resize_mc = this.createChildAtDepth('resize',DepthManager.kTop); resize_mc.resize_btn.useHandCursor = false; @@ -82,9 +82,9 @@ } public function draw(Void):Void { - //trace('LFWindow.draw'); + //Call the super methods and size after a draw. super.draw(); - size() + size(); } public function size(Void):Void { @@ -101,10 +101,6 @@ //Resize the scrollpane content scrollPane.content.setSize(w,h); - - //trace('scrollPane.content.size :' + scrollPane.content.size); - //forward the resize to any registered listeners, i.e the content - //dispatchEvent({type:"size",target:this}); } public function startDragging(Void):Void { @@ -114,7 +110,6 @@ /** * overrides UIObject.setStyle to provide custom style setting */ - public function setStyle(styleName:String,styleObj:Object){ trace('setstyle'); //Pass it up the inheritance chain to set any inherited styles or non-custom/LAMS style properties @@ -126,16 +121,29 @@ } } - - //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; } /** + * Sets HelpButton handler function and creates a help button on the window for calling it + */ + [Inspectable(defaultValue='')] + function set helpButtonHandler (value:Function){ + if(value){ + _helpButtonHandler = value; + //Create Help Button + + } + } + + /** * override parent property becuase we don't want to be able to set LFWindow content path * because LWWindow 'content' is created in createChildren */