Ejemplo n.º 1
0
        void MemoGUI()
        {
            var memoCount = memoTreeView.GetRows().Count;

            EditorGUILayout.BeginVertical();
            {
                SplitterGUI.BeginHorizontalSplit(horizontalState);
                {
                    // category area
                    EditorGUILayout.BeginVertical();
                    GUILayout.Space(1);
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndVertical();

                    categoryTreeView.OnGUI(GUILayoutUtility.GetLastRect());
                    var selected = categoryTreeView.state.lastClickedID;
                    if (selected != selectCategoryId)
                    {
                        selectCategoryId = selected;
                        OnCategoryChange();
                    }

                    // memo area
                    EditorGUILayout.BeginVertical();
                    {
                        if (memoCount == 0)
                        {
                            EditorGUILayout.HelpBox(WindowHelper.TEXT_NO_MEMO, MessageType.Info);
                            GUILayout.FlexibleSpace();
                        }
                        else
                        {
                            EditorGUILayout.BeginVertical();
                            GUILayout.Space(2);
                            GUILayout.FlexibleSpace();
                            EditorGUILayout.EndVertical();

                            var memoRect = GUILayoutUtility.GetLastRect();
                            if (Event.current.type == EventType.Repaint)
                            {
                                if (preMemoWidth != memoRect.width)
                                {
                                    memoTreeView.UpdateRowHeight(memoRect.width);
                                    preMemoWidth = memoRect.width;
                                }
                            }
                            memoTreeView.OnGUI(memoRect);
                        }
                        LabelGUI();
                    }
                    EditorGUILayout.EndVertical();
                }
                SplitterGUI.EndHorizontalSplit();
            }
            EditorGUILayout.EndVertical();
        }
Ejemplo n.º 2
0
 void DrawContents()
 {
     if (WindowHelper.Data == null || WindowHelper.GetCategory(selectCategoryId) == null)
     {
         EditorGUILayout.HelpBox("fatal Error.", MessageType.Error);
         selectCategoryId = 0;
         return;
     }
     HeaderGUI();
     SplitterGUI.BeginVerticalSplit(verticalState);
     {
         MemoGUI();
         PostGUI();
     }
     SplitterGUI.EndVerticalSplit();
 }