1////////////////////////////////////////////////////////////////////////////////
2//
3//  ADOBE SYSTEMS INCORPORATED
4//  Copyright 2004-2006 Adobe Systems Incorporated
5//  All Rights Reserved.
6//
7//  NOTICE: Adobe permits you to use, modify, and distribute this file
8//  in accordance with the terms of the license agreement accompanying it.
9//
10////////////////////////////////////////////////////////////////////////////////
11
12package haloclassic
13{
14
15import mx.skins.Border;
16import mx.styles.StyleManager;
17import mx.utils.ColorUtil;
18
19/**
20 *  The skin for the track in a Slider.
21 */
22public class SliderTrackSkin extends Border
23{
24	include "../mx/core/Version.as";
25
26	//--------------------------------------------------------------------------
27	//
28	//  Constructor
29	//
30	//--------------------------------------------------------------------------
31
32    /**
33	 *  Constructor.
34	 */
35	public function SliderTrackSkin()
36	{
37		super();
38	}
39
40	//--------------------------------------------------------------------------
41	//
42	//  Overridden properties
43	//
44	//--------------------------------------------------------------------------
45
46	//----------------------------------
47	//  measuredWidth
48	//----------------------------------
49
50	/**
51	 *  The preferred width of this object.
52	 */
53	override public function get measuredWidth():Number
54	{
55		return 200;
56	}
57
58	//----------------------------------
59	//  measuredHeight
60	//----------------------------------
61
62	/**
63	 *  The preferred height of this object.
64	 */
65	override public function get measuredHeight():Number
66	{
67		return 4;
68	}
69
70	//--------------------------------------------------------------------------
71	//
72	//  Overridden methods
73	//
74	//--------------------------------------------------------------------------
75
76    /**
77	 *  @private
78	 */
79	override protected function updateDisplayList(w:Number, h:Number):void
80	{
81		super.updateDisplayList(w, h);
82
83		// User-defined styles.
84		var bevel:Boolean = getStyle("bevel");
85		var borderColor:uint = getStyle("borderColor");
86		var trackColors:Array = getStyle("trackColors");
87		StyleManager.getColorNames(trackColors);
88
89		var borderColorDrk:Number =
90			ColorUtil.adjustBrightness2(borderColor, -50);
91
92		graphics.clear();
93
94		if (bevel)
95		{
96			drawRoundRect(
97				0, 0, w, h, 0,
98				borderColorDrk, 1);
99
100			drawRoundRect(
101				1, 1, w - 1, h - 1, 0,
102				borderColor, 1);
103		}
104		else
105		{
106			drawRoundRect(
107				0, 0, w, h, 0,
108				borderColor, 1);
109		}
110
111		drawRoundRect(
112			1, 1, w - 2, h - 2, 0,
113			trackColors, 1,
114			verticalGradientMatrix(0, 0, w - 2, h - 2));
115	}
116}
117
118}
119