Exemplo n.º 1
0
 public static RadioButtonsDto ConvertRadioButtonsDto(RadioButtons but)
 {
     return(new RadioButtonsDto()
     {
         ActionArticles = but.ActionArticles, ActionCatalog = but.ActionCatalog, ActionGroupTree = but.ActionGroupTree
     });
 }
Exemplo n.º 2
0
    public override void Initialize()
    {
        // Clear existing
        OnDestroy();
        foreach (Transform child in transform)
        {
            DestroyImmediate(child.gameObject);
        }

        Assert.IsTrue(labels.Count == values.Count);
        for (var i = 0; i < labels.Count; i++)
        {
            var label = labels[i];
            var value = values[i];
            var child = Instantiate(NavigationUiElementProvider.Instance.pillRadioButton, transform, false);
            // Set its parent (PulseElement) instead
            child.transform.parent.GetComponent <RectTransform>().SetWidth(labels.Count > 2 ? 128 : 192);
            var pillRadioButton = child.GetComponent <PillRadioButton>();
            pillRadioButton.label.text = label;
            pillRadioButton.value      = value;
            RadioButtons.Add(pillRadioButton);
        }

        base.Initialize();
    }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            while (this.Controls.Count > 3)
            {
                this.Controls.RemoveAt(3);
            }

            Label[] labels = new Label[(int)this.numberOfContacts.Value];
            _contactsTextBox = new TextBox[(int)this.numberOfContacts.Value];
            _radioButtons    = new RadioButtons[(int)this.numberOfContacts.Value];
            Button button = new Button();

            for (int i = 0; i < _contactsTextBox.Length; i++)
            {
                _contactsTextBox[i] = new TextBox();
                System.Drawing.Point p = new System.Drawing.Point(476, 114 + i * 25);
                _contactsTextBox[i].Location = p;
                _contactsTextBox[i].Size     = new System.Drawing.Size(183, 20);
                this.Controls.Add(_contactsTextBox[i]);
                labels[i] = new Label();
                System.Drawing.Point pLabel = new System.Drawing.Point(400, 114 + i * 25);
                labels[i].Location = pLabel;
                labels[i].Size     = new System.Drawing.Size(80, 13);
                labels[i].Text     = @"Contact " + (i + 1).ToString() + ":";
                this.Controls.Add(labels[i]);
                _radioButtons[i]          = new RadioButtons();
                _radioButtons[i].Location = new System.Drawing.Point(670, 110 + i * 25);
                this.Controls.Add(_radioButtons[i]);
            }

            button.Text     = "Submit";
            button.Click   += new System.EventHandler(this.submit_Click);
            button.Location = new System.Drawing.Point(470, 110 + (_contactsTextBox.Length + 1) * 25);
            this.Controls.Add(button);
        }
        protected override void RadioButtons_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RadioButtons radioButtons = sender as RadioButtons;

            if (radioButtons.Name != "facilityStatus")
            {
                base.RadioButtons_SelectionChanged(sender, e);
            }

            foreach (RadioButton radioButton in radioButtons.Items)
            {
                if (IsFieldRequired(radioButtons) && radioButtons.SelectedIndex == -1)
                {
                    radioButton.Foreground = new SolidColorBrush(Colors.Red);
                }
                else
                {
                    radioButton.Foreground = new SolidColorBrush(Colors.Black);
                }
            }
            if (IsFieldRequired(radioButtons) && radioButtons.SelectedIndex == -1)
            {
                facilityStatusGreen.Foreground = new SolidColorBrush(Colors.Red);
                facilityStatusRed.Foreground   = new SolidColorBrush(Colors.Red);
                facilityStatusBlack.Foreground = new SolidColorBrush(Colors.Red);
            }
            else
            {
                facilityStatusGreen.Foreground = new SolidColorBrush(Colors.Black);
                facilityStatusRed.Foreground   = new SolidColorBrush(Colors.Black);
                facilityStatusBlack.Foreground = new SolidColorBrush(Colors.Black);
            }
        }
