From 99e5843f0d86dfeb657790e0fb73c1443ed6d934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=A6=E5=87=8C=E6=B1=90?= Date: Sun, 15 Dec 2024 02:19:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/log.txt | 22 ------------- utils/log.txt | 78 ---------------------------------------------- 2 files changed, 100 deletions(-) delete mode 100644 components/log.txt delete mode 100644 utils/log.txt diff --git a/components/log.txt b/components/log.txt deleted file mode 100644 index e91ab0b..0000000 --- a/components/log.txt +++ /dev/null @@ -1,22 +0,0 @@ -Hello, World with colors! -------------------------------------------- -And more text. -------------------------------------------- -And more more more text. And more more more more more text. -------------------------------------------- - -------------------------------------------- -111 -------------------------------------------- - -------------------------------------------- -And more more more more more more text. And more more more more more more more text. -------------------------------------------- - With some spaces before And more more more more more more more more text. -------------------------------------------- -And more more more more more more more more more text. -------------------------------------------- -And more more more more more more more more more more text. -------------------------------------------- -Last Key: 113 -------------------------------------------- diff --git a/utils/log.txt b/utils/log.txt deleted file mode 100644 index ec843ac..0000000 --- a/utils/log.txt +++ /dev/null @@ -1,78 +0,0 @@ -#include "SyntaxHighlighter.h" -#include "../components/TextArea.h" - -int main() { - SyntaxHighlighter highlighter = SyntaxHighlighter("cpp"); - TextArea textArea = TextArea(1, 1, 100, 50); - std::string rawText; - // read in SyntaxHighlighter_test.cpp - std::ifstream file("SyntaxHighlighter_test.cpp"); - std::string line; - while (std::getline(file, line)) { - rawText += line + "\n"; - } - file.close(); - - RichText richText = highlighter.highlight(rawText); - - // // 创建后台缓冲区 - // HANDLE hBackBuffer = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); - - // // 清空后台缓冲区 - // CONSOLE_SCREEN_BUFFER_INFO csbi; - // GetConsoleScreenBufferInfo(hConsole, &csbi); - // DWORD dwBytesWritten; - // FillConsoleOutputCharacter(hBackBuffer, ' ', csbi.dwSize.X * csbi.dwSize.Y, {0, 0}, &dwBytesWritten); - // FillConsoleOutputAttribute(hBackBuffer, csbi.wAttributes, csbi.dwSize.X * csbi.dwSize.Y, {0, 0}, &dwBytesWritten); - CONSOLE_CURSOR_INFO cci; - cci.bVisible = false; - cci.dwSize = 1; - //SetConsoleCursorInfo(hBackBuffer, &cci); - SetConsoleCursorInfo(hConsole, &cci); - - textArea.setTitle(RichText("SyntaxHighlighter Test", COLOR_LIGHTRED)); - textArea.setText(richText); - // textArea.setText(RichText(rawText, COLOR_WHITE)); - textArea.draw(); - - while(true) { - if (_kbhit()) { - // SetConsoleActiveScreenBuffer(hBackBuffer); - char opt = _getch(); - - switch(opt) { - case 72: - textArea.moveUp(); - break; - case 80: - textArea.moveDown(); - break; - case 75: - textArea.moveLeft(); - break; - case 77: - textArea.moveRight(); - break; - case 'q': - // SetConsoleActiveScreenBuffer(hConsole); - // CloseHandle(hBackBuffer); - return 0; - } - - // // 清空后台缓冲区 - // FillConsoleOutputCharacter(hBackBuffer, ' ', csbi.dwSize.X * csbi.dwSize.Y, {0, 0}, &dwBytesWritten); - // FillConsoleOutputAttribute(hBackBuffer, csbi.wAttributes, csbi.dwSize.X * csbi.dwSize.Y, {0, 0}, &dwBytesWritten); - - // // 在后台缓冲区中绘制 - textArea.draw(); - - // // 切换到后台缓冲区,显示绘制的内容 - // SetConsoleActiveScreenBuffer(hConsole); - } - Sleep(1); - } - - return 0; -} -