Example #1
0
 public static SearchList getInstance()
 {
     if (_instance == null)
     {
         _instance = new SearchList();
     }
     return(_instance);
 }
Example #2
0
 public static void Show(string key = "effect", Action <string> callBack = null)
 {
     if (w == null)
     {
         w = EditorWindow.CreateInstance <SearchList>();
     }
     w.show(key, callBack);
 }
Example #3
0
        public override void onRender()
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label(label, GUILayout.ExpandWidth(false));

            EventType typeBackup = Event.current.type;

            GUI.SetNextControlName(controlID);

            GUI.changed = false;

            if (lineCount == 1)
            {
                _value = EditorGUILayout.TextField(_value);
            }
            else
            {
                if (wordWrap == null)
                {
                    wordWrap          = new GUIStyle("TextArea");
                    wordWrap.wordWrap = true;
                }
                _value = EditorGUILayout.TextArea(_value, wordWrap, GUILayout.Height(20 * lineCount));
            }
            if (string.IsNullOrEmpty(searckKey) == false)
            {
                if (GUILayout.Button("S", EditorStyles.miniButton, GUILayout.Width(20)))
                {
                    SearchList.Show(searckKey, selectBackHandle);
                }
            }

            if (GUI.changed)
            {
                this.simpleDispatch(EventX.CHANGE, _value);
            }
            CheckFocus(this);
            GUILayout.EndHorizontal();
        }