GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_text_button_text_color_set.c Lines: 7 7 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 100.0 %

Line Branch Exec Source
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 (text_button)                                     */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_button.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_text_button_color_set                           PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function assigns the color used to draw text                   */
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_system_dirty_mark                 Mark this prompt as dirty     */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*                                                                        */
66
/**************************************************************************/
67
18515
UINT  _gx_text_button_text_color_set(GX_TEXT_BUTTON *text_button,
68
                                     GX_RESOURCE_ID normal_text_color_id,
69
                                     GX_RESOURCE_ID selected_text_color_id,
70
                                     GX_RESOURCE_ID disabled_text_color_id)
71
{
72
73
18515
    text_button -> gx_text_button_normal_text_color = normal_text_color_id;
74
18515
    text_button -> gx_text_button_selected_text_color = selected_text_color_id;
75
18515
    text_button -> gx_text_button_disabled_text_color = disabled_text_color_id;
76
77
18515
    if (text_button -> gx_widget_status & GX_STATUS_VISIBLE)
78
    {
79
1
        _gx_system_dirty_mark((GX_WIDGET *)text_button);
80
    }
81
82
18515
    return(GX_SUCCESS);
83
}
84