//==================================================================
// Touch Gesture Library (Rotate reverse)
// 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("hand1").pathAttributes.fillColor = white;
		Widget.GetObjectByName("hand1").pathAttributes.brushColor = black;
		Widget.GetObjectByName("hand2").pathAttributes.fillColor = white;
		Widget.GetObjectByName("hand2").pathAttributes.brushColor = black;
		Widget.GetObjectByName("arrow1").pathAttributes.fillColor = black;
		Widget.GetObjectByName("arrow2").pathAttributes.fillColor = black;
		}
		
if (theme == "Dark") {
		Widget.GetObjectByName("hand1").pathAttributes.fillColor = black;
		Widget.GetObjectByName("hand1").pathAttributes.brushColor = white;
		Widget.GetObjectByName("hand2").pathAttributes.fillColor = black;
		Widget.GetObjectByName("hand2").pathAttributes.brushColor = white;
		Widget.GetObjectByName("arrow1").pathAttributes.fillColor = white;
		Widget.GetObjectByName("arrow2").pathAttributes.fillColor = white;
		}

if (values[1].value.toString() == "true") {
		Widget.GetObjectByName("hand1").pathAttributes.brushColor = values[2].value;
		Widget.GetObjectByName("hand2").pathAttributes.brushColor = values[2].value;
		Widget.GetObjectByName("arrow1").pathAttributes.fillColor = values[2].value;
		Widget.GetObjectByName("arrow2").pathAttributes.fillColor = values[2].value;
		}
}

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