Ejemplo n.º 1
0
 private void del_Click(object sender, EventArgs e)
 {
     ClickButtonEvent?.Invoke(this, new DeleteEventArgs(delBox.Text));
     //createHero a = new createHero();
     //int g;
     //if (Int32.TryParse(delBox.Text, out g))
     //{
     //    SwowBox.Text = a.DELETE(g-1);
     //}
     //else
     //{
     //    delBox.Text = "insert mumber";
     //}
 }
Ejemplo n.º 2
0
    //
    // Click for pressDuration seconds
    //  a good visual pressDuration is 0.33f
    public virtual void Click(float pressDuration = 0)
    {
        if (!(isActiveAndEnabled && Interactable))
        {
            // button must be active and interactable to click
            return;
        }

        // show button as pressed
        _showAsPressed = true;
        UpdateButton();

        void unpressCallback()
        {
            //
            // invoke and unpress button

            onClickEvent?.Invoke(this);

            // SkipPointerUp skips returning to the normal ("Up") state after
            //  clicking, which is useful with tab menus or button toggles,
            //  otherwise you see the normal state flicker.
            _showAsPressed = SkipPointerUp;
            UpdateButton();
        }

        if (waitForClickSound && pressDuration == 0 && Enabled)
        {
            SoundHelper.Play(clickSound, unpressCallback);
        }
        else
        {
            if (clickSound && Enabled)
            {
                clickSound?.Play();
            }
            if (pressDuration > 0)
            {
                Delayer.Delay(pressDuration, unpressCallback);
            }
            else
            {
                unpressCallback();
            }
        }
    }
Ejemplo n.º 3
0
 public void Select(string value, bool giveWarning = true)
 {
     for (int i = 0; i < _menuItems.Length; ++i)
     {
         string menuItem = _menuItems[i];
         if (value == menuItem)
         {
             ClickButton      clickButton  = _menuButtons[i];
             ClickButtonEvent onClickEvent = clickButton.onClickEvent;
             onClickEvent?.Invoke(clickButton);
             return;
         }
     }
     if (giveWarning)
     {
         Logger.Warning("Could not select button \"" + value + "\" on popup.");
     }
 }
Ejemplo n.º 4
0
 public void OnPointerClick(PointerEventData eventData)
 {
     ClickButtonEvent?.Invoke(eventData.pointerPress.name);
 }
Ejemplo n.º 5
0
 private void All_Click(object sender, EventArgs e)
 {
     ClickButtonEvent?.Invoke(this, new NewWindowEventArgs("ShowAll"));
     //ShowAll S_ALL = new ShowAll();
     //S_ALL.ShowDialog();
 }
Ejemplo n.º 6
0
 private void Sh_Click(object sender, EventArgs e)
 {
     ClickButtonEvent?.Invoke(this, new NewWindowEventArgs("ShowOne"));
     //Show sh = new Show();
     //sh.ShowDialog();
 }
Ejemplo n.º 7
0
 private void Del_Click(object sender, EventArgs e)
 {
     ClickButtonEvent?.Invoke(this, new NewWindowEventArgs("Delete"));
     //DelCharacter del = new DelCharacter();
     //del.ShowDialog();
 }
Ejemplo n.º 8
0
        //public NH RETURN(int i)
        //{
        //    return heros[i];
        //}


        //public int RETURN_col()
        //{
        //    return heros.Count;
        //}
        //public string DELETE(int i)
        //{
        //    if (i >= 0 && i < RETURN_col())
        //    {
        //        string t = "this element was deleted: " + heros[i].input();
        //        heros.RemoveAt(i);
        //        return t;
        //    }
        //    else { return "the Character is not founded"; }
        //}
        //public string SHOW(int i)
        //{
        //    if (i >= 0 && i < RETURN_col())
        //    {
        //        return heros[i].input();
        //    }
        //    else { return "the Character is not founded"; }
        //}


        private void New_Click(object sender, EventArgs e)
        {
            ClickButtonEvent?.Invoke(this, new NewWindowEventArgs("New"));
            //New a = new New();
            //a.ShowDialog();
        }