internal void UpdateValueFromText() { var newValue = StringToValue(text); TextInputBaseField <TValueType> parentTextField = (TextInputBaseField <TValueType>)parent; parentTextField.value = newValue; }
internal void UpdateValueFromText() { TValueType value = this.StringToValue(this.text); TextInputBaseField <TValueType> textInputBaseField = (TextInputBaseField <TValueType>)base.parent; textInputBaseField.value = value; }
protected TextInputBaseField(string label, int maxLength, char maskChar, TextInputBaseField <TValueType> .TextInputBase textInputBase) { this.< textHandle > k__BackingField = TextHandle.New(); base..ctor(label, textInputBase); base.tabIndex = 0; base.delegatesFocus = false; base.AddToClassList(TextInputBaseField <TValueType> .ussClassName); base.labelElement.AddToClassList(TextInputBaseField <TValueType> .labelUssClassName); base.visualInput.AddToClassList(TextInputBaseField <TValueType> .inputUssClassName); this.m_TextInputBase = textInputBase; this.m_TextInputBase.maxLength = maxLength; this.m_TextInputBase.maskChar = maskChar; base.RegisterCallback <AttachToPanelEvent>(new EventCallback <AttachToPanelEvent>(this.OnAttachToPanel), TrickleDown.NoTrickleDown); }
public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) { base.Init(ve, bag, cc); TextInputBaseField <TValueType> textInputBaseField = (TextInputBaseField <TValueType>)ve; textInputBaseField.maxLength = this.m_MaxLength.GetValueFromBag(bag, cc); textInputBaseField.isPasswordField = this.m_Password.GetValueFromBag(bag, cc); textInputBaseField.isReadOnly = this.m_IsReadOnly.GetValueFromBag(bag, cc); string valueFromBag = this.m_MaskCharacter.GetValueFromBag(bag, cc); bool flag = !string.IsNullOrEmpty(valueFromBag); if (flag) { textInputBaseField.maskChar = valueFromBag[0]; } textInputBaseField.text = this.m_Text.GetValueFromBag(bag, cc); }
private static void SyncGUIStyle(TextInputBaseField <TValueType> .TextInputBase textInput, GUIStyle style) { ComputedStyle computedStyle = textInput.computedStyle; style.alignment = computedStyle.unityTextAlign.value; style.wordWrap = (computedStyle.whiteSpace.value == WhiteSpace.Normal); style.clipping = ((computedStyle.overflow.value == OverflowInternal.Visible) ? TextClipping.Overflow : TextClipping.Clip); bool flag = computedStyle.unityFont.value != null; if (flag) { style.font = computedStyle.unityFont.value; } style.fontSize = (int)computedStyle.fontSize.value.value; style.fontStyle = computedStyle.unityFontStyleAndWeight.value; int left = computedStyle.unitySliceLeft.value; int top = computedStyle.unitySliceTop.value; int right = computedStyle.unitySliceRight.value; int bottom = computedStyle.unitySliceBottom.value; TextInputBaseField <TValueType> .TextInputBase.AssignRect(style.border, left, top, right, bottom); bool flag2 = TextInputBaseField <TValueType> .TextInputBase.IsLayoutUsingPercent(textInput); if (flag2) { textInput.DeferGUIStyleRectSync(); } else { left = (int)computedStyle.marginLeft.value.value; top = (int)computedStyle.marginTop.value.value; right = (int)computedStyle.marginRight.value.value; bottom = (int)computedStyle.marginBottom.value.value; TextInputBaseField <TValueType> .TextInputBase.AssignRect(style.margin, left, top, right, bottom); left = (int)computedStyle.paddingLeft.value.value; top = (int)computedStyle.paddingTop.value.value; right = (int)computedStyle.paddingRight.value.value; bottom = (int)computedStyle.paddingBottom.value.value; TextInputBaseField <TValueType> .TextInputBase.AssignRect(style.padding, left, top, right, bottom); } }
protected TextInputBaseField(int maxLength, char maskChar, TextInputBaseField <TValueType> .TextInputBase textInputBase) : this(null, maxLength, maskChar, textInputBase) { }