1 /**************************************************************************/ 2 /* */ 3 /* Copyright (c) Microsoft Corporation. All rights reserved. */ 4 /* */ 5 /* This software is licensed under the Microsoft Software License */ 6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */ 7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ 8 /* and in the root directory of this software. */ 9 /* */ 10 /**************************************************************************/ 11 12 13 /**************************************************************************/ 14 /**************************************************************************/ 15 /** */ 16 /** GUIX Component */ 17 /** */ 18 /** Scroll Wheel Management (Generic 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_generic_scroll_wheel_event_process PORTABLE C */ 36 /* 6.1.7 */ 37 /* AUTHOR */ 38 /* */ 39 /* Ting Zhu, Microsoft Corporation */ 40 /* */ 41 /* DESCRIPTION */ 42 /* */ 43 /* This service processes an event for the generic scroll wheel. */ 44 /* */ 45 /* INPUT */ 46 /* */ 47 /* wheel Scroll wheel control block */ 48 /* event_ptr Pointer to event to process */ 49 /* */ 50 /* OUTPUT */ 51 /* */ 52 /* status Completion status */ 53 /* */ 54 /* CALLS */ 55 /* */ 56 /* _gx_generic_scroll_wheel_children_position */ 57 /* Position the children for */ 58 /* the scroll wheel children */ 59 /* _gx_scroll_wheel_event_process Process events for the */ 60 /* scroll wheel widget */ 61 /* */ 62 /* CALLED BY */ 63 /* */ 64 /* Application Code */ 65 /* */ 66 /* RELEASE HISTORY */ 67 /* */ 68 /* DATE NAME DESCRIPTION */ 69 /* */ 70 /* 06-02-2021 Ting Zhu Initial Version 6.1.7 */ 71 /* */ 72 /**************************************************************************/ _gx_generic_scroll_wheel_event_process(GX_GENERIC_SCROLL_WHEEL * wheel,GX_EVENT * event_ptr)73UINT _gx_generic_scroll_wheel_event_process(GX_GENERIC_SCROLL_WHEEL *wheel, GX_EVENT *event_ptr) 74 { 75 UINT status; 76 77 switch (event_ptr -> gx_event_type) 78 { 79 case GX_EVENT_SHOW: 80 81 /* Show the children before attempting to position them, because child 82 widgets do not know their size until shown. */ 83 84 status = _gx_scroll_wheel_event_process((GX_SCROLL_WHEEL *)wheel, event_ptr); 85 86 /* Position the child widgets. */ 87 if (!wheel -> gx_generic_scroll_wheel_child_count) 88 { 89 _gx_generic_scroll_wheel_children_position(wheel); 90 } 91 break; 92 93 default: 94 status = _gx_scroll_wheel_event_process((GX_SCROLL_WHEEL *)wheel, event_ptr); 95 break; 96 } 97 98 return status; 99 } 100 101