Esempio n. 1
0
        public void AddPopupWindow(Control _TargetControl, Control _PopupControl, PopupEvent _PStyle,WindowStyle _WStyle, int _width, int _height,bool _ismouseclickhide)
        {
            PopupContent popup = new PopupContent();
            popup.TargetControl = _TargetControl;
            popup.PopupControl = _PopupControl;
            popup.PType = PopupType.Window;
            popup.PStyle = _PStyle;
            popup.WStyle = _WStyle;
            popup.Width = _width;
            popup.Height = _height;
            popup.IsMCHide = _ismouseclickhide;
            popup.WindowTitle = "";

            _PopupControl.Tag = this;

            if (popup.PStyle == PopupEvent.Click)
            {
                _TargetControl.Click += new EventHandler(_TargetControl_Click);
            }
            else if (popup.PStyle == PopupEvent.Mouse)
            {
                _TargetControl.MouseEnter += new EventHandler(_TargetControl_MouseEnter);
                _TargetControl.MouseLeave += new EventHandler(_TargetControl_MouseLeave);
            }
            else
            {

            }

            popupList.Add(popup);

            _PopupControl.Hide();
        }
Esempio n. 2
0
        public void AddPopupWindow(Control _TargetControl, Control _PopupControl, PopupEvent _PStyle, WindowStyle _WStyle, int _width, int _height, bool _ismouseclickhide)
        {
            PopupContent popup = new PopupContent();

            popup.TargetControl = _TargetControl;
            popup.PopupControl  = _PopupControl;
            popup.PType         = PopupType.Window;
            popup.PStyle        = _PStyle;
            popup.WStyle        = _WStyle;
            popup.Width         = _width;
            popup.Height        = _height;
            popup.IsMCHide      = _ismouseclickhide;
            popup.WindowTitle   = "";

            _PopupControl.Tag = this;

            if (popup.PStyle == PopupEvent.Click)
            {
                _TargetControl.Click += new EventHandler(_TargetControl_Click);
            }
            else if (popup.PStyle == PopupEvent.Mouse)
            {
                _TargetControl.MouseEnter += new EventHandler(_TargetControl_MouseEnter);
                _TargetControl.MouseLeave += new EventHandler(_TargetControl_MouseLeave);
            }
            else
            {
            }

            popupList.Add(popup);

            _PopupControl.Hide();
        }
Esempio n. 3
0
    // === Scripted events ===
    IEnumerator FirstTimePopup()
    {
        PopupEvent p = new PopupEvent(new Rect(Screen.width*.15f, 300, Screen.width*.7f, 400), "Welcome to "+appName+"!", "Begin by exploring the toolbox of useful daily metrics. If you see a that metric that looks useful to you, tap to add it to your checklist.\n\nThe checklist is your custom list of daily reminders. Add anything you want to it – but we recommend starting with the basics. You'll unlock more tools as you level up.");
        yield return StartCoroutine(eventProcessor.DoProcessUI(p));

        ExplainLevelsPopup();
    }
    public static void Setup(string text, PopupEvent ok, PopupEvent cancel = null)
    {
        var popupTemplate = Resources.Load("ConfirmPopup");
        var popup         = (GameObject.Instantiate(popupTemplate) as GameObject).GetComponent <ConfirmPopup>();

        popup._text.text   = text;
        popup._okEvent     = ok;
        popup._cancelEvent = cancel;

        Utilities.SetUIParentFit(GameObject.FindGameObjectWithTag("RootCanvas"), popup.gameObject);
    }
Esempio n. 5
0
        private static void SendEvent(GameObject gameObject, PopupEvent eventFunc)
        {
            var popup = gameObject.GetComponent <IPopup>();

            if (popup == null)
            {
                Debug.LogError(gameObject.name + " is not a popup object", gameObject);
                return;
            }

            eventFunc(popup);
        }
Esempio n. 6
0
    public static PopupEvent Instantiate()
    {
        GameObject obj = Instantiate(Resources.Load <GameObject>("Popup/PopupEvent"));

        if (obj == null || obj.GetComponent <PopupEvent>() == null)
        {
            Debug.LogError("<color=red> Resource Loading Error!! - PopupEvent </color>");
            return(null);
        }

        PopupEvent popup = obj.GetComponent <PopupEvent>();

        obj.transform.parent = m_canvas.transform;
        return(popup);
    }
Esempio n. 7
0
 public void NotifyPopupClose(PopupEvent eventArgs)
 {
     OnPopupClose?.Invoke(this, eventArgs);
 }
Esempio n. 8
0
 public void NotifyPopupOpen(PopupEvent eventArgs)
 {
     OnPopupOpen?.Invoke(this, eventArgs);
 }
