public void AddButton(MenuRadioButton button) { if (button.Active && actives.Count < maxActive) { actives.Add(button); } button.Parent = this; button.Enabled = _enabled; _buttons.Add(button); }
public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) int count = _buttons.Count; for (int i = 0; i < count; i++) { if (_buttons[i].Contains(e.CanvasLocation)) { GH_ObjectResponse val = _buttons[i].RespondToMouseDown(sender, e); if ((int)val != 0) { _activeControl = _buttons[i]; return(val); } } } return((GH_ObjectResponse)0); }
private void Update() { _ = _buttons.Count; int count = actives.Count; if (count > maxActive) { int num = count - maxActive; for (int i = 0; i < num; i++) { MenuRadioButton menuRadioButton = actives[0]; actives.RemoveAt(0); menuRadioButton.Active = false; } } else { if (count >= minActive) { return; } int num2 = count - maxActive; int num3 = 0; for (int j = 0; j < num2; j++) { if (!actives.Contains(_buttons[num3])) { MenuRadioButton menuRadioButton2 = _buttons[num3]; menuRadioButton2.Active = true; actives.Add(menuRadioButton2); j--; } num3++; } } }