diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-02-19 07:45:47 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-02-19 07:45:47 +1000 |
commit | 6d372f13528f44919ec193d03248d55a53484968 (patch) | |
tree | 66f6ba33c6bcfed2b5b3846cf1f309e9b7e715e6 /demos/modules/gwin | |
parent | 03914d2d2b438062d3062e2c3a588d53d3040cff (diff) | |
parent | 37966ff16d923bbca53c9464815cb49cbd7fc3be (diff) | |
download | uGFX-6d372f13528f44919ec193d03248d55a53484968.tar.gz uGFX-6d372f13528f44919ec193d03248d55a53484968.tar.bz2 uGFX-6d372f13528f44919ec193d03248d55a53484968.zip |
Merge branch 'master' into freertos
Diffstat (limited to 'demos/modules/gwin')
-rw-r--r-- | demos/modules/gwin/basic/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/button/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/button/gfxconf.h | 1 | ||||
-rw-r--r-- | demos/modules/gwin/button/main.c | 16 | ||||
-rw-r--r-- | demos/modules/gwin/checkbox/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/checkbox/main.c | 2 | ||||
-rw-r--r-- | demos/modules/gwin/console/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/graph/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/graph/gfxconf.h | 4 | ||||
-rw-r--r-- | demos/modules/gwin/list/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/list/gfxconf.h | 1 | ||||
-rw-r--r-- | demos/modules/gwin/progressbar/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/radio/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/radio/main.c | 2 | ||||
-rw-r--r-- | demos/modules/gwin/slider/demo.mk | 3 | ||||
-rw-r--r-- | demos/modules/gwin/slider/main.c | 2 | ||||
-rw-r--r-- | demos/modules/gwin/widgets/demo.mk | 3 |
17 files changed, 54 insertions, 4 deletions
diff --git a/demos/modules/gwin/basic/demo.mk b/demos/modules/gwin/basic/demo.mk new file mode 100644 index 00000000..a5b7a8f2 --- /dev/null +++ b/demos/modules/gwin/basic/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/basic +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/button/demo.mk b/demos/modules/gwin/button/demo.mk new file mode 100644 index 00000000..5b8cd2a5 --- /dev/null +++ b/demos/modules/gwin/button/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/button +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/button/gfxconf.h b/demos/modules/gwin/button/gfxconf.h index 5376bd52..eba3f4ef 100644 --- a/demos/modules/gwin/button/gfxconf.h +++ b/demos/modules/gwin/button/gfxconf.h @@ -48,6 +48,7 @@ #define GDISP_NEED_CLIP TRUE #define GDISP_NEED_CIRCLE TRUE #define GDISP_NEED_TEXT TRUE +#define GDISP_NEED_CONTROL TRUE /* GDISP fonts to include */ #define GDISP_INCLUDE_FONT_UI2 TRUE diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index 6ec8a287..6349ca09 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -54,10 +54,16 @@ static void createWidgets(void) { int main(void) { GEvent* pe; + static const orientation_t orients[] = { GDISP_ROTATE_0, GDISP_ROTATE_90, GDISP_ROTATE_180, GDISP_ROTATE_270 }; + unsigned which; // Initialize the display gfxInit(); + // We are currently at GDISP_ROTATE_0 + which = 0; + gdispSetOrientation(orients[which]); + // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); @@ -81,7 +87,15 @@ int main(void) { case GEVENT_GWIN_BUTTON: if (((GEventGWinButton*)pe)->button == ghButton1) { // Our button has been pressed - printf("Button clicked\r\n"); + if (++which >= sizeof(orients)/sizeof(orients[0])) + which = 0; + + // Setting the orientation during run-time is a bit naughty particularly with + // GWIN windows. In this case however we know that the button is in the top-left + // corner which should translate safely into any orientation. + gdispSetOrientation(orients[which]); + gdispClear(White); + gwinRedrawDisplay(GDISP, FALSE); } break; diff --git a/demos/modules/gwin/checkbox/demo.mk b/demos/modules/gwin/checkbox/demo.mk new file mode 100644 index 00000000..8e6edf46 --- /dev/null +++ b/demos/modules/gwin/checkbox/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/checkbox +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/checkbox/main.c b/demos/modules/gwin/checkbox/main.c index 51f96518..b6cef40b 100644 --- a/demos/modules/gwin/checkbox/main.c +++ b/demos/modules/gwin/checkbox/main.c @@ -81,7 +81,7 @@ int main(void) { case GEVENT_GWIN_CHECKBOX: if (((GEventGWinCheckbox*)pe)->checkbox == ghCheckbox1) { // The state of our checkbox has changed - printf("Checkbox state: %d\r\n", ((GEventGWinCheckbox*)pe)->isChecked); + //printf("Checkbox state: %d\r\n", ((GEventGWinCheckbox*)pe)->isChecked); } break; diff --git a/demos/modules/gwin/console/demo.mk b/demos/modules/gwin/console/demo.mk new file mode 100644 index 00000000..09851d35 --- /dev/null +++ b/demos/modules/gwin/console/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/console +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/graph/demo.mk b/demos/modules/gwin/graph/demo.mk new file mode 100644 index 00000000..c602c83e --- /dev/null +++ b/demos/modules/gwin/graph/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/graph +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/graph/gfxconf.h b/demos/modules/gwin/graph/gfxconf.h index c09bfc6e..bc65beea 100644 --- a/demos/modules/gwin/graph/gfxconf.h +++ b/demos/modules/gwin/graph/gfxconf.h @@ -39,6 +39,7 @@ /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GWIN TRUE +#define GFX_USE_GMISC TRUE /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE @@ -48,5 +49,8 @@ #define GWIN_NEED_WINDOWMANAGER TRUE #define GWIN_NEED_GRAPH TRUE +/* Features for the GMISC subsystem. */ +#define GMISC_NEED_FASTTRIG TRUE + #endif /* _GFXCONF_H */ diff --git a/demos/modules/gwin/list/demo.mk b/demos/modules/gwin/list/demo.mk new file mode 100644 index 00000000..22b06b09 --- /dev/null +++ b/demos/modules/gwin/list/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/list +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/list/gfxconf.h b/demos/modules/gwin/list/gfxconf.h index ebd35f05..505ff2cc 100644 --- a/demos/modules/gwin/list/gfxconf.h +++ b/demos/modules/gwin/list/gfxconf.h @@ -43,6 +43,7 @@ #define GWIN_NEED_WINDOWMANAGER TRUE #define GWIN_NEED_WIDGET TRUE + #define GWIN_NEED_LABEL TRUE #define GWIN_NEED_LIST TRUE #define GWIN_NEED_LIST_IMAGES TRUE diff --git a/demos/modules/gwin/progressbar/demo.mk b/demos/modules/gwin/progressbar/demo.mk new file mode 100644 index 00000000..dffd40d7 --- /dev/null +++ b/demos/modules/gwin/progressbar/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/progressbar +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/radio/demo.mk b/demos/modules/gwin/radio/demo.mk new file mode 100644 index 00000000..e9e61456 --- /dev/null +++ b/demos/modules/gwin/radio/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/radio +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/radio/main.c b/demos/modules/gwin/radio/main.c index 9287dcf9..a3c493c3 100644 --- a/demos/modules/gwin/radio/main.c +++ b/demos/modules/gwin/radio/main.c @@ -101,7 +101,7 @@ int main(void) { switch(pe->type) { case GEVENT_GWIN_RADIO: - printf("group: %u radio: %s\n", ((GEventGWinRadio *)pe)->group, gwinGetText(((GEventGWinRadio *)pe)->radio)); + //printf("group: %u radio: %s\n", ((GEventGWinRadio *)pe)->group, gwinGetText(((GEventGWinRadio *)pe)->radio)); break; default: diff --git a/demos/modules/gwin/slider/demo.mk b/demos/modules/gwin/slider/demo.mk new file mode 100644 index 00000000..3e358dfa --- /dev/null +++ b/demos/modules/gwin/slider/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/slider +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c index 6e72b447..0897f1f3 100644 --- a/demos/modules/gwin/slider/main.c +++ b/demos/modules/gwin/slider/main.c @@ -77,7 +77,7 @@ int main(void) { switch(pe->type) { case GEVENT_GWIN_SLIDER: - printf("Slider %s = %d\n", gwinGetText(((GEventGWinSlider *)pe)->slider), ((GEventGWinSlider *)pe)->position); + //printf("Slider %s = %d\n", gwinGetText(((GEventGWinSlider *)pe)->slider), ((GEventGWinSlider *)pe)->position); break; default: diff --git a/demos/modules/gwin/widgets/demo.mk b/demos/modules/gwin/widgets/demo.mk new file mode 100644 index 00000000..2e70fa4d --- /dev/null +++ b/demos/modules/gwin/widgets/demo.mk @@ -0,0 +1,3 @@ +DEMODIR = $(GFXLIB)/demos/modules/gwin/widgets +GFXINC += $(DEMODIR) +GFXSRC += $(DEMODIR)/main.c |