1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
10 /**************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** GUIX Component */
17 /** */
18 /** Numeric Pixelmap Prompt Management (Prompt) */
19 /** */
20 /**************************************************************************/
21
22 #define GX_SOURCE_CODE
23
24
25 /* Include necessary system files. */
26
27 #include "gx_api.h"
28 #include "gx_widget.h"
29 #include "gx_pixelmap_prompt.h"
30 #include "gx_numeric_pixelmap_prompt.h"
31
32
33 /**************************************************************************/
34 /* */
35 /* FUNCTION RELEASE */
36 /* */
37 /* _gx_numeric_pixelmap_prompt_create PORTABLE C */
38 /* 6.1 */
39 /* AUTHOR */
40 /* */
41 /* Kenneth Maxwell, Microsoft Corporation */
42 /* */
43 /* DESCRIPTION */
44 /* */
45 /* This function creates a numeric pixelmap prompt, which is a special */
46 /* type of widget. */
47 /* */
48 /* INPUT */
49 /* */
50 /* prompt Numeric Pixelmap Prompt */
51 /* control block */
52 /* name Name of prompt */
53 /* parent Parent widget control block */
54 /* text_id Resource string id */
55 /* fill_id Pixelmap id for fill area */
56 /* style Style of pixelmap prompt */
57 /* pixelmap_prompt_id Application-defined ID of */
58 /* numeric pixelmap prompt */
59 /* size Dimemsions of numeric pixelmap*/
60 /* prompt */
61 /* */
62 /* OUTPUT */
63 /* */
64 /* status Completion status */
65 /* */
66 /* CALLS */
67 /* */
68 /* _gx_pixelmap_prompt_create Create a pixelmap prompt */
69 /* _gx_widget_link Link a widget to its parent */
70 /* */
71 /* CALLED BY */
72 /* */
73 /* Application Code */
74 /* */
75 /* RELEASE HISTORY */
76 /* */
77 /* DATE NAME DESCRIPTION */
78 /* */
79 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
80 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */
81 /* resulting in version 6.1 */
82 /* */
83 /**************************************************************************/
_gx_numeric_pixelmap_prompt_create(GX_NUMERIC_PIXELMAP_PROMPT * prompt,GX_CONST GX_CHAR * name,GX_WIDGET * parent,GX_RESOURCE_ID text_id,GX_RESOURCE_ID fill_id,ULONG style,USHORT pixelmap_prompt_id,GX_CONST GX_RECTANGLE * size)84 UINT _gx_numeric_pixelmap_prompt_create(GX_NUMERIC_PIXELMAP_PROMPT *prompt,
85 GX_CONST GX_CHAR *name, GX_WIDGET *parent,
86 GX_RESOURCE_ID text_id, GX_RESOURCE_ID fill_id,
87 ULONG style, USHORT pixelmap_prompt_id,
88 GX_CONST GX_RECTANGLE *size)
89 {
90
91 /* Call the pixelmap prompt create function. */
92 _gx_pixelmap_prompt_create((GX_PIXELMAP_PROMPT *)prompt, name, parent, text_id, fill_id, style, pixelmap_prompt_id, size);
93
94 /* Populate the rest of numeric pixelmap prompt control block - overriding as necessary. */
95 prompt -> gx_widget_type = GX_TYPE_NUMERIC_PIXELMAP_PROMPT;
96 prompt -> gx_numeric_pixelmap_prompt_format_function = _gx_numeric_pixelmap_prompt_format;
97
98 /* Determine if a parent widget was provided. */
99 if (parent)
100 {
101 _gx_widget_link(parent, (GX_WIDGET *)prompt);
102 }
103
104 return(GX_SUCCESS);
105 }
106
107