<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Spark Spinner</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Spark%2520Spinner/</link><description>Recent changes to Spark Spinner</description><atom:link href="https://sourceforge.net/adobe/flexsdk/wiki/Spark%20Spinner/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 06 Dec 2012 23:12:22 -0000</lastBuildDate><atom:link href="https://sourceforge.net/adobe/flexsdk/wiki/Spark%20Spinner/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Spark Spinner modified by SourceForge Editorial Staff</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Spark%2520Spinner/</link><description>&lt;pre&gt;--- v1
+++ v2
@@ -1,12 +1,12 @@
   
 
 
-&lt;div class="section"&gt;
-
-  
-
-
-&lt;div class="column" style="display:inline-block; vertical-align:top; width:80%;"&gt;
+&lt;div class="section" markdown&gt;
+
+  
+
+
+&lt;div class="column" style="display:inline-block; vertical-align:top; width:80%;" markdown&gt;
 
 
 
@@ -14,7 +14,7 @@
 
 ----  
   
-\\
+ 
 
 ## Glossary
 
@@ -340,16 +340,16 @@
 
 
 
-&lt;div class="column" style="display:inline-block; vertical-align:top; ;"&gt;
+&lt;div class="column" style="display:inline-block; vertical-align:top; ;" markdown&gt;
 
   
 [[ include ref='flexsdk_rightnav' ]]  
 
 
-&lt;div class="section"&gt;
-
-  
-[[ include ref='site:open_commentlogin' ]]
+&lt;div class="section" markdown&gt;
+
+  
+
 
 
 &lt;/div&gt;
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SourceForge Editorial Staff</dc:creator><pubDate>Thu, 06 Dec 2012 23:12:22 -0000</pubDate><guid>https://sourceforge.net53592edc396cd05b491070aea3e2f112edd92223</guid></item><item><title>WikiPage Spark Spinner modified by SourceForge Editorial Staff</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Spark%2520Spinner/</link><description>  


&lt;div class="section"&gt;

  


&lt;div class="column" style="display:inline-block; vertical-align:top; width:80%;"&gt;



# Spark Spinner - Functional and Design Specification

----  
  
\\

## Glossary

----

**scale** - See [Range](Spark%20Range%23Glossary)  
**value wrapping** - When the current value is at the maximum, stepping to the next value will set the current value to the minimum and vice versa.

## Summary and Background

----  
This specification describes the proposed new **Spinner** class which extends [Range](Spark%20Range) in Gumbo. 

Spinner extends from [Range](Spark%20Range) and adds two buttons as skin parts that allow someone to step the current value through its scale. [NumericStepper](Spark%20NumericStepper) will extend from Spinner. The primary motivations for adding this new class were:

  1. To allow more generic display components and more complex behavior than the Halo NumericStepper allowed.
  2. To have NumericStepper adhere to accessibility standards.

By having the Spinner class, developers can be more flexible with the types of displays allowed. One can imagine having a Spinner controlling tabs or a menu by assigning different values to tabs or menu items. Also, NumericStepper was the only basic component that did not support accessibility. Spinner remedies this problem by allowing [NumericStepper](Spark%20NumericStepper) to be a spinner with the additional element of a [TextInput](Gumbo%20FxTextInput).

## Usage Scenarios

  * Base class for some Gumbo controls such as [NumericStepper](Spark%20NumericStepper).
  * Base class or separate part for custom controls that utilize selection from an ordered set. Use cases include: 
    1. Modified [NumericStepper](Spark%20NumericStepper) with different input/display
    2. Tabbing control (assign tabs to values)
    3. Mobile menu (assign menu items to values)

## Detailed Description

----

##### Behavior

Spinner controls a value through its two buttons, `incrementButton` and `decrementButton`. These buttons use `stepSize` to increment or decrement the values.

##### SkinParts

Spinner is composed of two skin parts that are buttons: 

  1. **incrementButton** increases the value by `stepSize`, if possible, when pressed.
  2. **decrementButton** decreases the value by `stepSize`, if possible, when pressed.

##### Inherited Properties

`value, minimum, maximum, snapInterval, stepSize` - See [Range](Spark%20Range).

  * Note: Correct behavior is only implemented for stepSize &gt;= 0.

##### New Properties

`allowValueWrap` - enables or disables [value wrapping](%23Glossary). The default is false.

##### Methods

`incrementButton_buttonDownHandler(), decrementButton_buttonDownHandler()` - These protected methods handle the behavior of each button.

`system_mouseWheelHandler()` - Handles mouse wheel events.

##### Events

Whenever the value changes, a `valueCommit` event is dispatched (inherited from [Range](Spark%20Range)). Whenever the value changes because of user interaction, a `change` event is dispatched.

##### Keyboard Behavior

  * Up increments the value
  * Down decrements the value.

\\

## API Description

