GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_numeric_scroll_wheel_range_set.c Lines: 5 5 100.0 %
Date: 2026-03-06 19:21:09 Branches: 0 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_system.h"
29
#include "gx_scroll_wheel.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_numeric_scroll_wheel_range_set                  PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function sets range values for numeric scroll wheel widget.    */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    wheel                                 Scroll wheel control block    */
48
/*    start_val                             Start value of numeric range  */
49
/*    end_val                               End value of numeric range    */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    status                                Completion status             */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    _gx_scroll_wheel_total_rows_set       Reset scroll wheel total rows */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    Application Code                                                    */
62
/*                                                                        */
63
/**************************************************************************/
64
4
UINT  _gx_numeric_scroll_wheel_range_set(GX_NUMERIC_SCROLL_WHEEL *wheel, INT start_val, INT end_val)
65
{
66
UINT status;
67
68
#ifdef GX_DYNAMIC_BIDI_TEXT_SUPPORT
69
    _gx_text_scroll_wheel_dynamic_bidi_text_delete((GX_TEXT_SCROLL_WHEEL *)wheel);
70
#endif  // GX_DYNAMIC_BIDI_TEXT_SUPPORT
71
72
4
    wheel -> gx_numeric_scroll_wheel_start_val = start_val;
73
4
    wheel -> gx_numeric_scroll_wheel_end_val = end_val;
74
75
    /* Reset total rows. */
76
4
    status = _gx_scroll_wheel_total_rows_set((GX_SCROLL_WHEEL *)wheel, GX_ABS(end_val - start_val) + 1);
77
78
    /* Return completion status.  */
79
4
    return status;
80
}
81