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 (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_widget.h"
28 #include "gx_button.h"
29 #include "gx_system.h"
30 #include "gx_utility.h"
31 
32 /* Bring in externs for caller checking code.  */
33 GX_CALLER_CHECKING_EXTERNS
34 
35 /**************************************************************************/
36 /*                                                                        */
37 /*  FUNCTION                                               RELEASE        */
38 /*                                                                        */
39 /*    _gxe_radio_button_pixelmap_set                      PORTABLE C      */
40 /*                                                           6.1          */
41 /*  AUTHOR                                                                */
42 /*                                                                        */
43 /*    Kenneth Maxwell, Microsoft Corporation                              */
44 /*                                                                        */
45 /*  DESCRIPTION                                                           */
46 /*                                                                        */
47 /*    This function checks for errors in the checkbox pixlemap set routine*/
48 /*    button.                                                             */
49 /*                                                                        */
50 /*  INPUT                                                                 */
51 /*                                                                        */
52 /*    button                                Button control block          */
53 /*    off_id                                Resource ID of the pixelmap   */
54 /*                                            used for draw button off    */
55 /*    on_id                                 Resource ID of the pixelmap   */
56 /*                                            used for checke  d box      */
57 /*    off_disabled_id                       Resource ID of the pixelmap   */
58 /*                                            used for unchecked disabled */
59 /*                                             box                        */
60 /*    on_disabled_id                        Resource ID of the pixelmap   */
61 /*                                            used for checked disabled   */
62 /*                                            box                         */
63 /*                                                                        */
64 /*  OUTPUT                                                                */
65 /*                                                                        */
66 /*    status                                Completion status             */
67 /*                                                                        */
68 /*  CALLS                                                                 */
69 /*                                                                        */
70 /*    _gx_radio_button_pixelmap_set         Acutal pixelmap set function  */
71 /*                                                                        */
72 /*  CALLED BY                                                             */
73 /*                                                                        */
74 /*    Application Code                                                    */
75 /*                                                                        */
76 /*  RELEASE HISTORY                                                       */
77 /*                                                                        */
78 /*    DATE              NAME                      DESCRIPTION             */
79 /*                                                                        */
80 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
81 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
82 /*                                            resulting in version 6.1    */
83 /*                                                                        */
84 /**************************************************************************/
_gxe_radio_button_pixelmap_set(GX_RADIO_BUTTON * button,GX_RESOURCE_ID off_id,GX_RESOURCE_ID on_id,GX_RESOURCE_ID off_disabled_id,GX_RESOURCE_ID on_disabled_id)85 UINT  _gxe_radio_button_pixelmap_set(GX_RADIO_BUTTON *button,
86                                      GX_RESOURCE_ID off_id,
87                                      GX_RESOURCE_ID on_id,
88                                      GX_RESOURCE_ID off_disabled_id,
89                                      GX_RESOURCE_ID on_disabled_id)
90 {
91 UINT status;
92 
93     /* Check for appropriate caller.  */
94     GX_INIT_AND_THREADS_CALLER_CHECKING
95 
96     /* Check for the invalid input pointers.  */
97     if (button == GX_NULL)
98     {
99         return(GX_PTR_ERROR);
100     }
101 
102     /* Check for invalid widget. */
103     if (button->gx_widget_type == 0)
104     {
105         return(GX_INVALID_WIDGET);
106     }
107 
108     status = _gx_radio_button_pixelmap_set(button, off_id, on_id,
109                                            off_disabled_id, on_disabled_id);
110 
111     return(status);
112 }
113 
114