1 /*******************************************************************************/
2 /*  This file is auto-generated by Azure RTOS GUIX Studio. Do not edit this    */
3 /*  file by hand. Modifications to this file should only be made by running    */
4 /*  the Azure RTOS GUIX Studio application and re-generating the application   */
5 /*  specification file(s). For more information please refer to the Azure RTOS */
6 /*  GUIX Studio User Guide, or visit our web site at azure.com/rtos            */
7 /*                                                                             */
8 /*  GUIX Studio Revision 6.3.0.1                                               */
9 /*  Date (dd.mm.yyyy): 22.12.2023   Time (hh:mm): 16:06                        */
10 /*******************************************************************************/
11 
12 
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "template_resources.h"
16 #include "template_specifications.h"
17 
18 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent);
19 TEMPLATE_SCREEN_CONTROL_BLOCK template_screen;
20 CHILD_TEMPLATE_SCREEN_CONTROL_BLOCK child_template_screen;
21 GX_CONST GX_STUDIO_WIDGET dynamic_template_screen_define;
22 GX_DISPLAY Primary_control_block;
23 GX_WINDOW_ROOT Primary_root_window;
24 GX_CANVAS  Primary_canvas_control_block;
25 ULONG      Primary_canvas_memory[307200];
26 
27 extern GX_CONST GX_THEME *Primary_theme_table[];
28 extern GX_CONST GX_STRING *Primary_language_table[];
29 
30 GX_STUDIO_DISPLAY_INFO template_display_table[1] =
31 {
32     {
33     "Primary",
34     "Primary_canvas",
35     Primary_theme_table,
36     Primary_language_table,
37     PRIMARY_THEME_TABLE_SIZE,
38     PRIMARY_LANGUAGE_TABLE_SIZE,
39     PRIMARY_STRING_TABLE_SIZE,
40     640,                                     /* x resolution                   */
41     480,                                     /* y resolution                   */
42     &Primary_control_block,
43     &Primary_canvas_control_block,
44     &Primary_root_window,
45     Primary_canvas_memory,                   /* canvas memory area             */
46     1228800,                                 /* canvas memory size in bytes    */
47     0                                        /* rotation angle                 */
48     }
49 };
50 
gx_studio_action_target_get(GX_WIDGET * current,GX_CONST GX_STUDIO_ACTION * action)51 static GX_WIDGET *gx_studio_action_target_get(GX_WIDGET *current, GX_CONST GX_STUDIO_ACTION *action)
52 {
53     GX_WIDGET *parent = GX_NULL;
54     GX_WIDGET *target = GX_NULL;
55     INT        search_depth;
56     GX_STUDIO_WIDGET *widget_define;
57 
58     if (action->flags & GX_ACTION_FLAG_DYNAMIC_TARGET)
59     {
60                                              /* dynamically create the target widget */
61         widget_define = (GX_STUDIO_WIDGET *) action->target;
62         if(action->flags & GX_ACTION_FLAG_DYNAMIC_PARENT)
63         {
64             gx_window_root_find(current, (GX_WINDOW_ROOT **)&parent);
65             search_depth = GX_SEARCH_DEPTH_INFINITE;
66         }
67         else
68         {
69             parent = (GX_WIDGET *)action->parent;
70             search_depth = 1;
71         }
72         gx_widget_find(parent, widget_define->widget_id, search_depth, &target);
73         if (target == GX_NULL)
74         {
75             target = gx_studio_widget_create(GX_NULL, widget_define, GX_NULL);
76         }
77         if (target)
78         {
79             target->gx_widget_status |= GX_STATUS_STUDIO_CREATED;
80         }
81     }
82     else
83     {
84         target = (GX_WIDGET *) action->target;
85     }
86     return target;
87 }
88 
gx_studio_action_target_find(GX_WIDGET * current,GX_CONST GX_STUDIO_ACTION * action)89 static GX_WIDGET *gx_studio_action_target_find(GX_WIDGET *current, GX_CONST GX_STUDIO_ACTION *action)
90 {
91     GX_WIDGET *parent = GX_NULL;
92     GX_WIDGET *target = GX_NULL;
93     GX_STUDIO_WIDGET *widget_define;
94 
95     if (action->flags & GX_ACTION_FLAG_DYNAMIC_TARGET)
96     {
97                                              /* Find the dynamically created target */
98         widget_define = (GX_STUDIO_WIDGET *) action->target;
99         if(action->flags & GX_ACTION_FLAG_DYNAMIC_PARENT)
100         {
101             gx_window_root_find(current, (GX_WINDOW_ROOT **)&parent);
102         }
103         else
104         {
105             parent = (GX_WIDGET *)action->parent;
106         }
107         gx_widget_find(parent, widget_define->widget_id, GX_SEARCH_DEPTH_INFINITE, &target);
108     }
109     else
110     {
111         target = (GX_WIDGET *) action->target;
112     }
113     return target;
114 }
115 
gx_studio_action_parent_find(GX_WIDGET * current,GX_CONST GX_STUDIO_ACTION * action)116 static GX_WIDGET *gx_studio_action_parent_find(GX_WIDGET *current, GX_CONST GX_STUDIO_ACTION *action)
117 {
118 GX_WIDGET *parent = GX_NULL;
119 GX_STUDIO_WIDGET *widget_define;
120 
121     if (action->flags & GX_ACTION_FLAG_DYNAMIC_PARENT)
122     {
123                                              /* Find the dynamically created target */
124         widget_define = (GX_STUDIO_WIDGET *)action->parent;
125         gx_window_root_find(current, (GX_WINDOW_ROOT **)&parent);
126         gx_widget_find(parent, widget_define->widget_id, GX_SEARCH_DEPTH_INFINITE, &parent);
127     }
128     else
129     {
130         parent = (GX_WIDGET *)action->parent;
131     }
132     return parent;
133 }
134 
gx_studio_animation_execute(GX_WIDGET * current,GX_CONST GX_STUDIO_ACTION * action)135 static VOID gx_studio_animation_execute(GX_WIDGET *current, GX_CONST GX_STUDIO_ACTION *action)
136 {
137     GX_ANIMATION *animation;
138     GX_ANIMATION_INFO animation_info;
139     GX_WIDGET *parent = GX_NULL;
140     GX_WIDGET *target = GX_NULL;
141     gx_system_animation_get(&animation);
142     if (animation)
143     {
144         animation_info = *action->animation;
145 
146         if((action->flags & GX_ACTION_FLAG_POP_TARGET) ||
147            (action->flags & GX_ACTION_FLAG_POP_PARENT))
148         {
149             gx_system_screen_stack_get((GX_WIDGET **)&parent, &target);
150         }
151 
152         if(action->flags & GX_ACTION_FLAG_POP_TARGET)
153         {
154             animation_info.gx_animation_target = target;
155         }
156 
157         if(action->flags & GX_ACTION_FLAG_POP_PARENT)
158         {
159             animation_info.gx_animation_parent = (GX_WIDGET *)parent;
160         }
161 
162         if ((!animation_info.gx_animation_target) &&
163             (action->flags & GX_ACTION_FLAG_DYNAMIC_TARGET))
164         {
165             target = gx_studio_action_target_get(current, action);
166             animation_info.gx_animation_target = target;
167         }
168 
169         if (!animation_info.gx_animation_parent)
170         {
171             animation_info.gx_animation_parent = gx_studio_action_parent_find(current, action);
172         }
173 
174         if (animation_info.gx_animation_target &&
175             animation_info.gx_animation_parent)
176         {
177             gx_animation_start(animation, &animation_info);
178         }
179     }
180 }
181 
gx_studio_auto_event_handler(GX_WIDGET * widget,GX_EVENT * event_ptr,GX_CONST GX_STUDIO_EVENT_PROCESS * record)182 UINT gx_studio_auto_event_handler(GX_WIDGET *widget, GX_EVENT *event_ptr, GX_CONST GX_STUDIO_EVENT_PROCESS *record)
183 {
184     UINT status = GX_SUCCESS;
185     GX_CONST GX_STUDIO_ACTION *action;
186     GX_CONST GX_WIDGET *parent = GX_NULL;
187     GX_WIDGET *target = GX_NULL;
188     GX_CONST GX_STUDIO_EVENT_ENTRY *entry = record->event_table;
189 
190     while(entry->event_type)
191     {
192         if (entry->event_type == event_ptr->gx_event_type)
193         {
194             if((entry->event_type == GX_EVENT_ANIMATION_COMPLETE) &&
195                (entry->event_sender != event_ptr->gx_event_sender))
196             {
197                 entry++;
198                 continue;
199             }
200             action = entry->action_list;
201 
202             while(action->opcode)
203             {
204                 switch(action->opcode)
205                 {
206                 case GX_ACTION_TYPE_ATTACH:
207                     if((action->flags & GX_ACTION_FLAG_POP_TARGET) ||
208                        (action->flags & GX_ACTION_FLAG_POP_PARENT))
209                     {
210                         gx_system_screen_stack_get((GX_WIDGET **)&parent, &target);
211                     }
212 
213                     if(!(action->flags & GX_ACTION_FLAG_POP_PARENT))
214                     {
215                         parent = action->parent;
216                     }
217                     if(!(action->flags & GX_ACTION_FLAG_POP_TARGET))
218                     {
219                         target = gx_studio_action_target_get(widget, action);
220                     }
221                     if (parent && target)
222                     {
223                         gx_widget_attach(parent, target);
224                     }
225                     break;
226 
227                 case GX_ACTION_TYPE_DETACH:
228                     target = gx_studio_action_target_find(widget, action);
229                     if (target)
230                     {
231                         gx_widget_detach(target);
232                         if (target->gx_widget_status & GX_STATUS_STUDIO_CREATED)
233                         {
234                             if (widget == target)
235                             {
236                                 widget = GX_NULL;
237                             }
238 
239                             gx_widget_delete(target);
240                         }
241                     }
242                     break;
243 
244                 case GX_ACTION_TYPE_TOGGLE:
245                     if(action->flags & GX_ACTION_FLAG_POP_TARGET)
246                     {
247                        gx_system_screen_stack_get(GX_NULL, &target);
248                     }
249                     else
250                     {
251                         target = gx_studio_action_target_get(widget, action);
252                     }
253                     parent = widget->gx_widget_parent;
254                     if (parent)
255                     {
256                         gx_widget_detach(widget);
257                         gx_widget_attach(parent, target);
258                         if (widget->gx_widget_status & GX_STATUS_STUDIO_CREATED)
259                         {
260                             gx_widget_delete(widget);
261                             widget = GX_NULL;
262                         }
263                     }
264                     break;
265 
266                 case GX_ACTION_TYPE_SHOW:
267                     target = gx_studio_action_target_get(widget, action);
268                     if(target)
269                     {
270                         gx_widget_show(target);
271                     }
272                     break;
273 
274                 case GX_ACTION_TYPE_HIDE:
275                     target = gx_studio_action_target_find(widget, action);
276                     if(target)
277                     {
278                         gx_widget_hide(target);
279                     }
280                     break;
281 
282                 case GX_ACTION_TYPE_ANIMATION:
283                     gx_studio_animation_execute(widget, action);
284                     break;
285 
286                 case GX_ACTION_TYPE_WINDOW_EXECUTE:
287                     if((action->flags & GX_ACTION_FLAG_POP_TARGET) ||
288                        (action->flags & GX_ACTION_FLAG_POP_PARENT))
289                     {
290                         gx_system_screen_stack_get((GX_WIDGET **)&parent, &target);
291                     }
292 
293                     if(!(action->flags & GX_ACTION_FLAG_POP_PARENT))
294                     {
295                         parent = widget->gx_widget_parent;
296                     }
297                     if(!(action->flags & GX_ACTION_FLAG_POP_TARGET))
298                     {
299                         target = gx_studio_action_target_get(widget, action);
300                     }
301                     if (parent && target)
302                     {
303                         gx_widget_attach(parent, target);
304                         gx_window_execute((GX_WINDOW *) target, GX_NULL);
305                     }
306                     break;
307 
308                 case GX_ACTION_TYPE_WINDOW_EXECUTE_STOP:
309                     return event_ptr->gx_event_sender;
310 
311                 case GX_ACTION_TYPE_SCREEN_STACK_PUSH:
312                     target = gx_studio_action_target_get(widget, action);
313                     if(target)
314                     {
315                         gx_system_screen_stack_push(target);
316                     }
317                     break;
318 
319                 case GX_ACTION_TYPE_SCREEN_STACK_POP:
320                     gx_system_screen_stack_pop();
321                     break;
322 
323                 case GX_ACTION_TYPE_SCREEN_STACK_RESET:
324                     gx_system_screen_stack_reset();
325                     break;
326 
327                 default:
328                     break;
329                 }
330                 action++;
331             }
332         }
333         entry++;
334     }
335 
336     if (widget && record->chain_event_handler)
337     {
338         status = record->chain_event_handler(widget, event_ptr);
339     }
340     return status;
341 }
342 
343 
gx_studio_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)344 UINT gx_studio_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
345 {
346     UINT status;
347     GX_BUTTON *button = (GX_BUTTON *) control_block;
348     status = gx_button_create(button, info->widget_name, parent, info->style, info->widget_id, &info->size);
349     return status;
350 }
351 
gx_studio_text_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)352 UINT gx_studio_text_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
353 {
354     UINT status;
355     GX_TEXT_BUTTON *button = (GX_TEXT_BUTTON *) control_block;
356     GX_TEXT_BUTTON_PROPERTIES *props = (GX_TEXT_BUTTON_PROPERTIES *) info->properties;
357     status = gx_text_button_create(button, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
358     if (status == GX_SUCCESS)
359     {
360         gx_text_button_font_set(button, props->font_id);
361 #if defined(GUIX_5_4_0_COMPATIBILITY)
362         gx_text_button_text_color_set(button, props->normal_text_color_id, props->selected_text_color_id);
363 #else
364         gx_text_button_text_color_set(button, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
365 #endif
366     }
367     return status;
368 }
369 
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)370 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
371 {
372     UINT status;
373     GX_PROMPT *prompt = (GX_PROMPT *) control_block;
374     GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
375     status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
376     if (status == GX_SUCCESS)
377     {
378         gx_prompt_font_set(prompt, props->font_id);
379 #if defined(GUIX_5_4_0_COMPATIBILITY)
380         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
381 #else
382         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
383 #endif
384     }
385     return status;
386 }
387 
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)388 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
389 {
390     UINT status;
391     GX_WINDOW *window = (GX_WINDOW *) control_block;
392     GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
393     status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
394     if (status == GX_SUCCESS)
395     {
396         if (props->wallpaper_id)
397         {
398             gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
399         }
400     }
401     return status;
402 }
403 
gx_studio_template_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)404 UINT gx_studio_template_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
405 {
406     UINT status = GX_SUCCESS;
407     GX_STUDIO_WIDGET derived;
408     GX_TEMPLATE_PROPERTIES *props = (GX_TEMPLATE_PROPERTIES *) info->properties;
409 
410                                              /* create base widget and children */
411     derived =            *props->base_info;
412     derived.widget_id =   info->widget_id;
413     derived.widget_name = info->widget_name;
414 
415     if (info->style & GX_STYLE_ENABLED)
416     {
417         derived.style |= GX_STYLE_ENABLED;
418     }
419     else
420     {
421         derived.style &= ~GX_STYLE_ENABLED;
422     }
423     if (info->status & GX_STATUS_ACCEPTS_FOCUS)
424     {
425         derived.status |= GX_STATUS_ACCEPTS_FOCUS;
426     }
427     else
428     {
429         derived.status &= ~GX_STATUS_ACCEPTS_FOCUS;
430     }
431 
432     #if defined(GX_WIDGET_USER_DATA)
433     derived.user_data =   info->user_data;
434     #endif
435 
436     control_block = gx_studio_widget_create((GX_BYTE *) control_block, &derived, parent);
437     if (control_block)
438     {
439         if (info->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
440         {
441             control_block->gx_widget_status |= GX_STATUS_DYNAMICALLY_ALLOCATED;
442         }
443         if (derived.size.gx_rectangle_left != info->size.gx_rectangle_left ||
444             derived.size.gx_rectangle_top != info->size.gx_rectangle_top)
445         {
446             gx_widget_shift(control_block,
447                 info->size.gx_rectangle_left - derived.size.gx_rectangle_left,
448                 info->size.gx_rectangle_top - derived.size.gx_rectangle_top, GX_FALSE);
449         }
450     }
451     else
452     {
453         status = GX_FAILURE;
454     }
455     return status;
456 }
457 GX_WINDOW_PROPERTIES base_properties =
458 {
459     0                                        /* wallpaper pixelmap id          */
460 };
461 GX_PROMPT_PROPERTIES base_prompt_properties =
462 {
463     GX_STRING_ID_STRING_1,                   /* string id                      */
464     GX_FONT_ID_PROMPT,                       /* font id                        */
465     GX_COLOR_ID_TEXT,                        /* normal text color              */
466     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
467     GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
468 };
469 
470 GX_CONST GX_STUDIO_WIDGET base_button_define =
471 {
472     "button",
473     GX_TYPE_BUTTON,                          /* widget type                    */
474     GX_ID_NONE,                              /* widget id                      */
475     #if defined(GX_WIDGET_USER_DATA)
476     0,                                       /* user data                      */
477     #endif
478     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
479     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
480     sizeof(GX_BUTTON),                       /* control block size             */
481     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
482     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
483     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
484     gx_studio_button_create,                 /* create function                */
485     GX_NULL,                                 /* drawing function override      */
486     GX_NULL,                                 /* event function override        */
487     {261, 205, 340, 228},                    /* widget size                    */
488     GX_NULL,                                 /* no next widget                 */
489     GX_NULL,                                 /* no child widgets               */
490     offsetof(BASE_CONTROL_BLOCK, base_button), /* control block                */
491     (void *) GX_NULL                         /* no extended properties         */
492 };
493 
494 GX_CONST GX_STUDIO_WIDGET base_prompt_define =
495 {
496     "prompt",
497     GX_TYPE_PROMPT,                          /* widget type                    */
498     GX_ID_NONE,                              /* widget id                      */
499     #if defined(GX_WIDGET_USER_DATA)
500     0,                                       /* user data                      */
501     #endif
502     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
503     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
504     sizeof(GX_PROMPT),                       /* control block size             */
505     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
506     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
507     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
508     gx_studio_prompt_create,                 /* create function                */
509     GX_NULL,                                 /* drawing function override      */
510     GX_NULL,                                 /* event function override        */
511     {377, 160, 456, 183},                    /* widget size                    */
512     &base_button_define,                     /* next widget definition         */
513     GX_NULL,                                 /* no child widgets               */
514     offsetof(BASE_CONTROL_BLOCK, base_prompt), /* control block                */
515     (void *) &base_prompt_properties         /* extended properties            */
516 };
517 
518 GX_CONST GX_STUDIO_WIDGET base_define =
519 {
520     "base",
521     GX_TYPE_WINDOW,                          /* widget type                    */
522     GX_ID_NONE,                              /* widget id                      */
523     #if defined(GX_WIDGET_USER_DATA)
524     0,                                       /* user data                      */
525     #endif
526     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED,   /* style flags                    */
527     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
528     sizeof(BASE_CONTROL_BLOCK),              /* control block size             */
529     GX_COLOR_ID_ORANGE,                      /* normal color id                */
530     GX_COLOR_ID_ORANGE,                      /* selected color id              */
531     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
532     gx_studio_window_create,                 /* create function                */
533     GX_NULL,                                 /* drawing function override      */
534     GX_NULL,                                 /* event function override        */
535     {74, 120, 603, 317},                     /* widget size                    */
536     GX_NULL,                                 /* next widget                    */
537     &base_prompt_define,                     /* child widget                   */
538     0,                                       /* control block                  */
539     (void *) &base_properties                /* extended properties            */
540 };
541 GX_TEMPLATE_PROPERTIES dynamic_template_screen_properties =
542 {
543     &base_define,                            /* base info                      */
544     gx_studio_window_create,                 /* base create function           */
545     {64, 121, 593, 318}                      /* widget size                    */
546 };
547 GX_PROMPT_PROPERTIES dynamic_template_screen_prompt_14_properties =
548 {
549     GX_STRING_ID_STRING_99,                  /* string id                      */
550     GX_FONT_ID_PROMPT,                       /* font id                        */
551     GX_COLOR_ID_TEXT,                        /* normal text color              */
552     GX_COLOR_ID_TEXT,                        /* selected text color            */
553     GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
554 };
555 GX_TEXT_BUTTON_PROPERTIES dynamic_template_screen_next_button_11_properties =
556 {
557     GX_STRING_ID_STRING_36,                  /* string id                      */
558     GX_FONT_ID_BUTTON,                       /* font id                        */
559     GX_COLOR_ID_WHITE,                       /* normal text color              */
560     GX_COLOR_ID_WHITE,                       /* selected text color            */
561     GX_COLOR_ID_WHITE                        /* disabled text color            */
562 };
563 GX_PROMPT_PROPERTIES dynamic_template_screen_prompt_14_2_properties =
564 {
565     GX_STRING_ID_STRING_100,                 /* string id                      */
566     GX_FONT_ID_PROMPT,                       /* font id                        */
567     GX_COLOR_ID_TEXT,                        /* normal text color              */
568     GX_COLOR_ID_TEXT,                        /* selected text color            */
569     GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
570 };
571 
572 GX_CONST GX_STUDIO_WIDGET dynamic_template_screen_prompt_14_2_define =
573 {
574     "prompt_14_2",
575     GX_TYPE_PROMPT,                          /* widget type                    */
576     GX_ID_NONE,                              /* widget id                      */
577     #if defined(GX_WIDGET_USER_DATA)
578     0,                                       /* user data                      */
579     #endif
580     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_DYNAMICALLY_ALLOCATED|GX_STYLE_TEXT_CENTER,   /* style flags */
581     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
582     sizeof(GX_PROMPT),                       /* control block size             */
583     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
584     GX_COLOR_ID_WIDGET_FILL,                 /* selected color id              */
585     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
586     gx_studio_prompt_create,                 /* create function                */
587     GX_NULL,                                 /* drawing function override      */
588     GX_NULL,                                 /* event function override        */
589     {130, 169, 295, 186},                    /* widget size                    */
590     GX_NULL,                                 /* no next widget                 */
591     GX_NULL,                                 /* no child widgets               */
592     0,                                       /* runtime control block          */
593     (void *) &dynamic_template_screen_prompt_14_2_properties /* extended properties */
594 };
595 
596 GX_CONST GX_STUDIO_WIDGET dynamic_template_screen_next_button_11_define =
597 {
598     "next_button_11",
599     GX_TYPE_TEXT_BUTTON,                     /* widget type                    */
600     IDB_NEXT,                                /* widget id                      */
601     #if defined(GX_WIDGET_USER_DATA)
602     0,                                       /* user data                      */
603     #endif
604     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_DYNAMICALLY_ALLOCATED|GX_STYLE_TEXT_CENTER,   /* style flags */
605     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
606     sizeof(GX_TEXT_BUTTON),                  /* control block size             */
607     GX_COLOR_ID_NEXT_BUTTON_LOWER,           /* normal color id                */
608     GX_COLOR_ID_NEXT_BUTTON_UPPER,           /* selected color id              */
609     GX_COLOR_ID_NEXT_BUTTON_LOWER,           /* disabled color id              */
610     gx_studio_text_button_create,            /* create function                */
611     GX_NULL,                                 /* drawing function override      */
612     GX_NULL,                                 /* event function override        */
613     {488, 270, 567, 297},                    /* widget size                    */
614     &dynamic_template_screen_prompt_14_2_define, /* next widget definition     */
615     GX_NULL,                                 /* no child widgets               */
616     0,                                       /* runtime control block          */
617     (void *) &dynamic_template_screen_next_button_11_properties /* extended properties */
618 };
619 
620 GX_CONST GX_STUDIO_WIDGET dynamic_template_screen_prompt_14_define =
621 {
622     "prompt_14",
623     GX_TYPE_PROMPT,                          /* widget type                    */
624     GX_ID_NONE,                              /* widget id                      */
625     #if defined(GX_WIDGET_USER_DATA)
626     0,                                       /* user data                      */
627     #endif
628     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_DYNAMICALLY_ALLOCATED|GX_STYLE_TEXT_CENTER,   /* style flags */
629     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
630     sizeof(GX_PROMPT),                       /* control block size             */
631     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
632     GX_COLOR_ID_WIDGET_FILL,                 /* selected color id              */
633     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
634     gx_studio_prompt_create,                 /* create function                */
635     GX_NULL,                                 /* drawing function override      */
636     GX_NULL,                                 /* event function override        */
637     {129, 139, 328, 156},                    /* widget size                    */
638     &dynamic_template_screen_next_button_11_define, /* next widget definition  */
639     GX_NULL,                                 /* no child widgets               */
640     0,                                       /* runtime control block          */
641     (void *) &dynamic_template_screen_prompt_14_properties /* extended properties */
642 };
643 
644 GX_STUDIO_ACTION dynamic_template_screen__idb_next_gx_event_clicked_actions[2] = {
645     {GX_ACTION_TYPE_TOGGLE, 0, &Primary_root_window, &template_screen, GX_NULL},
646     {0, 0, GX_NULL, GX_NULL, GX_NULL}
647 };
648 
649 static GX_STUDIO_EVENT_ENTRY gx_studio_dynamic_template_screen_event_table[] = {
650     {GX_SIGNAL(IDB_NEXT, GX_EVENT_CLICKED), 0, dynamic_template_screen__idb_next_gx_event_clicked_actions},
651     {0, 0, GX_NULL}
652 };
653 
654 GX_STUDIO_EVENT_PROCESS dynamic_template_screen_event_chain = {gx_studio_dynamic_template_screen_event_table, (UINT (*)(GX_WIDGET *, GX_EVENT *))gx_window_event_process};
gx_studio_dynamic_template_screen_event_process(GX_WIDGET * target,GX_EVENT * event_ptr)655 static UINT gx_studio_dynamic_template_screen_event_process(GX_WIDGET *target, GX_EVENT *event_ptr)
656 {
657     return (gx_studio_auto_event_handler(target, event_ptr, &dynamic_template_screen_event_chain));
658 }
659 
660 
661 GX_CONST GX_STUDIO_WIDGET dynamic_template_screen_define =
662 {
663     "dynamic_template_screen",
664     GX_TYPE_TEMPLATE,                        /* widget type                    */
665     ID_DYNAMIC_TEMPLATE_SCREEN,              /* widget id                      */
666     #if defined(GX_WIDGET_USER_DATA)
667     0,                                       /* user data                      */
668     #endif
669     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_DYNAMICALLY_ALLOCATED,   /* style flags */
670     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
671     sizeof(DYNAMIC_TEMPLATE_SCREEN_CONTROL_BLOCK), /* control block size       */
672     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
673     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
674     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
675     gx_studio_template_create,               /* create function                */
676     GX_NULL,                                 /* drawing function override      */
677     (UINT (*)(GX_WIDGET *, GX_EVENT *)) gx_studio_dynamic_template_screen_event_process, /* event function override */
678     {64, 121, 593, 318},                     /* widget size                    */
679     GX_NULL,                                 /* next widget                    */
680     &dynamic_template_screen_prompt_14_define, /* child widget                 */
681     0,                                       /* control block                  */
682     (void *) &dynamic_template_screen_properties /* extended properties        */
683 };
684 GX_TEMPLATE_PROPERTIES template_screen_properties =
685 {
686     &base_define,                            /* base info                      */
687     gx_studio_window_create,                 /* base create function           */
688     {56, 123, 585, 320}                      /* widget size                    */
689 };
690 GX_TEXT_BUTTON_PROPERTIES template_screen_next_button_10_properties =
691 {
692     GX_STRING_ID_STRING_36,                  /* string id                      */
693     GX_FONT_ID_BUTTON,                       /* font id                        */
694     GX_COLOR_ID_WHITE,                       /* normal text color              */
695     GX_COLOR_ID_WHITE,                       /* selected text color            */
696     GX_COLOR_ID_WHITE                        /* disabled text color            */
697 };
698 GX_PROMPT_PROPERTIES template_screen_prompt_13_properties =
699 {
700     GX_STRING_ID_STRING_102,                 /* string id                      */
701     GX_FONT_ID_PROMPT,                       /* font id                        */
702     GX_COLOR_ID_TEXT,                        /* normal text color              */
703     GX_COLOR_ID_TEXT,                        /* selected text color            */
704     GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
705 };
706 
707 GX_CONST GX_STUDIO_WIDGET template_screen_prompt_13_define =
708 {
709     "prompt_13",
710     GX_TYPE_PROMPT,                          /* widget type                    */
711     GX_ID_NONE,                              /* widget id                      */
712     #if defined(GX_WIDGET_USER_DATA)
713     0,                                       /* user data                      */
714     #endif
715     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
716     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
717     sizeof(GX_PROMPT),                       /* control block size             */
718     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
719     GX_COLOR_ID_WIDGET_FILL,                 /* selected color id              */
720     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
721     gx_studio_prompt_create,                 /* create function                */
722     GX_NULL,                                 /* drawing function override      */
723     GX_NULL,                                 /* event function override        */
724     {104, 145, 307, 162},                    /* widget size                    */
725     GX_NULL,                                 /* no next widget                 */
726     GX_NULL,                                 /* no child widgets               */
727     offsetof(TEMPLATE_SCREEN_CONTROL_BLOCK, template_screen_prompt_13), /* control block */
728     (void *) &template_screen_prompt_13_properties /* extended properties      */
729 };
730 
731 GX_CONST GX_STUDIO_WIDGET template_screen_next_button_10_define =
732 {
733     "next_button_10",
734     GX_TYPE_TEXT_BUTTON,                     /* widget type                    */
735     IDB_NEXT,                                /* widget id                      */
736     #if defined(GX_WIDGET_USER_DATA)
737     0,                                       /* user data                      */
738     #endif
739     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
740     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
741     sizeof(GX_TEXT_BUTTON),                  /* control block size             */
742     GX_COLOR_ID_NEXT_BUTTON_LOWER,           /* normal color id                */
743     GX_COLOR_ID_NEXT_BUTTON_UPPER,           /* selected color id              */
744     GX_COLOR_ID_NEXT_BUTTON_LOWER,           /* disabled color id              */
745     gx_studio_text_button_create,            /* create function                */
746     GX_NULL,                                 /* drawing function override      */
747     GX_NULL,                                 /* event function override        */
748     {480, 278, 559, 302},                    /* widget size                    */
749     &template_screen_prompt_13_define,       /* next widget definition         */
750     GX_NULL,                                 /* no child widgets               */
751     offsetof(TEMPLATE_SCREEN_CONTROL_BLOCK, template_screen_next_button_10), /* control block */
752     (void *) &template_screen_next_button_10_properties /* extended properties */
753 };
754 
755 GX_STUDIO_ACTION template_screen__idb_next_gx_event_clicked_actions[2] = {
756     {GX_ACTION_TYPE_TOGGLE, 0, &Primary_root_window, &child_template_screen, GX_NULL},
757     {0, 0, GX_NULL, GX_NULL, GX_NULL}
758 };
759 
760 static GX_STUDIO_EVENT_ENTRY gx_studio_template_screen_event_table[] = {
761     {GX_SIGNAL(IDB_NEXT, GX_EVENT_CLICKED), 0, template_screen__idb_next_gx_event_clicked_actions},
762     {0, 0, GX_NULL}
763 };
764 
765 GX_STUDIO_EVENT_PROCESS template_screen_event_chain = {gx_studio_template_screen_event_table, (UINT (*)(GX_WIDGET *, GX_EVENT *))gx_window_event_process};
gx_studio_template_screen_event_process(GX_WIDGET * target,GX_EVENT * event_ptr)766 static UINT gx_studio_template_screen_event_process(GX_WIDGET *target, GX_EVENT *event_ptr)
767 {
768     return (gx_studio_auto_event_handler(target, event_ptr, &template_screen_event_chain));
769 }
770 
771 
772 GX_CONST GX_STUDIO_WIDGET template_screen_define =
773 {
774     "template_screen",
775     GX_TYPE_TEMPLATE,                        /* widget type                    */
776     ID_TEMPLATE_SCREEN,                      /* widget id                      */
777     #if defined(GX_WIDGET_USER_DATA)
778     0,                                       /* user data                      */
779     #endif
780     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED,   /* style flags                    */
781     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
782     sizeof(TEMPLATE_SCREEN_CONTROL_BLOCK),   /* control block size             */
783     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
784     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
785     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
786     gx_studio_template_create,               /* create function                */
787     GX_NULL,                                 /* drawing function override      */
788     (UINT (*)(GX_WIDGET *, GX_EVENT *)) gx_studio_template_screen_event_process, /* event function override */
789     {56, 123, 585, 320},                     /* widget size                    */
790     GX_NULL,                                 /* next widget                    */
791     &template_screen_next_button_10_define,  /* child widget                   */
792     0,                                       /* control block                  */
793     (void *) &template_screen_properties     /* extended properties            */
794 };
795 GX_WINDOW_PROPERTIES child_template_screen_properties =
796 {
797     0                                        /* wallpaper pixelmap id          */
798 };
799 GX_TEXT_BUTTON_PROPERTIES child_template_screen_next_button_9_properties =
800 {
801     GX_STRING_ID_STRING_36,                  /* string id                      */
802     GX_FONT_ID_BUTTON,                       /* font id                        */
803     GX_COLOR_ID_WHITE,                       /* normal text color              */
804     GX_COLOR_ID_WHITE,                       /* selected text color            */
805     GX_COLOR_ID_WHITE                        /* disabled text color            */
806 };
807 GX_TEMPLATE_PROPERTIES child_template_screen_child_template_properties =
808 {
809     &base_define,                            /* base info                      */
810     gx_studio_window_create,                 /* base create function           */
811     {18, 30, 547, 227}                       /* widget size                    */
812 };
813 GX_PROMPT_PROPERTIES child_template_screen_prompt_13_2_properties =
814 {
815     GX_STRING_ID_STRING_101,                 /* string id                      */
816     GX_FONT_ID_PROMPT,                       /* font id                        */
817     GX_COLOR_ID_TEXT,                        /* normal text color              */
818     GX_COLOR_ID_TEXT,                        /* selected text color            */
819     GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
820 };
821 GX_TEMPLATE_PROPERTIES child_template_screen_dynamic_child_template_properties =
822 {
823     &base_define,                            /* base info                      */
824     gx_studio_window_create,                 /* base create function           */
825     {17, 238, 546, 435}                      /* widget size                    */
826 };
827 GX_PROMPT_PROPERTIES child_template_screen_prompt_13_3_properties =
828 {
829     GX_STRING_ID_STRING_101,                 /* string id                      */
830     GX_FONT_ID_PROMPT,                       /* font id                        */
831     GX_COLOR_ID_TEXT,                        /* normal text color              */
832     GX_COLOR_ID_TEXT,                        /* selected text color            */
833     GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
834 };
835 GX_PROMPT_PROPERTIES child_template_screen_prompt_13_4_properties =
836 {
837     GX_STRING_ID_STRING_100,                 /* string id                      */
838     GX_FONT_ID_PROMPT,                       /* font id                        */
839     GX_COLOR_ID_TEXT,                        /* normal text color              */
840     GX_COLOR_ID_TEXT,                        /* selected text color            */
841     GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
842 };
843 
844 GX_CONST GX_STUDIO_WIDGET child_template_screen_prompt_13_2_define =
845 {
846     "prompt_13_2",
847     GX_TYPE_PROMPT,                          /* widget type                    */
848     GX_ID_NONE,                              /* widget id                      */
849     #if defined(GX_WIDGET_USER_DATA)
850     0,                                       /* user data                      */
851     #endif
852     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
853     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
854     sizeof(GX_PROMPT),                       /* control block size             */
855     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
856     GX_COLOR_ID_WIDGET_FILL,                 /* selected color id              */
857     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
858     gx_studio_prompt_create,                 /* create function                */
859     GX_NULL,                                 /* drawing function override      */
860     GX_NULL,                                 /* event function override        */
861     {73, 51, 247, 68},                       /* widget size                    */
862     GX_NULL,                                 /* no next widget                 */
863     GX_NULL,                                 /* no child widgets               */
864     offsetof(CHILD_TEMPLATE_SCREEN_CONTROL_BLOCK, child_template_screen_prompt_13_2), /* control block */
865     (void *) &child_template_screen_prompt_13_2_properties /* extended properties */
866 };
867 
868 GX_CONST GX_STUDIO_WIDGET child_template_screen_prompt_13_4_define =
869 {
870     "prompt_13_4",
871     GX_TYPE_PROMPT,                          /* widget type                    */
872     GX_ID_NONE,                              /* widget id                      */
873     #if defined(GX_WIDGET_USER_DATA)
874     0,                                       /* user data                      */
875     #endif
876     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_DYNAMICALLY_ALLOCATED|GX_STYLE_TEXT_CENTER,   /* style flags */
877     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
878     sizeof(GX_PROMPT),                       /* control block size             */
879     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
880     GX_COLOR_ID_WIDGET_FILL,                 /* selected color id              */
881     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
882     gx_studio_prompt_create,                 /* create function                */
883     GX_NULL,                                 /* drawing function override      */
884     GX_NULL,                                 /* event function override        */
885     {95, 296, 260, 313},                     /* widget size                    */
886     GX_NULL,                                 /* no next widget                 */
887     GX_NULL,                                 /* no child widgets               */
888     0,                                       /* runtime control block          */
889     (void *) &child_template_screen_prompt_13_4_properties /* extended properties */
890 };
891 
892 GX_CONST GX_STUDIO_WIDGET child_template_screen_prompt_13_3_define =
893 {
894     "prompt_13_3",
895     GX_TYPE_PROMPT,                          /* widget type                    */
896     GX_ID_NONE,                              /* widget id                      */
897     #if defined(GX_WIDGET_USER_DATA)
898     0,                                       /* user data                      */
899     #endif
900     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_DYNAMICALLY_ALLOCATED|GX_STYLE_TEXT_CENTER,   /* style flags */
901     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
902     sizeof(GX_PROMPT),                       /* control block size             */
903     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
904     GX_COLOR_ID_WIDGET_FILL,                 /* selected color id              */
905     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
906     gx_studio_prompt_create,                 /* create function                */
907     GX_NULL,                                 /* drawing function override      */
908     GX_NULL,                                 /* event function override        */
909     {67, 262, 295, 279},                     /* widget size                    */
910     &child_template_screen_prompt_13_4_define, /* next widget definition       */
911     GX_NULL,                                 /* no child widgets               */
912     0,                                       /* runtime control block          */
913     (void *) &child_template_screen_prompt_13_3_properties /* extended properties */
914 };
915 
916 GX_CONST GX_STUDIO_WIDGET child_template_screen_dynamic_child_template_define =
917 {
918     "dynamic_child_template",
919     GX_TYPE_TEMPLATE,                        /* widget type                    */
920     GX_ID_NONE,                              /* widget id                      */
921     #if defined(GX_WIDGET_USER_DATA)
922     0,                                       /* user data                      */
923     #endif
924     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_DYNAMICALLY_ALLOCATED,   /* style flags */
925     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
926     sizeof(BASE_CONTROL_BLOCK),              /* control block size             */
927     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
928     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
929     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
930     gx_studio_template_create,               /* create function                */
931     GX_NULL,                                 /* drawing function override      */
932     GX_NULL,                                 /* event function override        */
933     {17, 238, 546, 435},                     /* widget size                    */
934     GX_NULL,                                 /* no next widget                 */
935     &child_template_screen_prompt_13_3_define, /* child widget definition      */
936     0,                                       /* runtime control block          */
937     (void *) &child_template_screen_dynamic_child_template_properties /* extended properties */
938 };
939 
940 GX_CONST GX_STUDIO_WIDGET child_template_screen_child_template_define =
941 {
942     "child_template",
943     GX_TYPE_TEMPLATE,                        /* widget type                    */
944     GX_ID_NONE,                              /* widget id                      */
945     #if defined(GX_WIDGET_USER_DATA)
946     0,                                       /* user data                      */
947     #endif
948     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED,   /* style flags                    */
949     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
950     sizeof(BASE_CONTROL_BLOCK),              /* control block size             */
951     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
952     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
953     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
954     gx_studio_template_create,               /* create function                */
955     GX_NULL,                                 /* drawing function override      */
956     GX_NULL,                                 /* event function override        */
957     {18, 30, 547, 227},                      /* widget size                    */
958     &child_template_screen_dynamic_child_template_define, /* next widget definition */
959     &child_template_screen_prompt_13_2_define, /* child widget definition      */
960     offsetof(CHILD_TEMPLATE_SCREEN_CONTROL_BLOCK, child_template_screen_child_template), /* control block */
961     (void *) &child_template_screen_child_template_properties /* extended properties */
962 };
963 
964 GX_CONST GX_STUDIO_WIDGET child_template_screen_next_button_9_define =
965 {
966     "next_button_9",
967     GX_TYPE_TEXT_BUTTON,                     /* widget type                    */
968     IDB_NEXT,                                /* widget id                      */
969     #if defined(GX_WIDGET_USER_DATA)
970     0,                                       /* user data                      */
971     #endif
972     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
973     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
974     sizeof(GX_TEXT_BUTTON),                  /* control block size             */
975     GX_COLOR_ID_NEXT_BUTTON_LOWER,           /* normal color id                */
976     GX_COLOR_ID_NEXT_BUTTON_UPPER,           /* selected color id              */
977     GX_COLOR_ID_NEXT_BUTTON_LOWER,           /* disabled color id              */
978     gx_studio_text_button_create,            /* create function                */
979     GX_NULL,                                 /* drawing function override      */
980     GX_NULL,                                 /* event function override        */
981     {538, 440, 617, 464},                    /* widget size                    */
982     &child_template_screen_child_template_define, /* next widget definition    */
983     GX_NULL,                                 /* no child widgets               */
984     offsetof(CHILD_TEMPLATE_SCREEN_CONTROL_BLOCK, child_template_screen_next_button_9), /* control block */
985     (void *) &child_template_screen_next_button_9_properties /* extended properties */
986 };
987 
988 GX_STUDIO_ACTION child_template_screen__idb_next_gx_event_clicked_actions[2] = {
989     {GX_ACTION_TYPE_TOGGLE, GX_ACTION_FLAG_DYNAMIC_TARGET, &Primary_root_window,  &dynamic_template_screen_define, GX_NULL},
990     {0, 0, GX_NULL, GX_NULL, GX_NULL}
991 };
992 
993 static GX_STUDIO_EVENT_ENTRY gx_studio_child_template_screen_event_table[] = {
994     {GX_SIGNAL(IDB_NEXT, GX_EVENT_CLICKED), 0, child_template_screen__idb_next_gx_event_clicked_actions},
995     {0, 0, GX_NULL}
996 };
997 
998 GX_STUDIO_EVENT_PROCESS child_template_screen_event_chain = {gx_studio_child_template_screen_event_table, (UINT (*)(GX_WIDGET *, GX_EVENT *))gx_window_event_process};
gx_studio_child_template_screen_event_process(GX_WIDGET * target,GX_EVENT * event_ptr)999 static UINT gx_studio_child_template_screen_event_process(GX_WIDGET *target, GX_EVENT *event_ptr)
1000 {
1001     return (gx_studio_auto_event_handler(target, event_ptr, &child_template_screen_event_chain));
1002 }
1003 
1004 
1005 GX_CONST GX_STUDIO_WIDGET child_template_screen_define =
1006 {
1007     "child_template_screen",
1008     GX_TYPE_WINDOW,                          /* widget type                    */
1009     ID_CHILD_TEMPLATE_SCREEN,                /* widget id                      */
1010     #if defined(GX_WIDGET_USER_DATA)
1011     0,                                       /* user data                      */
1012     #endif
1013     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED,   /* style flags                    */
1014     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
1015     sizeof(CHILD_TEMPLATE_SCREEN_CONTROL_BLOCK), /* control block size         */
1016     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
1017     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
1018     GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
1019     gx_studio_window_create,                 /* create function                */
1020     GX_NULL,                                 /* drawing function override      */
1021     (UINT (*)(GX_WIDGET *, GX_EVENT *)) gx_studio_child_template_screen_event_process, /* event function override */
1022     {0, 0, 639, 479},                        /* widget size                    */
1023     GX_NULL,                                 /* next widget                    */
1024     &child_template_screen_next_button_9_define, /* child widget               */
1025     0,                                       /* control block                  */
1026     (void *) &child_template_screen_properties /* extended properties          */
1027 };
1028 GX_CONST GX_STUDIO_WIDGET_ENTRY template_widget_table[] =
1029 {
1030     { &dynamic_template_screen_define, GX_NULL },
1031     { &template_screen_define, (GX_WIDGET *) &template_screen },
1032     { &child_template_screen_define, (GX_WIDGET *) &child_template_screen },
1033     {GX_NULL, GX_NULL}
1034 };
1035 
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)1036 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
1037 {
1038     UINT status = GX_SUCCESS;
1039     GX_WIDGET *widget = GX_NULL;
1040     GX_VALUE   list_count = 0;
1041     GX_VALUE   list_total_count = 0;
1042 
1043     if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
1044     {
1045         list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
1046     }
1047 
1048     while(definition && status == GX_SUCCESS)
1049     {
1050         if (definition->create_function)
1051         {
1052             if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
1053             {
1054                 status = gx_widget_allocate(&widget, definition->control_block_size);
1055                 if (status != GX_SUCCESS)
1056                 {
1057                     return GX_NULL;
1058                 }
1059             }
1060             else
1061             {
1062                 if (control == GX_NULL)
1063                 {
1064                     return GX_NULL;
1065                 }
1066                 widget = (GX_WIDGET *) (control + definition->control_block_offset);
1067             }
1068 
1069             status = definition->create_function(definition, widget, parent);
1070 
1071             if(list_count < list_total_count)
1072             {
1073                 gx_menu_insert((GX_MENU *)parent, widget);
1074                 ((GX_MENU *)parent)->gx_menu_list_total_count--;
1075                 list_count++;
1076             }
1077 
1078             if (status == GX_SUCCESS)
1079             {
1080                 if (definition->widget_type != GX_TYPE_TEMPLATE)
1081                 {
1082 #if defined(GUIX_5_4_0_COMPATIBILITY)
1083                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
1084 #else
1085                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
1086 #endif
1087                 }
1088 
1089                 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
1090                 {
1091                     gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
1092                 }
1093 
1094                 if (definition->draw_function)
1095                 {
1096                     gx_widget_draw_set(widget, definition->draw_function);
1097                 }
1098                 if (definition->event_function)
1099                 {
1100                     gx_widget_event_process_set(widget, definition->event_function);
1101                 }
1102 
1103                 #if defined(GX_WIDGET_USER_DATA)
1104                 widget->gx_widget_user_data = definition->user_data;
1105                 #endif
1106 
1107                 if (definition->child_widget)
1108                 {
1109                     gx_studio_nested_widget_create(control, definition->child_widget, widget);
1110                 }
1111             }
1112             definition = definition->next_widget;
1113         }
1114     }
1115     return widget;
1116 }
1117 
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)1118 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
1119 {
1120     GX_WIDGET *widget;
1121     widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
1122 
1123     if (parent && widget)
1124     {
1125         gx_widget_attach(parent, widget);
1126     }
1127     return widget;
1128 }
1129 
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)1130 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
1131 {
1132     UINT status = GX_FAILURE;
1133     GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = template_widget_table;
1134     GX_WIDGET *widget = GX_NULL;
1135 
1136     while(entry->widget_information)
1137     {
1138         if (!strcmp(name, entry->widget_information->widget_name))
1139         {
1140             widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
1141             if (widget)
1142             {
1143                 status = GX_SUCCESS;
1144             }
1145             break;
1146         }
1147         entry++;
1148     }
1149 
1150     if (new_widget)
1151     {
1152         *new_widget = widget;
1153     }
1154     return status;
1155 }
1156 
1157 
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)1158 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
1159     GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
1160 {
1161     GX_CONST GX_THEME *theme_ptr;
1162     GX_RECTANGLE size;
1163 
1164     GX_STUDIO_DISPLAY_INFO *display_info = &template_display_table[display];
1165 
1166 
1167 /* create the requested display                                                */
1168 
1169     gx_display_create(display_info->display,
1170                       display_info->name,
1171                       driver,
1172                       (GX_VALUE) display_info->x_resolution,
1173                       (GX_VALUE) display_info->y_resolution);
1174 
1175 
1176 /* install the request theme                                                   */
1177 
1178     if(display_info->theme_table)
1179     {
1180         theme_ptr = display_info->theme_table[theme];
1181         if(theme_ptr)
1182         {
1183             gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
1184 
1185 /* install the color palette if required                                       */
1186             if (display_info->display->gx_display_driver_palette_set &&
1187                 theme_ptr->theme_palette != NULL)
1188             {
1189                 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
1190             }
1191 
1192             gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
1193             gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
1194             gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
1195             gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
1196         }
1197     }
1198 
1199 /* Install the language table.                                                 */
1200 
1201     if(display_info->language_table)
1202     {
1203         gx_display_language_table_set_ext(display_info->display, display_info->language_table, (GX_UBYTE) display_info->language_table_size, display_info->string_table_size);
1204         gx_display_active_language_set(display_info->display, language);
1205     }
1206 
1207 /* Set screen rotation angle.                                                  */
1208 
1209     display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
1210 
1211 /* create the canvas for this display                                          */
1212 
1213     gx_canvas_create(display_info->canvas,
1214                      display_info->canvas_name,
1215                      display_info->display,
1216                      GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
1217                      display_info->x_resolution,
1218                      display_info->y_resolution,
1219                      display_info->canvas_memory,
1220                      display_info->canvas_memory_size);
1221 
1222 /* Create the root window for this canvas                                      */
1223 
1224     gx_utility_rectangle_define(&size,
1225                                 0, 0,
1226                                 (GX_VALUE) (display_info->x_resolution - 1),
1227                                 (GX_VALUE) (display_info->y_resolution - 1));
1228 
1229     gx_window_root_create(display_info->root_window,
1230                           display_info->name,
1231                           display_info->canvas, GX_STYLE_NONE, 0, &size);
1232     if (return_root)
1233     {
1234         *return_root = display_info->root_window;
1235     }
1236     return GX_SUCCESS;
1237 }
1238 #undef GUIX_STUDIO_GENERATED_FILE
1239