Ejemplo n.º 1
0
        /// <summary>
        /// apply the text entered from the keyboard onto the visual item located by
        /// the canvas cursor. Handle error where the canvas cursor item is not input
        /// capable.
        /// </summary>
        /// <param name="Cursor"></param>
        /// <param name="Text"></param>
        /// <param name="Reuse"></param>
        /// <returns></returns>
        public Tuple <VisualItem, string> PutKeyboardText(
            CanvasPositionCursor Cursor, string Text, bool Reuse = true)
        {
            string     errmsg     = null;
            VisualItem visualItem = null;

            if (Cursor.IsInputItem( ) == true)
            {
                visualItem = Cursor.PutKeyboardText(Text);

                // send the keyboard input to the master thread. That thread applies input
                // and WTD commands to the master screenContent block.
                if (this.MasterThread != null)
                {
                    var kbInput = new KeyboardInputMessage()
                    {
                        RowCol = Cursor.RowCol as ZeroRowCol,
                        Text   = Text
                    };
                    this.MasterThread.PostInputMessage(kbInput);
                }
            }
            else
            {
                errmsg = "not entry field";
            }

            return(new Tuple <VisualItem, string>(visualItem, errmsg));
        }
Ejemplo n.º 2
0
        private void PostKeyboardInput(Key key)
        {
            // send the keyboard input to the master thread. That thread applies input
            // and WTD commands to the master screenContent block.
            if (this.MasterThread != null)
            {
                var kbInput = new KeyboardInputMessage()
                {
                    KeyCode   = key,
                    ShiftDown = KeyboardExt.IsShiftDown( )
                };
                this.MasterThread.PostInputMessage(kbInput);
//        this.MasterThread.MasterQueue.Enqueue(kbInput);
            }
        }
Ejemplo n.º 3
0
        public void ApplyInput(KeyboardInputMessage Input)
        {
            ContentField contentField = null;
            var          showText     = Input.Text;

            // find the content field in which the input is being applied.
            contentField = this.GetContentField(Input.RowCol);

            // set the "modified" flag of the input field.
            if (contentField != null)
            {
                contentField.ModifiedFlag = true;
            }

            // change the input text to uppercase.
            if ((contentField != null) && (contentField.IsMonocase == true))
            {
                showText = showText.ToUpper();
            }

            // apply the text to the array of content bytes.
            ApplyTextBytes(Input.RowCol, showText.ToEbcdicBytes());
        }