public void AddButtonInColumns(ref DataGridView dgv, TypeButton tb, EventEdit editEvent, EventDelete deleteEvent) { switch (tb) { case TypeButton.Search: DataGridViewButtonColumn editColumn = new DataGridViewButtonColumn(); editColumn.Text = "Editar"; editColumn.Name = "Editar"; editColumn.Width = 45; editColumn.DataPropertyName = "btnDgvEdit"; dgv.Columns.Add(editColumn); editColumn.DataGridView.CellContentClick += new DataGridViewCellEventHandler(editEvent); DataGridViewButtonColumn delColumn = new DataGridViewButtonColumn(); delColumn.Text = "Deletar"; delColumn.Name = "Deletar"; delColumn.Width = 45; delColumn.DataPropertyName = "btnDgvEditDelete"; dgv.Columns.Add(delColumn); delColumn.DataGridView.CellContentClick += new DataGridViewCellEventHandler(deleteEvent); //image column //DataGridViewImageColumn img = new DataGridViewImageColumn(); //Image image = Image.FromFile(@"..\Resources\plus.png"); //img.Image = image; //dgv.Columns.Add(img); //img.HeaderText = "Image"; //img.Name = "img"; break; } }
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- private void UpdateViewValues() { if (DataManager.selectedCity != null) { CityButton.SetTitle(DataManager.selectedCity.name, UIControlState.Normal); } if (DataManager.selectedDivision != null) { DivisionButton.SetTitle(DataManager.selectedDivision.name, UIControlState.Normal); } if (DataManager.selectedMachineType != null) { TypeButton.SetTitle(DataManager.selectedMachineType.name, UIControlState.Normal); TypeImageButton.SetBackgroundImage(UIImage.FromFile(DataManager.selectedMachineType.iconName), UIControlState.Normal); } if (DataManager.selectedMachineState != null) { StateButton.SetTitle(DataManager.selectedMachineState.name, UIControlState.Normal); StateImageButton.SetBackgroundImage(UIImage.FromFile(DataManager.selectedMachineState.iconName), UIControlState.Normal); } if (DataManager.selectedMachineServiceState != null) { ServiceStateButton.SetTitle(DataManager.selectedMachineServiceState.name, UIControlState.Normal); ServiceStateImageButton.SetBackgroundImage(UIImage.FromFile(DataManager.selectedMachineServiceState.iconName), UIControlState.Normal); } OnlyMyButton.SetState(DataManager.onlyMyMachines, false); }
public void PressedButtonDialog(TypeButton typeButton) { switch (dialogState) { case DialogState.StartPhrase: RenderDialog(DialogState.Common, 0); break; case DialogState.Common: RenderDialog(DialogState.GirlAnswer, dialogPage, typeButton); break; case DialogState.GirlAnswer: if (_dialogFailed) { RenderDialog(DialogState.Failed, dialogPage); } else { RenderDialog(DialogState.Common, dialogPage + 1); } break; case DialogState.Failed: GameController.Instance.GameStart(); break; default: throw new ArgumentOutOfRangeException(); } }
public TypeTrainPage ClickTypeTrain() { new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='ufs-railway-app']/div/div[2]/div[2]/div[4]/div/div[3]/div/div[4]"))); TypeButton.Click(); new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='ufs-railway-app']/div/div[2]/div[2]/div[4]/div/div[5]/div[3]/button"))); NextButton.Click(); new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='ufs-railway-app']/div/div[2]/div[2]/div[4]/div/div[5]/div[2]/span/span"))); return(this); }
//кликнули на кнопку public static void OnButtonClick(TypeButton _tb, int num_but = 0)//нажатие кнопки { if (_AppRoot == null) { Debug.Log("Not initialized AppRoot"); return; } _AppRoot.OnButtonClick(_tb, num_but); }
public TypeTrainPage ClickTypeTrain() { new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@class='wg-wagon-type']/div[1]"))); TypeButton.Click(); new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//button[@class='wg-button']"))); NextButton.Click(); new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//span[@class='wg-block__section-label t_error']/span"))); return(this); }
public void SetAsSelected() { for (int i = 0; i < icon.Length; i++) { if (playerSelection.playerEventSystem.currentSelectedGameObject == icon[i].gameObject) { selectedButton = (TypeButton)i; } } }
public static bool isActive(TypeButton _tb)//кнопка { for (int i = 0; i < lButton.Count; i++) { if (lButton[i].type == _tb) { return(lButton[i].isActive()); } } Debug.LogError("Active:None Button"); return(false); }
public void ChooseTypeButton(TypeButton _type) { type = _type; switch (type) { case TypeButton.Okey: _okeyObj.SetActive(true); break; case TypeButton.YesNo: _yesno.SetActive(true); break; } }
/** Pulsar y soltar el botón del ratón */ public static Boolean mouseClickPressed(TypeButton button) { switch (button) { case TypeButton.LEFT_BUTTON: return(mouseClickDown(button) && lastMouseState.LeftButton == ButtonState.Released); case TypeButton.RIGHT_BUTTON: return(mouseClickDown(button) && lastMouseState.RightButton == ButtonState.Released); default: return(false); } }
public static void SetActiveButton(TypeButton _tb, bool _g) //кнопка { if (_tb == TypeButton.Viewer) { Debug.LogError("Button:For the object function is not available!"); return; } for (int i = 0; i < lButton.Count; i++) { if (lButton[i].type == _tb) { lButton[i].SetActive(_g); return; } } Debug.LogError("Button not found"); }
public static void SetButtonText(TypeButton _tl, string _str)//кнопка { if (_tl != TypeButton.NextInstr && _tl != TypeButton.PrevInstr) { Debug.Log("Button:For the object function is not available!"); return; } for (int i = 0; i < lButton.Count; i++) { if (lButton[i].type == _tl) { lButton[i].SetText(_str); return; } } Debug.LogError("Button not found"); }
void SetButton(Button button, TypeButton type, int number = 0) { BitmapImage bitmap = new BitmapImage(); if (type == TypeButton.None) { button.IsEnabled = false; return; } if (type == TypeButton.Mine) { bitmap = imgMine; button.IsEnabled = false; } if (type == TypeButton.Sign) { bitmap = imgSign; } if (type != TypeButton.Number) { Image img = new Image() { Source = bitmap }; Grid grid = new Grid(); grid.Children.Add(img); button.Content = grid; } if (type == TypeButton.Number) { button.Content = number; button.IsEnabled = false; } }
public InteractionTypes(Type t) { type = t; //Je nach Typ den Text der Buttons bestimmen switch (type) { case Type.USE: button = new TypeButton(); button.name = "use"; button.methodName = "use"; button.infoText = "Benutze Objekt"; button.iconPos = 5; break; case Type.OPEN: button = new TypeButton(); button.name = "open"; button.methodName = "use"; button.infoText = "Öffne Objekt"; button.iconPos = 0; break; case Type.TAKE: button = new TypeButton(); button.name = "take"; button.methodName = "take"; button.infoText = "Nimm Objekt"; button.iconPos = 1; break; case Type.COMBINE: button = new TypeButton(); button.name = "combine"; button.methodName = "combine"; button.infoText = "Kombiniere Gegenstände"; button.iconPos = 6; break; case Type.STAIRS_UP: button = new TypeButton(); button.name = "stairs_up"; button.methodName = "stairsUp"; button.infoText = "Gehe nach oben"; button.iconPos = 3; break; case Type.STAIRS_DOWN: button = new TypeButton(); button.name = "stairs_down"; button.methodName = "stairsDown"; button.infoText = "Gehe nach unten"; button.iconPos = 4; break; case Type.LADDER_UP: button = new TypeButton(); button.name = "ladder_up"; button.methodName = "ladderUp"; button.infoText = "Kletter nach oben"; button.iconPos = 3; break; case Type.LADDER_DOWN: button = new TypeButton(); button.name = "ladder_down"; button.methodName = "ladderDown"; button.infoText = "Kletter nach unten"; button.iconPos = 4; break; case Type.START_GAME: button = new TypeButton(); button.name = "start_game"; button.methodName = "startGame"; button.infoText = "Starte ein neues Spiel"; button.iconPos = 1; break; case Type.QUIT_GAME: button = new TypeButton(); button.name = "quit_game"; button.methodName = "quitGame"; button.infoText = "Beende das Spiel"; button.iconPos = 0; break; case Type.CURSE: button = new TypeButton(); button.name = "curse_object"; button.methodName = "curseObject"; button.infoText = "Verfluche einen Gegenstand"; button.iconPos = 2; break; default: break; } }
public void OnButtonClick(TypeButton _tb, int num_but = 0) { switch (_tb) { case TypeButton.Next: if (NumberRoom != 0 && NumberRoom != 5) { AppRootStatic.NextRoomNavigation(); } NumberRoom++; ViewerActivWindow(); break; case TypeButton.Back: if (NumberRoom != 6 && NumberRoom != 1) { AppRootStatic.PrevRoomNavigation(); } NumberRoom--; ViewerActivWindow(); break; case TypeButton.Metodics: AppRootStatic.SetActiveUI(TypeUI.AppMenu, false); AppRootStatic.SetActiveLabel(TypeLabel.Header, false); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveUI(TypeUI.Metodic, true); oWindows = false; break; case TypeButton.CloseMetodics: AppRootStatic.SetActiveUI(TypeUI.Metodic, false); ViewerActivWindow(); break; case TypeButton.CloseApplication: AppRootStatic.SetActiveUI(TypeUI.AppMenu, false); AppRootStatic.SetActiveLabel(TypeLabel.Header, false); AppRootStatic.SetActiveLabel(TypeLabel.Info, false); AppRootStatic.SetActiveUI(TypeUI.Exit, true); oWindows = false; break; case TypeButton.YesExit: Application.Quit(); break; case TypeButton.NoExit: AppRootStatic.SetActiveUI(TypeUI.Exit, false); ViewerActivWindow(); break; case TypeButton.NextInstr: if (Instrument % 3 != 0) { return; } Instrument = (Instrument + 1) % 3; ButtonInstrument(); AppRootStatic.NextTool(); break; case TypeButton.PrevInstr: if (Instrument % 3 != 1) { return; } Instrument = (Instrument - 1) % 3; AppRootStatic.PrevuTool(); ButtonInstrument(); break; case TypeButton.Viewer: AppRootStatic.SetActiveUI(TypeUI.Metodic, false); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, true); AppRootStatic.SetObjectViewer(num_but, true); ///просотр объектов!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! break; case TypeButton.CloseViewr: AppRootStatic.SetActiveUI(TypeUI.Metodic, true); AppRootStatic.SetActiveLabel(TypeLabel.Viewer, false); break; case TypeButton.Task: AppRootStatic.SetActiveLabel(TypeLabel.Task, !AppRootStatic.isActive(TypeLabel.Task)); ///задачи break; } }
// Use this for initialization void Start() { //Load the mini map and assign the menu width and mini map rect IMiniMapController miniMap = ManagerResolver.Resolve <IMiniMapController>(); float tempWidth; miniMap.LoadMiniMap(out tempWidth, out m_MiniMapRect); MainMenuWidth = tempWidth; //Build Borders around the map float sideBorderWidth = (m_MainMenuWidth - (m_MiniMapRect.width * Screen.width)) / 2; float topBorderHeight = (1 - m_MiniMapRect.yMax) * Screen.height; m_LeftMiniMapBG = new Rect(); m_LeftMiniMapBG.xMin = Screen.width - m_MainMenuWidth; m_LeftMiniMapBG.xMax = m_LeftMiniMapBG.xMin + sideBorderWidth; m_LeftMiniMapBG.yMin = 0; m_LeftMiniMapBG.yMax = (1 - m_MiniMapRect.yMin) * Screen.height; m_RightMiniMapBG = new Rect(); m_RightMiniMapBG.xMin = m_MiniMapRect.xMax * Screen.width; m_RightMiniMapBG.xMax = Screen.width; m_RightMiniMapBG.yMin = 0; m_RightMiniMapBG.yMax = (1 - m_MiniMapRect.yMin) * Screen.height; m_AboveMiniMapBG = new Rect(); m_AboveMiniMapBG.xMin = Screen.width - m_MainMenuWidth; m_AboveMiniMapBG.xMax = Screen.width; m_AboveMiniMapBG.yMin = 0; m_AboveMiniMapBG.yMax = topBorderHeight; m_BelowMiniMapBG = new Rect(); m_BelowMiniMapBG.xMin = Screen.width - m_MainMenuWidth; m_BelowMiniMapBG.xMax = Screen.width; m_BelowMiniMapBG.yMin = ((1 - m_MiniMapRect.yMin) * Screen.height) - 1; m_BelowMiniMapBG.yMax = Screen.height; //Create viewable area rect Rect menuArea = new Rect(); menuArea.xMin = m_LeftMiniMapBG.xMin; menuArea.xMax = m_RightMiniMapBG.xMax; menuArea.yMin = m_BelowMiniMapBG.yMin; menuArea.yMax = Screen.height; //Create type buttons m_TypeButtons[0] = new TypeButton(ButtonType.Building, menuArea); m_TypeButtons[1] = new TypeButton(ButtonType.Support, menuArea); m_TypeButtons[2] = new TypeButton(ButtonType.Infantry, menuArea); m_TypeButtons[3] = new TypeButton(ButtonType.Vehicle, menuArea); m_TypeButtons[4] = new TypeButton(ButtonType.Air, menuArea); //Calcualte Maintenace button rects float size = m_RightMiniMapBG.width - 4; float totalHeight = size * 3; float offSet = (m_RightMiniMapBG.height - totalHeight) / 2; float x = m_RightMiniMapBG.xMin; float y = m_RightMiniMapBG.yMin + offSet; Rect rect1 = new Rect(x, y, size, size); Rect rect2 = new Rect(x, y + size, size, size); Rect rect3 = new Rect(x, y + (size * 2), size, size); //Assign maintenance buttons m_MaintenanceButtons[0] = new Maintenance_Sell(rect1); m_MaintenanceButtons[1] = new Maintenance_Fix(rect2); m_MaintenanceButtons[2] = new Maintanance_Disable(rect3); //Resolve Manager m_Manager = ManagerResolver.Resolve <IManager>(); }
public OrderButton(Panel pnl, Image img, TypeButton tb) { typeButton = tb; panel = pnl; image = img; }
private void RenderDialog(DialogState dlgState, uint page, TypeButton typeButton = TypeButton.One) { dialogState = dlgState; dialogPage = page; var dlg = dialogCommon[page]; var girlImage = girl.GetComponent <Image>(); var i = 0; switch (dlgState) { case DialogState.Common: headerText.text = dlg.textGirl; girlImage.sprite = emotions[Convert.ToInt32(dlg.girlEmotion)]; foreach (var button in buttons) { button.SetActive(true); button.GetComponent <ButtonDialog>().SetTextButton(dlg.textGuy[i++].text); } break; case DialogState.Failed: headerText.text = totalFailedText; girlImage.sprite = emotions[Convert.ToInt32(totalFailedEmotion)]; buttons[0].SetActive(true); buttons[0].GetComponent <ButtonDialog>().SetTextButton(defaultNextButtonText); for (i = 1; i < buttons.Length; ++i) { buttons[i].SetActive(false); } break; case DialogState.StartPhrase: headerText.text = startGuyText; girlImage.sprite = emotions[Convert.ToInt32(GirlEmotion.hey)]; buttons[0].SetActive(true); buttons[0].GetComponent <ButtonDialog>().SetTextButton(defaultNextButtonText); for (i = 1; i < buttons.Length; ++i) { buttons[i].SetActive(false); } break; case DialogState.GirlAnswer: var textGuy = dlg.textGuy[Convert.ToInt32(typeButton) - 1]; girlImage.sprite = emotions[Convert.ToInt32(textGuy.girtAnswerEmotion)]; // Если диалог провален, после ответа девушки будет totalFailedText _dialogFailed = textGuy.badText; headerText.text = textGuy.girlAnswer; buttons[0].SetActive(true); buttons[0].GetComponent <ButtonDialog>().SetTextButton(defaultNextButtonText); for (i = 1; i < buttons.Length; ++i) { buttons[i].SetActive(false); } break; default: throw new ArgumentOutOfRangeException(nameof(dlgState), dlgState, null); } }
void ReleaseDesignerOutlets() { if (CityButton != null) { CityButton.Dispose(); CityButton = null; } if (DivisionButton != null) { DivisionButton.Dispose(); DivisionButton = null; } if (OnlyMyButton != null) { OnlyMyButton.Dispose(); OnlyMyButton = null; } if (ServiceStateButton != null) { ServiceStateButton.Dispose(); ServiceStateButton = null; } if (ServiceStateImageButton != null) { ServiceStateImageButton.Dispose(); ServiceStateImageButton = null; } if (StateButton != null) { StateButton.Dispose(); StateButton = null; } if (StateImageButton != null) { StateImageButton.Dispose(); StateImageButton = null; } if (TypeButton != null) { TypeButton.Dispose(); TypeButton = null; } if (TypeImageButton != null) { TypeImageButton.Dispose(); TypeImageButton = null; } if (UserButton != null) { UserButton.Dispose(); UserButton = null; } }