mirror of
https://github.com/MeowLynxSea/ceditor.git
synced 2025-07-09 10:54:37 +00:00
fixed TextArea
This commit is contained in:
parent
e432c9c95d
commit
530483e2eb
@ -88,7 +88,7 @@ public:
|
|||||||
for(int i = 0; i < height && top + i < csbi.dwSize.Y; i++) {
|
for(int i = 0; i < height && top + i < csbi.dwSize.Y; i++) {
|
||||||
for(int j = 0; j < width && left + j < csbi.dwSize.X; j++) {
|
for(int j = 0; j < width && left + j < csbi.dwSize.X; j++) {
|
||||||
SetConsoleCursorPosition(hConsole, {static_cast<short>(left + j), static_cast<short>(top + i)});
|
SetConsoleCursorPosition(hConsole, {static_cast<short>(left + j), static_cast<short>(top + i)});
|
||||||
printf(" ");
|
putchar(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//绘制边框到缓冲区
|
//绘制边框到缓冲区
|
||||||
|
@ -16,5 +16,6 @@ int main() {
|
|||||||
textLine2.draw();
|
textLine2.draw();
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
getchar();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
20
main.cpp
20
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;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user