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 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_widget.h"
28 #include "gx_button.h"
29 #include "gx_canvas.h"
30 #include "gx_system.h"
31 #include "gx_context.h"
32 
33 /**************************************************************************/
34 /*                                                                        */
35 /*  FUNCTION                                               RELEASE        */
36 /*                                                                        */
37 /*    _gx_multi_line_text_button_draw                     PORTABLE C      */
38 /*                                                           6.1          */
39 /*  AUTHOR                                                                */
40 /*                                                                        */
41 /*    Kenneth Maxwell, Microsoft Corporation                              */
42 /*                                                                        */
43 /*  DESCRIPTION                                                           */
44 /*                                                                        */
45 /*    This function draws the specified multi-line text button, which is  */
46 /*    special type of button (widget).                                    */
47 /*                                                                        */
48 /*  INPUT                                                                 */
49 /*                                                                        */
50 /*    button                                Button control block          */
51 /*                                                                        */
52 /*  OUTPUT                                                                */
53 /*                                                                        */
54 /*    None                                                                */
55 /*                                                                        */
56 /*  CALLS                                                                 */
57 /*                                                                        */
58 /*   _gx_button_background_draw             Draw button background        */
59 /*   _gx_multi_line_text_button_text_draw   Draw multi-line button text   */
60 /*   _gx_widget_children_draw               Draw children widgets         */
61 /*   _gx_monochrome_driver_disabled_button_line_draw                      */
62 /*                                          Draw a line for disabled      */
63 /*                                            monochrome button           */
64 /*                                                                        */
65 /*  CALLED BY                                                             */
66 /*                                                                        */
67 /*    System and Application Code                                         */
68 /*                                                                        */
69 /*  RELEASE HISTORY                                                       */
70 /*                                                                        */
71 /*    DATE              NAME                      DESCRIPTION             */
72 /*                                                                        */
73 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
74 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
75 /*                                            resulting in version 6.1    */
76 /*                                                                        */
77 /**************************************************************************/
_gx_multi_line_text_button_draw(GX_MULTI_LINE_TEXT_BUTTON * button)78 VOID  _gx_multi_line_text_button_draw(GX_MULTI_LINE_TEXT_BUTTON *button)
79 {
80 GX_WIDGET *widget = (GX_WIDGET *)button;
81 
82     /* draw the background button */
83     _gx_button_background_draw((GX_BUTTON *)button);
84 
85     /* draw the text lines */
86     _gx_multi_line_text_button_text_draw(button);
87 
88     /* Draw button's children.  */
89     _gx_widget_children_draw(widget);
90 
91     if (!(button -> gx_widget_style & GX_STYLE_ENABLED))
92     {
93         /* Draw a line on the button to show it's disable for mono driver. */
94         _gx_monochrome_driver_disabled_button_line_draw((GX_BUTTON *)button);
95     }
96 }
97 
98