Exemple #1
0
        public TextFormBase(TextWindowCreateArgs args)
        {
            Text            = args.Caption;
            Cols            = args.Width;
            Rows            = args.Height;
            BackColor       = args.BackColor;
            OnCloseFunction = args.OnCloseFunction;

            if (args.Left == -1 || args.Top == -1)
            {
                StartPosition = FormStartPosition.CenterScreen;
            }
            else
            {
                SetDesktopLocation(args.Left * CharWidth, args.Top * LineHeight);
                StartPosition = FormStartPosition.Manual;
            }

            if (args.Scrollable)
            {
                VertScrollBar = new TerminalVScrollBar(this);
                Controls.Add(VertScrollBar);
                HoriScrollBar = new TerminalHScrollBar(this);
                Controls.Add(HoriScrollBar);
            }
            else
            {
                VertScrollBar = null;
                HoriScrollBar = null;
            }

            if (args.Resizable)
            {
                FormBorderStyle = FormBorderStyle.Sizable;
            }
            else if (args.Border)
            {
                FormBorderStyle = FormBorderStyle.FixedSingle;
            }
            else
            {
                FormBorderStyle = FormBorderStyle.FixedToolWindow;
                ShowInTaskbar   = false;
            }

            Content          = new TextControl(this);
            Content.Location = new Point(0, 0);
            Content.Size     = new Size(CharWidth * Cols, LineHeight * Rows);
            ClientSize       = new Size(Content.Width + ExtraWidth, Content.Height + ExtraHeight);
            Content.Anchor   = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            Controls.Add(Content);

            Visible = args.Visible;
        }
 internal TextWindow(TextControl parent, TextWindowCreateArgs args)
 {
     ParentControl = parent;
     ForeColor = args.ForeColor;
     BackColor = args.BackColor;
     HighlightForeColor = RuntimeRepl.DefaultHighlightForeColor;
     HighlightBackColor = RuntimeRepl.DefaultHighlightBackColor;
     ShadowBackColor = RuntimeRepl.DefaultShadowBackColor;
     Buffer = new TextBuffer(args.BufferWidth, args.BufferHeight, foreColor, backColor);
     CodeCompletion = args.CodeCompletion;
     HtmlPrefix = args.HtmlPrefix;
     HtmlSuffix = RuntimeRepl.GetSuffixFromPrefix(HtmlPrefix);
     TextWriter = TextWriter.Synchronized(new TextWindowTextWriter(this));
     InitEditHandlers();
     InitScrollHandlers();
     dirty = true;
     Style = 0;
     BufferMark = BufferBound = -1;
 }
 internal TextWindow(TextControl parent, TextWindowCreateArgs args)
 {
     ParentControl      = parent;
     ForeColor          = args.ForeColor;
     BackColor          = args.BackColor;
     HighlightForeColor = RuntimeRepl.DefaultHighlightForeColor;
     HighlightBackColor = RuntimeRepl.DefaultHighlightBackColor;
     ShadowBackColor    = RuntimeRepl.DefaultShadowBackColor;
     Buffer             = new TextBuffer(args.BufferWidth, args.BufferHeight, foreColor, backColor);
     CodeCompletion     = args.CodeCompletion;
     HtmlPrefix         = args.HtmlPrefix;
     HtmlSuffix         = RuntimeRepl.GetSuffixFromPrefix(HtmlPrefix);
     TextWriter         = TextWriter.Synchronized(new TextWindowTextWriter(this));
     InitEditHandlers();
     InitScrollHandlers();
     dirty      = true;
     Style      = 0;
     BufferMark = BufferBound = -1;
 }
 internal ReplTextWindow(TextControl parent, TextWindowCreateArgs args)
     : base(parent, args)
 {
     InitReplEditHandlers();
 }
Exemple #5
0
 internal ReplTextWindow(TextControl parent, TextWindowCreateArgs args)
     : base(parent, args)
 {
     InitReplEditHandlers();
 }