----


    package spark.components
    {
    
    //--------------------------------------
    //  Styles
    //--------------------------------------
    
    /**
     *  The radius of the corners of this component.
     *
     *  @default 2
     */
    &lt;a href="Style%28name%3D%26quot%3BcornerRadius%26quot%3B%2C%20type%3D%26quot%3BNumber%26quot%3B%2C%20format%3D%26quot%3BLength%26quot%3B%2C%20inherit%3D%26quot%3Bno%26quot%3B%2C%20theme%3D%26quot%3Bspark%26quot%3B%2C%20minValue%3D%26quot%3B0.0%26quot%3B%29"&gt;Style(name="cornerRadius", type="Number", format="Length", inherit="no", theme="spark", minValue="0.0")&lt;/a&gt;
    
    /**
     *  The alpha of the focus ring for this component.
     *
     *  @default 0.5
     */
    &lt;a href="Style%28name%3D%26quot%3BfocusAlpha%26quot%3B%2C%20type%3D%26quot%3BNumber%26quot%3B%2C%20inherit%3D%26quot%3Bno%26quot%3B%2C%20theme%3D%26quot%3Bspark%26quot%3B%2C%20minValue%3D%26quot%3B0.0%26quot%3B%2C%20maxValue%3D%26quot%3B1.0%26quot%3B%29"&gt;Style(name="focusAlpha", type="Number", inherit="no", theme="spark", minValue="0.0", maxValue="1.0")&lt;/a&gt;
    
    /**
     *  @copy spark.components.supportClasses.GroupBase#style:focusColor
     *
     *  @default 0x70B2EE
     */ 
    &lt;a href="Style%28name%3D%26quot%3BfocusColor%26quot%3B%2C%20type%3D%26quot%3Buint%26quot%3B%2C%20format%3D%26quot%3BColor%26quot%3B%2C%20inherit%3D%26quot%3Byes%26quot%3B%2C%20theme%3D%26quot%3Bspark%26quot%3B%29"&gt;Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark")&lt;/a&gt;
    
    /**
     *  @copy spark.components.supportClasses.GroupBase#style:symbolColor
     *
     *  @default 0x000000
     */ 
    &lt;a href="Style%28name%3D%26quot%3BsymbolColor%26quot%3B%2C%20type%3D%26quot%3Buint%26quot%3B%2C%20format%3D%26quot%3BColor%26quot%3B%2C%20inherit%3D%26quot%3Byes%26quot%3B%2C%20theme%3D%26quot%3Bspark%26quot%3B%29"&gt;Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark")&lt;/a&gt;
    
    //--------------------------------------
    //  Events
    //--------------------------------------
    
    /**
     *  Dispatched when the value of the Spinner control changes
     *  as a result of user interaction.
     *
     *  @eventType flash.events.Event.CHANGE
     */
    &lt;a href="Event%28name%3D%26quot%3Bchange%26quot%3B%2C%20type%3D%26quot%3Bflash.events.Event%26quot%3B%29"&gt;Event(name="change", type="flash.events.Event")&lt;/a&gt;
    
    //--------------------------------------
    //  Skin states
    //--------------------------------------
    
    /**
     *  Normal State
     */
    &lt;a href="SkinState%28%26quot%3Bnormal%26quot%3B%29"&gt;SkinState("normal")&lt;/a&gt;
    
    /**
     *  Disabled State
     */
    &lt;a href="SkinState%28%26quot%3Bdisabled%26quot%3B%29"&gt;SkinState("disabled")&lt;/a&gt;
    
    /**
     *  A Spinner component selects a value from an
     *  ordered set. It uses two buttons that increase or
     *  decrease the current value based on the current
     *  value of the &lt;code&gt;stepSize&lt;/code&gt; property.
     *  
     *  &lt;p&gt;A Spinner consists of two required buttons,
     *  one to increase the current value and one to decrease the 
     *  current value. Users can also use the Up Arrow and Down Arrow keys
     *  and the mouse wheel to cycle through the values. 
     *  An input value is committed when the user presses the Enter key,
     *  removes focus from the component, or steps the Spinner 
     *  by pressing an arrow button or by calling the 
     *  &lt;code&gt;changeValueByStep()&lt;/code&gt; method.&lt;/p&gt;
     *
     *  &lt;p&gt;The scale of an Spinner component is the set of 
     *  allowed values for the &lt;code&gt;value&lt;/code&gt; property. 
     *  The allowed values are the sum of the minimum with
     *  integer multiples of the &lt;code&gt;snapInterval&lt;/code&gt; property
     *  which are less than or equal to the &lt;code&gt;maximum&lt;/code&gt;value.
     *  For example:&lt;/p&gt;
     *  
     *  &lt;ul&gt;
     *    &lt;li&gt;&lt;code&gt;minimum&lt;/code&gt; = -1&lt;/li&gt;
     *    &lt;li&gt;&lt;code&gt;maximum&lt;/code&gt; = 10&lt;/li&gt;
     *    &lt;li&gt;&lt;code&gt;snapInterval&lt;/code&gt; = 3&lt;/li&gt;
     *  &lt;/ul&gt;
     *  
     *  Therefore the scale is {-1,2,5,8,10}.
     *
     *  @see spark.components.NumericStepper
     *  @see spark.skins.spark.SpinnerSkin
     */
    public class Spinner extends Range implements IFocusManagerComponent
    {
        include "../core/Version.as";
    
        //--------------------------------------------------------------------------
        //
        //  Constructor
        //
        //--------------------------------------------------------------------------
    
        /**
         *  Constructor. 
         */
        public function Spinner():void;
    
        //--------------------------------------------------------------------------
        //
        // SkinParts
        //
        //--------------------------------------------------------------------------
        
        //----------------------------------
        //  decrementButton
        //----------------------------------
    
        &lt;a href="SkinPart%28required%3D%26quot%3Bfalse%26quot%3B%29"&gt;SkinPart(required="false")&lt;/a&gt;
        
        /**
         *  A skin part that defines the  button that, 
         *  when pressed, decrements the &lt;code&gt;value&lt;/code&gt; property
         *  by &lt;code&gt;stepSize&lt;/code&gt;.
         */
        public var decrementButton:Button;
        
        //----------------------------------
        //  incrementButton
        //----------------------------------
    
        &lt;a href="SkinPart%28required%3D%26quot%3Bfalse%26quot%3B%29"&gt;SkinPart(required="false")&lt;/a&gt;
        
        /**
         *  A skin part that defines the  button that, 
         *  when pressed, increments the &lt;code&gt;value&lt;/code&gt; property
         *  by &lt;code&gt;stepSize&lt;/code&gt;.
         */
        public var incrementButton:Button;
    
        //--------------------------------------------------------------------------
        //
        // Properties
        //
        //--------------------------------------------------------------------------
    
        //----------------------------------
        //  valueWrap
        //----------------------------------
    
        /**
         *  Determines the behavior of the control for a step when the current 
         *  &lt;code&gt;value&lt;/code&gt; is either the &lt;code&gt;maximum&lt;/code&gt; 
         *  or &lt;code&gt;minimum&lt;/code&gt; value.  
         *  If &lt;code&gt;allowValueWrap&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;, then the 
         *  &lt;code&gt;value&lt;/code&gt; property wraps from the &lt;code&gt;maximum&lt;/code&gt; 
         *  to the &lt;code&gt;minimum&lt;/code&gt; value, or from 
         *  the &lt;code&gt;minimum&lt;/code&gt; to the &lt;code&gt;maximum&lt;/code&gt; value.
         * 
         *  @default false
         */
        public function get allowValueWrap():Boolean;
        public function set allowValueWrap(value:Boolean):void;
        
        //--------------------------------------------------------------------------
        // 
        //  Event handlers
        //
        //--------------------------------------------------------------------------
           
        /**
         *  Handle a click on the incrementButton. This should
         *  increment &lt;code&gt;value&lt;/code&gt; by &lt;code&gt;stepSize&lt;/code&gt;.
         */
        protected function incrementButton_buttonDownHandler(event:Event):void;
        
        /**
         *  Handle a click on the decrementButton. This should
         *  decrement &lt;code&gt;value&lt;/code&gt; by &lt;code&gt;stepSize&lt;/code&gt;.
         */
        protected function decrementButton_buttonDownHandler(event:Event):void;
    
        /**
         *  Handles the &lt;code&gt;mouseWheel&lt;/code&gt; event
         *  when the component is in focus.
         *  The spinner is moved by the amount of the mouse event delta
         *  multiplied by the &lt;code&gt;stepSize&lt;/code&gt;.  
         */ 
        protected function system_mouseWheelHandler(event:MouseEvent):void;
    
    }
    
    }
    

