Exemple #1
0
        public override void Draw(SpriteBatch sb)
        {
            if (MenuButton == null)
            {
                return;
            }

            int buttonLock = ButtonLock;             // we only want to get this once

            bool foundHighlight = false;

            Vector2 mouse = new Vector2(Main.mouseX, Main.mouseY);

            Update();

            int count = 0;

            MenuButton.whoAmi = count++;
            MenuButton.Update();

            if (foundHighlight)
            {
                MenuButton.Draw(sb, false);
            }
            else
            {
                if (MenuButton.canMouseOver && !MenuButton.disabled && (buttonLock == -1 || buttonLock == MenuButton.whoAmi))
                {
                    foundHighlight = MenuButton.MouseOver(mouse);
                }

                if (MenuButton.whoAmi == buttonLock)
                {
                    foundHighlight = true;
                }

                MenuButton.Draw(sb, foundHighlight);

                if (foundHighlight && Main.mouseLeft)
                {
                    if (MenuButton.buttonLock)
                    {
                        ButtonLock = MenuButton.whoAmi;
                    }

                    if (Main.mouseLeftRelease)
                    {
                        MenuButton.framesHeld = 0;
                        MenuButton.Click();
                    }
                    else
                    {
                        MenuButton.framesHeld++;
                        MenuButton.ClickHold();
                    }
                }
            }

            base.Draw(sb);
        }
 public ContactPage CustomerSupport()
 {
     MenuButton.Click();
     CustomerButton.Click();
     log.Info("Go to CustomerSupportPage");
     return(new ContactPage(driver));
 }
 public void CreateMenu(string title, Page page, bool canClose)
 {
     if (menuPages.Keys.Contains(title))
     {
         (UIElement as WindowMain).PageFrame.Content = menuPages[title];
     }
     else
     {
         (UIElement as WindowMain).PageFrame.Content = page;
         MenuButton button = new MenuButton();
         button.CanClose    = canClose;
         button.Text        = title;
         button.ButtonStyle = MenuButtonStyle.DGrayBlue;
         button.Close((s, e) => {
             menuPages.Remove(title);
             menuButtons.Remove(title);
             (UIElement as WindowMain).MenuPanel.Children.Remove(button);
             if ((UIElement as WindowMain).MenuPanel.Children.Count == 1)
             {
                 (UIElement as WindowMain).PageFrame.Content = (mainPage.UIElement as Page);
             }
         });
         button.Click((s, e) => {
             (UIElement as WindowMain).PageFrame.Content = page;
             FocusButton(title);
         });
         (UIElement as WindowMain).MenuPanel.Children.Add(button);
         menuPages.Add(title, page);
         menuButtons.Add(title, button);
     }
     //FocusButton(title);
 }
Exemple #4
0
        /// <summary>
        /// Opens the dropdown menu and waits for the animation.
        /// </summary>
        public void ClickMenuButton()
        {
            MenuButton.Click();

            WebDriverWait wait = new WebDriverWait(_webDriver, TimeSpan.FromSeconds(10));

            wait.Until(browser => ResumeButton.Displayed == true);
        }
Exemple #5
0
        public void CustomerClickMenuButton()
        {
            screenshot screens = new screenshot();

            MenuButton.Click();
            screens.Takescreenshot4("filename");
            //CartImg.Click();
            //Console.WriteLine("The item that the customer chose is " + ItemName.Text);
        }
Exemple #6
0
 public void GetMenu()
 {
     MenuButton.Click();
     foreach (IWebElement item in driver.FindElements(By.CssSelector("li[id]>a.parent")))
     {
         MenuComponent menu = new MenuComponent();
         menu.MenuButton = item;
         menu.MenuLabel  = item.FindElement(By.XPath("./span")).Text;
         Menus.Add(menu.MenuLabel, menu);
     }
     //MenuButton.Click();
 }
Exemple #7
0
 public void ClickBatchRevertButton()
 {
     BatchRevertButton.Click();
 }
Exemple #8
0
 public void ClickBatchIgnoreButton()
 {
     BatchIgnoreButton.Click();
 }
Exemple #9
0
 public void ClickBatchModifyButton()
 {
     BatchModifyButton.Click();
 }
 public void ClickRankTypeConvertTargetButton()
 {
     RankTypeConvertTargetButton.Click();
 }
 public void ClickFuncModeConvertTargetButton()
 {
     FuncModeConvertTargetButton.Click();
 }