Exemplo n.º 5
0
 internal static void SetTestHooksEnabled(RadioButtons radioButtons, bool enabled)
 {
     if (radioButtons != null)
     {
         radioButtons.SetTestHooksEnabled(enabled);
     }
 }
Exemplo n.º 6
0
    public override GameObject createContent() // создание контента, на основе радиобатона, заполнение заготовленых айтемов
    {
        var        goldFromCrystalExchange = windowController.getMarketExchange();
        GameObject prefab       = getResources().goldBuyItemPrefab;
        GameObject content      = new GameObject("Content");
        GameObject radioButtons = new GameObject("RadioButtons");

        radioButtons.transform.parent = content.transform;
        RadioButtons rb = radioButtons.AddComponent <RadioButtons>();

        rb.shift = new Vector2(0.0f, -2.09f);
        int len = goldFromCrystalExchange.Length;

        rb.init(prefab, len, RadioButtons.TypeDisposition.VERTICAL, 1.0f, true);
        isHaveBonuses = false;
        for (int i = 0; i < goldFromCrystalExchange.Length; i++)
        {
            if (goldFromCrystalExchange[i].Free > 0)
            {
                isHaveBonuses = true;
            }
        }
        fillGoldItems(rb);
        rb.subscribeOnRadioBtnSelected(onBuyGoldClick);
        return(content);
    }
Exemplo n.º 7
0
    void fillCrystalItems(RadioButtons radioButtons) // заполнения контента, данными из сервера
    {
        var crystalItems = windowController.getCrystalItems();

        //print(crystalItems.Length);
        for (int i = 0; i < radioButtons.transform.childCount; i++)
        {
            Transform tChild  = radioButtons.transform.GetChild(i);
            var       ico     = tChild.FindChild("ico").GetComponent <SpriteRenderer>();
            string    icoAddr = "PopUpWindows/rubin" + (i + 2);
            ico.sprite = Resources.Load <Sprite>(icoAddr);
            var    countCrystals     = tChild.FindChild("countBuyItem").GetComponent <DigitsLabel>();
            var    buttonGO          = tChild.Find("Button");
            var    aditionalCrystals = tChild.FindChild("aditionalBuyItem").GetComponent <DigitsLabel>();
            var    cost = tChild.Find("Button").Find("costLabel").GetComponent <DigitsLabel>();
            int    len  = crystalItems[i].Name.Length;
            string str  = crystalItems[i].Name.Substring(8, len - 8);
            countCrystals.setValue(int.Parse(str));
            if (crystalItems[i].Free > 0)
            {
                aditionalCrystals.setValue(crystalItems[i].Free, DigitsLabel.AdditionalPrefixSymbols.PLUS);
            }
            else   // если бонусов нету прячем ненужные элементы:
            {
                aditionalCrystals.gameObject.SetActive(false);
                tChild.Find("coinsIco").gameObject.SetActive(false);
                tChild.Find("freeLabel").gameObject.SetActive(false);
                tChild.Find("underButtonLabel").gameObject.SetActive(false);
            }
            cost.setFloatValue((float)(crystalItems[i].Price));

            buttonGO.name = i.ToString();
        }
    }
 public override object VisitRadioButtons(RadioButtons radioButtons)
 {
     if (!radioButtons.SupportsDataType(_currentDataType))
     {
         Report.AddError(radioButtons.Position, MessageFormat, "radiobuttons", StringEnum.GetStringValue(_currentDataType));
     }
     return(null);
 }
Exemplo n.º 9
0
        public void should_select_by_text_other()
        {
            var radio = new RadioButtons(_driver, By.Name("gender"));

            radio.SelectByText("Other");

            Assert.AreEqual("other", radio.SelectedOption.Element.GetAttribute("value"));
        }
