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; }
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++; } }
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; }