diff --git a/components/TextArea.h b/components/TextArea.h index 46e379f..c1a2d6f 100644 --- a/components/TextArea.h +++ b/components/TextArea.h @@ -88,7 +88,7 @@ public: for(int i = 0; i < height && top + i < csbi.dwSize.Y; i++) { for(int j = 0; j < width && left + j < csbi.dwSize.X; j++) { SetConsoleCursorPosition(hConsole, {static_cast(left + j), static_cast(top + i)}); - printf(" "); + putchar(' '); } } //绘制边框到缓冲区 diff --git a/components/TextLine_test.cpp b/components/TextLine_test.cpp index 47155df..02e8a8e 100644 --- a/components/TextLine_test.cpp +++ b/components/TextLine_test.cpp @@ -16,5 +16,6 @@ int main() { textLine2.draw(); printf("\n"); + getchar(); return 0; } \ No newline at end of file diff --git a/main.cpp b/main.cpp index 9c35504..e69de29 100644 --- a/main.cpp +++ b/main.cpp @@ -1,20 +0,0 @@ -#include "components/BaseComponent.h" -#include "components/TextLine.h" -#include "utils/RichText.h" - -int main() { - RichText richText; - richText = "Hello, World"; - richText += StringPart(" with colors!", COLOR_RED); - - TextLine textLine(2, 2, 23, 3); - textLine.setText(richText); - textLine.draw(); - - TextLine textLine2(7, 5, 40, 3); - textLine2.setText(richText + StringPart(" and more colors!", COLOR_LIGHTCYAN)); - textLine2.draw(); - - printf("\n"); - return 0; -} \ No newline at end of file