示例#1
0
        public static API_ConsoleOut show_ConsoleOut_TestGui(this API_ConsoleOut apiConsoleOut, Control topPanel)
        {
            var consoleIn     = topPanel.insert_Above(40, "ConsoleIn");
            var lines_TextBox = topPanel.clear().add_GroupBox("Console.Out Lines").add_TreeView();
            var chars_TextBox = topPanel.insert_Right("Console.Out Chars")
                                .add_RichTextBox()
                                .showSelection()
                                .wordWrap(false);

            consoleIn.add_TextBox("Write to send to Console Input ->", "")
            //.onKeyPress_getChar( (_char)=> { if (_char == '\x0d') Console.WriteLine(); else  Console.Write(_char); })
            .onKeyPress_getChar((_char) => Console.Write(_char))
            .multiLine(true)
            .focus();

            //apiConsoleOut.o2StreamWriter.On_NewChar = (_char) => chars_TextBox.append_Text(_char.str());
            apiConsoleOut.o2StreamWriter.On_NewChar = (_char) => { if (_char != '\x0a')
                                                                   {
                                                                       chars_TextBox.append_Text(_char.str());
                                                                   }
            };
            apiConsoleOut.o2StreamWriter.On_NewLine = (line) => lines_TextBox.add_Node(line);

            //apiConsoleOut.o2StreamWriter.PauseBetweenCharWrite = 1;

            Console.WriteLine("Welcome to show_ConsoleOut_TestGui");
            Console.Write("Type something on the TextBox above to see it here".line());
            return(apiConsoleOut);
        }
示例#2
0
        public static API_ConsoleOut show_ConsoleOut(this string message)
        {
            var apiConsoleOut = new API_ConsoleOut();

            apiConsoleOut.show_ConsoleOut();
            Console.WriteLine(message);
            return(apiConsoleOut);
        }
示例#3
0
        public static API_ConsoleOut show_ConsoleOut <T>(this T topPanel, string message)
            where T : Control
        {
            var apiConsoleOut = new API_ConsoleOut();

            apiConsoleOut.show_ConsoleOut(topPanel);
            Console.WriteLine(message);
            return(apiConsoleOut);
        }
示例#4
0
        public static API_ConsoleOut show_ConsoleOut(this API_ConsoleOut apiConsoleOut, Control topPanel)
        {
            var consoleOut = topPanel.add_RichTextBox().showSelection().wordWrap(false);

            consoleOut.backColor(Color.Black);
            consoleOut.foreColor(Color.White);
            consoleOut.font("Lucida Console");
            //.onKeyPress_getChar( (_char)=> { if (_char == '\x0d') Console.WriteLine(); else  Console.Write(_char); })
            apiConsoleOut.o2StreamWriter.On_NewChar = (_char) => { if (_char != '\x0d')
                                                                   {
                                                                       consoleOut.append_Text(_char.str());
                                                                   }
            };
            //apiConsoleOut.o2StreamWriter.On_NewChar = (_char) => consoleOut.append_Text(_char.str());
            apiConsoleOut.o2StreamWriter.LogAllLines = false;

            consoleOut.add_ContextMenu()
            .add_MenuItem("Clear", true, () => consoleOut.set_Text(""))
            .add_MenuItem("Write to Console Input", () => Console.WriteLine("Text to send to Console.Input".askUser()));
            return(apiConsoleOut);
        }
示例#5
0
        public static API_ConsoleOut show_ConsoleOut(this API_ConsoleOut apiConsoleOut)
        {
            var topPanel = O2Gui.open <Panel>("Console.Out", 700, 200);

            return(apiConsoleOut.show_ConsoleOut(topPanel));
        }