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 |
|
|
/** Button Management (text_button) */ |
18 |
|
|
/** */ |
19 |
|
|
/**************************************************************************/ |
20 |
|
|
|
21 |
|
|
#define GX_SOURCE_CODE |
22 |
|
|
|
23 |
|
|
|
24 |
|
|
/* Include necessary system files. */ |
25 |
|
|
|
26 |
|
|
#include "gx_api.h" |
27 |
|
|
#include "gx_button.h" |
28 |
|
|
|
29 |
|
|
GX_CALLER_CHECKING_EXTERNS |
30 |
|
|
|
31 |
|
|
/**************************************************************************/ |
32 |
|
|
/* */ |
33 |
|
|
/* FUNCTION RELEASE */ |
34 |
|
|
/* */ |
35 |
|
|
/* _gxe_text_button_text_color_set PORTABLE C */ |
36 |
|
|
/* 6.1 */ |
37 |
|
|
/* AUTHOR */ |
38 |
|
|
/* */ |
39 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
40 |
|
|
/* */ |
41 |
|
|
/* DESCRIPTION */ |
42 |
|
|
/* */ |
43 |
|
|
/* This function checks for errors in the text button text color set */ |
44 |
|
|
/* function call. */ |
45 |
|
|
/* */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* text_button Button control block */ |
50 |
|
|
/* normal_text_color_id Resource ID of normal text */ |
51 |
|
|
/* selected_text_color_id Resource ID of selected text */ |
52 |
|
|
/* disabled_text_color_id Resource ID of disabled text */ |
53 |
|
|
/* */ |
54 |
|
|
/* OUTPUT */ |
55 |
|
|
/* */ |
56 |
|
|
/* status Completion status */ |
57 |
|
|
/* */ |
58 |
|
|
/* CALLS */ |
59 |
|
|
/* */ |
60 |
|
|
/* _gx_text_button_text_color_set Actual text button color */ |
61 |
|
|
/* set function */ |
62 |
|
|
/* */ |
63 |
|
|
/* CALLED BY */ |
64 |
|
|
/* */ |
65 |
|
|
/* Application Code */ |
66 |
|
|
/* */ |
67 |
|
|
/* RELEASE HISTORY */ |
68 |
|
|
/* */ |
69 |
|
|
/* DATE NAME DESCRIPTION */ |
70 |
|
|
/* */ |
71 |
|
|
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ |
72 |
|
|
/* 09-30-2020 Kenneth Maxwell Modified comment(s), */ |
73 |
|
|
/* resulting in version 6.1 */ |
74 |
|
|
/* */ |
75 |
|
|
/**************************************************************************/ |
76 |
|
18520 |
UINT _gxe_text_button_text_color_set(GX_TEXT_BUTTON *text_button, |
77 |
|
|
GX_RESOURCE_ID normal_text_color_id, |
78 |
|
|
GX_RESOURCE_ID selected_text_color_id, |
79 |
|
|
GX_RESOURCE_ID disabled_text_color_id) |
80 |
|
|
{ |
81 |
|
|
|
82 |
|
|
/* Check for appropriate caller. */ |
83 |
✓✓✓✓ ✓✓ |
18520 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
84 |
|
|
|
85 |
|
|
/* Check for invalid input pointers. */ |
86 |
✓✓ |
18518 |
if (text_button == GX_NULL) |
87 |
|
|
{ |
88 |
|
2 |
return(GX_PTR_ERROR); |
89 |
|
|
} |
90 |
|
|
|
91 |
|
|
/* Check for valid widget. */ |
92 |
✓✓ |
18516 |
if (text_button -> gx_widget_type == 0) |
93 |
|
|
{ |
94 |
|
1 |
return GX_INVALID_WIDGET; |
95 |
|
|
} |
96 |
|
|
|
97 |
|
|
/* Call the actual text button color set function. */ |
98 |
|
18515 |
_gx_text_button_text_color_set(text_button, normal_text_color_id, selected_text_color_id, disabled_text_color_id); |
99 |
|
|
|
100 |
|
|
/* Return completion status. */ |
101 |
|
18515 |
return GX_SUCCESS; |
102 |
|
|
} |
103 |
|
|
|