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 /**   Text Button Management (Button)                                     */
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_button.h"
30 
31 /**************************************************************************/
32 /*                                                                        */
33 /*  FUNCTION                                               RELEASE        */
34 /*                                                                        */
35 /*    _gx_multi_line_text_button_event_process            PORTABLE C      */
36 /*                                                           6.1          */
37 /*  AUTHOR                                                                */
38 /*                                                                        */
39 /*    Kenneth Maxwell, Microsoft Corporation                              */
40 /*                                                                        */
41 /*  DESCRIPTION                                                           */
42 /*                                                                        */
43 /*    This function creates a multi-line text button, which is a special  */
44 /*    type of button (widget).                                            */
45 /*                                                                        */
46 /*  INPUT                                                                 */
47 /*                                                                        */
48 /*    button                                Button control block          */
49 /*    name                                  Name of button                */
50 /*    parent                                Parent widget control block   */
51 /*    text_id                               text resource id              */
52 /*    style                                 Style of button               */
53 /*    size                                  Button size                   */
54 /*                                                                        */
55 /*  OUTPUT                                                                */
56 /*                                                                        */
57 /*    status                                Completion status             */
58 /*                                                                        */
59 /*  CALLS                                                                 */
60 /*                                                                        */
61 /*    _gx_text_button_event_process                                       */
62 /*    _gx_multi_line_text_button_line_pointers_set                        */
63 /*                                                                        */
64 /*  CALLED BY                                                             */
65 /*                                                                        */
66 /*    System and Application Code                                         */
67 /*                                                                        */
68 /*  RELEASE HISTORY                                                       */
69 /*                                                                        */
70 /*    DATE              NAME                      DESCRIPTION             */
71 /*                                                                        */
72 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
73 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
74 /*                                            updated default call,       */
75 /*                                            added logic to handle new   */
76 /*                                            events,                     */
77 /*                                            resulting in version 6.1    */
78 /*                                                                        */
79 /**************************************************************************/
_gx_multi_line_text_button_event_process(GX_MULTI_LINE_TEXT_BUTTON * button,GX_EVENT * event_ptr)80 UINT  _gx_multi_line_text_button_event_process(GX_MULTI_LINE_TEXT_BUTTON *button, GX_EVENT *event_ptr)
81 {
82 UINT status;
83 
84     /* Default status to success.  */
85     status =  GX_SUCCESS;
86 
87     /* Process relative to the type of event.  */
88     switch (event_ptr -> gx_event_type)
89     {
90     case GX_EVENT_SHOW:
91     case GX_EVENT_LANGUAGE_CHANGE:
92         status = _gx_text_button_event_process((GX_TEXT_BUTTON *)button, event_ptr);
93         _gx_multi_line_text_button_line_pointers_set(button);
94         break;
95 
96 #if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
97     case GX_EVENT_DYNAMIC_BIDI_TEXT_ENABLE:
98     case GX_EVENT_DYNAMIC_BIDI_TEXT_DISABLE:
99         _gx_multi_line_text_button_line_pointers_set(button);
100         break;
101 #endif
102 
103     default:
104 
105         /* Call the widget default processing.  */
106         status = _gx_text_button_event_process((GX_TEXT_BUTTON *)button, event_ptr);
107     }
108 
109     /* Return completion status.  */
110     return(status);
111 }
112 
113