hackedteam/rcs-console

View on GitHub
src/it/ht/rcs/console/operations/view/evidences/actionbar/editors/TagEditor.mxml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx"
         xmlns:utils="it.ht.rcs.console.utils.*"
         horizontalAlign="center"
         gap="1">
  
  <fx:Metadata> 
    [Event(name="change", type="flash.events.Event")]
  </fx:Metadata> 
  
  <fx:Script>
    <![CDATA[

      private var _label:String;
      private var _tag:int;
      
      public function set tag(value:int):void
      {
        _tag=value;
        sliderTag.value=tag;
      }
      
      public function get tag():int
      {
        return _tag;
      }
      
      [Bindable]
      public function set label(value:String):void
      {
         _label=value;
         labelDisplay.text=_label;
      }
 
      public function get label():String
      {
        return _label;
      }

    
      protected function onSliderChange():void
      {
        tag=sliderTag.value;
        dispatchEvent(new Event("change"))
      }
      
     
    ]]>
  </fx:Script>
    <utils:TagImage value="{sliderTag.value}"/>   
    <s:HSlider id="sliderTag" width="30" maximum="4" minimum="0"
               showDataTip="false" changeEnd="onSliderChange()"/>
  
    <s:Label id="labelDisplay"   textAlign="center" paddingTop="2"
             maxDisplayedLines="1" fontFamily="Myriad" fontSize="12"
             horizontalCenter="0" verticalCenter="1" verticalAlign="middle"
             left="10" right="10" top="2" bottom="2"/>
 
</s:VGroup>