<?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 Slider</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Spark%2520Slider/</link><description>Recent changes to Spark Slider</description><atom:link href="https://sourceforge.net/adobe/flexsdk/wiki/Spark%20Slider/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 06 Dec 2012 23:10:39 -0000</lastBuildDate><atom:link href="https://sourceforge.net/adobe/flexsdk/wiki/Spark%20Slider/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Spark Slider modified by SourceForge Editorial Staff</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Spark%2520Slider/</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 @@
 
 ----  
   
-\\
+
 
 ## Summary and Background
 
@@ -351,16 +351,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:10:39 -0000</pubDate><guid>https://sourceforge.netb242e199960778ab5023a9263325e45d1309ed53</guid></item><item><title>WikiPage Spark Slider modified by SourceForge Editorial Staff</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Spark%2520Slider/</link><description>  


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

  


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



# Spark Slider - Functional and Design Specification

----  
  
\\

## Summary and Background

----  
The **SliderBase** class is the base class for Slider controls. It inherits from [TrackBase](Spark%20TrackBase), which contains code common to both Sliders and ScrollBars. SliderBase provides basic functionality for Slider controls such as liveDragging, keyboard handling, track click handling, animation, and dataTips. 

## Usage Scenarios

----

  * Basic one thumb sliders using the default ticks and labels. Developer only has to set a few properties and change the number of thumbs in the skin.
  * Two thumb sliders that select a range instead of a certain value. (B-Feature)
  * Custom sliders with special tracks. Developer subclasses the Slider base class and overrides a few methods. He also must use a custom skin to match the custom slider's behavior. For example, a circular slider or a wavy slider.
  * Multiple thumb sliders. (B-Feature)
  * Basic sliders with customized ticks and/or labels.

## Detailed Description

----

##### SkinParts

Slider consists of 2 SkinParts inherited from TrackBase

  * The [**track**](Spark%20TrackBase%23SkinParts)
  * The [**thumb**](Spark%20TrackBase%23SkinParts)

As well as a new skin part:

  * The **dataTip** is a dynamic skin part and is of type IFactory which is expected to create instances of type `mx.core.IDataRenderer`. It is used to display a formatted version of the value.

##### Inherited Properties

See [Range](Spark%20Range%23Properties).

##### New Properties

  * **liveDragging** - The default is false. When liveDragging is enabled, the thumb's value is committed as it is dragged along the track instead of when the thumb is released.
  * **pendingValue** - This protected property holds the temporary value of the slider during animation and user interaction. It is updated even if liveDragging is false.
  * **showDataTip, dataTipFormatFunction and dataTipPrecision** - These three properties are used to toggle and customize the dataTip.

##### Events

See [Range](Spark%20Range%23Events) and [TrackBase](Spark%20TrackBase%23Events).

##### Track Behavior

Clicking on the track should result in the thumb sliding to that position. The slide lasts for as long as the value of the style, `slideDuration`. If `slideDuration` is 0, then the thumb will snap to that position.

##### Keyboard Behavior

When the thumb has focus:

  * Left/Down Arrow - decreases the value by stepSize.
  * Right/Up Arrow - increase the value by stepSize.
  * Home/End - Change the value to the lowest and highest possible values for the thumb that has focus.

A future consideration is how to easily change the keyboard behavior in subclasses instead of assuming standard behavior based on the values. Consider the case of a reversed HSlider where the max is on the left instead of the right. 

##### Methods

`updateDataTip()` - Subclasses must override this function to position the dataTip.

##### Additional Items to be considered

  * Slider with more than one thumb - (B feature)
  * &lt;del&gt;enableTrack property - enables/disables the track.&lt;/del&gt; (can enable/disable through skin)
  * tickInterval/tickValues - TBD
  * labels - TBD
  * &lt;del&gt;data tips - Implemented&lt;/del&gt;

## API Description

