1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** GUIX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Button Management (checkbox) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_button.h" |
29 |
|
|
|
30 |
|
|
GX_CALLER_CHECKING_EXTERNS |
31 |
|
|
|
32 |
|
|
|
33 |
|
|
/**************************************************************************/ |
34 |
|
|
/* */ |
35 |
|
|
/* FUNCTION RELEASE */ |
36 |
|
|
/* */ |
37 |
|
|
/* _gxe_checkbox_create PORTABLE C */ |
38 |
|
|
/* 6.1 */ |
39 |
|
|
/* AUTHOR */ |
40 |
|
|
/* */ |
41 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
42 |
|
|
/* */ |
43 |
|
|
/* DESCRIPTION */ |
44 |
|
|
/* */ |
45 |
|
|
/* This function checks for errors in the checkbox create function */ |
46 |
|
|
/* call. */ |
47 |
|
|
/* */ |
48 |
|
|
/* INPUT */ |
49 |
|
|
/* */ |
50 |
|
|
/* checkbox Checkbox control block */ |
51 |
|
|
/* name Name of checkbox */ |
52 |
|
|
/* parent Parent widget control block */ |
53 |
|
|
/* text_id text resource id */ |
54 |
|
|
/* style Style of checkbox */ |
55 |
|
|
/* checkbox_id Application-defined ID of */ |
56 |
|
|
/* checkbox */ |
57 |
|
|
/* size Checkbox size */ |
58 |
|
|
/* checkbox_control_block_size Size of the checkbox control */ |
59 |
|
|
/* block */ |
60 |
|
|
/* */ |
61 |
|
|
/* OUTPUT */ |
62 |
|
|
/* */ |
63 |
|
|
/* status Completion status */ |
64 |
|
|
/* */ |
65 |
|
|
/* CALLS */ |
66 |
|
|
/* */ |
67 |
|
|
/* _gx_checkbox_create Actual checkbox create call */ |
68 |
|
|
/* */ |
69 |
|
|
/* CALLED BY */ |
70 |
|
|
/* */ |
71 |
|
|
/* Application Code */ |
72 |
|
|
/* */ |
73 |
|
|
/**************************************************************************/ |
74 |
|
3975 |
UINT _gxe_checkbox_create(GX_CHECKBOX *checkbox, GX_CONST GX_CHAR *name, GX_WIDGET *parent, |
75 |
|
|
GX_RESOURCE_ID text_id, ULONG style, USHORT checkbox_id, |
76 |
|
|
GX_CONST GX_RECTANGLE *size, UINT checkbox_control_block_size) |
77 |
|
|
{ |
78 |
|
|
UINT status; |
79 |
|
|
|
80 |
|
|
/* Check for appropriate caller. */ |
81 |
✓✓✓✓ ✓✓ |
3975 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
82 |
|
|
|
83 |
|
|
/* Check for the invalid input pointers. */ |
84 |
✓✓✓✓
|
3973 |
if ((checkbox == GX_NULL) || (size == GX_NULL)) |
85 |
|
|
{ |
86 |
|
3 |
return(GX_PTR_ERROR); |
87 |
|
|
} |
88 |
|
|
|
89 |
✓✓ |
3970 |
if (checkbox_control_block_size != sizeof(GX_CHECKBOX)) |
90 |
|
|
{ |
91 |
|
1 |
return(GX_INVALID_SIZE); |
92 |
|
|
} |
93 |
|
|
|
94 |
|
|
/* Check for the checkbox is already created. */ |
95 |
✓✓ |
3969 |
if (checkbox -> gx_widget_type != 0) |
96 |
|
|
{ |
97 |
|
1 |
return(GX_ALREADY_CREATED); |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
/* Call the actual checkbox create funtion. */ |
101 |
|
3968 |
status = _gx_checkbox_create(checkbox, name, parent, text_id, style, checkbox_id, size); |
102 |
|
|
|
103 |
|
|
/* Return completion status. */ |
104 |
|
3968 |
return status; |
105 |
|
|
} |
106 |
|
|
|