aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gwin/console
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-03-04 14:14:15 +1000
committerinmarket <andrewh@inmarket.com.au>2014-03-04 14:14:15 +1000
commitc1105485079fba97a62df62baeff3a4dcc7686ef (patch)
tree541731c9c4431ad81728122df90c2b2f77b6a03a /demos/modules/gwin/console
parent43527de2c09eb90e5c1cebbce587b5da2bda957d (diff)
downloaduGFX-c1105485079fba97a62df62baeff3a4dcc7686ef.tar.gz
uGFX-c1105485079fba97a62df62baeff3a4dcc7686ef.tar.bz2
uGFX-c1105485079fba97a62df62baeff3a4dcc7686ef.zip
Add support for ANSI like escape sequences to control display color and attributes in a GWIN console.
Updated the console demo to demonstrate this.
Diffstat (limited to 'demos/modules/gwin/console')
-rw-r--r--demos/modules/gwin/console/gfxconf.h1
-rw-r--r--demos/modules/gwin/console/main.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/demos/modules/gwin/console/gfxconf.h b/demos/modules/gwin/console/gfxconf.h
index 3ada3b89..e1b4db61 100644
--- a/demos/modules/gwin/console/gfxconf.h
+++ b/demos/modules/gwin/console/gfxconf.h
@@ -52,6 +52,7 @@
/* Features for the GWIN subsystem. */
#define GWIN_NEED_WINDOWMANAGER TRUE
#define GWIN_NEED_CONSOLE TRUE
+#define GWIN_CONSOLE_ESCSEQ TRUE
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c
index 83753c6c..e9165cac 100644
--- a/demos/modules/gwin/console/main.c
+++ b/demos/modules/gwin/console/main.c
@@ -75,17 +75,17 @@ int main(void) {
/* Output some data on the first console */
for(i = 0; i < 10; i++) {
- gwinPrintf(GW1, "Hello uGFX!\r\n");
+ gwinPrintf(GW1, "Hello \033buGFX\033B!\r\n");
}
/* Output some data on the second console */
for(i = 0; i < 16; i++) {
- gwinPrintf(GW2, "Message Nr.: %d\r\n", i+1);
+ gwinPrintf(GW2, "Message Nr.: \0331\033b%d\033B\033C\r\n", i+1);
}
/* Output some data on the third console */
for(i = 0; i < 18; i++) {
- gwinPrintf(GW3, "Message Nr.: %d\r\n", i+1);
+ gwinPrintf(GW3, "Message Nr.: \033u%d\033U\r\n", i+1);
}
while(TRUE) {