From 9e8b38ba943b339b966b1011bab899720d6305fc Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 9 May 2014 21:25:31 +1000 Subject: Add gwinClearInit() and gwinWidgetClearInit() to clear gwin initialisation structures. Incorporate into demo's --- demos/modules/gadc/main.c | 4 ++++ demos/modules/gaudio/oscilloscope/main.c | 1 + demos/modules/gwin/basic/main.c | 1 + demos/modules/gwin/button/main.c | 4 +--- demos/modules/gwin/checkbox/main.c | 4 +--- demos/modules/gwin/console/main.c | 1 + demos/modules/gwin/graph/main.c | 1 + demos/modules/gwin/list/main.c | 4 +--- demos/modules/gwin/progressbar/main.c | 4 +--- demos/modules/gwin/radio/main.c | 4 +--- demos/modules/gwin/slider/main.c | 4 +--- demos/modules/gwin/widgets/main.c | 2 +- 12 files changed, 15 insertions(+), 19 deletions(-) (limited to 'demos') diff --git a/demos/modules/gadc/main.c b/demos/modules/gadc/main.c index 7db14c82..ae508278 100644 --- a/demos/modules/gadc/main.c +++ b/demos/modules/gadc/main.c @@ -152,6 +152,8 @@ int main(void) { gwinSetDefaultFont(font); { GWindowInit wi; + + gwinClearInit(&wi); wi.show = TRUE; wi.x = wi.y = 0; wi.width = swidth-SCOPE_CX; @@ -184,6 +186,8 @@ int main(void) { /* Set up the scope window in the top right on the screen */ { GWindowInit wi; + + gwinClearInit(&wi); wi.show = TRUE; wi.x = swidth-SCOPE_CX; wi.y = 0; diff --git a/demos/modules/gaudio/oscilloscope/main.c b/demos/modules/gaudio/oscilloscope/main.c index 3636e8f9..b544016e 100644 --- a/demos/modules/gaudio/oscilloscope/main.c +++ b/demos/modules/gaudio/oscilloscope/main.c @@ -73,6 +73,7 @@ int main(void) { { GWindowInit wi; + gwinClearInit(&wi); wi.show = TRUE; wi.x = wi.y = 0; wi.width = swidth; wi.height = sheight; diff --git a/demos/modules/gwin/basic/main.c b/demos/modules/gwin/basic/main.c index 4d8fa33c..fca150c9 100644 --- a/demos/modules/gwin/basic/main.c +++ b/demos/modules/gwin/basic/main.c @@ -43,6 +43,7 @@ int main(void) { { GWindowInit wi; + gwinClearInit(&wi); wi.show = TRUE; wi.x = 20; wi.y = 10; wi.width = 200; wi.height = 150; GW1 = gwinWindowCreate(0, &wi); wi.show = TRUE; wi.x = 50; wi.y = 190; wi.width = 150; wi.height = 100; diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index 6349ca09..156e929e 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -36,9 +36,7 @@ static void createWidgets(void) { GWidgetInit wi; // Apply some default values for GWIN - wi.customDraw = 0; - wi.customParam = 0; - wi.customStyle = 0; + gwinWidgetClearInit(&wi); wi.g.show = TRUE; // Apply the button parameters diff --git a/demos/modules/gwin/checkbox/main.c b/demos/modules/gwin/checkbox/main.c index b6cef40b..2a2df2fb 100644 --- a/demos/modules/gwin/checkbox/main.c +++ b/demos/modules/gwin/checkbox/main.c @@ -36,9 +36,7 @@ static void createWidgets(void) { GWidgetInit wi; // Apply some default values for GWIN - wi.customDraw = 0; - wi.customParam = 0; - wi.customStyle = 0; + gwinWidgetClearInit(&wi); wi.g.show = TRUE; // Apply the checkbox parameters diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c index 14f68cd4..0e9000b5 100644 --- a/demos/modules/gwin/console/main.c +++ b/demos/modules/gwin/console/main.c @@ -48,6 +48,7 @@ int main(void) { { GWindowInit wi; + gwinClearInit(&wi); wi.show = TRUE; wi.x = 0; wi.y = 0; wi.width = gdispGetWidth(); wi.height = gdispGetHeight()/2; GW1 = gwinConsoleCreate(0, &wi); diff --git a/demos/modules/gwin/graph/main.c b/demos/modules/gwin/graph/main.c index 4dd67ae8..7a496fae 100644 --- a/demos/modules/gwin/graph/main.c +++ b/demos/modules/gwin/graph/main.c @@ -69,6 +69,7 @@ int main(void) { { GWindowInit wi; + gwinClearInit(&wi); wi.show = TRUE; wi.x = wi.y = 0; wi.width = gdispGetWidth(); diff --git a/demos/modules/gwin/list/main.c b/demos/modules/gwin/list/main.c index 3811c36f..6d469626 100644 --- a/demos/modules/gwin/list/main.c +++ b/demos/modules/gwin/list/main.c @@ -37,9 +37,7 @@ static void createWidgets(void) { GWidgetInit wi; // Apply some default values for GWIN - wi.customDraw = 0; - wi.customParam = 0; - wi.customStyle = 0; + gwinWidgetClearInit(&wi); wi.g.show = TRUE; // Create the label for the first list diff --git a/demos/modules/gwin/progressbar/main.c b/demos/modules/gwin/progressbar/main.c index 960a3293..6fb53c2e 100644 --- a/demos/modules/gwin/progressbar/main.c +++ b/demos/modules/gwin/progressbar/main.c @@ -5,9 +5,7 @@ GHandle ghProgressbar; static void _createWidget(void) { GWidgetInit wi; - wi.customDraw = 0; - wi.customParam = 0; - wi.customStyle = 0; + gwinWidgetClearInit(&wi); wi.g.show = TRUE; wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "Progress 1"; diff --git a/demos/modules/gwin/radio/main.c b/demos/modules/gwin/radio/main.c index a3c493c3..60bf206f 100644 --- a/demos/modules/gwin/radio/main.c +++ b/demos/modules/gwin/radio/main.c @@ -40,9 +40,7 @@ static void createWidgets(void) { GWidgetInit wi; // Apply some default values for GWIN - wi.customDraw = 0; - wi.customParam = 0; - wi.customStyle = 0; + gwinWidgetClearInit(&wi); wi.g.show = TRUE; // create Radio11 diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c index 0897f1f3..475f68cf 100644 --- a/demos/modules/gwin/slider/main.c +++ b/demos/modules/gwin/slider/main.c @@ -36,9 +36,7 @@ static void createWidgets(void) { GWidgetInit wi; // Apply some default values for GWIN - wi.customDraw = 0; - wi.customParam = 0; - wi.customStyle = 0; + gwinWidgetClearInit(&wi); wi.g.show = TRUE; // create Slider1 diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index 17f87d46..9742a027 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -113,7 +113,7 @@ static gdispImage imgYesNo; static void createWidgets(void) { GWidgetInit wi; - wi.customDraw = 0; wi.customParam = 0; wi.customStyle = 0; + gwinWidgetClearInit(&wi); // Create the Tabs wi.g.show = TRUE; wi.customDraw = gwinRadioDraw_Tab; -- cgit v1.2.3