예제 #1
0
 public static TextWindow OpenWindow(TextWindowCreateArgs args)
 {
     return((TextWindow)GuiInvoke(new Func <TextWindow>(() =>
     {
         return GuiOpenWindow(args);
     })));
 }
예제 #2
0
        public static TextWindow GuiOpenWindow(TextWindowCreateArgs args)
        {
            var form = new TextForm(args);

            if (args.Owned)
            {
                form.Owner = TerminalWindow;
            }
            return(form.Content.Window);
        }
예제 #3
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;
        }
예제 #4
0
 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;
 }
예제 #5
0
 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;
 }
예제 #6
0
 internal ReplTextWindow(TextControl parent, TextWindowCreateArgs args)
     : base(parent, args)
 {
     InitReplEditHandlers();
 }
예제 #7
0
 public static TextWindow Open(params object[] args)
 {
     var createArgs = new TextWindowCreateArgs(args);
     return RuntimeRepl.OpenWindow(createArgs);
 }
예제 #8
0
 internal ReplTextWindow(TextControl parent, TextWindowCreateArgs args)
     : base(parent, args)
 {
     InitReplEditHandlers();
 }
예제 #9
0
 public ReplTextForm(TextWindowCreateArgs args)
     : base(args)
 {
     Content.Window = new ReplTextWindow(Content, args);
     Content.InitScrollBars();
 }
예제 #10
0
 public static TextWindow OpenWindow(TextWindowCreateArgs args)
 {
     return (TextWindow)GuiInvoke(new Func<TextWindow>(() =>
     {
         return GuiOpenWindow(args);
     }));
 }
예제 #11
0
 public static TextWindow GuiOpenWindow(TextWindowCreateArgs args)
 {
     var form = new TextForm(args);
     if (args.Owned)
     {
         form.Owner = TerminalWindow;
     }
     return form.Content.Window;
 }
예제 #12
0
        public static TextWindow Open(params object[] args)
        {
            var createArgs = new TextWindowCreateArgs(args);

            return(RuntimeRepl.OpenWindow(createArgs));
        }