Esempio n. 1
0
 static void refreshGUI()
 {
     if (isShowing && window == null)
     {
         //Debug.Log("----> NULL " + wPosition);
         var ofocus = focusedWindow;
         window          = wPosition.xAsDropdown <IsolateWindow>();
         window.position = wPosition;
         if (ofocus != null)
         {
             ofocus.Focus();
         }
     }
 }
Esempio n. 2
0
    public void OnGUI()
    {
        if (!isShowing)
        {
            isShowing = true;
            window    = this;
            wPosition = window.position;

            EditorApplication.update -= refreshGUI;
            EditorApplication.update += refreshGUI;
        }

        //Debug.Log(Event.current + ":" + window.position);

        using (GuiX.hzLayout) {
            GUILayout.Label(wtitle ?? "", GUILayout.Width(50f));
            this.xInvoke("SearchFieldGUI", typeof(SearchableEditorWindow));
            GUILayout.Space(20f);

            var r = GUILayoutUtility.GetLastRect().dx(2f).dy(1f).wh(18f, 18f);
            //if (r.Contains(Event.current.mousePosition)) GUI.Box(r, " ");
            GUI.Label(r, "X");

            if (r.xLMB_isUp().noModifier)
            {
                isShowing = false;
                window    = null;
                Close();
            }
        }

        if (guiList == null)
        {
            return;
        }
        //GUILayout.Label(title + "[" + guiList.CacheList.Count + "]");

        guiList.Draw((r, info, idx) => {
            if (r.xLMB_isDown())
            {
                info.go.xPing();
            }
            GUI.Label(r, info.Name);
            return(20);
        });

        GUILayout.Space(20f);
    }