public void OnGUIDraw(Rect position)
        {
            GUI.Label(new Rect(0, 0, 124, 18), "", EditorStyles.toolbar);
            if (GUI.Button(new Rect(124, 0, 26, 18), StyleTools.gearIcon, EditorStyles.toolbarButton))
            {
                ShowGear();
            }
            Rect menuTreeRect = new Rect(0, 18, 150, position.height);

            if (menuTree != null)
            {
                menuTree.OnGUI(menuTreeRect, this);
            }
            if (!isPopup)
            {
                if (curMenuTreeItem != null)
                {
                    Rect mentTreeItemDrawRecr = new Rect(151, 1, position.width - 152, position.height - 3);
                    if (curMenuTreeItem.menuTreeItemDraw != null)
                    {
                        GUILayout.BeginArea(mentTreeItemDrawRecr, StyleTools.Skin.box);
                        curMenuTreeItem.menuTreeItemDraw.Invoke(new Rect(0, 0, mentTreeItemDrawRecr.width, mentTreeItemDrawRecr.height));
                        GUILayout.EndArea();
                    }
                    else
                    {
                        GUI.Label(mentTreeItemDrawRecr, GUILayoutTools.GetTextSizeOf(curMenuTreeItem.Name + " 内容未定制...", 30), StyleTools.MiddleCenterLab);
                    }
                }
            }
        }
Example #2
0
        protected override void RowGUI(RowGUIArgs args)
        {
            Rect rect     = args.rowRect;
            var  id       = args.item.id;
            bool isSelect = IsSelected(id);

            if (!isSelect)
            {
                if (rect.Contains(Event.current.mousePosition))
                {
                    EditorGUI.DrawRect(rect, hoverColor);
                }
            }
            GUI.Label(rect, GUILayoutTools.GetTextSizeOf(args.item.displayName, 16), StyleTools.MiddleCenterLab);
            if (menuTreeItems.FindIndex(t => { return(t.Id == id); }) != menuTreeItems.Count - 1)
            {
                GUITools.Separator_SingleLine(new Rect(rect.x, rect.y + rect.height - 1, rect.width, 10));
            }
        }
 public override void OnGUI(Rect rect)
 {
     position = rect;
     HandleDragRect();
     //CheckSize();
     if (drawer != null)
     {
         if (drawer.drawTitle)
         {
             GUILayoutTools.DrawTitle(drawer.Name, true);
         }
         if (drawer.menuTreeItemDraw != null)
         {
             drawer.menuTreeItemDraw(rect);
         }
     }
     else
     {
         GUI.Label(rect, GUILayoutTools.GetTextSizeOf("内容未定制...", 30), StyleTools.MiddleCenterLab);
     }
     editorWindow.Repaint();
 }