Exemplo n.º 10
0
        public void should_select_by_value()
        {
            var radio = new RadioButtons(_driver, By.Name("gender"));

            radio.SelectByValue("female");

            Assert.AreEqual("female", radio.SelectedOption.Element.GetAttribute("value"));
        }
Exemplo n.º 11
0
 public static int GetColumns(RadioButtons radioButtons)
 {
     if (radioButtons != null)
     {
         return(radioButtons.GetColumns());
     }
     return(-1);
 }
Exemplo n.º 12
0
 internal static int GetLargerColumns(RadioButtons radioButtons)
 {
     if (radioButtons != null)
     {
         return(radioButtons.GetLargerColumns());
     }
     return(-1);
 }
Exemplo n.º 13
0
 internal static int GetRows(RadioButtons radioButtons)
 {
     if (radioButtons != null)
     {
         return(radioButtons.GetRows());
     }
     return(-1);
 }
Exemplo n.º 14
0
 public MainPage()
 {
     this.InitializeComponent();
     RadioButtons.Add("Option1", Colors.Black);
     RadioButtons.Add("Option2", Colors.Blue);
     RadioButtons.Add("Option3", Colors.Red);
     //Model = new ViewModel();
     //this.DataContext = Model;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Maps a value to a radio button.
 /// </summary>
 /// <param name="radioButton"></param>
 /// <param name="value"></param>
 public void MapButtonValue(RadioButton radioButton, object value)
 {
     if (RadioButtons.Contains(radioButton) && !_RadioButtonValues.Any(r => radioButton == r.RadioButton))
     {
         var radioButtonValue = new RadioButtonValue(radioButton, value);
         HookRadioButton(radioButton);
         _RadioButtonValues.Add(radioButtonValue);
     }
 }
Exemplo n.º 16
0
    public static void Main(String[] args)
    {
        RadioButtons form = new RadioButtons();

        form.Width  = 470;
        form.Height = 470;
        form.Text   = "RadioButtons example";
        Application.Run(form);
    }
Exemplo n.º 17
0
        private void ExcuteRadioCommand()
        {
            RadioButton     = RadioButtons.Where(p => p.IsCheck).First();
            RadioTimeButton = RadioTimeButtons.Where(p => p.IsCheck).First();
            switch (RadioButton.Content)
            {
            case "所有":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = false;
                QueryDepartmentEna = false;
                QueryPersonEna     = false;
            }
            break;

            case "录入部门":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = false;
                QueryDepartmentEna = true;
                QueryPersonEna     = false;
            }
            break;

            case "发票号码":
            {
                QuerySnEna         = true;
                QueryOperatorEna   = false;
                QueryDepartmentEna = false;
                QueryPersonEna     = false;
            }
            break;

            case "报销人":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = false;
                QueryDepartmentEna = true;
                QueryPersonEna     = true;
            }
            break;

            case "录入人员":
            {
                QuerySnEna         = false;
                QueryOperatorEna   = true;
                QueryDepartmentEna = false;
                QueryPersonEna     = false;
            }
            break;

            default:
                break;
            }
            QueryDateEna = RadioTimeButton.Content == "所有" ? false : true;
        }
Exemplo n.º 18
0
 private void CheckItem(RadioButton radioBtn)
 {
     if (!radioBtn.Checked)
     {
         radioBtn.Checked = true;
         foreach (RadioButton otherRadioBtn in RadioButtons.Where(x => x != radioBtn))
         {
             otherRadioBtn.Checked = false;
         }
     }
 }
