コード例 #1
0
        public static string DelayedPlaceholderField(string text, out string current, GUIContent placeholder, GUIStyle textStyle = null, GUIStyle placeholderStyle = null, GUILayoutOption[] options = null)
        {
            if (textStyle == null)
            {
                textStyle = "textfield";
            }
            Rect rect = GUILayoutUtility.GetRect(GUIContent.none, textStyle, options);

            return(EditorGUIx.DelayedPlaceholderField(rect, text, out current, placeholder, textStyle: textStyle, placeholderStyle: placeholderStyle));
        }
コード例 #2
0
        public static string FileField(string file, string extension, string title, string relativePath = null, GUIStyle style = null, params GUILayoutOption[] options)
        {
            if (style == null)
            {
                style = "textfield";
            }
            Rect rect = GUILayoutUtility.GetRect(GUIContent.none, style, options);

            return(EditorGUIx.FileField(rect, file ?? string.Empty, extension, title, style, relativePath));
        }
コード例 #3
0
        public static string SearchTextField(string text, GUIContent placeholder, params GUILayoutOption[] options)
        {
            Rect     rect;//= EditorGUILayout.GetControlRect(true, options);
            GUIStyle searchTextFieldStyle;

            searchTextFieldStyle = "SearchTextField";

            rect = GUILayoutUtility.GetRect(GUIContent.none, searchTextFieldStyle, options);
            return(EditorGUIx.SearchTextField(rect, text, placeholder));
        }
コード例 #4
0
        public static bool ToggleLabel(this GUIContent label, bool value, GUIStyle style = null, GUILayoutOption[] options = null)
        {
            if (style == null)
            {
                style = EditorGUIx.Styles.ToggleLabel;
            }
            var rect = GUILayoutUtility.GetRect(label, style, options);

            return(EditorGUIx.ToggleLabel(rect, label, value));
        }
コード例 #5
0
        public static string FolderField(string folder, string title, string relativePath = null, GUIStyle style = null, params GUILayoutOption[] options)
        {
            if (style == null)
            {
                style = "textfield";
            }
            GUIContent content = new GUIContent(folder ?? string.Empty);
            Rect       rect    = GUILayoutUtility.GetRect(content, style, options);

            return(EditorGUIx.FolderField(rect, folder, title, relativePath: relativePath, style: style, options));
        }
コード例 #6
0
        public static string DelayedEditableLabel(string text, GUIStyle labelStyle = null, GUIStyle textStyle = null, int clickCount = GUIx.EditableLabelClickCount, GUILayoutOption[] options = null)
        {
            if (labelStyle == null)
            {
                labelStyle = "label";
            }
            if (options == null)
            {
                options = new GUILayoutOption[0];
            }
            Rect rect = GUILayoutUtility.GetRect(new GUIContent(text), labelStyle, options);

            return(EditorGUIx.DelayedEditableLabel(rect, text, labelStyle: labelStyle, textStyle: textStyle, clickCount: clickCount));
        }