public TextBoxSteps(IWebDriver driver) : base(driver) { this.driver = driver; homepage = new Homepage(driver); elementmenu = new ElementMenu(driver); textbox = new TextBox(driver); }
private void CreateMenuItems() { var addElement = new UIMenuListScrollerItem <string>("Add Element", "", new[] { "Rect", "Text" }); addElement.Activated += (m, s) => { ElementMenu menu = addElement.Index switch { 0 => new RectMenu(rectId++), 1 => new TextMenu(textId++), _ => throw new NotImplementedException(), }; var bindItem = new UIMenuItem(menu.Name); AddItem(bindItem); BindMenuToItem(menu, bindItem); elements.Add(menu.Element); }; AddItems(addElement); }
private void Awake() { //savePanel = GameObject.Find("SavePanel"); //saveMenu = GameObject.Find("SaveMenu").GetComponent<SaveMenu>(); pauseMenu = GameObject.Find("UICameraCanvas/GameMenu/PauseMenu"); if (pauseMenu == null) { Debug.LogError("在" + gameObject.name + "中,找不到pauseMenu"); } //switchButton = GameObject.Find("UICameraCanvas/GameMenu/SwitchButton"); //if (switchButton == null) //{ // Debug.LogError("在" + gameObject.name + "中,找不到switchButton"); //} //pauseButton = GameObject.Find("UICameraCanvas/GameMenu/PauseButton"); //if (pauseButton == null) //{ // Debug.LogError("在" + gameObject.name + "中,找不到pauseButton"); //} taskPanel = GameObject.Find("TaskPanel"); elementMenu = GameObject.Find("SwitchElementMenu").GetComponent <ElementMenu>(); if (elementMenu == null) { Debug.LogError("在" + gameObject.name + "中,找不到switchElementMenu"); } gameOverPanel = GameObject.Find("GameOverPanel"); if (gameOverPanel == null) { Debug.LogError("在" + gameObject.name + "中,找不到GameOverPanel"); } }
public WebTablesSteps(IWebDriver driver) : base(driver) { this.driver = driver; webtables = new WebTables(driver); elementmenu = new ElementMenu(driver); }
void Awake() { collider = GetComponent <CircleCollider2D> (); sourceElement = GetComponent <SourceElement> (); menu = GetComponentInChildren <ElementMenu> (); }
/// <summary> /// Creates one instance of the top most menu /// </summary> /// <param name="center">The Menus center</param> /// <param name="angle">The angle of the menu</param> public IndividualMenu BuildMenu(Point center, double angle) { ScatterViewItem item = NonMovingItemFactory(center, angle); IndividualMenu sideMenu = new Menu.IndividualMenu(Catagory.ReadFile("Resources/Information/Top.xml"), AddAnimation(item)); MenuList.Add(sideMenu); TextBlock block = new TextBlock(); block.Text="Touch Here to Begin"; block.FontSize = 35; ScatterViewItem touchme = NonMovingItemFactory(center, angle); touchme.Content = block; touchme.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center; touchme.Focusable = false; touchme.Width = sideMenu.Width; touchme.Height = sideMenu.Height; scatter.Items.Add(touchme); Canvas canvas = sideMenu.DrawMenu(); item.Content = canvas; item.Background = Brushes.Transparent; scatter.Items.Add(item); ElementMenu historyMenu = new ElementMenu(); TransformGroup transform = new TransformGroup(); transform.Children.Add(new ScaleTransform(-1, -1)); transform.Children.Add(new TranslateTransform(sideMenu.Width * 0.5 + 1.7 * MenuTileSize, 2.2 * MenuTileSize)); historyMenu.RenderTransform = transform; historyMenu.ActivationMode = ElementMenuActivationMode.AlwaysActive; sideMenu.AddUpListenerToButtons(new EventHandler<TouchEventArgs>(TouchUpMenu)); canvas.Children.Insert(0, historyMenu); return sideMenu; }
//Browser Code private void BuildBrowserInScatterView(string s, ScatterView scatterview) { ScatterViewItem svi = new ScatterViewItem(); Grid addition = new Grid(); CustomBrowser webBrower = new CustomBrowser(); webBrower.scatter = scatterview; webBrower.Width = double.NaN; //set it for auto width webBrower.Height = double.NaN; webBrower.Source = new Uri(s); webBrower.ShowCreatedWebView += new ShowCreatedWebViewEventHandler(webBrower_ShowCreatedWebView); //newItem.Margin = new Thickness(25.0, 25.0, 25.0, 25.0); svi.Padding = new Thickness(25.0, 25.0, 25.0, 25.0); //newItem.Content = webBrower; WrapPanel wrap = new WrapPanel(); wrap.Orientation = System.Windows.Controls.Orientation.Vertical; //wrap.Children.Add(new SurfaceTextBox()); wrap.Children.Add(webBrower); addition.Children.Add(wrap); svi.Content = addition; //Sets the new grid as the SVI content //ElementMenuItem check = (ElementMenuItem)sender; scatterview.Items.Add(svi); ElementMenu menu = new ElementMenu(); menu.ActivationHost = svi; menu.ActivationMode = ElementMenuActivationMode.HostInteraction; ElementMenuItem emi = new ElementMenuItem(); emi.Header = "Close"; emi.Click += new RoutedEventHandler(ElementCloseMenuItem_Click); menu.Items.Add(emi); menu.VerticalAlignment = System.Windows.VerticalAlignment.Top; menu.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; addition.Children.Add(menu); //adds ElementMenu to the grid }
private void ElementShareRight_click(object sender, RoutedEventArgs e) { ElementMenuItem check = (ElementMenuItem)sender; ScatterViewItem svi = new ScatterViewItem(); String Aloha = check.Uid; Grid addition = new Grid(); addition.Children.Add(WindowCall(Aloha)); svi.Content = addition; //Sets the new grid as the SVI content SVR.Items.Add(svi); ElementMenu menu = new ElementMenu(); menu.ActivationHost = svi; menu.ActivationMode = ElementMenuActivationMode.HostInteraction; ElementMenuItem emi = new ElementMenuItem(); emi.Header = "Close"; emi.Click += new RoutedEventHandler(ElementCloseMenuItem_Click); menu.Items.Add(emi); ElementMenuItem emi2 = new ElementMenuItem(); emi2.Header = "Share"; emi2.Click += new RoutedEventHandler(ElementShareLeft_click); emi2.Uid = Aloha; emi.Icon = WindowCall(Aloha); //Will have to change to seperate image when WindowCall changed to browser menu.Items.Add(emi2); menu.VerticalAlignment = System.Windows.VerticalAlignment.Top; menu.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; addition.Children.Add(menu); //adds ElementMenu to the grid }
private void ElementMenuRight_click(object sender, RoutedEventArgs e) { ScatterViewItem svi = new ScatterViewItem(); Grid addition = new Grid(); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "JPEG Files (*.jpg)|*.jpg"; openFileDialog1.Title = "Select an Image File"; //List<string> RightValues = new List<string>(); // Show the Dialog. // If the user clicked OK in the dialog and // a .JPG file was selected, open it. if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //RightValues.Add(openFileDialog1.FileName); addition.Children.Add(WindowCall(openFileDialog1.FileName)); svi.Content = addition; //Sets the new grid as the SVI content ElementMenuItem check = (ElementMenuItem)sender; SVR.Items.Add(svi); ElementMenu menu = new ElementMenu(); menu.ActivationHost = svi; menu.ActivationMode = ElementMenuActivationMode.HostInteraction; ElementMenuItem emi = new ElementMenuItem(); emi.Header = "Close"; emi.Click += new RoutedEventHandler(ElementCloseMenuItem_Click); menu.Items.Add(emi); ElementMenuItem emi2 = new ElementMenuItem(); emi2.Header = "Share"; emi.Icon = WindowCall(openFileDialog1.FileName); //Will have to change to seperate image when WindowCall changed to browser emi2.Click += new RoutedEventHandler(ElementShareLeft_click); emi2.Uid = openFileDialog1.FileName; menu.Items.Add(emi2); menu.VerticalAlignment = System.Windows.VerticalAlignment.Top; menu.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; addition.Children.Add(menu); //adds ElementMenu to the grid } }
private void Awake() { elementMenuObject = GameObject.Find("SwitchElementMenu"); elementMenuScript = elementMenuObject.GetComponent <ElementMenu>(); objectNameOnUI = "元素石"; }
public LinkSteps(IWebDriver driver) : base(driver) { this.driver = driver; link = new Link(driver); elementmenu = new ElementMenu(driver); }