//==================================================================
// iPhone Keyboard Press
// Timur Prokopiev 2011
//==================================================================

function setDefaultValues() {
  var values = new Array();
  
// Label
  values.push({ name:"Label", type:"text", value:"X"});

// Style
  values.push({ name:"Style", type:"ComboBox", value:"Center,Left,Center,Right"});

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

}

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

  Widget.GetObjectByName("label").textChars = values[0].value;

  Widget.GetObjectByName("center").visible = (style == "Center");
  Widget.GetObjectByName("left").visible = (style == "Right");
  Widget.GetObjectByName("right").visible = (style == "Left");

}

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