Example #1
0
        public object DoLayout(GUIStyle style = null, object newValue = null, object scrollPos = null)
        {
            if (!isRoot)
            {
                if (hasAction)
                {
                    ActionButton.DoLayout(style ?? klvGUIStyles.HighlightHeader, NestOffset(levelDepth - 1) + (isCollapsed ? expIcon : colIcon) + FullText, FullText);
                }
                else
                {
                    GUILayout.Label(NestOffset(levelDepth - 1) + FullText, levelStyle ?? klvGUIStyles.HighlightBody, GUILayout.Height(22), GUILayout.ExpandWidth(false));
                }
            }

            if (!isCollapsed)
            {
                for (int i = 0; i < Nodes.Count; i++)
                {
                    scrollPos = (Vector2)Nodes[i].DoLayout(klvGUIStyles.HighlightBody, null, scrollPos);
                }
            }

            return(scrollPos);
        }