1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** GUIX Component                                                        */
16 /**                                                                       */
17 /**   Text Button Management (Button)                                     */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_widget.h"
28 #include "gx_button.h"
29 
30 /**************************************************************************/
31 /*                                                                        */
32 /*  FUNCTION                                               RELEASE        */
33 /*                                                                        */
34 /*    _gx_multi_line_text_button_event_process            PORTABLE C      */
35 /*                                                           6.1          */
36 /*  AUTHOR                                                                */
37 /*                                                                        */
38 /*    Kenneth Maxwell, Microsoft Corporation                              */
39 /*                                                                        */
40 /*  DESCRIPTION                                                           */
41 /*                                                                        */
42 /*    This function creates a multi-line text button, which is a special  */
43 /*    type of button (widget).                                            */
44 /*                                                                        */
45 /*  INPUT                                                                 */
46 /*                                                                        */
47 /*    button                                Button control block          */
48 /*    name                                  Name of button                */
49 /*    parent                                Parent widget control block   */
50 /*    text_id                               text resource id              */
51 /*    style                                 Style of button               */
52 /*    size                                  Button size                   */
53 /*                                                                        */
54 /*  OUTPUT                                                                */
55 /*                                                                        */
56 /*    status                                Completion status             */
57 /*                                                                        */
58 /*  CALLS                                                                 */
59 /*                                                                        */
60 /*    _gx_text_button_event_process                                       */
61 /*    _gx_multi_line_text_button_line_pointers_set                        */
62 /*                                                                        */
63 /*  CALLED BY                                                             */
64 /*                                                                        */
65 /*    System and Application Code                                         */
66 /*                                                                        */
67 /*  RELEASE HISTORY                                                       */
68 /*                                                                        */
69 /*    DATE              NAME                      DESCRIPTION             */
70 /*                                                                        */
71 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
72 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
73 /*                                            updated default call,       */
74 /*                                            added logic to handle new   */
75 /*                                            events,                     */
76 /*                                            resulting in version 6.1    */
77 /*                                                                        */
78 /**************************************************************************/
_gx_multi_line_text_button_event_process(GX_MULTI_LINE_TEXT_BUTTON * button,GX_EVENT * event_ptr)79 UINT  _gx_multi_line_text_button_event_process(GX_MULTI_LINE_TEXT_BUTTON *button, GX_EVENT *event_ptr)
80 {
81 UINT status;
82 
83     /* Default status to success.  */
84     status =  GX_SUCCESS;
85 
86     /* Process relative to the type of event.  */
87     switch (event_ptr -> gx_event_type)
88     {
89     case GX_EVENT_SHOW:
90     case GX_EVENT_LANGUAGE_CHANGE:
91         status = _gx_text_button_event_process((GX_TEXT_BUTTON *)button, event_ptr);
92         _gx_multi_line_text_button_line_pointers_set(button);
93         break;
94 
95 #if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT)
96     case GX_EVENT_DYNAMIC_BIDI_TEXT_ENABLE:
97     case GX_EVENT_DYNAMIC_BIDI_TEXT_DISABLE:
98         _gx_multi_line_text_button_line_pointers_set(button);
99         break;
100 #endif
101 
102     default:
103 
104         /* Call the widget default processing.  */
105         status = _gx_text_button_event_process((GX_TEXT_BUTTON *)button, event_ptr);
106     }
107 
108     /* Return completion status.  */
109     return(status);
110 }
111 
112