FairyGUI.TreeView.__clickExpandButton C# (CSharp) Method

__clickExpandButton() public method

public __clickExpandButton ( EventContext context ) : void
context EventContext
return void
        void __clickExpandButton(EventContext context)
        {
            GButton expandButton = (GButton)context.sender;
            TreeNode node = (TreeNode)expandButton.parent.data;
            if (list.scrollPane != null)
            {
                float posY = list.scrollPane.posY;
                if (expandButton.selected)
                    node.expanded = true;
                else
                    node.expanded = false;
                list.scrollPane.posY = posY;
                list.scrollPane.ScrollToView(node.cell);
            }
            else
            {
                if (expandButton.selected)
                    node.expanded = true;
                else
                    node.expanded = false;
            }
        }