public static void ShowDialog(string caption, List<UTAutomationPlan> allItems, List<UTAutomationPlan> visibleItems, AutomationPlanSelected selectionCallback)
    {
        UTAutomationPlanPopup popup = Instance;
        popup.caption = caption;
        popup.allItems = allItems;
        popup.visibleItems = visibleItems;
        popup.currentItems = visibleItems;
        popup.showAllItems = false;
        popup.selectionCallback = selectionCallback;
        popup.listData = new CUListData(false);
        popup.listData.ExecutionListener = popup;

        if (popup.currentItems.Count > 0) {
            // select first entry
            popup.listData[0] = true;
        }

        if (!visible) {
            requestFocus = true;
            visible = true;
            wasGuiPaintedAtLeastOnce = false;
            forceDelayedClose = false;
            popup.itemRenderer = new UTAutomationPlanListItemRenderer();
            popup.position = new Rect(Mathf.Max(0, (Screen.width - Width) / 2), Mathf.Max(0, (Screen.height - Height) / 2), Width, Height);
            popup.ShowPopup();
            popup.Focus();
        }
    }
예제 #2
0
 private void CloseDialog()
 {
     allItems          = null;
     visibleItems      = null;
     currentItems      = null;
     selectionCallback = null;
     visible           = false;
     forceDelayedClose = false;
     Close();
     if (Event.current != null)
     {
         Event.current.Use();
     }
 }
 private void CloseDialog()
 {
     allItems = null;
     visibleItems = null;
     currentItems = null;
     selectionCallback = null;
     visible = false;
     forceDelayedClose = false;
     Close();
     if (Event.current != null) {
         Event.current.Use();
     }
 }
예제 #4
0
    public static void ShowDialog(string caption, List <UTAutomationPlan> allItems, List <UTAutomationPlan> visibleItems, AutomationPlanSelected selectionCallback)
    {
        UTAutomationPlanPopup popup = Instance;

        popup.caption                    = caption;
        popup.allItems                   = allItems;
        popup.visibleItems               = visibleItems;
        popup.currentItems               = visibleItems;
        popup.showAllItems               = false;
        popup.selectionCallback          = selectionCallback;
        popup.listData                   = new CUListData(false);
        popup.listData.ExecutionListener = popup;

        if (popup.currentItems.Count > 0)
        {
            // select first entry
            popup.listData[0] = true;
        }

        if (!visible)
        {
            requestFocus             = true;
            visible                  = true;
            wasGuiPaintedAtLeastOnce = false;
            forceDelayedClose        = false;
            popup.itemRenderer       = new UTAutomationPlanListItemRenderer();
            popup.position           = new Rect(Mathf.Max(0, (Screen.width - Width) / 2), Mathf.Max(0, (Screen.height - Height) / 2), Width, Height);
            popup.ShowPopup();
            popup.Focus();
        }
    }