Пример #1
0
        private void Create(string message)
        {
            IsDialog  = true;
            BackColor = Terminal.YELLOW;
            Message   = message;
            var count      = 0;
            var lines      = BasicOne.SplitToLines(message, Width - 2);
            var enumerable = lines as string[] ?? lines.ToArray();

            Height   = enumerable.Length + 3;
            PostionY = ParentWindow.Height / 2 - Height / 2;
            foreach (var l in enumerable)
            {
                var messageLabel = new Label(l, 1, 2 + count, this);
                Inputs.Add(messageLabel);
                count++;
            }

            _okBtn = new Button(Width - 4, Height, "OK", this, "OkBtn")
            {
                Action = ExitWindow
            };

            Inputs.Add(_okBtn);

            CurrentlySelected = _okBtn;
        }
Пример #2
0
        public LanguageWindow(BasicOne basicOne, int postionX, int postionY, int width, int height,
                              IWindow parentWindow) : base(postionX, postionY, width, height, parentWindow)
        {
            BackColor = Terminal.LIGHT_GREEN;
            BasicOne  = basicOne;

            Inputs.Add(new Button(1, 1, "Home", this)
            {
                Action = ShowHome, BackColor = Terminal.GREEN
            });
            Inputs.Add(new Button(7, 1, "Syntax", this)
            {
                Action = ShowSyntax, BackColor = Terminal.GREEN
            });
            Inputs.Add(new Button(15, 1, "Types", this)
            {
                Action = ShowTypes, BackColor = Terminal.GREEN
            });
            Inputs.Add(new Button(22, 1, "Constants", this)
            {
                Action = ShowConstants, BackColor = Terminal.GREEN
            });
            Inputs.Add(new Button(33, 1, "Functions", this)
            {
                Action = ShowFunctions, BackColor = Terminal.GREEN
            });

            CurrentlySelected = Inputs[0];
            ShowHome();
        }
Пример #3
0
 public SaveDialog(BasicOne basicOne, string title, string name, FullWindow parentWindow)
     : base(parentWindow.Width / 2 - 15, 6, 30, 5, parentWindow)
 {
     BasicOne    = basicOne;
     CurrentName = name ?? "new.basic";
     Height      = 10;
     Create(title);
 }
Пример #4
0
 public void WriteText(string s, int x, int y, int fColor, int bColor)
 {
     foreach (var l in BasicOne.SplitToLines(s, Width))
     {
         ParentWindow.WriteText(l, x + PostionX, y + PostionY, fColor, bColor);
         y++;
     }
 }
Пример #5
0
        public EditorWindow(BasicOne basicOne, string name, IStorageFile code, int postionX, int postionY, int width,
                            int height, FullWindow parentWindow)
            : base(postionX, postionY, width, height, parentWindow)
        {
            Saved     = true;
            CodeFile  = code;
            BasicOne  = basicOne;
            Name      = string.IsNullOrEmpty(name) ? "new.basic" : name;
            BackColor = Terminal.BLUE;

            CursorX = Indent;
            CursorY = 1;
        }
Пример #6
0
        private void Create(string message)
        {
            IsDialog = true;
            Message  = message;
            var count      = 0;
            var lines      = BasicOne.SplitToLines(message, Width - 2);
            var enumerable = lines as string[] ?? lines.ToArray();

            Height   = enumerable.Length + 3;
            PostionY = ParentWindow.Height / 2 - Height / 2;
            foreach (var l in enumerable)
            {
                var messageLabel = new Label(l, 1, 2 + count, this);
                Inputs.Add(messageLabel);
                count++;
            }


            /*
             * var messageLabel = new Label(Message, PostionX + 2, PostionY + 2, "messageLabel", this);
             * messageLabel.BackgroundColour = BackgroundColour;*/

            _yesBtn = new Button(Width - 9, Height, "YES", this)
            {
                Action = () =>
                {
                    OnYes?.Invoke();
                    ExitWindow();
                }
            };
            _noBtn = new Button(Width - 4, Height, "NO", this)
            {
                Action = () =>
                {
                    OnNo?.Invoke();
                    ExitWindow();
                }
            };

            Inputs.Add(_yesBtn);
            Inputs.Add(_noBtn);

            CurrentlySelected = _yesBtn;
        }
        public GlyphEditor(int postionX, int postionY, IWindow parentWindow, BasicOne basicOne)
            : base(postionX, postionY, 31, 24, parentWindow)
        {
            BasicOne  = basicOne;
            BackColor = Terminal.YELLOW;
            ForeColor = Terminal.BLACK;
            Inputs.Add(new Button(22, 1, "COPY ", this)
            {
                Action = () =>
                {
                    CurrentlySelected?.Unselect();
                    CurrentlySelected = null;
                    var data          = new DataPackage();
                    data.SetText($"{GetGlyph()}");
                    Clipboard.SetContent(data);
                }
            });
            Inputs.Add(new Button(22, 3, "PASTE", this)
            {
                Action = () =>
                {
                    CurrentlySelected?.Unselect();
                    CurrentlySelected = null;

                    Paste();
                }
            });

            Inputs.Add(new Button(22, 5, "NEG  ", this)
            {
                Action = () =>
                {
                    CurrentlySelected?.Unselect();
                    CurrentlySelected = null;

                    Negative();
                }
            });
        }
 public void DrawVLine(int x, int y, int l, int c, bool clear = false)
 {
     BasicOne.DrawVLine(x, y, l, c, clear);
 }
 public void DrawRect(int x, int y, int w, int h, int c, bool clear = false)
 {
     BasicOne.DrawRect(x, y, w, h, c, clear);
 }
 public void SetCursor(int x, int y)
 {
     BasicOne.SetCursor(x, y);
 }
 public void Clear(int color)
 {
     BasicOne.Clear(color);
 }
 public FullWindow(BasicOne basicOne)
 {
     BasicOne     = basicOne;
     ParentWindow = this;
 }
 public void WriteGlyph(Glyph g, int x, int y, int fColor, int bColor) => BasicOne.WriteGlyph(g, x, y, fColor, bColor);
 public void WriteText(string s, int x, int f, int fColor, int bColor) => BasicOne.WriteText(s, x, f, fColor, bColor);
 public int GetXY(int x, int y) => BasicOne.GetXY(x, y);
 public void SetForgroundGround(int x, int y, int c, bool clear = false) => BasicOne.SetForgroundGround(x, y, c, clear);