flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Modifications to support better basic styling via CSS. Extracted JS element-construction code from the Spinner main strand and moved into the SpinnerView bead, adding new SpinnerButton for styling control.
Date Fri, 24 Jun 2016 19:24:04 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 3382138b2 -> 7bd1f43ed


Modifications to support better basic styling via CSS. Extracted JS element-construction code
from the Spinner main strand and moved into the SpinnerView bead, adding new SpinnerButton
for styling control.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7bd1f43e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7bd1f43e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7bd1f43e

Branch: refs/heads/develop
Commit: 7bd1f43edb70a59d160b82da875c62040c6fd3bd
Parents: 3382138
Author: Peter Ent <pent@apache.org>
Authored: Fri Jun 24 15:22:12 2016 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Fri Jun 24 15:22:12 2016 -0400

----------------------------------------------------------------------
 .../projects/HTML/src/main/flex/HTMLClasses.as  |   2 +-
 .../flex/org/apache/flex/html/NumericStepper.as |  60 ++++------
 .../main/flex/org/apache/flex/html/Spinner.as   |  55 +++-------
 .../apache/flex/html/beads/DateChooserView.as   |   6 +
 .../org/apache/flex/html/beads/ISpinnerView.as  |  18 ++-
 .../org/apache/flex/html/beads/SpinnerView.as   | 109 +++++++++++++------
 .../beads/controllers/SpinnerMouseController.as |  51 +++++----
 .../flex/html/supportClasses/SpinnerButton.as   |  31 ++++++
 .../HTML/src/main/resources/defaults.css        |   2 +-
 9 files changed, 195 insertions(+), 139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
index 76481bd..c31d79c 100644
--- a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
+++ b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
@@ -76,10 +76,10 @@ internal class HTMLClasses
 	}
 	import org.apache.flex.html.beads.SliderThumbView; SliderThumbView;
 	import org.apache.flex.html.beads.SliderTrackView; SliderTrackView;