Exemplo n.º 19
0
 public RadioButtonSe RadioButton(Predicate <ElementSe> predicate)
 {
     try
     {
         return(RadioButtons.Find(predicate));
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemplo n.º 20
0
        public void ShouldSerializeType()
        {
            // arrange
            var radio = new RadioButtons();

            // act
            var payload = SlackClient.SerializeObject(radio);

            // assert
            payload.Should().Contain("\"type\":\"radio_buttons\"");
        }
Exemplo n.º 21
0
        public void ShouldSerializeActionId()
        {
            // arrange
            var radio = new RadioButtons {
                ActionId = "Action123"
            };

            // act
            var payload = SlackClient.SerializeObject(radio);

            // assert
            payload.Should().Contain("\"action_id\":\"Action123\"");
        }
        private void SpecialtyService_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RadioButtons radioButtons = sender as RadioButtons;

            string tag = GetTagIndex(radioButtons);

            string      commentsTag        = tag.TrimEnd('.') + "c.";
            FormControl formControlComment = null;
            string      dateTag            = tag.TrimEnd('.') + "d.";
            FormControl formControlDate    = null;

            foreach (FormControl formControl in _formControlsList)
            {
                if (formControl.InputControl is TextBox textBox)
                {
                    if (textBox.Tag as string == commentsTag)
                    {
                        formControlComment = formControl;
                    }
                    if (textBox.Tag as string == dateTag)
                    {
                        formControlDate = formControl;
                    }
                }
            }
            TextBox textBoxComment = formControlComment?.InputControl as TextBox;
            TextBox textBoxDate    = formControlDate?.InputControl as TextBox;

            for (int i = 0; i < radioButtons.Items.Count; i++) //RadioButton radioButton in radioButtons.Items
            {
                RadioButton radioButton = radioButtons.Items[i] as RadioButton;
                radioButton.Foreground = new SolidColorBrush(Colors.Black);
                if (i == radioButtons.SelectedIndex)
                {
                    if ((radioButton.Tag as string).Contains("Y"))
                    {
                        textBoxComment.Text         = "";
                        textBoxComment.IsReadOnly   = true;
                        textBoxDate.IsReadOnly      = true;
                        textBoxDate.PlaceholderText = "";
                        textBoxDate.Text            = "";
                    }
                    else if ((radioButton.Tag as string).Contains("N"))
                    {
                        textBoxComment.IsReadOnly   = false;
                        textBoxDate.IsReadOnly      = false;
                        textBoxDate.PlaceholderText = "mm/dd/yyyy";
                    }
                }
            }
        }
Exemplo n.º 23
0
 void IActiveTaskDialog.SetButtonEnabledState(int buttonId, bool enabled)
 {
     if (NormalButtons.Any(b => b.ID == buttonId))
     {
         NormalButtons.First(b => b.ID == buttonId).IsEnabled = enabled;
     }
     else if (CommandLinks.Any(cl => cl.ID == buttonId))
     {
         CommandLinks.First(b => b.ID == buttonId).IsEnabled = enabled;
     }
     else if (RadioButtons.Any(rb => rb.ID == buttonId))
     {
         RadioButtons.First(b => b.ID == buttonId).IsEnabled = enabled;
     }
 }
Exemplo n.º 24
0
        public void ShouldSerializeConfirm()
        {
            // arrange
            var confirm = new Confirmation();
            var radio   = new RadioButtons {
                Confirm = confirm
            };

            // act
            var confirmPayload = SlackClient.SerializeObject(confirm);
            var payload        = SlackClient.SerializeObject(radio);

            // assert
            payload.Should().Contain($"\"confirm\":{confirmPayload}");
        }
Exemplo n.º 25
0
    float shiftValue = 0.06f;   // значение смещения по вертикале при выборе

    void Start()
    {
        DigitsLabel label = transform.Find("Label").GetComponent <DigitsLabel>();

        label.setValue(int.Parse(name));
        RadioButtons rb             = transform.parent.GetComponent <RadioButtons>();
        var          selectedButton = rb.getSelectedButton();

        IAmSelected = selectedButton != null && gameObject == rb.getSelectedButton().gameObject;
        rb.subscribeOnRadioBtnSelected(OnNewSelected);
        if (IAmSelected)
        {
            select(true);
            Rooms.countTickets = int.Parse(this.gameObject.GetComponent <BaseController>().name);
        }
    }
Exemplo n.º 26
0
        public void ShouldSerializeInitialOption()
        {
            // arrange
            var option = new Option {
                Value = "Value123"
            };
            var radio = new RadioButtons {
                InitialOption = option
            };

            // act
            var optionsPayload = SlackClient.SerializeObject(option);
            var payload        = SlackClient.SerializeObject(radio);

            // assert
            payload.Should().Contain($"\"initial_option\":{optionsPayload}");
        }
 public void FillForm(RegistrationUser user)
 {
     RadioButtons.Click();
     CustomerFirstName.SendKeys(user.FirstName);
     CustomerLastName.SendKeys(user.LastName);
     Password.SendKeys(user.Password);
     Days.SelectByValue(user.Date);
     Months.SelectByValue(user.Month);
     Years.SelectByValue(user.Year);
     FirstName.SendKeys(user.RealFirstName);
     LastName.SendKeys(user.RealLastName);
     Address.SendKeys(user.Address);
     City.SendKeys(user.City);
     State.SelectByValue(user.State);
     PostCode.SendKeys(user.PostCode);
     Phone.SendKeys(user.Phone);
     Alias.SendKeys(user.Alias);
     RegisterButton.Click();
 }
        // ###############################################################################################
        private void ThemeRadioButtons_Changed(object sender, SelectionChangedEventArgs e)
        {
            RadioButtons r = sender as RadioButtons;

            if (r.SelectedIndex < 0)
            {
                return;
            }
            var theme = ((ContentControl)r.SelectedItem).Content.ToString();

            var parentFrame  = (Frame)Window.Current.Content;
            var parentDialog = (FrameworkElement)((FrameworkElement)((FrameworkElement)this.Parent).Parent).Parent;

            App._LocalSettings.Set(UserSettings.Theme, theme);
            var darkTheme = ColorConstants.CurrentThemeIsDark();

            parentFrame.RequestedTheme  = darkTheme ? ElementTheme.Dark : ElementTheme.Light;
            parentDialog.RequestedTheme = darkTheme ? ElementTheme.Dark : ElementTheme.Light;
        }
 public void FillForm(RegistrationUser user)
 {
     RadioButtons.Click();
     CustomerFirstName.Type(user.FirstName);
     CustomerLastName.Type(user.LastName);
     Password.Type(user.Password);
     //Days.SelectByText(user.Date);
     //Months.SelectByText(user.Month);
     //Years.SelectByText(user.Year);
     FirstName.Type(user.RealFirstName);
     LastName.Type(user.RealLastName);
     Address.Type(user.Address);
     City.Type(user.City);
     State.SelectByText(user.State);
     Zip.Type(user.Zip);
     Phone.Type(user.Phone);
     Alias.Type(user.Alias);
     RegisterButton.Click();
 }
Exemplo n.º 30
0
        public void ShouldSerializeOptions()
        {
            // arrange
            var options = new List <Option> {
                new Option {
                    Value = "Value123"
                }
            };
            var radio = new RadioButtons {
                Options = options
            };

            // act
            var optionsPayload = SlackClient.SerializeObject(options);
            var payload        = SlackClient.SerializeObject(radio);

            // assert
            payload.Should().Contain($"\"options\":{optionsPayload}");
        }
Exemplo n.º 31
0
 public override object VisitRadioButtons(RadioButtons radioButtons)
 {
     if (!radioButtons.SupportsDataType(_currentDataType))
     {
         Report.AddError(radioButtons.Position, MessageFormat, "radiobuttons", StringEnum.GetStringValue(_currentDataType));
     }
     return null;
 }
Exemplo n.º 32
0
	public static void Main(String[] args)
	{
		RadioButtons form = new RadioButtons();
		form.Width = 470;
		form.Height = 470;
		form.Text = "RadioButtons example";
		Application.Run(form);
	}