Esempio n. 9
0
 private void FillGrid()
 {
     if (checkDeleted.Checked)
     {
         _listPopups = Popups.GetDeletedForFamily(PatCur);
     }
     else
     {
         _listPopups = Popups.GetForFamily(PatCur);
     }
     #region Automation PopUpThenDisable10Min
     //Joe - We are mimicing popups through a new AutomationAction PopUpThenDisable10Min.
     //We want to show it in this list to avoid confusion and phone calls.
     List <long> listAutoNums = FormOpenDental.DicBlockedAutomations.Keys.ToList();
     Dictionary <long, DateTime> dictPatDate;
     //First level dictionary key is an AutomationNum.
     //Value is Dictionary<long,DateTime>.
     Popup             popup;
     Automation        autoCur;
     List <Automation> listAutomations = Automations.GetDeepCopy();
     foreach (long automationNum in listAutoNums)
     {
         dictPatDate = FormOpenDental.DicBlockedAutomations[automationNum];              //Gets all patnums for current automation.
         //Second level dictionary key is a patNum for current AutomationNum key.
         //Value is DateTime representing block until time.
         foreach (KeyValuePair <long, DateTime> kvp in dictPatDate)
         {
             if (!Patients.GetAllFamilyPatNums(new List <long>()
             {
                 kvp.Key
             }).Contains(PatCur.PatNum))
             {
                 continue;                        //Not in the same family.
             }
             autoCur = listAutomations.FirstOrDefault(x => x.AutomationNum == automationNum);
             if (autoCur == null)
             {
                 continue;
             }
             #region Dummy PopUp
             //Create dummy Popup.
             //Since we never insert these into the DB we just put them in our list that we fill the grid with.
             popup = new Popup()
             {
                 PopupNum      = automationNum,
                 PatNum        = kvp.Key,
                 PopupLevel    = EnumPopupLevel.Automation,
                 DateTimeEntry = kvp.Value.AddMinutes(-10),
                 Description   = autoCur.MessageContent
             };
             _listPopups.Add(popup);
             #endregion Dummy PopUp
         }
     }
     _listPopups = _listPopups.OrderBy(x => x.PatNum).ThenBy(x => x.PopupLevel).ToList();
     #endregion Automation PopUpThenDisable10Min
     gridMain.BeginUpdate();
     gridMain.ListGridColumns.Clear();
     GridColumn col = new GridColumn(Lan.g("TablePopupsForFamily", "Patient"), 120);
     gridMain.ListGridColumns.Add(col);
     col = new GridColumn(Lan.g("TablePopupsForFamily", "Level"), 80);
     gridMain.ListGridColumns.Add(col);
     col = new GridColumn(Lan.g("TablePopupsForFamily", "Disabled"), 60, HorizontalAlignment.Center);
     gridMain.ListGridColumns.Add(col);
     col = new GridColumn(Lan.g("TablePopupsForFamily", "Last Viewed"), 80, HorizontalAlignment.Center);
     gridMain.ListGridColumns.Add(col);
     if (checkDeleted.Checked)
     {
         col = new GridColumn(Lan.g("TablePopupsForFamily", "Deleted"), 60, HorizontalAlignment.Center);
         gridMain.ListGridColumns.Add(col);
     }
     col = new GridColumn(Lan.g("TablePopupsForFamily", "Popup Message"), 120);
     gridMain.ListGridColumns.Add(col);
     gridMain.ListGridRows.Clear();
     GridRow row;
     _listPopups.RemoveAll(x => x.PopupLevel == EnumPopupLevel.Automation && !listAutomations.Any(y => y.AutomationNum == x.PopupNum));
     for (int i = 0; i < _listPopups.Count; i++)
     {
         row = new GridRow();
         row.Cells.Add(Patients.GetPat(_listPopups[i].PatNum).GetNameLF());
         if (_listPopups[i].PopupLevel == EnumPopupLevel.Automation)
         {
             autoCur = Automations.GetFirstOrDefault(x => x.AutomationNum == _listPopups[i].PopupNum);                //Get by PK.
             //this should never happen because we remove any where the AutomationNum is not in Automations.Listt
             //if(autoCur==null) {
             //	continue;
             //}
             row.Cells.Add(Lan.g("enumEnumPopupLevel", "Auto") + ": " + Lan.g("enumEnumPopupLevel", autoCur.Autotrigger.ToString()));
             row.Cells.Add("");                    //Disabled column. Will never happen for automations.
             row.Cells.Add(_listPopups[i].DateTimeEntry.ToShortTimeString());
         }
         else
         {
             row.Cells.Add(Lan.g("enumEnumPopupLevel", _listPopups[i].PopupLevel.ToString()));
             row.Cells.Add(_listPopups[i].IsDisabled?"X":"");
             PopupEvent popEvent = _listPopEvents.FirstOrDefault(x => x.PopupNum == _listPopups[i].PopupNum);
             if (popEvent != null && popEvent.LastViewed.Year > 1880)
             {
                 row.Cells.Add(popEvent.LastViewed.ToShortTimeString());
             }
             else
             {
                 row.Cells.Add("");
             }
         }
         if (checkDeleted.Checked)
         {
             row.Cells.Add(_listPopups[i].IsArchived?"X":"");
         }
         row.Cells.Add(_listPopups[i].Description);
         row.Tag = _listPopups[i];
         gridMain.ListGridRows.Add(row);
     }
     gridMain.EndUpdate();
 }
Esempio n. 10
0
 void ExplainLevelsPopup()
 {
     PopupEvent p = new PopupEvent(new Rect(Screen.width*.15f, 300, Screen.width*.7f, 400), "How does leveling work?", "Every day you will be given random quests to explore different parts of "+appName+". Complete these to develop your Pillars of Awesomeness and unlock more functionality. Check the store or the toolbox often to find new features.");
     eventProcessor.ProcessUIEvent(p);
 }