+	import org.apache.flex.html.beads.SpinnerView; SpinnerView;
 	COMPILE::SWF
 	{
 		import org.apache.flex.html.beads.SolidBackgroundBead; SolidBackgroundBead;
-	    import org.apache.flex.html.beads.SpinnerView; SpinnerView;
     	import org.apache.flex.html.beads.TextButtonMeasurementBead; TextButtonMeasurementBead;
 		import org.apache.flex.html.beads.TextFieldLabelMeasurementBead; TextFieldLabelMeasurementBead;
     	import org.apache.flex.html.beads.TextAreaView; TextAreaView;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
index 02120e7..e919295 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
@@ -23,20 +23,20 @@ package org.apache.flex.html
     COMPILE::JS
     {
         import goog.events;
-        import org.apache.flex.core.WrappedHTMLElement;            
+        import org.apache.flex.core.WrappedHTMLElement;
     }
 
 	[Event(name="valueChange", type="org.apache.flex.events.Event")]
-	
+
 	/**
 	 *  The NumericStepper class is a component that displays a numeric
-	 *  value and up/down controls (using a org.apache.flex.html.Spinner) to 
+	 *  value and up/down controls (using a org.apache.flex.html.Spinner) to
 	 *  increase and decrease the value by specific amounts. The NumericStepper uses the following
beads:
-	 * 
+	 *
 	 *  org.apache.flex.core.IBeadModel: the data model for the component of type org.apache.flex.core.IRangeModel.
 	 *  org.apache.flex.core.IBeadView: constructs the parts of the component.
 	 *  org.apache.flex.core.IBeadController: handles the input events.
-	 *  
+	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
@@ -56,7 +56,7 @@ package org.apache.flex.html
 		{
 			super();
 		}
-		
+
         [Bindable("valueChange")]
 		/**
 		 *  The current value of the control.
@@ -74,7 +74,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).value = newValue;
 		}
-		
+
 		/**
 		 *  The minimum value the control will display.
 		 *
@@ -91,7 +91,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).minimum = value;
 		}
-		
+
 		/**
 		 *  The maximum value the control will display.
 		 *
@@ -108,7 +108,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).maximum = value;
 		}
-		
+
 		/**
 		 *  The amount to increase or descrease the value. The value
 		 *  will not exceed the minimum or maximum value. The final
@@ -127,7 +127,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).stepSize = value;
 		}
-		
+
 		/**
 		 *  The modulus for the value. If this property is set,
 		 *  the value displayed with a muliple of the snapInterval.
@@ -145,13 +145,13 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).snapInterval = value;
 		}
-        
+
         COMPILE::JS
         private var input:TextInput;
-        
+
         COMPILE::JS
         private var spinner:Spinner;
-        
+
         /**
          * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
          */
@@ -161,41 +161,29 @@ package org.apache.flex.html
             element = document.createElement('div') as WrappedHTMLElement;
             positioner = element;
             positioner.style.position = 'relative';
-            
+
             input = new TextInput();
+            input.className = "NumericStepperInput";
+            input.typeNames = "NumericStepperInput";
             addElement(input);
             input.positioner.style.display = 'inline-block';
             input.positioner.style.width = '100px';
-            
+
             spinner = new Spinner();
-            spinner.positioner.style.display = 'inline-block';
-            spinner.positioner.style.height = '24px';
-            spinner.positioner.style.marginLeft = '-1px';
-            spinner.positioner.style.marginTop = '-1px';
             addElement(spinner);
-            
+
             /* TODO: ajh move to view and css */
-            spinner.incrementButton.positioner.style.display = 'block';
-            spinner.incrementButton.positioner.style.marginBottom = '-1px';
-            spinner.incrementButton.positioner.style.paddingTop = '1.5px';
-            spinner.incrementButton.positioner.style.paddingBottom = '2px';
-            spinner.incrementButton.positioner.style.fontSize = '7px';
-            spinner.decrementButton.positioner.style.marginTop = '0px';
-            spinner.decrementButton.positioner.style.display = 'block';
-            spinner.decrementButton.positioner.style.paddingTop = '2px';
-            spinner.decrementButton.positioner.style.paddingBottom = '1.5px';
-            spinner.decrementButton.positioner.style.fontSize = '7px';
             spinner.positioner.style.display = 'inline-block';
             goog.events.listen(spinner, 'valueChange',
                 spinnerChange);
-            
+
             element.flexjs_wrapper = this;
             className = 'NumericStepper';
-            
+
             input.text = String(spinner.value);
-            
+
             return element;
-        }        
+        }
 
         /**
          * @param event The input event.
@@ -208,7 +196,7 @@ package org.apache.flex.html
             input.text = String(spinner.value);
             dispatchEvent(new Event('valueChange'));
         };
-        
-        
+
+
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as
index c6ef625..65b5290 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as
@@ -20,23 +20,23 @@ package org.apache.flex.html
 {
 	import org.apache.flex.core.IRangeModel;
 	import org.apache.flex.core.UIBase;
+
     COMPILE::JS
     {
-        import org.apache.flex.html.beads.controllers.SpinnerMouseController;
-        import org.apache.flex.core.WrappedHTMLElement;            
+        import org.apache.flex.core.WrappedHTMLElement;
     }
-	
+
 	[Event(name="valueChange", type="org.apache.flex.events.Event")]
-	
+
 	/**
 	 *  The Spinner class is a component that displays a control for incrementing a value
-	 *  and a control for decrementing a value. The org.apache.flex.html.NumericStepper 
+	 *  and a control for decrementing a value. The org.apache.flex.html.NumericStepper
 	 *  uses a Spinner as part of the component. Spinner uses the following beads:
-	 * 
+	 *
 	 *  org.apache.flex.core.IBeadModel: an IRangeModel to hold the properties.
 	 *  org.apache.flex.core.IBeadView:  the bead that constructs the visual parts of the Spinner.
 	 *  org.apache.flex.core.IBeadController: a bead that handles the input events.
-	 *  
+	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
@@ -55,10 +55,10 @@ package org.apache.flex.html
 		public function Spinner()
 		{
 			super();
-			
+
 			className = "Spinner";
 		}
-		
+
 		/**
 		 *  The current value of the Spinner.
 		 *
@@ -75,7 +75,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).value = newValue;
 		}
-		
+
 		/**
 		 *  The minimum value of the Spinner.
 		 *
@@ -92,7 +92,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).minimum = value;
 		}
-		
+
 		/**
 		 *  The maximum value of the Spinner.
 		 *
@@ -109,7 +109,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).maximum = value;
 		}
-		
+
 		/**
 		 *  The modulus for the value. If this property is set,
 		 *  the value displayed with a muliple of the snapInterval.
@@ -127,7 +127,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).snapInterval = value;
 		}
-		
+
 		/**
 		 *  The amount to increase or descrease the value. The value
 		 *  will not exceed the minimum or maximum value. The final
@@ -146,16 +146,7 @@ package org.apache.flex.html
 		{
 			IRangeModel(model).stepSize = value;
 		}
-		
-        COMPILE::JS
-        public var incrementButton:TextButton;
-        
-        COMPILE::JS
-        public var decrementButton:TextButton;
-        
-        COMPILE::JS
-        private var controller:SpinnerMouseController;
-        
+
         /**
          * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
          */
