Example #1
0
 public TextWindowCreateArgs(CommandLineOptions options)
 {
     //
     // Called for REPL window
     //
     Left            = -1;
     Top             = -1;
     Width           = options.Width;
     Height          = options.Height;
     BufferWidth     = Math.Max(Width, options.BufferWidth);
     BufferHeight    = Math.Max(Height, options.BufferHeight);
     ForeColor       = RuntimeRepl.MakeColor(options.ForeColor);
     BackColor       = RuntimeRepl.MakeColor(options.BackColor);
     Caption         = "Kiezellisp";
     Visible         = true;
     Resizable       = true;
     Scrollable      = true;
     CodeCompletion  = true;
     HtmlPrefix      = options.HtmlPrefix;
     Owned           = false;
     Border          = true;
     OnCloseFunction = null;
 }
Example #2
0
        public TextWindowCreateArgs(object[] args)
        {
            //
            // Called for non-REPL windows
            //
            var dict       = new Prototype(args);
            var defaults   = (TextWindow)(dict["defaults"] ?? RuntimeRepl.StdScr);
            var shiftRight = 5;
            var shiftDown  = 3;

            Left            = (int)(dict["left"] ?? defaults.ScreenLeft + shiftRight);
            Top             = (int)(dict["top"] ?? defaults.ScreenTop + shiftDown);
            Width           = (int)(dict["width"] ?? defaults.WindowWidth);
            Height          = (int)(dict["height"] ?? defaults.WindowHeight);
            BufferWidth     = (int)(dict["buffer-width"] ?? dict["width"] ?? defaults.BufferWidth);
            BufferHeight    = (int)(dict["buffer-height"] ?? dict["height"] ?? defaults.BufferHeight);
            BufferWidth     = Math.Max(Width, BufferWidth);
            BufferHeight    = Math.Max(Height, BufferHeight);
            ForeColor       = RuntimeRepl.MakeColor(dict["fore-color"] ?? defaults.ForeColor);
            BackColor       = RuntimeRepl.MakeColor(dict["back-color"] ?? defaults.BackColor);
            Caption         = (string)dict["caption"];
            Visible         = (bool)(dict["visible"] ?? true);
            Resizable       = (bool)(dict["resizable"] ?? true);
            Scrollable      = Resizable || (bool)(dict["scrollable"] ?? true);
            CodeCompletion  = (bool)(dict["code-completion"] ?? false);
            HtmlPrefix      = (string)(dict["html-prefix"] ?? defaults.HtmlPrefix);
            Owned           = (bool)(dict["owned"] ?? false);
            Border          = (bool)(dict["border"] ?? true);
            OnCloseFunction = (IApply)(dict["on-close"] ?? null);

            if (!Border)
            {
                Resizable    = Scrollable = false;
                BufferWidth  = Width;
                BufferHeight = Height;
            }
        }