/// <summary>
 /// Hide imfManager.
 /// </summary>
 private void HideImf()
 {
     ImfManager.Get().Deactivate();
     ImfManager.Get().HideInputPanel();
     Tizen.Log.Fatal("NUI", "Hide ImfManager!!!!!");
     //FocusManager.Instance.SetCurrentFocusView(guide);
 }
Пример #2
0
        /// <summary>
        /// InputField initialisation.
        /// </summary>
        private void OnIntialize()
        {
            imf = ImfManager.Get();
            imf.AutoEnableInputPanel(true);
            isImfVisible = false;

            // Add a _text label to the window
            _textField = new TextField();
            PropertyMap map = new PropertyMap();

            map.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
            map.Insert((int)ImageVisualProperty.URL, new PropertyValue(textFieldBG));
            _textField.Background             = map;
            _textField.FontFamily             = "Samsung One 400";
            _textField.PrimaryCursorColor     = new Color(0, 129, 198, 100);
            _textField.SecondaryCursorColor   = new Color(0, 129, 198, 100);
            _textField.CursorWidth            = 2;
            _textField.PlaceholderText        = "Input your Name";
            _textField.PlaceholderTextFocused = "Input your Name";
            _textField.ParentOrigin           = ParentOrigin.TopLeft;
            _textField.PivotPoint             = PivotPoint.TopLeft;
            _textField.Position            = new Position(30, 18, 0);
            _textField.Size2D              = new Size2D(1000, 80);
            _textField.HorizontalAlignment = HorizontalAlignment.Begin;
            _textField.VerticalAlignment   = VerticalAlignment.Center;
            _textField.PointSize           = DeviceCheck.PointSize10;
            //_textField.PointSize = 10.0f;
            _textField.Focusable    = true;
            _textField.FocusGained += OnFocusGained;
            _textField.FocusLost   += OnFocusLost;
            //_textField.KeyEvent += OnIMEKeyEvent;

            // Create TextField's BackgroundView.
            PropertyMap bgMap = new PropertyMap();

            bgMap.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
            bgMap.Insert((int)ImageVisualProperty.URL, new PropertyValue(textFieldBG));
            bgView              = new View();
            bgView.Background   = bgMap;
            bgView.ParentOrigin = ParentOrigin.TopLeft;
            bgView.PivotPoint   = PivotPoint.TopLeft;
            bgView.Size2D       = new Size2D(1060, 116);
            bgView.Add(_textField);
        }
Пример #3
0
        public ImfManager.ImfCallbackData ImfManager_ImfManagerEventReceived(object sender, ImfManager.EventReceivedEventArgs e)
        {
            Tizen.Log.Debug("NUI", "ImfManager_ImfManagerEventReceived()!");

            Tizen.Log.Debug("NUI", "e.ImfEventData.PredictiveString= " + e?.ImfEventData?.PredictiveString);
            Tizen.Log.Debug("NUI", "e.ImfEventData.CursorOffset= " + e?.ImfEventData?.CursorOffset);
            Tizen.Log.Debug("NUI", "e.ImfEventData.EventName= " + e?.ImfEventData?.EventName);
            Tizen.Log.Debug("NUI", "e.ImfEventData.NumberOfChars= " + e?.ImfEventData?.NumberOfChars);

            //Be able to compare VD specific private command with ImfEventData.predictiveString
            if (e.ImfEventData.PredictiveString == "IME_F31")
            {
                ImfManager.Get().Deactivate();
                ImfManager.Get().HideInputPanel();
                // Do Something the user wants
                Tizen.Log.Debug("NUI", "ImfManager ImfEventData.PredictiveString: IME_F31!!!");
            }
            ImfManager.ImfCallbackData callbackData = new ImfManager.ImfCallbackData(true, 0, e.ImfEventData.PredictiveString, false);
            Tizen.Log.Debug("NUI", "ImfManager return callbackData!!!");
            return(callbackData);
        }
Пример #4
0
        public void Initialize()
        {
            Window window = Window.Instance;

            window.BackgroundColor = Color.White;

            PropertyMap propertyMap = new PropertyMap();

            propertyMap.Add("placeholderText", new PropertyValue("TextEditor Placeholder Text"));
            propertyMap.Add("placeholderColor", new PropertyValue(Color.Red));
            propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f));

            PropertyMap fontStyleMap = new PropertyMap();

            fontStyleMap.Add("weight", new PropertyValue("bold"));
            fontStyleMap.Add("width", new PropertyValue("condensed"));
            fontStyleMap.Add("slant", new PropertyValue("italic"));
            propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap));


            editor = new TextEditor()
            {
                Size2D          = new Size2D(500, 300),
                Position2D      = new Position2D(10, 550),
                BackgroundColor = Color.Magenta,
                Focusable       = true,
                Placeholder     = propertyMap
            };

            window.Add(editor);

            editor.TextChanged += (obj, e) => {
                Tizen.Log.Fatal("NUI", "editor line count: " + e.TextEditor.LineCount);
            };

            editor.ScrollStateChanged += (obj, e) => {
                Tizen.Log.Fatal("NUI", "editor scroll state:" + e.ScrollState);
            };

            editor.KeyEvent += OnKeyEvent;


            Tizen.Log.Debug("NUI", "editor id: " + editor.ID);

            imfManager = ImfManager.Get();
            imfManager.AutoEnableInputPanel(false);
            imfManager.SetInputPanelUserData("layouttype = 1 & entrylimit = 255 & action = clearall_for_voice_commit & caller = org.volt.search - all");


            // send privatecommand event
            ImfManager.ImfEventData imfevent = new ImfManager.ImfEventData(ImfManager.ImfEvent.PrivateCommand, "", 0, 0);
            imfManager.EventReceived += ImfManager_ImfManagerEventReceived;

            imfManager.LanguageChanged += ImfManager_LanguageChanged;

            imfManager.Activated += (obj, e) => {
                Tizen.Log.Debug("NUI", "ImfManager Activated !!!!!");
            };
            imfManager.StatusChanged += (obj, e) => {
                Tizen.Log.Debug("NUI", "ImfManager StatusChanged: !!!!!" + e.StatusChanged);
            };
            imfManager.Resized += (obj, e) =>
            {
                Tizen.Log.Debug("NUI", "ImfManager Resized !!!!!");
            };
            imfManager.KeyboardTypeChanged += (obj, e) => {
                Tizen.Log.Debug("NUI", "ImfManager KeyboardTypeChanged: !!!!!" + e.KeyboardType);
            };

            button = new PushButton()
            {
                LabelText              = "Button",
                Size2D                 = new Size2D(400, 200),
                Position2D             = new Position2D(10, -10),
                ParentOrigin           = ParentOrigin.BottomLeft,
                PivotPoint             = PivotPoint.BottomLeft,
                PositionUsesPivotPoint = true,
                Focusable              = true
            };

            window.Add(button);

            button.UpFocusableView   = editor;
            editor.DownFocusableView = button;

            FocusManager.Instance.SetCurrentFocusView(button);
        }
 /// <summary>
 /// Show imfManager.
 /// </summary>
 private void ShowImf()
 {
     ImfManager.Get().Activate();
     ImfManager.Get().ShowInputPanel();
 }