GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_drop_list_close.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 4 4 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
/**   Drop List Management (List)                                         */
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_window.h"
30
#include "gx_system.h"
31
#include "gx_drop_list.h"
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_drop_list_close                                 PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This service closes a drop list.                                    */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    drop_list                             Drop list control block       */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    status                                Completion status             */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    _gx_widget_unlink                     Unlink a widget               */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    Application Code                                                    */
62
/*    _gx_drop_list_event_process                                         */
63
/*                                                                        */
64
/**************************************************************************/
65
19
UINT _gx_drop_list_close(GX_DROP_LIST *drop_list)
66
{
67
19
GX_VERTICAL_LIST *list = &drop_list -> gx_drop_list_popup.gx_popup_list_list;
68
19
GX_WIDGET        *child = list -> gx_widget_first_child;
69
70
19
    if (drop_list -> gx_drop_list_popup_open)
71
    {
72
9
        drop_list -> gx_drop_list_popup_open = GX_FALSE;
73
723
        while (child)
74
        {
75
714
            child -> gx_widget_style &= ~GX_STYLE_DRAW_SELECTED;
76
714
            child = child -> gx_widget_next;
77
        }
78
9
        _gx_widget_unlink((GX_WIDGET *)list);
79
    }
80
81
19
    return(GX_SUCCESS);
82
}
83