aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-03-05 13:42:41 +1000
committerinmarket <andrewh@inmarket.com.au>2014-03-05 13:42:41 +1000
commitccf05de456c5ff1ef4db9757eab5e81be8ae41fb (patch)
tree57bb149ca588f2e88c5f9efe561cba34f8ec1407 /demos/modules
parentc1105485079fba97a62df62baeff3a4dcc7686ef (diff)
downloaduGFX-ccf05de456c5ff1ef4db9757eab5e81be8ae41fb.tar.gz
uGFX-ccf05de456c5ff1ef4db9757eab5e81be8ae41fb.tar.bz2
uGFX-ccf05de456c5ff1ef4db9757eab5e81be8ae41fb.zip
Update console demo to test more console features.
Diffstat (limited to 'demos/modules')
-rw-r--r--demos/modules/gwin/console/gfxconf.h3
-rw-r--r--demos/modules/gwin/console/main.c23
2 files changed, 19 insertions, 7 deletions
diff --git a/demos/modules/gwin/console/gfxconf.h b/demos/modules/gwin/console/gfxconf.h
index e1b4db61..9efba8eb 100644
--- a/demos/modules/gwin/console/gfxconf.h
+++ b/demos/modules/gwin/console/gfxconf.h
@@ -53,6 +53,9 @@
#define GWIN_NEED_WINDOWMANAGER TRUE
#define GWIN_NEED_CONSOLE TRUE
#define GWIN_CONSOLE_ESCSEQ TRUE
+#define GWIN_CONSOLE_USE_HISTORY TRUE
+#define GWIN_CONSOLE_HISTORY_AVERAGING TRUE
+#define GWIN_CONSOLE_HISTORY_ATCREATE TRUE
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c
index e9165cac..14f68cd4 100644
--- a/demos/modules/gwin/console/main.c
+++ b/demos/modules/gwin/console/main.c
@@ -75,19 +75,28 @@ int main(void) {
/* Output some data on the first console */
for(i = 0; i < 10; i++) {
- gwinPrintf(GW1, "Hello \033buGFX\033B!\r\n");
+ gwinPrintf(GW1, "Hello \033buGFX\033B!\n");
}
- /* Output some data on the second console */
- for(i = 0; i < 16; i++) {
- gwinPrintf(GW2, "Message Nr.: \0331\033b%d\033B\033C\r\n", i+1);
+ /* Output some data on the second console - Fast */
+ for(i = 0; i < 32; i++) {
+ gwinPrintf(GW2, "Message Nr.: \0331\033b%d\033B\033C\n", i+1);
}
- /* Output some data on the third console */
- for(i = 0; i < 18; i++) {
- gwinPrintf(GW3, "Message Nr.: \033u%d\033U\r\n", i+1);
+ /* Output some data on the third console - Slowly */
+ for(i = 0; i < 32; i++) {
+ gwinPrintf(GW3, "Message Nr.: \033u%d\033U\n", i+1);
+ gfxSleepMilliseconds(500);
}
+ /* Make console 3 invisible and then visible again to demonstrate the history buffer */
+ gwinPrintf(GW2, "Making red window \033uinvisible\033U\n");
+ gwinSetVisible(GW3, FALSE);
+ gfxSleepMilliseconds(1000);
+ gwinPrintf(GW2, "Making red window \033uvisible\033U\n");
+ gwinSetVisible(GW3, TRUE);
+ gwinPrintf(GW3, "\033bI'm back!!!\033B\n", i+1);
+
while(TRUE) {
gfxSleepMilliseconds(500);
}