GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_drop_list_event_process.c Lines: 22 22 100.0 %
Date: 2026-03-06 19:21:09 Branches: 9 9 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_scrollbar.h"
32
#include "gx_drop_list.h"
33
34
35
#define GX_FLICK_TIMER 1001
36
37
/**************************************************************************/
38
/*                                                                        */
39
/*  FUNCTION                                               RELEASE        */
40
/*                                                                        */
41
/*    _gx_drop_list_event_process                         PORTABLE C      */
42
/*                                                           6.1          */
43
/*  AUTHOR                                                                */
44
/*                                                                        */
45
/*    Kenneth Maxwell, Microsoft Corporation                              */
46
/*                                                                        */
47
/*  DESCRIPTION                                                           */
48
/*                                                                        */
49
/*    This service processes an event for the vertical list.              */
50
/*                                                                        */
51
/*  INPUT                                                                 */
52
/*                                                                        */
53
/*    drop_list                             Drop list widget control block*/
54
/*    event_ptr                             Pointer to event to process   */
55
/*                                                                        */
56
/*  OUTPUT                                                                */
57
/*                                                                        */
58
/*    status                                Completion status             */
59
/*                                                                        */
60
/*  CALLS                                                                 */
61
/*                                                                        */
62
/*    _gx_vertical_list_selected_set        Set the list entry at the     */
63
/*                                          current list index            */
64
/*    _gx_drop_list_close                   Close a drop list             */
65
/*    _gx_drop_list_open                    Open a drop list              */
66
/*    _gx_first_client_child_get            Get the first client child    */
67
/*    _gx_widget_event_process              Process events for the        */
68
/*                                          specified window              */
69
/*                                                                        */
70
/*  CALLED BY                                                             */
71
/*                                                                        */
72
/*    Application Code                                                    */
73
/*                                                                        */
74
/**************************************************************************/
75
76
212
UINT _gx_drop_list_event_process(GX_DROP_LIST *drop_list, GX_EVENT *event_ptr)
77
{
78
GX_WIDGET *widget;
79
80
212
    widget = (GX_WIDGET *)drop_list;
81
82

212
    switch (event_ptr -> gx_event_type)
83
    {
84
124
    case GX_EVENT_SHOW:
85
124
        _gx_widget_event_process(widget, event_ptr);
86
124
        break;
87
88
36
    case GX_EVENT_HIDE:
89
36
        if (drop_list -> gx_drop_list_popup_open)
90
        {
91
1
            _gx_drop_list_close(drop_list);
92
        }
93
36
        _gx_widget_event_process(widget, event_ptr);
94
36
        break;
95
96
10
    case GX_SIGNAL(ID_DROP_LIST_BUTTON, GX_EVENT_CLICKED):
97
10
        if (drop_list -> gx_drop_list_popup_open)
98
        {
99
2
            _gx_drop_list_close(drop_list);
100
        }
101
        else
102
        {
103
8
            _gx_drop_list_open(drop_list);
104
        }
105
10
        break;
106
107
15
    case GX_EVENT_CLOSE_POPUP:
108
15
        _gx_drop_list_close(drop_list);
109
15
        break;
110
111
27
    default:
112
27
        return _gx_widget_event_process(widget, event_ptr);
113
    }
114
185
    return(GX_SUCCESS);
115
}
116