Index: lams_common/src/flash/Panel.fla =================================================================== diff -u -rf7d2d605aee66e82062f414327e2f1f74a186f25 -re46356f441a80d593b897bb7a572fc544ba000ed Binary files differ Index: lams_common/src/flash/Panel.swc =================================================================== diff -u -rf7d2d605aee66e82062f414327e2f1f74a186f25 -re46356f441a80d593b897bb7a572fc544ba000ed Binary files differ Index: lams_common/src/flash/org/lamsfoundation/lams/common/ui/Panel.as =================================================================== diff -u -r7635e0ccbfeee9bbbe701ba153a7e4fee9fef124 -re46356f441a80d593b897bb7a572fc544ba000ed --- lams_common/src/flash/org/lamsfoundation/lams/common/ui/Panel.as (.../Panel.as) (revision 7635e0ccbfeee9bbbe701ba153a7e4fee9fef124) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ui/Panel.as (.../Panel.as) (revision e46356f441a80d593b897bb7a572fc544ba000ed) @@ -1,8 +1,8 @@ import org.lamsfoundation.lams.common.ui. * import mx.core.UIComponent /** -* Panel is a base UI used in LAMS. It is a holder for other UI -* components and forms the building blocks of much of the UI. +* Panel is a base UI building block used in LAMS. It is a holder for other UI +* components * It is re-sizable, and supports Macromedia's skinning * * @see More info on core functions required when developing a component @@ -18,7 +18,11 @@ var className : String = "Panel"; //Variables private var panel : MovieClip; - private var boundingBox_mc : MovieClip; + private var boundingBox_mc : MovieClip; + private var border_mc : MovieClip; + var __borderType : String = "inset"; + + /** * Constructor (Empty) * @@ -44,7 +48,57 @@ boundingBox_mc._height = 0; //attach the actual component createChildren (); - } + } + + /** + * The draw method is invoked after the component has + * been invalidated, by someone calling invalidate(). + * This is better than redrawing from within the set function + * for value, because if there are other properties, it's + * better to batch up the changes into one redraw, rather + * than doing them all individually. This approach leads + * to more efficiency and better centralization of code. + * + * Here we just call layout children and the super + * + */ + + public function draw () : Void + { + //trace ('panel.draw()'); + super.draw (); + layoutChildren (); + } + /** + * Overrides the function in UIObject. + * Calls invalidate, which will call draw() one frame + * later and therefore will call layoutChildren + * - to hanlde the size... + */ + public function size (Void) : Void + { + //trace ('Panel.size()'); + invalidate (); + } + + /** + * The type indicated if inny our outy etc.. + * @param type The kind of border we use, possible values: 'inset', 'outset', 'solid' + */ + [Inspectable(enumeration="inset,outset,solid,default"defaultValue="inset")] + function set borderType (bStyle:String):Void{ + //trace('set bStyle:'+bStyle); + __borderType = bStyle; + invalidate(); + } + + function get borderType():String{ + return __borderType; + + } + + + /** * Attaches the PanelAssets mc which contains all the actual * mc's that make up the component @@ -54,8 +108,9 @@ { _global.breakpoint (); //trace ('create children in panel'); - panel = this.createObject ("PanelAssets", "panel", 10); - layoutChildren (); + panel = this.createObject ("PanelAssets", "panel", 10); + border_mc = createClassObject(mx.skins.RectBorder,"border_mc", getNextHighestDepth()); //make sure this is the last + layoutChildren(); } /** @@ -68,7 +123,14 @@ panel._xscale = 100; //__width and __height is set in UIObject on resizes n stuff panel.background_mc._width = __width; - panel.background_mc._height = __height; + panel.background_mc._height = __height; + + border_mc.setSize(__width, __height); + + border_mc.setStyle("borderStyle",__borderType); + + + /* panel.borderTop_mc._width = __width; panel.borderBottom_mc._width = __width; panel.borderBottom_mc._y = __height; @@ -78,43 +140,17 @@ //trace ('width:' + width); //trace ('__width :' + __width); //trace ('height:' + height); - //trace ('__height:' + __height); + //trace ('__height:' + __height); + */ } - /** - * The draw method is invoked after the component has - * been invalidated, by someone calling invalidate(). - * This is better than redrawing from within the set function - * for value, because if there are other properties, it's - * better to batch up the changes into one redraw, rather - * than doing them all individually. This approach leads - * to more efficiency and better centralization of code. - * - * Here we just call layout children and the super - * - */ - function draw () : Void - { - //trace ('panel.draw()'); - super.draw (); - layoutChildren (); - } - /** - * Overrides the function in UIObject. - * Calls invalidate, which will call draw() one frame - * later and therefore will call layoutChildren - * - to hanlde the size... - */ - public function size (Void) : Void - { - //trace ('Panel.size()'); - invalidate (); - } /* * These are not used, but I have left them her so we know how - * to do inspectable properties, as that bit worked! + * to do inspectable properties, as that bit worked! + * + * public function getWidth(Void):Number{ return __width; } @@ -123,7 +159,7 @@ } - //[Inspectable(defaultValue=550)] + [Inspectable(defaultValue=550)] function set width(w:Number):Void{ trace('set width w:'+w); setWidth(w); @@ -135,7 +171,7 @@ } - //[Inspectable(defaultValue=40)] + [Inspectable(defaultValue=40)] function set height(h:Number):Void{ trace('set height:'+h); setHeight(h);