----


    package spark.components.supportClasses
    {
    
    //--------------------------------------
    //  Styles
    //--------------------------------------
    
    include "../../styles/metadata/BasicInheritingTextStyles.as"
    
    /**
     *  The alpha of the focus ring for this component.
     *
     *  @default 0.55
     */
    &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#focusColor
     *
     *  @default 0xFFFFFF
     */ 
    &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;
    
    /**
     *  When &lt;code&gt;true&lt;/code&gt;, the thumb's value is
     *  committed as it is dragged along the track instead
     *  of when the thumb button is released.
     *  
     *  @default true
     */
    &lt;a href="Style%28name%3D%26quot%3BliveDragging%26quot%3B%2C%20type%3D%26quot%3BBoolean%26quot%3B%2C%20inherit%3D%26quot%3Bno%26quot%3B%29"&gt;Style(name="liveDragging", type="Boolean", inherit="no")&lt;/a&gt;
    
    /**
     *  The SliderBase class lets users select a value by moving a slider thumb between 
     *  the end points of the slider track. 
     *  The current value of the slider is determined by the relative location of 
     *  the thumb between the end points of the slider, 
     *  corresponding to the slider's minimum and maximum values.
     *
     *  The SliderBase class is a base class for HSlider and VSlider.
     *
     *  @see spark.components.HSlider
     *  @see spark.components.VSlider
     */
    public class SliderBase extends TrackBase implements IFocusManagerComponent
    {
        include "../../core/Version.as";
    
        //--------------------------------------------------------------------------
        //
        //  Constructor
        //
        //--------------------------------------------------------------------------
    
        /**
         *  Constructor. 
         */
        public function SliderBase():void;
    
        //--------------------------------------------------------------------------
        //
        //  Skin parts
        //
        //--------------------------------------------------------------------------
    
        &lt;a href="SkinPart%28required%3D%26quot%3Bfalse%26quot%3B%2C%20type%3D%26quot%3Bmx.core.IDataRenderer%26quot%3B%29"&gt;SkinPart(required="false", type="mx.core.IDataRenderer")&lt;/a&gt;
        
        /**
         *  A skin part that defines a dataTip that displays a formatted version of 
         *  the current value. The dataTip appears while the thumb is being dragged.
         *  This is a dynamic skin part and must be of type IFactory.
         */
        public var dataTip:IFactory; 
    
        //--------------------------------------------------------------------------
        //
        //  Properties
        //
        //--------------------------------------------------------------------------    
    
        //--------------------------------- 
        //  dataTipformatFunction
        //---------------------------------
    
        /**
         *  Callback function that formats the data tip text.
         *  The function takes a single Number as an argument
         *  and returns a formatted String.
         *
         *  &lt;p&gt;The function has the following signature:&lt;/p&gt;
         *  &lt;pre&gt;
         *  funcName(value:Number):Object
         *  &lt;/pre&gt;
         *
         *  &lt;p&gt;The following example prefixes the data tip text with a dollar sign and 
         *  formats the text using the &lt;code&gt;dataTipPrecision&lt;/code&gt; 
         *  of a SliderBase Control named 'slide': &lt;/p&gt;
         *
         *  &lt;pre&gt;
         *  import mx.formatters.NumberBase;
         *  function myDataTipFormatter(value:Number):Object { 
         *      var dataFormatter:NumberBase = new NumberBase(".", ",", ".", ""); 
         *      return   "$ " + dataFormatter.formatPrecision(String(value), slide.dataTipPrecision); 
         *  }
         *  &lt;/pre&gt;
         *
         *  @default undefined
         */
        public function get dataTipFormatFunction():Function;
        public function set dataTipFormatFunction(value:Function):void;
        
        //--------------------------------- 
        //  dataTipPrecision
        //---------------------------------
    
        /**
         *  Number of decimal places to use for the data tip text.
         *  A value of 0 means to round all values to an integer.
         *  This value is ignored if &lt;code&gt;dataTipFormatFunction&lt;/code&gt; is defined.
         * 
         *  @default 2
         */
        public var dataTipPrecision:int;
        
        //----------------------------------
        //  pendingValue
        //----------------------------------
        
        /**
         *  The value the slider will have when the mouse button is released. This property
         *  also holds the temporary values set during an animation of the thumb if
         *  the &lt;code&gt;liveDragging&lt;/code&gt; style is true; the real value is only set
         *  when the animation ends.
         * 
         *  &lt;p&gt;If the &lt;code&gt;liveDragging&lt;/code&gt; style is false, then the slider's value is only set
         *  when the mouse button is released. The value is not updated while the slider thumb is
         *  being dragged.&lt;/p&gt;
         * 
         *  &lt;p&gt;This property is updated when the slider thumb moves, even if 
         *  &lt;code&gt;liveDragging&lt;/code&gt; is false.&lt;/p&gt;
         *  
         *  @default 0
         *  @return The value implied by the thumb position. 
         */
        protected function get pendingValue():Number;
        protected function set pendingValue(value:Number):void;
        
        //--------------------------------- 
        //  showDataTip
        //---------------------------------
        
        /**
         *  If set to &lt;code&gt;true&lt;/code&gt;, shows a data tip during user interaction
         *  containing the current value of the slider. In addition, the skinPart,
         *  &lt;code&gt;dataTip&lt;/code&gt;, must be defined in the skin in order to 
         *  display a data tip. 
         *  @default true
         */
        public var showDataTip:Boolean;
    
        //--------------------------------------------------------------------------
        //
        // Methods
        //
        //--------------------------------------------------------------------------
    
        /**
         *  Used to position the data tip when it is visible. Subclasses must implement
         *  this function. 
         *  
         *  @param dataTipInstance The &lt;code&gt;dataTip&lt;/code&gt; instance to update and position
         *  @param initialPosition The initial position of the &lt;code&gt;dataTip&lt;/code&gt; in the skin
         */
        protected function updateDataTip(dataTipInstance:IDataRenderer, initialPosition:Point):void
    }
    
    }
    

## B Features

----

## Additional Implementation Details

----  
none

## Prototype Work

----

  * Working prototype of HSlider, CircularSlider

## Compiler Work

----  
none

## Web Tier Compiler Impact

----  
none

## Flex Feature Dependencies

----

  * Depends on Range.

## Backwards Compatibility

----

### Syntax changes

None - New Class

### Behavior

None

### Warnings/Deprecation

None

## Accessibility

----

Support Halo equivalent.

## Performance

----  
none.

## Globalization

----  
none

## Localization

----

### Compiler Features

none.

## QA

----  
Yes. 

----  




&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:59 -0000</pubDate><guid>https://sourceforge.net0e6c3cfa5238561fffe1b275bb8f46eb06b9eeb0</guid></item></channel></rss>