1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* |
4 |
|
|
* This program and the accompanying materials are made available under the |
5 |
|
|
* terms of the MIT License which is available at |
6 |
|
|
* https://opensource.org/licenses/MIT. |
7 |
|
|
* |
8 |
|
|
* SPDX-License-Identifier: MIT |
9 |
|
|
**************************************************************************/ |
10 |
|
|
|
11 |
|
|
|
12 |
|
|
/**************************************************************************/ |
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/** */ |
15 |
|
|
/** GUIX Component */ |
16 |
|
|
/** */ |
17 |
|
|
/** String Scroll Wheel Management (Scroll Wheel) */ |
18 |
|
|
/** */ |
19 |
|
|
/**************************************************************************/ |
20 |
|
|
|
21 |
|
|
#define GX_SOURCE_CODE |
22 |
|
|
|
23 |
|
|
|
24 |
|
|
/* Include necessary system files. */ |
25 |
|
|
|
26 |
|
|
#include "gx_api.h" |
27 |
|
|
#include "gx_widget.h" |
28 |
|
|
#include "gx_scroll_wheel.h" |
29 |
|
|
|
30 |
|
|
/**************************************************************************/ |
31 |
|
|
/* */ |
32 |
|
|
/* FUNCTION RELEASE */ |
33 |
|
|
/* */ |
34 |
|
|
/* _gx_string_scroll_wheel_create PORTABLE C */ |
35 |
|
|
/* 6.1 */ |
36 |
|
|
/* AUTHOR */ |
37 |
|
|
/* */ |
38 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
39 |
|
|
/* */ |
40 |
|
|
/* DESCRIPTION (Deprecated) */ |
41 |
|
|
/* */ |
42 |
|
|
/* This function creates a string scroll wheel selector widget. */ |
43 |
|
|
/* */ |
44 |
|
|
/* INPUT */ |
45 |
|
|
/* */ |
46 |
|
|
/* wheel Scroll wheel control block */ |
47 |
|
|
/* name Name of widget */ |
48 |
|
|
/* parent Parent widget control block */ |
49 |
|
|
/* total_rows Total rows of the scroll wheel*/ |
50 |
|
|
/* string_list String list for display */ |
51 |
|
|
/* callback Callback for retrieved row */ |
52 |
|
|
/* string */ |
53 |
|
|
/* style Style of widget */ |
54 |
|
|
/* Id Application-defined ID of the */ |
55 |
|
|
/* the widget */ |
56 |
|
|
/* size Widget size */ |
57 |
|
|
/* */ |
58 |
|
|
/* OUTPUT */ |
59 |
|
|
/* */ |
60 |
|
|
/* status Completion status */ |
61 |
|
|
/* */ |
62 |
|
|
/* CALLS */ |
63 |
|
|
/* */ |
64 |
|
|
/* _gx_text_scroll_wheel_create Create a text scroll wheel */ |
65 |
|
|
/* _gx_widget_link Link a widget to parent */ |
66 |
|
|
/* */ |
67 |
|
|
/* CALLED BY */ |
68 |
|
|
/* */ |
69 |
|
|
/* Application Code */ |
70 |
|
|
/* */ |
71 |
|
|
/* RELEASE HISTORY */ |
72 |
|
|
/* */ |
73 |
|
|
/* DATE NAME DESCRIPTION */ |
74 |
|
|
/* */ |
75 |
|
|
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ |
76 |
|
|
/* 09-30-2020 Kenneth Maxwell Modified comment(s), */ |
77 |
|
|
/* resulting in version 6.1 */ |
78 |
|
|
/* */ |
79 |
|
|
/**************************************************************************/ |
80 |
|
|
#if defined(GX_ENABLE_DEPRECATED_STRING_API) |
81 |
|
4 |
UINT _gx_string_scroll_wheel_create(GX_STRING_SCROLL_WHEEL *wheel, |
82 |
|
|
GX_CONST GX_CHAR *name, |
83 |
|
|
GX_WIDGET *parent, INT total_rows, |
84 |
|
|
GX_CONST GX_CHAR **string_list, |
85 |
|
|
ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size) |
86 |
|
|
{ |
87 |
|
|
UINT status; |
88 |
|
|
|
89 |
|
4 |
status = _gx_string_scroll_wheel_create_ext(wheel, name, parent, total_rows, GX_NULL, style, Id, size); |
90 |
|
|
|
91 |
|
4 |
wheel -> gx_string_scroll_wheel_string_list_deprecated = string_list; |
92 |
|
|
|
93 |
|
|
/* Return successful status. */ |
94 |
|
4 |
return(status); |
95 |
|
|
} |
96 |
|
|
#endif |
97 |
|
|
|
98 |
|
|
|
99 |
|
|
/**************************************************************************/ |
100 |
|
|
/* */ |
101 |
|
|
/* FUNCTION RELEASE */ |
102 |
|
|
/* */ |
103 |
|
|
/* _gx_string_scroll_wheel_create_ext PORTABLE C */ |
104 |
|
|
/* 6.1 */ |
105 |
|
|
/* AUTHOR */ |
106 |
|
|
/* */ |
107 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
108 |
|
|
/* */ |
109 |
|
|
/* DESCRIPTION */ |
110 |
|
|
/* */ |
111 |
|
|
/* This function creates a string scroll wheel selector widget. */ |
112 |
|
|
/* */ |
113 |
|
|
/* INPUT */ |
114 |
|
|
/* */ |
115 |
|
|
/* wheel Scroll wheel control block */ |
116 |
|
|
/* name Name of widget */ |
117 |
|
|
/* parent Parent widget control block */ |
118 |
|
|
/* total_rows Total rows of the scroll wheel*/ |
119 |
|
|
/* string_list String list for display */ |
120 |
|
|
/* callback Callback for retrieved row */ |
121 |
|
|
/* string */ |
122 |
|
|
/* style Style of widget */ |
123 |
|
|
/* Id Application-defined ID of the */ |
124 |
|
|
/* the widget */ |
125 |
|
|
/* size Widget size */ |
126 |
|
|
/* */ |
127 |
|
|
/* OUTPUT */ |
128 |
|
|
/* */ |
129 |
|
|
/* status Completion status */ |
130 |
|
|
/* */ |
131 |
|
|
/* CALLS */ |
132 |
|
|
/* */ |
133 |
|
|
/* _gx_text_scroll_wheel_create Create a text scroll wheel */ |
134 |
|
|
/* _gx_widget_link Link a widget to parent */ |
135 |
|
|
/* */ |
136 |
|
|
/* CALLED BY */ |
137 |
|
|
/* */ |
138 |
|
|
/* Application Code */ |
139 |
|
|
/* */ |
140 |
|
|
/* RELEASE HISTORY */ |
141 |
|
|
/* */ |
142 |
|
|
/* DATE NAME DESCRIPTION */ |
143 |
|
|
/* */ |
144 |
|
|
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ |
145 |
|
|
/* 09-30-2020 Kenneth Maxwell Modified comment(s), */ |
146 |
|
|
/* set new event process, */ |
147 |
|
|
/* resulting in version 6.1 */ |
148 |
|
|
/* */ |
149 |
|
|
/**************************************************************************/ |
150 |
|
194 |
UINT _gx_string_scroll_wheel_create_ext(GX_STRING_SCROLL_WHEEL *wheel, |
151 |
|
|
GX_CONST GX_CHAR *name, |
152 |
|
|
GX_WIDGET *parent, INT total_rows, |
153 |
|
|
GX_CONST GX_STRING *string_list, |
154 |
|
|
ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size) |
155 |
|
|
{ |
156 |
|
|
|
157 |
|
|
/* Call text scroll wheel create. */ |
158 |
|
194 |
_gx_text_scroll_wheel_create((GX_TEXT_SCROLL_WHEEL *)wheel, name, GX_NULL, total_rows, style, Id, size); |
159 |
|
|
|
160 |
|
194 |
wheel -> gx_widget_type = GX_TYPE_STRING_SCROLL_WHEEL; |
161 |
|
|
#if defined(GX_ENABLE_DEPRECATED_STRING_API) |
162 |
|
194 |
wheel -> gx_string_scroll_wheel_string_list_deprecated = GX_NULL; |
163 |
|
|
#endif |
164 |
|
194 |
wheel -> gx_string_scroll_wheel_string_list = string_list; |
165 |
|
194 |
wheel -> gx_string_scroll_wheel_string_list_buffer_size = 0; |
166 |
|
194 |
wheel -> gx_string_scroll_wheel_string_id_list = GX_NULL; |
167 |
|
194 |
wheel -> gx_widget_event_process_function = (UINT(*)(GX_WIDGET*, GX_EVENT*))_gx_string_scroll_wheel_event_process; |
168 |
|
194 |
wheel -> gx_text_scroll_wheel_text_get = (UINT (*)(GX_TEXT_SCROLL_WHEEL *, INT, GX_STRING *))_gx_string_scroll_wheel_text_get; |
169 |
|
|
|
170 |
|
|
/* Determine if a parent widget was provided. */ |
171 |
✓✓ |
194 |
if (parent) |
172 |
|
|
{ |
173 |
|
187 |
_gx_widget_link(parent, (GX_WIDGET *)wheel); |
174 |
|
|
} |
175 |
|
|
|
176 |
|
|
/* Return successful status. */ |
177 |
|
194 |
return(GX_SUCCESS); |
178 |
|
|
} |
179 |
|
|
|