<commit_before>package
{
	import org.openPyro.aurora.AuroraScrollBarSkin;
	import org.openPyro.aurora.AuroraSliderSkin;
	import org.openPyro.controls.ScrollBar;
	import org.openPyro.controls.Slider;
	import org.openPyro.core.Direction;
	import org.openPyro.events.PyroEvent;
	import org.openPyro.examples.HaloTrackSkin;
	import org.openPyro.examples.SimpleButtonSkin;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class TestSlider extends Sprite
	{
		
		public function TestSlider()
		{
			
			stage.scaleMode = "noScale";
			stage.align = "TL";
			
			testScrollBarWithAuroraSkin();
			//testSliderWithAuroraSkin();
			stage.addEventListener(Event.RESIZE, onResize)
		}
		
		private function onResize(event:Event):void
		{
			if(scrollBar)
			{
				scrollBar.height = stage.stageHeight/3;
			}
			if(slider)
			{
				slider.height = stage.stageHeight/3
			}
		}
		
		private var scrollBar:ScrollBar
		private function testScrollBarWithAuroraSkin():void
		{
			scrollBar = new ScrollBar(Direction.VERTICAL);
			scrollBar.addEventListener(PyroEvent.UPDATE_COMPLETE, onScrollBarUpdate);
			scrollBar.x = 150
			scrollBar.y = 100
			
			scrollBar.width = 15;
			scrollBar.height = stage.stageHeight/3;
			addChild(scrollBar);
			
			var auroraScrollBarSkin:AuroraScrollBarSkin = new AuroraScrollBarSkin()
			auroraScrollBarSkin.direction = Direction.VERTICAL;
			scrollBar.skin = auroraScrollBarSkin
		}
		
		private function onScrollBarUpdate(event:PyroEvent):void
		{
			trace("-----------------------");
		}
		
		private var slider:Slider
		private function testSliderWithAuroraSkin():void
		{
			slider = new Slider(Direction.VERTICAL);
			addChild(slider);
			
			slider = new Slider(Direction.VERTICAL);
			slider.setSize(15, stage.stageHeight/3);
			
			var sliderSkin:AuroraSliderSkin = new AuroraSliderSkin()
			
			slider.skin = sliderSkin
			slider.x = 50;
			slider.y = 100;
			addChild(slider);
			
			var hSlider:Slider = new Slider(Direction.HORIZONTAL);
			hSlider.width = 300
			hSlider.height = 15;
			
			var hSliderSkin:AuroraSliderSkin = new AuroraSliderSkin()
			hSliderSkin.trackGradientRotation = Math.PI/2
			
			hSlider.skin = hSliderSkin
			
			addChild(hSlider)
			hSlider.x = 100
			hSlider.y = 50;
			
			stage.addEventListener(MouseEvent.CLICK, function():void{
					
			})
			
			
		}
		
		private function testSliderWithExplicitSkins():void
		{
				
			/*
			slider.thumbSkin = new SimpleButtonSkin();
			slider.addEventListener(SliderEvent.THUMB_DRAG, onThumbDrag)
			slider.trackSkin = new HaloTrackSkin();
			*/
		}
		
		private function testScrollBarWithExplicitSkins():void
		{
			
			var scrollBar:ScrollBar = new ScrollBar(Direction.VERTICAL);
			scrollBar.x = 100
			scrollBar.y = 100
			
			scrollBar.width = 15;
			scrollBar.height = 300;
			addChild(scrollBar);
			
			scrollBar.slider.trackSkin = new HaloTrackSkin()
			scrollBar.slider.thumbSkin = new SimpleButtonSkin()
			scrollBar.incrementButtonSkin = new SimpleButtonSkin()
			scrollBar.decrementButtonSkin = new SimpleButtonSkin();
			
		}
		
		private function onThumbDrag(event:Event):void{
			//trace(this,'-->'+slider.value)
		}

	}
}<commit_msg>Added a UI test in TestSlider to validate Slider thumb not showing up based on when addChild was being called (http://github.com/arpit/openpyro/issues/#issue/1)<commit_after>package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import org.openPyro.aurora.AuroraScrollBarSkin;
	import org.openPyro.aurora.AuroraSliderSkin;
	import org.openPyro.controls.ScrollBar;
	import org.openPyro.controls.Slider;
	import org.openPyro.core.Direction;
	import org.openPyro.core.UIContainer;
	import org.openPyro.events.PyroEvent;
	import org.openPyro.examples.HaloTrackSkin;
	import org.openPyro.examples.SimpleButtonSkin;
	import org.openPyro.layout.VLayout;
	import org.openPyro.painters.FillPainter;
	
	public class TestSlider extends Sprite
	{
		
		public function TestSlider()
		{
			
			stage.scaleMode = "noScale";
			stage.align = "TL";
			
			//testScrollBarWithAuroraSkin();
			//testSliderWithAuroraSkin();
			testSliderBug();
			//stage.addEventListener(Event.RESIZE, onResize)
		}
		
		private function testSliderBug():void{
			
			var container = new UIContainer();
			container.setSize(585, 700);
			container.layout = new VLayout(10);
			
			container.backgroundPainter = new FillPainter(0xcccccc);
			
			var redMultiplier = new Slider(Direction.HORIZONTAL);
			redMultiplier.percentWidth = 90;
			redMultiplier.height = 15;
			redMultiplier.minimum = 0;
			redMultiplier.maximum = 4;
			redMultiplier.skin = new AuroraSliderSkin();
			redMultiplier.thumbButtonWidth = 10;
			container.addChild(redMultiplier);
			redMultiplier.value = 1;
			
			var greenMultiplier = new Slider(Direction.HORIZONTAL);
			greenMultiplier.percentWidth = 90;
			greenMultiplier.height = 15;
			greenMultiplier.minimum = 0;
			greenMultiplier.maximum = 4;
			greenMultiplier.skin = new AuroraSliderSkin();
			greenMultiplier.thumbButtonWidth = 10;
			greenMultiplier.value = 1;
			container.addChild(greenMultiplier);
			
			addChild(container);
		}
		
		private function onResize(event:Event):void
		{
			if(scrollBar)
			{
				scrollBar.height = stage.stageHeight/3;
			}
			if(slider)
			{
				slider.height = stage.stageHeight/3
			}
		}
		
		private var scrollBar:ScrollBar
		private function testScrollBarWithAuroraSkin():void
		{
			scrollBar = new ScrollBar(Direction.VERTICAL);
			scrollBar.addEventListener(PyroEvent.UPDATE_COMPLETE, onScrollBarUpdate);
			scrollBar.x = 150
			scrollBar.y = 100
			
			scrollBar.width = 15;
			scrollBar.height = stage.stageHeight/3;
			addChild(scrollBar);
			
			var auroraScrollBarSkin:AuroraScrollBarSkin = new AuroraScrollBarSkin()
			auroraScrollBarSkin.direction = Direction.VERTICAL;
			scrollBar.skin = auroraScrollBarSkin
		}
		
		private function onScrollBarUpdate(event:PyroEvent):void
		{
			trace("-----------------------");
		}
		
		private var slider:Slider
		private function testSliderWithAuroraSkin():void
		{
			
			var uic:UIContainer = new UIContainer();
			uic.width = 400;
			uic.height = 200;
			uic.backgroundPainter = new FillPainter(0xefefef);
			addChild(uic);
			
			/*
			slider = new Slider(Direction.VERTICAL);
			addChild(slider);
			
			slider.setSize(15, stage.stageHeight/3);
			
			var sliderSkin:AuroraSliderSkin = new AuroraSliderSkin()
			
			slider.skin = sliderSkin
			slider.x = 50;
			slider.y = 100;
			slider.thumbButtonHeight = 20
			
			addChild(slider);
			*/
			
			var hSlider:Slider = new Slider(Direction.HORIZONTAL);
			hSlider.width = 200
			hSlider.height = 15;
			hSlider.thumbButtonWidth = 20;
			
			
			
			uic.addChild(hSlider)
			
			var hSliderSkin:AuroraSliderSkin = new AuroraSliderSkin()
			hSliderSkin.trackGradientRotation = Math.PI/2
			hSlider.skin = hSliderSkin
			
			
			hSlider.x = 50;
			hSlider.y = 50;
			
			stage.addEventListener(MouseEvent.CLICK, function():void{
					
			})
			
			
		}
		
		private function testSliderWithExplicitSkins():void
		{
				
			/*
			slider.thumbSkin = new SimpleButtonSkin();
			slider.addEventListener(SliderEvent.THUMB_DRAG, onThumbDrag)
			slider.trackSkin = new HaloTrackSkin();
			*/
		}
		
		private function testScrollBarWithExplicitSkins():void
		{
			
			var scrollBar:ScrollBar = new ScrollBar(Direction.VERTICAL);
			scrollBar.x = 100
			scrollBar.y = 100
			
			scrollBar.width = 15;
			scrollBar.height = 300;
			addChild(scrollBar);
			
			scrollBar.slider.trackSkin = new HaloTrackSkin()
			scrollBar.slider.thumbSkin = new SimpleButtonSkin()
			scrollBar.incrementButtonSkin = new SimpleButtonSkin()
			scrollBar.decrementButtonSkin = new SimpleButtonSkin();
			
		}
		
		private function onThumbDrag(event:Event):void{
			//trace(this,'-->'+slider.value)
		}

	}
}
{'fraction_non_alphanumeric': 0.10450793650793651, 'fraction_numerical': 0.015238095238095238, 'mean_word_length': 3.5186460126219163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7308994', 'n_tokens_mistral': 3285, 'n_tokens_neox': 2644, 'n_words': 440}