Beispiel #1
0
            internal void UpdateValueFromText()
            {
                var newValue = StringToValue(text);
                TextInputBaseField <TValueType> parentTextField = (TextInputBaseField <TValueType>)parent;

                parentTextField.value = newValue;
            }
 void AddControl <T1>(TextInputBaseField <T1> field, NodeSlot slot)
 {
     if (slot is IHasValue <T1> value)
     {
         field.value = value.value;
     }
     field.RegisterValueChangedCallback(OnValueChange);
     Add(field);
 }
 private TextInputBaseField <T> AddControl <T>(AbstractNode node, TextInputBaseField <T> field, ReflectionProperty property)
 {
     field.value = (T)property.GetValue(node);
     field.RegisterValueChangedCallback(e =>
     {
         node.owner.owner.RegisterCompleteObjectUndo(typeof(T).Name + " Change");
         property.SetValue(node, e.newValue);
         node.Dirty(ModificationScope.Node);
     });
     return(field);
 }
            internal void MoveFocusToCompositeRoot()
            {
                TextInputBaseField <TValueType> parentTextField = (TextInputBaseField <TValueType>)parent;

                parentTextField.Focus();
            }
            internal void UpdateTextFromValue()
            {
                TextInputBaseField <TValueType> parentTextField = (TextInputBaseField <TValueType>)parent;

                parentTextField.UpdateTextFromValue();
            }
Beispiel #6
0
 // HasFocus on textField should really see if the child TextInput hasFocus
 public static bool HasFocus <T>(this TextInputBaseField <T> texInput)
 {
     return(((VisualElement)texInput.Query(TextInputBaseField <T> .textInputUssName)).HasFocus());
 }