static public AssemblySelectionWindow Open(float screenX, float screenY, ProjectAuditorWindow projectAuditorWindow, TreeViewSelection selection, string[] names) { AssemblySelectionWindow window = GetWindow <AssemblySelectionWindow>("Assemblies"); window.position = new Rect(screenX, screenY, 400, 500); window.SetData(projectAuditorWindow, selection, names); window.Show(); return(window); }
private void DrawAssemblyFilter() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(Styles.AssemblyFilter, GUILayout.Width(LayoutSize.FilterOptionsLeftLabelWidth)); var lastEnabled = GUI.enabled; GUI.enabled = m_AnalysisState == AnalysisState.Valid && !AssemblySelectionWindow.IsOpen() && m_ActiveAnalysisView.desc.showAssemblySelection; if (GUILayout.Button(Styles.AssemblyFilterSelect, EditorStyles.miniButton, GUILayout.Width(LayoutSize.FilterOptionsEnumWidth))) { if (m_AssemblyNames != null && m_AssemblyNames.Length > 0) { // Note: Window auto closes as it loses focus so this isn't strictly required if (AssemblySelectionWindow.IsOpen()) { AssemblySelectionWindow.CloseAll(); } else { var windowPosition = new Vector2(Event.current.mousePosition.x + LayoutSize.FilterOptionsEnumWidth, Event.current.mousePosition.y + GUI.skin.label.lineHeight); var screenPosition = GUIUtility.GUIToScreenPoint(windowPosition); AssemblySelectionWindow.Open(screenPosition.x, screenPosition.y, this, m_AssemblySelection, m_AssemblyNames); } } } GUI.enabled = lastEnabled; m_AssemblySelectionSummary = GetSelectedAssembliesSummary(); DrawSelectedText(m_AssemblySelectionSummary); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }
private void DrawAssemblyFilter() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(Styles.assemblyFilter, GUILayout.Width(LayoutSize.FilterOptionsLeftLabelWidth)); if (m_AssemblyNames.Length > 0) { bool lastEnabled = GUI.enabled; // SteveM TODO - We don't currently have any sense of when the Auditor is busy and should disallow user input bool enabled = /*!IsAnalysisRunning() &&*/ !AssemblySelectionWindow.IsOpen(); GUI.enabled = enabled; if (GUILayout.Button(Styles.assemblyFilterSelect, EditorStyles.miniButton, GUILayout.Width(LayoutSize.FilterOptionsEnumWidth))) { // Note: Window auto closes as it loses focus so this isn't strictly required if (AssemblySelectionWindow.IsOpen()) { AssemblySelectionWindow.CloseAll(); } else { Vector2 windowPosition = new Vector2(Event.current.mousePosition.x + LayoutSize.FilterOptionsEnumWidth, Event.current.mousePosition.y + GUI.skin.label.lineHeight); Vector2 screenPosition = GUIUtility.GUIToScreenPoint(windowPosition); AssemblySelectionWindow.Open(screenPosition.x, screenPosition.y, this, m_AssemblySelection, m_AssemblyNames); } } GUI.enabled = lastEnabled; m_AssemblySelectionSummary = GetSelectedAssembliesSummary(); DrawSelectedText(m_AssemblySelectionSummary); GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); }
static public void CloseAll() { AssemblySelectionWindow window = GetWindow <AssemblySelectionWindow>("Assemblies"); window.Close(); }