//==================================================================
// Touch Gesture Library (Double Tap)
// Timur Prokopiev 2011
//==================================================================

function setDefaultValues() {
  var values = new Array();
  
// Gesture Theme
  values.push({ name:"Theme", type:"ComboBox", value:"Light,Light,Dark"});

// Enable Colorize
  values.push({ name:"Colorize", type:"Boolean",  value:"false" });

// Button Text Color
  values.push({ name:"Color", type:"color", value:"#FF0000" });

Widget.elem.customData["currentValues"] = values;

}

function applyCurrentValues() {
  var values = Widget.elem.customData["currentValues"];
  var theme  = values[0].value.split(",")[0].toString();
  var colorize = (values[1].value.toString()=="false");

  var black = "#000000";
  var white = "#FFFFFF";

if (theme == "Light") {
		Widget.GetObjectByName("hand").pathAttributes.fillColor = white;
		Widget.GetObjectByName("hand").pathAttributes.brushColor = black;
		Widget.GetObjectByName("circle1").pathAttributes.brushColor = black;
		Widget.GetObjectByName("circle2").pathAttributes.brushColor = black;

		}
		
if (theme == "Dark") {
		Widget.GetObjectByName("hand").pathAttributes.fillColor = black;
		Widget.GetObjectByName("hand").pathAttributes.brushColor = white;
		Widget.GetObjectByName("circle1").pathAttributes.brushColor = white;
		Widget.GetObjectByName("circle2").pathAttributes.brushColor = white;

		}

if (values[1].value.toString() == "true") {
		Widget.GetObjectByName("hand").pathAttributes.brushColor = values[2].value;
		Widget.GetObjectByName("circle1").pathAttributes.brushColor = values[2].value;
		Widget.GetObjectByName("circle2").pathAttributes.brushColor = values[2].value;

		}
}

switch (Widget.opCode)
{
	case 1: setDefaultValues();   break;
	case 2: applyCurrentValues(); break;
}