AddChildAt() public method

public AddChildAt ( GObject child, int index ) : GObject
child GObject
index int
return GObject
Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="caption"></param>
        /// <param name="index"></param>
        /// <param name="callback"></param>
        /// <returns></returns>
        public GButton AddItemAt(string caption, int index, EventCallback1 callback)
        {
            GButton item = CreateItem(caption, callback);

            _list.AddChildAt(item, index);

            return(item);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="caption"></param>
        /// <param name="index"></param>
        /// <param name="callback"></param>
        /// <returns></returns>
        public GButton AddItemAt(string caption, int index, EventCallback0 callback)
        {
            GObject obj = _list.GetFromPool(_list.defaultItem);

            _list.AddChildAt(obj, index);

            GButton item = (GButton)obj;

            item.title  = caption;
            item.data   = callback;
            item.grayed = false;
            Controller c = item.GetController("checked");

            if (c != null)
            {
                c.selectedIndex = 0;
            }

            return(item);
        }
Exemplo n.º 3
0
 static public int AddChildAt(IntPtr l)
 {
     try {
         FairyGUI.GList   self = (FairyGUI.GList)checkSelf(l);
         FairyGUI.GObject a1;
         checkType(l, 2, out a1);
         System.Int32 a2;
         checkType(l, 3, out a2);
         var ret = self.AddChildAt(a1, a2);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int AddChildAt(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         FairyGUI.GList   obj  = (FairyGUI.GList)ToLua.CheckObject(L, 1, typeof(FairyGUI.GList));
         FairyGUI.GObject arg0 = (FairyGUI.GObject)ToLua.CheckObject(L, 2, typeof(FairyGUI.GObject));
         int arg1           = (int)LuaDLL.luaL_checknumber(L, 3);
         FairyGUI.GObject o = obj.AddChildAt(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }