Exemple #1
0
        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
        {
            InputFieldAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as InputFieldAttributes;

            if (tempAttributes != null)
            {
                attributes = inputFieldAttrs = tempAttributes;
                RelayoutRequest();
            }
        }
Exemple #2
0
        private void Initialize()
        {
            inputFieldAttrs = attributes as InputFieldAttributes;
            if (null == inputFieldAttrs)
            {
                throw new Exception("Fail to get the InputField attributes.");
            }

            bgImage = new ImageView();
            if (null == bgImage)
            {
                throw new Exception("Fail to create background image.");
            }

            textField = new TextField();
            if (null == textField)
            {
                throw new Exception("Fail to create text field.");
            }

            if (null != inputFieldAttrs.BackgroundImageAttributes)
            {
                bgImage.WidthResizePolicy      = ResizePolicyType.FillToParent;
                bgImage.HeightResizePolicy     = ResizePolicyType.FillToParent;
                bgImage.ParentOrigin           = Tizen.NUI.ParentOrigin.Center;
                bgImage.PivotPoint             = Tizen.NUI.PivotPoint.Center;
                bgImage.PositionUsesPivotPoint = true;
                this.Add(bgImage);
            }

            if (null != inputFieldAttrs.InputBoxAttributes)
            {
                textField.WidthResizePolicy      = ResizePolicyType.Fixed;
                textField.HeightResizePolicy     = ResizePolicyType.Fixed;
                textField.ParentOrigin           = Tizen.NUI.ParentOrigin.CenterLeft;
                textField.PivotPoint             = Tizen.NUI.PivotPoint.CenterLeft;
                textField.PositionUsesPivotPoint = true;
                this.Add(textField);

                textField.FocusGained += OnTextFieldFocusGained;
                textField.FocusLost   += OnTextFieldFocusLost;
                textField.TextChanged += OnTextFieldTextChanged;
                textField.KeyEvent    += OnTextFieldKeyEvent;
            }
        }
 public InputFieldAttributes(InputFieldAttributes attrs) : base(attrs)
 {
     if (null == attrs)
     {
         return;
     }
     if (null != attrs.BackgroundImageAttributes)
     {
         BackgroundImageAttributes = attrs.BackgroundImageAttributes.Clone() as ImageAttributes;
     }
     if (null != attrs.InputBoxAttributes)
     {
         InputBoxAttributes = attrs.InputBoxAttributes.Clone() as TextFieldAttributes;
     }
     if (null != attrs.Space)
     {
         Space = attrs.Space;
     }
 }
Exemple #4
0
 public InputField(InputFieldAttributes attributes) : base(attributes)
 {
     Initialize();
 }