private void SetlMode(uc_Params CurParams) // set mode for ESC?l command
        {
            Int32 OptInt = 0;

            foreach (String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = Convert.ToInt32(CurOption);
                }
                catch (Exception CurException)
                {
                    MessageBox.Show(CurException.Message);
                }

                switch (OptInt)
                {
                case 1:     // set LocalEcho on
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.LocalEchoOff;
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 2
0
        private void ClearTabs(uc_Params CurParams) // TBC
        {
            Int32 Param = 0;

            if (CurParams.Count() > 0)
            {
                Param = Convert.ToInt32(CurParams.Elements[0]);
            }

            switch (Param)
            {
            case 0:     // Current Position
                this.TabStops.Columns[this.Caret.Pos.X] = false;
                break;

            case 3:     // All Tabs
                for (Int32 i = 0; i < this.TabStops.Columns.Length; i++)
                {
                    this.TabStops.Columns[i] = false;
                }

                break;

            default:
                break;
            }
        }
Esempio n. 3
0
        public void ClearTabs(uc_Params CurParams)  // TBC
        {
            //prntSome.printSome("ClearTabs");
            System.Int32 Param = 0;

            if (CurParams.Count() > 0)
            {
                Param = System.Convert.ToInt32(CurParams.Elements[0]);
            }

            switch (Param)
            {
            case 0:     // Current Position
                this.TabStops.Columns[this.Caret.Pos.X] = false;
                break;

            case 3:     // All Tabs
                for (int i = 0; i < this.TabStops.Columns.Length; i++)
                {
                    this.TabStops.Columns[i] = false;
                }
                break;

            default:
                break;
            }
        }
Esempio n. 4
0
        private void DeleteLine(uc_Params CurParams)
        {
            // if we're not in the scroll region then bail
            if (this.Caret.Pos.Y < this.TopMargin || this.Caret.Pos.Y > this.BottomMargin)
            {
                return;
            }

            Int32 NbrOff = 1;

            if (CurParams.Count() > 0)
            {
                NbrOff = Convert.ToInt32(CurParams.Elements[0]);
            }

            while (NbrOff > 0)
            {
                // Shift all the rows from below the current row to the bottom margin up one place
                for (Int32 i = this.Caret.Pos.Y; i < this.BottomMargin; i++)
                {
                    this.CharGrid[i]   = this.CharGrid[i + 1];
                    this.AttribGrid[i] = this.AttribGrid[i + 1];
                }

                this.CharGrid[this.BottomMargin]   = new Char[this._cols];
                this.AttribGrid[this.BottomMargin] = new CharAttribStruct[this._cols];

                NbrOff--;
            }
        }
Esempio n. 5
0
        private void SetlMode(uc_Params CurParams)  // set mode for ESC?l command
        {
            //prntSome.printSome("SetlMode");
            System.Int32 OptInt = 0;

            foreach (System.String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = System.Convert.ToInt32(CurOption);
                }
                catch (System.Exception CurException)
                {
                    System.Console.WriteLine(CurException.Message);
                }

                switch (OptInt)
                {
                case 1:     // set LocalEcho on
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.LocalEchoOff;
                    break;

                default:
                    break;
                }
            }
        }
        private void SetqmlMode(uc_Params CurParams) // set mode for ESC?l command
        {
            Int32 OptInt = 0;

            foreach (String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = Convert.ToInt32(CurOption);
                }
                catch (Exception CurException)
                {
                    MessageBox.Show(CurException.Message);
                }

                switch (OptInt)
                {
                case 1:     // set cursor keys to normal cursor mode
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.CursorAppln;
                    break;

                case 2:     // unlock the keyboard
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.Locked;
                    break;

                case 3:     // set terminal to 80 column mode
                    this.SetSize(this._rows, 80);
                    break;

                case 5:     // Dark Background Mode
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.LightBackground;
                    this.RefreshEvent();
                    break;

                case 6:     // Origin Mode Absolute
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.OriginRelative;
                    this.CaretToAbs(0, 0);
                    break;

                case 7:     // Autowrap Off
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.AutoWrap;
                    break;

                case 8:     // AutoRepeat Off
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.Repeat;
                    break;

                case 42:     // DECNRCM National Charset
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.National;
                    break;

                case 66:     // Numeric Keypad Application Mode On
                    this.Modes.Flags = this.Modes.Flags & ~uc_Mode.KeypadAppln;
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 7
0
        private void InsertLine(uc_Params CurParams)
        {
            //prntSome.printSome("InsertLine");
            // if we're not in the scroll region then bail
            if (this.Caret.Pos.Y < this.TopMargin ||
                this.Caret.Pos.Y > this.BottomMargin)
            {
                return;
            }

            System.Int32 NbrOff = 1;

            if (CurParams.Count() > 0)
            {
                NbrOff = System.Convert.ToInt32(CurParams.Elements[0]);
            }

            while (NbrOff > 0)
            {
                // Shift all the rows from the current row to the bottom margin down one place
                for (int i = this.BottomMargin; i > this.Caret.Pos.Y; i--)
                {
                    this.CharGrid[i]   = this.CharGrid[i - 1];
                    this.AttribGrid[i] = this.AttribGrid[i - 1];
                }

                this.CharGrid[this.Caret.Pos.Y]   = new System.Char[this.Columns];
                this.AttribGrid[this.Caret.Pos.Y] = new CharAttribs[this.Columns];

                NbrOff--;
            }
        }
 public ParserEventArgs(
     Actions p1,
     Char p2,
     String p3,
     uc_Params p4)
 {
     this.Action      = p1;
     this.CurChar     = p2;
     this.CurSequence = p3;
     this.CurParams   = p4;
 }
 public ParserEventArgs(
     Actions p1,
     Char p2,
     String p3,
     uc_Params p4)
 {
     this.Action = p1;
     this.CurChar = p2;
     this.CurSequence = p3;
     this.CurParams = p4;
 }
Esempio n. 10
0
 public ParserEventArgs(
     Actions p1,
     System.Char p2,
     System.String p3,
     uc_Params p4)
 {
     //prntSome.printSome("ParserEventArgs");
     Action      = p1;
     CurChar     = p2;
     CurSequence = p3;
     CurParams   = p4;
 }
Esempio n. 11
0
 public NvtParserEventArgs(
     NvtActions        p1,
     System.Char       p2,
     System.String     p3,
     uc_Params         p4)
 {
     //prntSome.printSome("NvtParserEventArgs");
     Action       = p1;
     CurChar      = p2;
     CurSequence  = p3;
     CurParams    = p4;
 }
        private void SetScrollRegion(uc_Params CurParams)
        {
            if (CurParams.Count() > 0)
            {
                this.TopMargin = Convert.ToInt32(CurParams.Elements[0]) - 1;
            }

            if (CurParams.Count() > 1)
            {
                this.BottomMargin = Convert.ToInt32(CurParams.Elements[1]) - 1;
            }

            if (this.BottomMargin == 0)
            {
                this.BottomMargin = this._rows - 1;
            }

            if (this.TopMargin < 0)
            {
                this.BottomMargin = 0;
            }
        }
Esempio n. 13
0
        private void SetScrollRegion(uc_Params CurParams)
        {
            //prntSome.printSome("SetScrollRegion");
            if (CurParams.Count() > 0)
            {
                this.TopMargin = System.Convert.ToInt32(CurParams.Elements[0]) - 1;
            }

            if (CurParams.Count() > 1)
            {
                this.BottomMargin = System.Convert.ToInt32(CurParams.Elements[1]) - 1;
            }

            if (this.BottomMargin == 0)
            {
                this.BottomMargin = this.Rows - 1;
            }

            if (this.TopMargin < 0)
            {
                this.BottomMargin = 0;
            }
        }
        private void SetqmlMode(uc_Params CurParams) // set mode for ESC?l command
        {
            Int32 OptInt = 0;

            foreach (String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = Convert.ToInt32(CurOption);
                }
                catch (Exception CurException)
                {
                    MessageBox.Show(CurException.Message);
                }

                switch (OptInt)
                {
                    case 1: // set cursor keys to normal cursor mode
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.CursorAppln;
                        break;

                    case 2: // unlock the keyboard
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.Locked;
                        break;

                    case 3: // set terminal to 80 column mode
                        this.SetSize(this._rows, 80);
                        break;

                    case 5: // Dark Background Mode
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.LightBackground;
                        this.RefreshEvent();
                        break;

                    case 6: // Origin Mode Absolute
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.OriginRelative;
                        this.CaretToAbs(0, 0);
                        break;

                    case 7: // Autowrap Off
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.AutoWrap;
                        break;

                    case 8: // AutoRepeat Off
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.Repeat;
                        break;

                    case 42: // DECNRCM National Charset
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.National;
                        break;

                    case 66: // Numeric Keypad Application Mode On
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.KeypadAppln;
                        break;

                    default:
                        break;
                }
            }
        }
        private void SetqmhMode(uc_Params CurParams) // set mode for ESC?h command
        {
            Int32 OptInt = 0;

            foreach (String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = Convert.ToInt32(CurOption);
                }
                catch (Exception CurException)
                {
                    // Console.WriteLine (CurException.Message);
                    MessageBox.Show(CurException.Message);
                }

                switch (OptInt)
                {
                    case 1: // set cursor keys to application mode
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.CursorAppln;
                        break;

                    case 2: // lock the keyboard
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.Locked;
                        break;

                    case 3: // set terminal to 132 column mode
                        this.SetSize(this._rows, 132);
                        break;

                    case 5: // Light Background Mode
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.LightBackground;
                        this.RefreshEvent();
                        break;

                    case 6: // Origin Mode Relative
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.OriginRelative;
                        this.CaretToRel(0, 0);
                        break;

                    case 7: // Autowrap On
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.AutoWrap;
                        break;

                    case 8: // AutoRepeat On
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.Repeat;
                        break;

                    case 42: // DECNRCM Multinational Charset
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.National;
                        break;

                    case 66: // Numeric Keypad Application Mode On
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.KeypadAppln;
                        break;

                    default:
                        break;
                }
            }
        }
Esempio n. 16
0
        private void SetCharAttribs(uc_Params CurParams)
        {
            //prntSome.printSome("SetCharAttribs");
            if (CurParams.Count() < 1)
            {
                this.ClearCharAttribs();
                return;
            }

            for (int i = 0; i < CurParams.Count(); i++)
            {
                switch (System.Convert.ToInt32(CurParams.Elements[i]))
                {
                case 0:
                    this.ClearCharAttribs();
                    break;

                case 1:
                    this.CharAttribs.IsBold = true;
                    break;

                case 4:
                    this.CharAttribs.IsUnderscored = true;
                    break;

                case 5:
                    this.CharAttribs.IsBlinking = true;
                    break;

                case 7:
                    this.CharAttribs.IsInverse = true;
                    break;

                case 10:
                    this.G0.Set = uc_Chars.Sets.ASCII;
                    break;

                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                    //alternate font
                    this.G0.Set = uc_Chars.Sets.DECSG;
                    break;

                case 22:
                    this.CharAttribs.IsBold = false;
                    break;

                case 24:
                    this.CharAttribs.IsUnderscored = false;
                    break;

                case 25:
                    this.CharAttribs.IsBlinking = false;
                    break;

                case 27:
                    this.CharAttribs.IsInverse = false;
                    break;

                case 30:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.Black;
                    break;

                case 31:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.Red;
                    break;

                case 32:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.Green;
                    break;

                case 33:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.Yellow;
                    break;

                case 34:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.Blue;
                    break;

                case 35:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.Magenta;
                    break;

                case 36:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.Cyan;
                    break;

                case 37:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = System.Drawing.Color.White;
                    break;

                case 40:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.Black;
                    break;

                case 41:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.Red;
                    break;

                case 42:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.Green;
                    break;

                case 43:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.Yellow;
                    break;

                case 44:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.Blue;
                    break;

                case 45:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.Magenta;
                    break;

                case 46:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.Cyan;
                    break;

                case 47:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = System.Drawing.Color.White;
                    break;

                default:
                    break;
                }
            }
        }
        private void SetCharAttribs(uc_Params CurParams)
        {
            if (CurParams.Count() < 1)
            {
                this.ClearCharAttribs();
                return;
            }

            for (int i = 0; i < CurParams.Count(); i++)
            {
                switch (Convert.ToInt32(CurParams.Elements[i]))
                {
                    case 0:
                        this.ClearCharAttribs();
                        break;

                    case 1:
                        this.CharAttribs.IsBold = true;
                        break;

                    case 4:
                        this.CharAttribs.IsUnderscored = true;
                        break;

                    case 5:
                        this.CharAttribs.IsBlinking = true;
                        break;

                    case 7:
                        this.CharAttribs.IsInverse = true;
                        break;

                    case 22:
                        this.CharAttribs.IsBold = false;
                        break;

                    case 24:
                        this.CharAttribs.IsUnderscored = false;
                        break;

                    case 25:
                        this.CharAttribs.IsBlinking = false;
                        break;

                    case 27:
                        this.CharAttribs.IsInverse = false;
                        break;

                    case 30:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.Black;
                        break;

                    case 31:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.Red;
                        break;

                    case 32:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.Green;
                        break;

                    case 33:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.Yellow;
                        break;

                    case 34:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.Blue;
                        break;

                    case 35:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.Magenta;
                        break;

                    case 36:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.Cyan;
                        break;

                    case 37:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = Color.White;
                        break;

                    case 40:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.Black;
                        break;

                    case 41:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.Red;
                        break;

                    case 42:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.Green;
                        break;

                    case 43:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.Yellow;
                        break;

                    case 44:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.Blue;
                        break;

                    case 45:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.Magenta;
                        break;

                    case 46:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.Cyan;
                        break;

                    case 47:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = Color.White;
                        break;

                    default:
                        break;
                }
            }
        }
        // set mode for ESC?h command
        private void SethMode(uc_Params CurParams)
        {
            //prntSome.printSome("SethMode");
            System.Int32 OptInt = 0;

            foreach (System.String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = System.Convert.ToInt32 (CurOption);
                }
                catch (System.Exception CurException)
                {
                    System.Console.WriteLine (CurException.Message);
                }

                switch (OptInt)
                {
                    case 1: // set local echo off
                        this.Modes.Flags = this.Modes.Flags | uc_Mode.LocalEchoOff;
                        break;

                    default:
                        break;
                }
            }
        }
        private void SetScrollRegion(uc_Params CurParams)
        {
            //prntSome.printSome("SetScrollRegion");
            if (CurParams.Count () > 0)
            {
                this.TopMargin = System.Convert.ToInt32 (CurParams.Elements[0]) - 1;
            }

            if (CurParams.Count () > 1)
            {
                this.BottomMargin = System.Convert.ToInt32 (CurParams.Elements[1]) - 1;
            }

            if (this.BottomMargin == 0)
            {
                this.BottomMargin = this.Rows - 1;
            }

            if (this.TopMargin < 0)
            {
                this.BottomMargin = 0;
            }
        }
        // TBC
        private void ClearTabs(uc_Params CurParams)
        {
            System.Int32 Param = 0;

            if (CurParams.Count () > 0)
            {
                Param = System.Convert.ToInt32 (CurParams.Elements[0]);
            }

            switch (Param)
            {
                case 0: // Current Position
                    this.TabStops.Columns[this.Caret.Pos.X] = false;
                    break;

                case 3: // All Tabs
                    for (int i = 0; i < this.TabStops.Columns.Length; i++)
                    {
                        this.TabStops.Columns[i] = false;
                    }
                    break;

                default:
                    break;
            }
        }
        private void DeleteLine(uc_Params CurParams)
        {
            // if we're not in the scroll region then bail
            if (this.Caret.Pos.Y < this.TopMargin || this.Caret.Pos.Y > this.BottomMargin)
            {
                return;
            }

            Int32 NbrOff = 1;
            if (CurParams.Count() > 0)
            {
                NbrOff = Convert.ToInt32(CurParams.Elements[0]);
            }

            while (NbrOff > 0)
            {
                // Shift all the rows from below the current row to the bottom margin up one place
                for (Int32 i = this.Caret.Pos.Y; i < this.BottomMargin; i++)
                {
                    this.CharGrid[i] = this.CharGrid[i + 1];
                    this.AttribGrid[i] = this.AttribGrid[i + 1];
                }

                this.CharGrid[this.BottomMargin] = new Char[this._cols];
                this.AttribGrid[this.BottomMargin] = new CharAttribStruct[this._cols];

                NbrOff--;
            }
        }
        // set mode for ESC?l command
        private void SetlMode(uc_Params CurParams)
        {
            System.Int32 OptInt = 0;

            foreach (System.String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = System.Convert.ToInt32 (CurOption);
                }
                catch (System.Exception CurException)
                {
                    //System.Console.WriteLine (CurException.Message);
                    MessageBox.Show(CurException.Message);
                }

                switch (OptInt)
                {
                    case 1: // set LocalEcho on
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.LocalEchoOff;
                        break;

                    default:
                        break;
                }
            }
        }
        private void InsertLine(uc_Params CurParams)
        {
            // if we're not in the scroll region then bail
            if (this.Caret.Pos.Y < this.TopMargin ||
                this.Caret.Pos.Y > this.BottomMargin)
            {
                return;
            }

            System.Int32 NbrOff = 1;

            if (CurParams.Count () > 0)
            {
                NbrOff = System.Convert.ToInt32 (CurParams.Elements[0]);
            }

            while (NbrOff > 0)
            {

                // Shift all the rows from the current row to the bottom margin down one place
                for (int i = this.BottomMargin; i > this.Caret.Pos.Y; i--)
                {
                    this.CharGrid[i]   = this.CharGrid[i - 1];
                    this.AttribGrid[i] = this.AttribGrid[i - 1];
                }

                this.CharGrid[this.Caret.Pos.Y]   = new System.Char[this._cols];
                this.AttribGrid[this.Caret.Pos.Y] = new CharAttribStruct[this._cols];

                NbrOff--;
            }
        }
        private void SetCharAttribs(uc_Params CurParams)
        {
            if (CurParams.Count() < 1)
            {
                this.ClearCharAttribs();
                return;
            }

            for (int i = 0; i < CurParams.Count(); i++)
            {
                switch (Convert.ToInt32(CurParams.Elements[i]))
                {
                case 0:
                    this.ClearCharAttribs();
                    break;

                case 1:
                    this.CharAttribs.IsBold = true;
                    break;

                case 4:
                    this.CharAttribs.IsUnderscored = true;
                    break;

                case 5:
                    this.CharAttribs.IsBlinking = true;
                    break;

                case 7:
                    this.CharAttribs.IsInverse = true;
                    break;

                case 22:
                    this.CharAttribs.IsBold = false;
                    break;

                case 24:
                    this.CharAttribs.IsUnderscored = false;
                    break;

                case 25:
                    this.CharAttribs.IsBlinking = false;
                    break;

                case 27:
                    this.CharAttribs.IsInverse = false;
                    break;

                case 30:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.Black;
                    break;

                case 31:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.Red;
                    break;

                case 32:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.Green;
                    break;

                case 33:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.Yellow;
                    break;

                case 34:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.Blue;
                    break;

                case 35:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.Magenta;
                    break;

                case 36:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.Cyan;
                    break;

                case 37:
                    this.CharAttribs.UseAltColor = true;
                    this.CharAttribs.AltColor    = Color.White;
                    break;

                case 40:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.Black;
                    break;

                case 41:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.Red;
                    break;

                case 42:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.Green;
                    break;

                case 43:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.Yellow;
                    break;

                case 44:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.Blue;
                    break;

                case 45:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.Magenta;
                    break;

                case 46:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.Cyan;
                    break;

                case 47:
                    this.CharAttribs.UseAltBGColor = true;
                    this.CharAttribs.AltBGColor    = Color.White;
                    break;

                default:
                    break;
                }
            }
        }
        private void SetlMode(uc_Params CurParams) // set mode for ESC?l command
        {
            Int32 OptInt = 0;

            foreach (String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = Convert.ToInt32(CurOption);
                }
                catch (Exception CurException)
                {
                    MessageBox.Show(CurException.Message);
                }

                switch (OptInt)
                {
                    case 1: // set LocalEcho on
                        this.Modes.Flags = this.Modes.Flags & ~uc_Mode.LocalEchoOff;
                        break;

                    default:
                        break;
                }
            }
        }
        private void SetScrollRegion(uc_Params CurParams)
        {
            if (CurParams.Count() > 0)
            {
                this.TopMargin = Convert.ToInt32(CurParams.Elements[0]) - 1;
            }

            if (CurParams.Count() > 1)
            {
                this.BottomMargin = Convert.ToInt32(CurParams.Elements[1]) - 1;
            }

            if (this.BottomMargin == 0)
            {
                this.BottomMargin = this._rows - 1;
            }

            if (this.TopMargin < 0)
            {
                this.BottomMargin = 0;
            }
        }
