Example #1
0
        private void CreateFamily()
        {
            inputFieldArr[0]            = new Tizen.FH.NUI.Controls.InputField("DefaultInputField");
            inputFieldArr[0].Name       = "DefaultInputField";
            inputFieldArr[0].Size2D     = new Size2D(1080, 95);
            inputFieldArr[0].Position2D = new Position2D(0, posY);
            rootView.Add(inputFieldArr[0]);
            inputFieldArr[0].HintText = "DefaultInputField";
            inputFieldArr[0].CancelButtonClickEvent += OnCancelBtnClickEvent;
            inputFieldArr[0].KeyEvent += OnKeyEvent;

            inputFieldArr[0].FocusGained += (object sender, EventArgs e) =>
            {
                Tizen.Log.Fatal("NUI", "Field0 get focus");
            };

            inputFieldArr[0].FocusLost += (object sender, EventArgs e) =>
            {
                Tizen.Log.Fatal("NUI", "Field0 lost focus");
            };

            posY                       += 100;
            inputFieldArr[1]            = new Tizen.FH.NUI.Controls.InputField("StyleBInputField");
            inputFieldArr[1].Name       = "StyleBInputField";
            inputFieldArr[1].Size2D     = new Size2D(1080, 95);
            inputFieldArr[1].Position2D = new Position2D(0, posY);
            rootView.Add(inputFieldArr[1]);
            inputFieldArr[1].HintText = "StyleBInputField";
            inputFieldArr[1].DeleteButtonClickEvent += OnDeleteBtnClickEvent;
            inputFieldArr[1].AddButtonClickEvent    += OnAddBtnClickEvent;
            inputFieldArr[1].KeyEvent += OnKeyEvent;
        }
Example #2
0
 private void OnAddBtnClickEvent(object sender, Tizen.FH.NUI.Controls.InputField.ButtonClickArgs args)
 {
     if (sender is Tizen.FH.NUI.Controls.InputField)
     {
         Tizen.FH.NUI.Controls.InputField inputfield = sender as Tizen.FH.NUI.Controls.InputField;
         Console.WriteLine("-------, name: " + inputfield.Name + ", args.State = " + args.State);
         inputfield.Text = "Click on the add button";
     }
 }
Example #3
0
        private void OnKeyEvent(object sender, View.KeyEventArgs e)
        {
            if (e.Key.State == Key.StateType.Down)
            {
                Tizen.Log.Fatal("NUI", "OnKeyEvent Key is " + e.Key.KeyPressedName);

                Tizen.FH.NUI.Controls.InputField inputField = sender as Tizen.FH.NUI.Controls.InputField;
                if (inputField != null)
                {
                    if (inputField.Text.Length > 5 && inputField.Text.Length <= 10)
                    {
                        inputField.TextColor = Color.Yellow;
                    }
                    else if (inputField.Text.Length > 10 && inputField.Text.Length <= 15)
                    {
                        inputField.TextColor = Color.Red;
                    }
                    else
                    {
                        inputField.TextColor = Color.Black;
                    }
                }
            }
        }