## B Features

----  
none so far

## Additional Implementation Details

----  
none

## Prototype Work

----  
Prototype of Spinner has shown that it can be a very lightweight base class for [NumericStepper](Spark%20NumericStepper) and other custom controls.

## Compiler Work

----  
none

## Web Tier Compiler Impact

----  
none

## Flex Feature Dependencies

----  
Spinner depends on [Range](Spark%20Range) as its base class.

## Backwards Compatibility

----

### Syntax changes

None - New Class

## Accessibility

----  
Provides accessibility for NumericStepper and similar controls.

## Issues and Recommendations

----

  1. Should there be more descriptive events? For distinguishing between keyboard and mouse?

----  




&lt;div class="column" style="display:inline-block; vertical-align:top; ;"&gt;

  
[[ include ref='flexsdk_rightnav' ]]  


&lt;div class="section"&gt;

  
[[ include ref='site:open_commentlogin' ]]


&lt;/div&gt;



&lt;/div&gt;



&lt;/div&gt;



&lt;/div&gt;

</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SourceForge Editorial Staff</dc:creator><pubDate>Thu, 15 Mar 2012 18:12:46 -0000</pubDate><guid>https://sourceforge.net6d85e2ac7a8f9a40a021547fa8b6e50f0f476340</guid></item></channel></rss>