Esempio n. 27
0
        private void SetqmhMode(uc_Params CurParams)  // set mode for ESC?h command
        {
            //prntSome.printSome("SetqmhMode");
            System.Int32 OptInt = 0;

            foreach (System.String CurOption in CurParams.Elements)
            {
                try
                {
                    OptInt = System.Convert.ToInt32(CurOption);
                }
                catch (System.Exception CurException)
                {
                    System.Console.WriteLine(CurException.Message);
                }

                switch (OptInt)
                {
                case 1:     // set cursor keys to application mode
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.CursorAppln;
                    break;

                case 2:     // lock the keyboard
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.Locked;
                    break;

                case 3:     // set terminal to 132 column mode
                    this.SetSize(this.Rows, 132);
                    break;

                case 5:     // Light Background Mode
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.LightBackground;
                    this.RefreshEvent();
                    break;

                case 6:     // Origin Mode Relative
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.OriginRelative;
                    this.CaretToRel(0, 0);
                    break;

                case 7:     // Autowrap On
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.AutoWrap;
                    break;

                case 8:     // AutoRepeat On
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.Repeat;
                    break;

                case 42:     // DECNRCM Multinational Charset
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.National;
                    break;

                case 66:     // Numeric Keypad Application Mode On
                    this.Modes.Flags = this.Modes.Flags | uc_Mode.KeypadAppln;
                    break;

                default:

                    break;
                }
            }
        }
 public ParserEventArgs(
     Actions           p1,
     System.Char       p2,
     System.String     p3,
     uc_Params         p4)
 {
     Action       = p1;
     CurChar      = p2;
     CurSequence  = p3;
     CurParams    = p4;
 }
        private void SetCharAttribs(uc_Params CurParams)
        {
            //prntSome.printSome("SetCharAttribs");
            if (CurParams.Count () < 1)
            {
                this.ClearCharAttribs ();
                return;
            }

            for (int i = 0; i < CurParams.Count (); i++)
            {
                switch (System.Convert.ToInt32 (CurParams.Elements[i]))
                {
                    case 0:
                        this.ClearCharAttribs ();
                        break;

                    case 1:
                        this.CharAttribs.IsBold = true;
                        break;

                    case 4:
                        this.CharAttribs.IsUnderscored = true;
                        break;

                    case 5:
                        this.CharAttribs.IsBlinking = true;
                        break;

                    case 7:
                        this.CharAttribs.IsInverse = true;
                        break;

                    case 10:
                        this.G0.Set = uc_Chars.Sets.ASCII;
                        break;

                    case 11:
                    case 12:
                    case 13:
                    case 14:
                    case 15:
                    case 16:
                    case 17:
                    case 18:
                    case 19:
                        //alternate font
                        this.G0.Set = uc_Chars.Sets.DECSG;
                        break;
                    case 22:
                        this.CharAttribs.IsBold = false;
                        break;

                    case 24:
                        this.CharAttribs.IsUnderscored = false;
                        break;

                    case 25:
                        this.CharAttribs.IsBlinking = false;
                        break;

                    case 27:
                        this.CharAttribs.IsInverse = false;
                        break;

                    case 30:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.Black;
                        break;

                    case 31:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.Red;
                        break;

                    case 32:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.Green;
                        break;

                    case 33:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.Yellow;
                        break;

                    case 34:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.Blue;
                        break;

                    case 35:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.Magenta;
                        break;

                    case 36:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.Cyan;
                        break;

                    case 37:
                        this.CharAttribs.UseAltColor = true;
                        this.CharAttribs.AltColor = System.Drawing.Color.White;
                        break;

                    case 40:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.Black;
                        break;

                    case 41:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.Red;
                        break;

                    case 42:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.Green;
                        break;

                    case 43:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.Yellow;
                        break;

                    case 44:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.Blue;
                        break;

                    case 45:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.Magenta;
                        break;

                    case 46:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.Cyan;
                        break;

                    case 47:
                        this.CharAttribs.UseAltBGColor = true;
                        this.CharAttribs.AltBGColor = System.Drawing.Color.White;
                        break;

                    default:
                        break;
                }
            }
        }