Exemplo n.º 1
0
 private static void adjustWidth(UIBase ctrl, FairyGUI.GList g)
 {
     try
     {
         var width          = ctrl.gObject.width;
         var containerWidth = g.viewWidth;
         var itemWidth      = containerWidth / g.numItems;
         for (int i = 0; i < g.numItems; i++)
         {
             g.GetChildAt(i).width = itemWidth;
         }
     }
     catch (System.NullReferenceException e)
     {
     }
 }
Exemplo n.º 2
0
        static StackObject *get_numItems_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            FairyGUI.GList instance_of_this_method = (FairyGUI.GList) typeof(FairyGUI.GList).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.numItems;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
Exemplo n.º 3
0
        static StackObject *set_numItems_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @value = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            FairyGUI.GList instance_of_this_method = (FairyGUI.GList) typeof(FairyGUI.GList).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.numItems = value;

            return(__ret);
        }
Exemplo n.º 4
0
        static StackObject *set_layout_15(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            FairyGUI.ListLayoutType @value = (FairyGUI.ListLayoutType) typeof(FairyGUI.ListLayoutType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 20);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            FairyGUI.GList instance_of_this_method = (FairyGUI.GList) typeof(FairyGUI.GList).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.layout = value;

            return(__ret);
        }
Exemplo n.º 5
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 2 && translator.Assignable <FairyGUI.GList>(L, 2))
                {
                    FairyGUI.GList _list = (FairyGUI.GList)translator.GetObject(L, 2, typeof(FairyGUI.GList));

                    FairyGUI.TreeView gen_ret = new FairyGUI.TreeView(_list);
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to FairyGUI.TreeView constructor!"));
        }
Exemplo n.º 6
0
        static StackObject *ChildIndexToItemIndex_13(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @index = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            FairyGUI.GList instance_of_this_method = (FairyGUI.GList) typeof(FairyGUI.GList).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.ChildIndexToItemIndex(@index);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
Exemplo n.º 7
0
        static StackObject *ScrollToView_10(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @ani = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @index = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            FairyGUI.GList instance_of_this_method = (FairyGUI.GList) typeof(FairyGUI.GList).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.ScrollToView(@index, @ani);

            return(__ret);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 同步创建Fairygui对象
        /// </summary>
        /// <param name="type"></param>
        /// <param name="createObjectCallback">回调</param>
        /// <param name="list">列表容器</param>
        public void CreateInstanceSync(System.Type type, FairyGUI.UIPackage.CreateObjectCallback createObjectCallback, bool fromPool = false, FairyGUI.GList list = null)
        {
#if _CREATE_INSTANCE
            var createInstanceAsyncMethod = type.GetMethod("CreateInstance", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
            createInstanceAsyncMethod.Invoke(null, new object[] {
                createObjectCallback
            });
#else
            var pakAtt           = GetPakIDAttFromType(type);
            var packageName      = pakAtt.Name;
            var itemName         = type.Name;
            FairyGUI.GObject obj = null;
#if _CREATE_LISTITEM_FROMPOOL_
            if (fromPool && list != null)
            {
                string url = string.Concat("ui://", packageName, "/", itemName);
                obj = list.itemPool.GetObject(url);
                createObjectCallback(obj);
            }
            else
            {
                obj = FairyGUI.UIPackage.CreateObject(packageName, itemName);
                createObjectCallback(obj);
            }
#else
            obj = FairyGUI.UIPackage.CreateObject(packageName, itemName);
            createObjectCallback(obj);
#endif
#endif
        }
Exemplo n.º 9
0
 public GListSub(UIBase uiBase, FairyGUI.GObject o)
 {
     this.uiBase  = uiBase;
     this.gObject = o as FairyGUI.GList;
 }