Author: aharui
Date: Tue Jan 29 19:07:38 2013
New Revision: 1440064

URL: http://svn.apache.org/viewvc?rev=1440064&view=rev
Log:
Buttons should resize without scaling by default.

Modified:
    
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
    
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/TextButton.as
    
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IButtonBead.as

Modified: 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
URL: 
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/Button.as?rev=1440064&r1=1440063&r2=1440064&view=diff
==============================================================================
--- 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
 (original)
+++ 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
 Tue Jan 29 19:07:38 2013
@@ -20,12 +20,15 @@ package org.apache.flex.html.staticContr
 {
        import flash.display.DisplayObject;
        import flash.display.SimpleButton;
+       import flash.events.Event;
        
        import org.apache.flex.core.IBead;
        import org.apache.flex.core.IBeadModel;
+       import org.apache.flex.core.IInitModel;
+       import org.apache.flex.core.IInitSkin;
        import org.apache.flex.core.IStrand;
        
-       public class Button extends SimpleButton implements IStrand
+       public class Button extends SimpleButton implements IStrand, IInitSkin, 
IInitModel
        {
                public function Button(upState:DisplayObject=null, 
overState:DisplayObject=null, downState:DisplayObject=null, 
hitTestState:DisplayObject=null)
                {
@@ -34,6 +37,42 @@ package org.apache.flex.html.staticContr
                        // mouseEnabled = true;
                }
                
+               private var _width:Number;
+               override public function get width():Number
+               {
+                       return _width;
+               }
+               override public function set width(value:Number):void
+               {
+                       if (_width != value)
+                       {
+                               _width = value;
+                               dispatchEvent(new Event("widthChanged"));
+                       }
+               }
+               protected function get $width():Number
+               {
+                       return super.width;
+               }
+               
+               private var _height:Number;
+               override public function get height():Number
+               {
+                       return _height;
+               }
+               override public function set height(value:Number):void
+               {
+                       if (_height != value)
+                       {
+                               _height = value;
+                               dispatchEvent(new Event("heightChanged"));
+                       }
+               }
+               protected function get $height():Number
+               {
+                       return super.height;
+               }
+
                private var _model:IBeadModel;
                protected function get model():IBeadModel
                {
@@ -76,5 +115,15 @@ package org.apache.flex.html.staticContr
                        return null;
                }
                
+               public function initModel():void
+               {
+                       
+               }
+               
+               public function initSkin():void
+               {
+                       _width = $width;
+                       _height = $height;
+               }
        }
 }
\ No newline at end of file

Modified: 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/TextButton.as
URL: 
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/TextButton.as?rev=1440064&r1=1440063&r2=1440064&view=diff
==============================================================================
--- 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/TextButton.as
 (original)
+++ 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/TextButton.as
 Tue Jan 29 19:07:38 2013
@@ -52,13 +52,13 @@ package org.apache.flex.html.staticContr
                        ITextModel(model).html = value;
                }
 
-               public function initModel():void
+               override public function initModel():void
                {
                        if (getBeadByType(ITextModel) == null)
                                addBead(new 
(ValuesManager.valuesImpl.getValue("ITextModel")) as IBead);
                }
                
-               public function initSkin():void
+               override public function initSkin():void
                {
                        if (getBeadByType(ITextButtonBead) == null)
                                addBead(new 
(ValuesManager.valuesImpl.getValue("ITextButtonBead")) as IBead);               
    

Modified: 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IButtonBead.as
URL: 
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IButtonBead.as?rev=1440064&r1=1440063&r2=1440064&view=diff
==============================================================================
--- 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IButtonBead.as
 (original)
+++ 
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/IButtonBead.as
 Tue Jan 29 19:07:38 2013
@@ -18,9 +18,9 @@
 
////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.staticControls.beads
 {
-       public interface IButtonBead
+       import org.apache.flex.core.IBead;
+
+       public interface IButtonBead extends IBead
        {
-               function get state():String;
-               function set state(value:String):void;
        }
 }
\ No newline at end of file


Reply via email to