From c1105485079fba97a62df62baeff3a4dcc7686ef Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 4 Mar 2014 14:14:15 +1000 Subject: Add support for ANSI like escape sequences to control display color and attributes in a GWIN console. Updated the console demo to demonstrate this. --- demos/modules/gwin/console/gfxconf.h | 1 + demos/modules/gwin/console/main.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'demos/modules/gwin') 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) { -- cgit v1.2.3