@@ -165,23 +156,11 @@ package org.apache.flex.html
             element = document.createElement('div') as WrappedHTMLElement;
             positioner = element;
             positioner.style.position = 'relative';
-            
+
             element.style.verticalAlign = 'middle';
-            
-            incrementButton = new TextButton();
-            incrementButton.text = '\u25B2';
-            addElement(incrementButton);
-            
-            decrementButton = new TextButton();
-            decrementButton.text = '\u25BC';
-            addElement(decrementButton);
-            
-            controller = new SpinnerMouseController();
-            addBead(controller);
-            
             element.flexjs_wrapper = this;
-            
+
             return element;
-        }        
+        }
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
index b3eac7f..0af846a 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
@@ -23,6 +23,7 @@ package org.apache.flex.html.beads
 	import org.apache.flex.html.supportClasses.DateHeaderButton;
 
     import org.apache.flex.core.BeadViewBase;
+	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IBeadModel;
 	import org.apache.flex.core.IBeadView;
 	import org.apache.flex.core.IStrand;
@@ -65,6 +66,11 @@ package org.apache.flex.html.beads
 		override public function set strand(value:IStrand):void
 		{
 			super.strand = value;
+			
+			COMPILE::SWF {
+				value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
+				value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
+			}
 
 			// make sure there is a model.
 			model = _strand.getBeadByType(IBeadModel) as DateChooserModel;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
index b6b148a..e786db4 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
@@ -20,15 +20,19 @@ package org.apache.flex.html.beads
 {
     COMPILE::SWF
     {
-        import flash.display.DisplayObject;            
+        import flash.display.DisplayObject;
     }
-	
+    COMPILE::JS
+    {
+    	import org.apache.flex.html.supportClasses.SpinnerButton;
+    }
+
 	import org.apache.flex.core.IBead;
-	
+
 	/**
 	 *  The ISpinnerView interface provides the protocol for any bead that
 	 *  creates the visual parts for a org.apache.flex.html.Spinner control.
-	 *  
+	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
@@ -46,7 +50,9 @@ package org.apache.flex.html.beads
 		 */
         COMPILE::SWF
 		function get increment():DisplayObject;
-		
+		COMPILE::JS
+		function get increment():SpinnerButton;
+
 		/**
 		 *  The component used to decrement the org.apache.flex.html.Spinner value.
 		 *
@@ -57,5 +63,7 @@ package org.apache.flex.html.beads
 		 */
         COMPILE::SWF
 		function get decrement():DisplayObject;
+		COMPILE::JS
+		function get decrement():SpinnerButton;
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
index 44d3da8..ecb2502 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
@@ -18,8 +18,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.beads
 {
+COMPILE::SWF {
 	import flash.display.DisplayObject;
-	
+}
+
     import org.apache.flex.core.BeadViewBase;
 	import org.apache.flex.core.IBeadModel;
 	import org.apache.flex.core.IBeadView;
@@ -30,11 +32,16 @@ package org.apache.flex.html.beads
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.html.Button;
 	import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
-	
+
+COMPILE::JS {
+	import org.apache.flex.html.beads.controllers.SpinnerMouseController;
+    import org.apache.flex.html.supportClasses.SpinnerButton;
+}
+
 	/**
-	 *  The SpinnerView class creates the visual elements of the org.apache.flex.html.Spinner

+	 *  The SpinnerView class creates the visual elements of the org.apache.flex.html.Spinner
 	 *  component.
-	 *  
+	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
@@ -53,12 +60,23 @@ package org.apache.flex.html.beads
 		public function SpinnerView()
 		{
 		}
-		
+
 		private var rangeModel:IRangeModel;
-		
+
+		COMPILE::JS {
+		public var _increment:SpinnerButton;
+        public var _decrement:SpinnerButton;
+        private var controller:SpinnerMouseController;
+		}
+
+		COMPILE::SWF {
+		private var _decrement:DisplayObject;
+		private var _increment:DisplayObject;
+		}
+
 		/**
 		 *  @copy org.apache.flex.core.IBead#strand
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
@@ -67,30 +85,44 @@ package org.apache.flex.html.beads
 		override public function set strand(value:IStrand):void
 		{
 			super.strand = value;
-            
-			_increment = new Button();
-			Button(_increment).addBead(new UpArrowButtonView());
-			Button(_increment).addBead(new ButtonAutoRepeatController());
-			_decrement = new Button();
-			Button(_decrement).addBead(new DownArrowButtonView());
-			Button(_decrement).addBead(new ButtonAutoRepeatController());
-						
-			Button(_increment).x = 0;
-			Button(_increment).y = 0;
-			Button(_decrement).x = 0;
-			Button(_decrement).y = Button(_increment).height;
-			
-			UIBase(_strand).addChild(_decrement);
-			UIBase(_strand).addChild(_increment);
-			rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
-			
-			IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
-			IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+
+            COMPILE::SWF {
+				_increment = new Button();
+				Button(_increment).addBead(new UpArrowButtonView());
+				Button(_increment).addBead(new ButtonAutoRepeatController());
+				_decrement = new Button();
+				Button(_decrement).addBead(new DownArrowButtonView());
+				Button(_decrement).addBead(new ButtonAutoRepeatController());
+
+				Button(_increment).x = 0;
+				Button(_increment).y = 0;
+				Button(_decrement).x = 0;
+				Button(_decrement).y = Button(_increment).height;
+
+				UIBase(_strand).addChild(_decrement);
+				UIBase(_strand).addChild(_increment);
+				rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
+
+				IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
+				IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+			}
+			COMPILE::JS {
+				var host:UIBase = value as UIBase;
+
+				_increment = new SpinnerButton();
+				_increment.text = '\u25B2';
+				host.addElement(_increment);
+
+				_decrement = new SpinnerButton();
+				_decrement.text = '\u25BC';
+				host.addElement(_decrement);
+
+// add this in CSS!
+				controller = new SpinnerMouseController();
+				host.addBead(controller);
+			}
 		}
-		
-		private var _decrement:DisplayObject;
-		private var _increment:DisplayObject;
-		
+
 		/**
 		 *  The component for decrementing the org.apache.flex.html.Spinner value.
 		 *
@@ -99,11 +131,17 @@ package org.apache.flex.html.beads
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
+		COMPILE::SWF
 		public function get decrement():DisplayObject
 		{
 			return _decrement;
 		}
-		
+		COMPILE::JS
+		public function get decrement():SpinnerButton
+		{
+			return _decrement;
+		}
+
 		/**
 		 *  The component for incrementing the org.apache.flex.html.Spinner value.
 		 *
@@ -112,14 +150,21 @@ package org.apache.flex.html.beads
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
+		COMPILE::SWF
 		public function get increment():DisplayObject
 		{
 			return _increment;
 		}
-		
+		COMPILE::JS
+		public function get increment():SpinnerButton
+		{
+			return _increment;
+		}
+
 		/**
 		 * @private
 		 */
+		COMPILE::SWF
 		private function sizeChangeHandler( event:Event ) : void
 		{
             var w:Number = UIBase(_strand).width;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
index 8303e12..2a898d8 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
@@ -30,15 +30,16 @@ package org.apache.flex.html.beads.controllers
     COMPILE::JS
     {
         import org.apache.flex.html.Spinner;
+        import org.apache.flex.html.supportClasses.SpinnerButton;
         import goog.events;
         import goog.events.EventType;
     }
-	
+
 	/**
-	 *  The SpinnerMouseController class bead handles mouse events on the 
-	 *  org.apache.flex.html.Spinner's component buttons, changing the 
+	 *  The SpinnerMouseController class bead handles mouse events on the
+	 *  org.apache.flex.html.Spinner's component buttons, changing the
 	 *  value of the Spinner.
-	 *  
+	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
@@ -48,7 +49,7 @@ package org.apache.flex.html.beads.controllers
 	{
 		/**
 		 *  constructor.
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
@@ -57,14 +58,14 @@ package org.apache.flex.html.beads.controllers
 		public function SpinnerMouseController()
 		{
 		}
-		
+
 		private var rangeModel:IRangeModel;
-		
+
 		private var _strand:IStrand;
-		
+
 		/**
 		 *  @copy org.apache.flex.core.IBead#strand
-		 *  
+		 *
 		 *  @flexjsignorecoercion org.apache.flex.html.Spinner
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
@@ -74,51 +75,49 @@ package org.apache.flex.html.beads.controllers
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			
+
 			rangeModel = UIBase(value).model as IRangeModel;
-			
+
             COMPILE::SWF
             {
                 var spinnerBead:ISpinnerView = value.getBeadByType(ISpinnerView) as ISpinnerView;
                 spinnerBead.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);
                 spinnerBead.decrement.addEventListener("buttonRepeat", decrementClickHandler);
                 spinnerBead.increment.addEventListener(MouseEvent.CLICK, incrementClickHandler);
-                spinnerBead.increment.addEventListener("buttonRepeat", incrementClickHandler);
                   
+                spinnerBead.increment.addEventListener("buttonRepeat", incrementClickHandler);
             }
-            
+
             COMPILE::JS
             {
-                var host:Spinner = value as Spinner;
-                incrementButton = host.incrementButton;
-                decrementButton = host.decrementButton;
-                
+            	var spinnerBead:ISpinnerView = value.getBeadByType(ISpinnerView) as ISpinnerView;
+
+                var incrementButton:SpinnerButton = spinnerBead.increment;
+                var decrementButton:SpinnerButton = spinnerBead.decrement;
+
                 goog.events.listen(incrementButton.element, goog.events.EventType.CLICK,
                     incrementClickHandler);
-                
+
                 goog.events.listen(decrementButton.element, goog.events.EventType.CLICK,
                     decrementClickHandler);
 
             }
 		}
-		
-        private var incrementButton:TextButton;
-        private var decrementButton:TextButton;
-        
+
 		/**
 		 * @private
 		 */
-		private function decrementClickHandler( event:Event ) : void
+		private function decrementClickHandler( event:org.apache.flex.events.MouseEvent ) : void
 		{
 			rangeModel.value = Math.max(rangeModel.minimum, rangeModel.value - rangeModel.stepSize);
 			IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
 		}
-		
+
 		/**
 		 * @private
 		 */
-		private function incrementClickHandler( event:Event ) : void
+		private function incrementClickHandler( event:org.apache.flex.events.MouseEvent ) : void
 		{
-			rangeModel.value = Math.min(rangeModel.maximum, rangeModel.value + rangeModel.stepSize);

+			rangeModel.value = Math.min(rangeModel.maximum, rangeModel.value + rangeModel.stepSize);
 			IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
 		}
 	}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as
new file mode 100644
index 0000000..f03b527
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.supportClasses
+{
+	import org.apache.flex.html.TextButton;
+
+	public class SpinnerButton extends TextButton
+	{
+		public function SpinnerButton()
+		{
+			super();
+			className = 'SpinnerButton';
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7bd1f43e/frameworks/projects/HTML/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/defaults.css b/frameworks/projects/HTML/src/main/resources/defaults.css
index ba63d8e..dae3e5a 100644
--- a/frameworks/projects/HTML/src/main/resources/defaults.css
+++ b/frameworks/projects/HTML/src/main/resources/defaults.css
@@ -279,6 +279,7 @@ Slider
 Spinner
 {
     IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
+    IBeadView:  ClassReference("org.apache.flex.html.beads.SpinnerView");
 }
 
 
@@ -579,7 +580,6 @@ Slider
 
 Spinner
 {
-    IBeadView:  ClassReference("org.apache.flex.html.beads.SpinnerView");
     IBeadController: ClassReference("org.apache.flex.html.beads.controllers.SpinnerMouseController");
 }
 


Mime
View raw message