GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_numeric_scroll_wheel_create.c Lines: 9 9 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
/**   Numeric Scroll Wheel Management (Scroll Wheel)                      */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_widget.h"
29
#include "gx_scroll_wheel.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_numeric_scroll_wheel_create                     PORTABLE C      */
36
/*                                                           6.1.6        */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function creates a numeric scroll wheel selector widget.       */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    wheel                                 Scroll wheel control block    */
48
/*    name                                  Name of widget                */
49
/*    parent                                Parent widget control block   */
50
/*    start_val                             Start value of numeric range  */
51
/*    end_val                               End value of numeric range    */
52
/*    style                                 Style of widget               */
53
/*    Id                                    Application-defined ID of the */
54
/*                                            the widget                  */
55
/*    size                                  Widget size                   */
56
/*                                                                        */
57
/*  OUTPUT                                                                */
58
/*                                                                        */
59
/*    status                                Completion status             */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*    _gx_text_scroll_wheel_create          Create a text scroll wheel    */
64
/*    _gx_widget_link                       Link a widget to parent       */
65
/*                                                                        */
66
/*  CALLED BY                                                             */
67
/*                                                                        */
68
/*    Application Code                                                    */
69
/*                                                                        */
70
/**************************************************************************/
71
263
UINT  _gx_numeric_scroll_wheel_create(GX_NUMERIC_SCROLL_WHEEL *wheel,
72
                                      GX_CONST GX_CHAR *name,
73
                                      GX_WIDGET *parent, INT start_val, INT end_val,
74
                                      ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size)
75
{
76
77
    /* Call text scroll wheel create. */
78
263
    _gx_text_scroll_wheel_create((GX_TEXT_SCROLL_WHEEL *)wheel, name, GX_NULL, GX_ABS(start_val - end_val) + 1, style, Id, size);
79
80
263
    wheel -> gx_widget_type = GX_TYPE_NUMERIC_SCROLL_WHEEL;
81
263
    wheel -> gx_numeric_scroll_wheel_start_val = start_val;
82
263
    wheel -> gx_numeric_scroll_wheel_end_val = end_val;
83
84
263
    wheel -> gx_text_scroll_wheel_text_get = (UINT (*)(GX_TEXT_SCROLL_WHEEL *, INT, GX_STRING *))_gx_numeric_scroll_wheel_text_get;
85
86
    /* Determine if a parent widget was provided.  */
87
263
    if (parent)
88
    {
89
261
        _gx_widget_link(parent, (GX_WIDGET *)wheel);
90
    }
91
92
    /* Return completion status.  */
93
263
    return(GX_SUCCESS);
94
}
95