Esempio n. 1
0
 function addLabels() {
     $.scroller.add(Ti.UI.createLabel(Alloy.createStyle("index", {
         apiName: "Ti.UI.Label",
         text: "Alloy.createStyle() + Ti.UI.createLabel()"
     })));
     $.scroller.add(Ti.UI.createLabel($.createStyle({
         apiName: "Ti.UI.Label",
         text: "$.createStyle() + Ti.UI.createLabel()"
     })));
     $.scroller.add(Alloy.UI.create("index", "Ti.UI.Label", {
         text: "Alloy.UI.create()"
     }));
     $.scroller.add($.UI.create("Ti.UI.Label", {
         text: "$.UI.create()"
     }));
     $.scroller.add(Alloy.createWidget("alloy.testWidget", "labelmaker").createLabels());
 }
Esempio n. 2
0
			create: function(apiName, opts) {
				return Alloy.UI.create(getControllerParam(), apiName, opts);
			}
Esempio n. 3
0
var Alloy=require("alloy"),Backbone=Alloy.Backbone,_=Alloy._,Controller=function(){function e(){return r.__widgetId?{widgetId:r.__widgetId,name:r.__controllerPath}:r.__controllerPath}var t=[],r=this;this.__iamalloy=!0,_.extend(this,Backbone.Events,{__views:{},__proxyProperties:{},setParent:function(e){var r=t.length;if(r){this.parent=e.__iamalloy?e.parent:e;for(var o=0;r>o;o++)t[o].__iamalloy?t[o].setParent(this.parent):this.parent.add(t[o])}},addTopLevelView:function(e){t.push(e)},addProxyProperty:function(e,t){this.__proxyProperties[e]=t},removeProxyProperty:function(e){delete this.__proxyProperties[e]},getTopLevelViews:function(){return t},getView:function(e){return"undefined"==typeof e||null===e?t[0]:this.__views[e]},removeView:function(e){delete this[e],delete this.__views[e]},getProxyProperty:function(e){return this.__proxyProperties[e]},getViews:function(){return this.__views},destroy:function(){},getViewEx:function(e){var t=e.recurse||!1;if(t){var r=this.getView();return r?r.__iamalloy?r.getViewEx({recurse:!0}):r:null}return this.getView()},getProxyPropertyEx:function(e,t){var r=t.recurse||!1;if(r){var o=this.getProxyProperty(e);return o?o.__iamalloy?o.getProxyProperty(e,{recurse:!0}):o:null}return this.getView(e)},createStyle:function(t){return Alloy.createStyle(e(),t)},UI:{create:function(t,r){return Alloy.UI.create(e(),t,r)}},addClass:function(t,r,o){return Alloy.addClass(e(),t,r,o)},removeClass:function(t,r,o){return Alloy.removeClass(e(),t,r,o)},resetClass:function(t,r,o){return Alloy.resetClass(e(),t,r,o)}})};module.exports=Controller;
Esempio n. 4
0
			create: function(apiName, opts) {
				return Alloy.UI.create(self.__widgetId ? {
					widgetId: self.__widgetId,
					name: self.__controllerPath
				} : self.__controllerPath, apiName, opts);
			}