Ext.define("IceCap.ux.form.label.Label", {
	
	extend: "Ext.form.field.Display",

	alias: [
		"widget.iLabel"
	],

	config: {
		theme: "default"
	},

	focusable: false,

	initComponent: function () {

		var i_self = this;

		var o_config = i_self.initialConfig;

		var s_value = o_config.text;

		if (o_config.ta == "right" && !o_config.off) {
			//o_config.col += o_config.len - o_config.dta.length;
		}

		if (o_config.off) {
			s_value = Ext.String.leftPad(s_value, s_value.length + o_config.off);
		}

		var o_field = {
			value: s_value,
			htmlEncode: true,
			cls: ["icecap-field", i_self.getTheme()].filter(Boolean).join("-")
		};

		var o_style = {
			"font": "normal " + IceCap.util.Handler.getTextSize() + "px Segoe UI,Segoe,DejaVu Sans,Trebuchet MS,Verdana,sans-serif",
			"margin-top": IceCap.util.Handler.getMargin() + "px !important",
			"min-height": "0px !important"
		};

		Ext.apply(o_field, {
			fieldStyle: o_style
		});

		if (o_config.atr == "27") {
			o_field.hidden = true;
		}

		Ext.apply(i_self, o_field);

		i_self.callParent();

		if (o_config.atr == 23) {

			i_self.addCls("icecap-invalid");
		}
	}
});