RemoveChildrenToPool() public method

public RemoveChildrenToPool ( ) : void
return void
Esempio n. 1
0
        void Create(string resourceURL)
        {
            if (resourceURL == null)
            {
                resourceURL = UIConfig.popupMenu;
                if (resourceURL == null)
                {
                    Debug.LogError("FairyGUI: UIConfig.popupMenu not defined");
                    return;
                }
            }

            _contentPane = UIPackage.CreateObjectFromURL(resourceURL).asCom;
            _contentPane.onAddedToStage.Add(__addedToStage);
            _contentPane.onRemovedFromStage.Add(__removeFromStage);
            _contentPane.focusable = false;

            _list = _contentPane.GetChild("list").asList;
            _list.RemoveChildrenToPool();

            _list.AddRelation(_contentPane, RelationType.Width);
            _list.RemoveRelation(_contentPane, RelationType.Height);
            _contentPane.AddRelation(_list, RelationType.Height);

            _list.onClickItem.Add(__clickItem);

            hideOnClickItem = true;
            _showSubMenu    = __showSubMenu;
            _closeSubMenu   = CloseSubMenu;
        }
Esempio n. 2
0
 static public int RemoveChildrenToPool(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             FairyGUI.GList self = (FairyGUI.GList)checkSelf(l);
             self.RemoveChildrenToPool();
             pushValue(l, true);
             return(1);
         }
         else if (argc == 3)
         {
             FairyGUI.GList self = (FairyGUI.GList)checkSelf(l);
             System.Int32   a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             self.RemoveChildrenToPool(a1, a2);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static int RemoveChildrenToPool(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.GList)))
            {
                FairyGUI.GList obj = (FairyGUI.GList)ToLua.ToObject(L, 1);
                obj.RemoveChildrenToPool();
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.GList), typeof(int), typeof(int)))
            {
                FairyGUI.GList obj  = (FairyGUI.GList)ToLua.ToObject(L, 1);
                int            arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                int            arg1 = (int)LuaDLL.lua_tonumber(L, 3);
                obj.RemoveChildrenToPool(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.GList.RemoveChildrenToPool"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    void Start()
    {
        Application.targetFrameRate = 60;
        GRoot.inst.SetContentScaleFactor(1136, 640);
        Stage.inst.onKeyDown.Add(OnKeyDown);

        UIPackage.AddPackage("UI/Emoji");

        UIConfig.verticalScrollBar = UIPackage.GetItemURL("Emoji", "ScrollBar_VT");
        UIConfig.defaultScrollBarDisplay = ScrollBarDisplayType.Auto;

        _mainView = UIPackage.CreateObject("Emoji", "Main").asCom;
        _mainView.fairyBatching = true;
        _mainView.SetSize(GRoot.inst.width, GRoot.inst.height);
        _mainView.AddRelation(GRoot.inst, RelationType.Size);
        GRoot.inst.AddChild(_mainView);

        _list = _mainView.GetChild("list").asList;
        _list.RemoveChildrenToPool();
        _input = _mainView.GetChild("input").asTextInput;
        _input.onKeyDown.Add(__inputKeyDown);

        _itemURL1 = UIPackage.GetItemURL("Emoji", "chatLeft");
        _itemURL2 = UIPackage.GetItemURL("Emoji", "chatRight");

        _mainView.GetChild("btnSend").onClick.Add(__clickSendBtn);
        _mainView.GetChild("btnEmoji").onClick.Add(__clickEmojiBtn);

        _emojiSelectUI = UIPackage.CreateObject("Emoji", "EmojiSelectUI").asCom;
        _emojiSelectUI.fairyBatching = true;
        _emojiSelectUI.GetChild("list").asList.onClickItem.Add(__clickEmoji);
    }
Esempio n. 5
0
        protected void ShowDropdown()
        {
            if (_itemsUpdated)
            {
                _itemsUpdated = false;

                _list.RemoveChildrenToPool();
                int cnt = _items.Length;
                for (int i = 0; i < cnt; i++)
                {
                    GObject item = _list.AddItemFromPool();
                    item.text = _items[i];
                    item.name = i < _values.Length ? _values[i] : string.Empty;
                }
                _list.ResizeToFit(visibleItemCount);
            }
            _list.selectedIndex   = -1;
            _dropdownObject.width = this.width;

            GRoot r = this.root;

            if (r != null)
            {
                r.TogglePopup(_dropdownObject, this, true);
            }
            if (_dropdownObject.parent != null)
            {
                _dropdownObject.displayObject.onRemovedFromStage.Add(__popupWinClosed);
                SetState(GButton.DOWN);
            }
        }
Esempio n. 6
0
        virtual protected void RenderDropdownList()
        {
            _list.RemoveChildrenToPool();
            int cnt = _items.Length;

            for (int i = 0; i < cnt; i++)
            {
                GObject item = _list.AddItemFromPool();
                item.text = _items[i];
                item.name = i < _values.Length ? _values[i] : string.Empty;
            }
        }
Esempio n. 7
0
        virtual protected void RenderDropdownList()
        {
            _list.RemoveChildrenToPool();
            int cnt = _items.Count;

            for (int i = 0; i < cnt; i++)
            {
                GObject item = _list.AddItemFromPool();
                item.text = _items[i];
                item.icon = (_icons != null && i < _icons.Count) ? _icons[i] : null;
                item.name = i < _values.Count ? _values[i] : string.Empty;
            }
        }
Esempio n. 8
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="list"></param>
		public TreeView(GList list)
		{
			this.list = list;
			list.onClickItem.Add(__clickItem);
			list.RemoveChildrenToPool();

			root = new TreeNode(true);
			root.SetTree(this);
			root.cell = list;
			root.expanded = true;

			indent = 30;

			onClickNode = new EventListener(this, "onClickNode");
		}
Esempio n. 9
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="list"></param>
        public TreeView(GList list)
        {
            this.list = list;
            list.onClickItem.Add(__clickItem);
            list.RemoveChildrenToPool();

            root = new TreeNode(true);
            root.SetTree(this);
            root.cell = list;
            root.expanded = true;

            indent = 30;

            onClickNode = new EventListener(this, "onClickNode");
        }
Esempio n. 10
0
    void Start()
    {
        Application.targetFrameRate = 60;
        Stage.inst.onKeyDown.Add(OnKeyDown);

        _mainView = this.GetComponent<UIPanel>().ui;

        _list = _mainView.GetChild("list").asList;
        _list.RemoveChildrenToPool();
        _input = _mainView.GetChild("input").asTextInput;
        _input.onKeyDown.Add(__inputKeyDown);

        _itemURL1 = UIPackage.GetItemURL("Emoji", "chatLeft");
        _itemURL2 = UIPackage.GetItemURL("Emoji", "chatRight");

        _mainView.GetChild("btnSend").onClick.Add(__clickSendBtn);
        _mainView.GetChild("btnEmoji").onClick.Add(__clickEmojiBtn);

        _emojiSelectUI = UIPackage.CreateObject("Emoji", "EmojiSelectUI").asCom;
        _emojiSelectUI.fairyBatching = true;
        _emojiSelectUI.GetChild("list").asList.onClickItem.Add(__clickEmoji);
    }
Esempio n. 11
0
        void Create(string resourceURL)
        {
            if (resourceURL == null)
            {
                resourceURL = UIConfig.popupMenu;
                if (resourceURL == null)
                {
                    Log.Error("FairyGUI: UIConfig.popupMenu not defined");
                    return;
                }
            }

            _contentPane = UIPackage.CreateObjectFromURL(resourceURL).asCom;
            _contentPane.onAddedToStage.Add(__addedToStage);

            _list = _contentPane.GetChild("list").asList;
            _list.RemoveChildrenToPool();

            _list.AddRelation(_contentPane, RelationType.Width);
            _list.RemoveRelation(_contentPane, RelationType.Height);
            _contentPane.AddRelation(_list, RelationType.Height);

            _list.onClickItem.Add(__clickItem);
        }
Esempio n. 12
0
    void Start()
    {
        Application.targetFrameRate = 60;
        DontDestroyOnLoad(this.gameObject);

        Stage.Instantiate(5);
        Stage.inst.AddChild(new GRoot().displayObject);
        Stage.inst.camera.clearFlags = CameraClearFlags.Depth;
        Stage.inst.onKeyDown.Add(OnKeyDown);

        GRoot.inst.SetContentScaleFactor(1136, 640);

        UIPackage.AddPackage("UI/EmojiDemo");

        UIConfig.verticalScrollBar = UIPackage.GetItemURL("Demo", "ScrollBar_VT");
        UIConfig.defaultScrollBarDisplay = ScrollBarDisplayType.Auto;

        _mainView = UIPackage.CreateObject("Demo", "Main").asCom;
        _mainView.SetSize(GRoot.inst.width, GRoot.inst.height);
        _mainView.AddRelation(GRoot.inst, RelationType.Size);
        GRoot.inst.AddChild(_mainView);

        _list = _mainView.GetChild("list").asList;
        _list.RemoveChildrenToPool();
        _input = _mainView.GetChild("input").asTextInput;
        _input.onKeyDown.Add(__inputKeyDown);

        _itemURL1 = UIPackage.GetItemURL("Demo", "chatLeft");
        _itemURL2 = UIPackage.GetItemURL("Demo", "chatRight");

        _mainView.GetChild("btnSend").onClick.Add(__clickSendBtn);
        _mainView.GetChild("btnEmoji").onClick.Add(__clickEmojiBtn);

        _emojiSelectUI = UIPackage.CreateObject("Demo", "EmojiSelectUI").asCom;
        _emojiSelectUI.GetChild("list").asList.onClickItem.Add(__clickEmoji);
    }
Esempio n. 13
0
 /// <summary>
 ///
 /// </summary>
 public void ClearItems()
 {
     _list.RemoveChildrenToPool();
 }
Esempio n. 14
0
        void Create(string resourceURL)
        {
            if (resourceURL == null)
            {
                resourceURL = UIConfig.popupMenu;
                if (resourceURL == null)
                {
                    Debug.LogError("FairyGUI: UIConfig.popupMenu not defined");
                    return;
                }
            }

            _contentPane = UIPackage.CreateObjectFromURL(resourceURL).asCom;
            _contentPane.onAddedToStage.Add(__addedToStage);

            _list = _contentPane.GetChild("list").asList;
            _list.RemoveChildrenToPool();

            _list.AddRelation(_contentPane, RelationType.Width);
            _list.RemoveRelation(_contentPane, RelationType.Height);
            _contentPane.AddRelation(_list, RelationType.Height);

            _list.onClickItem.Add(__clickItem);
        }