private void CmbbxVarRead_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count == 0) { SelectedStoredVariable = e.RemovedItems[0] as StoredVariable; cmbbxVarRead.SelectedItem = e.RemovedItems[0]; } else if (this.SelectedStoredVariable.Name == null) { SelectedStoredVariable = e.AddedItems[0] as StoredVariable; } }
public UINumberSetting(StoredVariable variable) { this.storedVar = variable; Width.Set(0, 1f); Height.Set(60f, 0f); UIText title = new UIText(storedVar.DisplayName, 0.9f, false); title.MaxWidth.Set(-10f, 1f); numberBox = new UITextPanel <string>("000000", 0.8f, false); numberBox.Top.Set(-18, 0.5f); numberBox.Left.Set(-110, 1f); numberBox.Width.Set(120f, 0f); _defaultBackground = numberBox.BackgroundColor; _defaultBorder = numberBox.BorderColor; numberBox.OnMouseOver += BoxMouseOver; numberBox.OnClick += BoxOnClick; useDecimalSystem = false; int min = (int)(storedVar.valMin - 0.5f); int max = (int)storedVar.valMax; if (min - max < 200 && storedVar.IsDecimalNumbers) { // set up to allow normalised increments useDecimalSystem = true; min = (int)(min * decimalIncrement - 0.5f); max = (int)(max * decimalIncrement); } numberBar = new UIValueBar(min, max); numberBar.Top.Set(-20f, 1f); numberBar.Left.Set(-6f, 0f); numberBar.OnMouseUp += BarMouseUp; base.Append(numberBar); base.Append(numberBox); base.Append(title); }
public UIBoolSetting(StoredVariable variable) { this.storedVar = variable; Width.Set(0, 1f); Height.Set(40f, 0f); UIText title = new UIText(storedVar.DisplayName, 0.9f, false); title.MaxWidth.Set(-10f, 1f); booleanSetting = new UITextPanel <string>("FILLER", 0.8f, false); booleanSetting.Top.Set(-18, 0.5f); booleanSetting.Left.Set(-46, 1f); booleanSetting.MinWidth.Set(60f, 0f); _defaultBackground = booleanSetting.BackgroundColor; _defaultBorder = booleanSetting.BorderColor; booleanSetting.OnMouseOver += boxOnMouseOver; booleanSetting.OnClick += boxOnClick; booleanSetting.OnMouseUp += boxOnMouseUpOut; booleanSetting.OnMouseOut += boxOnMouseUpOut; base.Append(booleanSetting); base.Append(title); }
public IFluentOperatingTime StoreStatusIn(StoredVariable storedVariable) { statusVariable = storedVariable; return this; }