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 /**   Multi Line Text View Management (Multi Line Text View)              */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "gx_api.h"
28 #include "gx_multi_line_text_view.h"
29 #include "gx_window.h"
30 #include "gx_widget.h"
31 
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _gx_multi_line_text_view_draw                       PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Kenneth Maxwell, Microsoft Corporation                              */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This function draws a multi-line-text-view widget.                  */
45 /*                                                                        */
46 /*  INPUT                                                                 */
47 /*                                                                        */
48 /*    text_view                              Multi-line_text_view widget  */
49 /*                                           control block                */
50 /*  OUTPUT                                                                */
51 /*                                                                        */
52 /*    None                                                                */
53 /*                                                                        */
54 /*  CALLS                                                                 */
55 /*                                                                        */
56 /*    _gx_window_border_draw                Draw window background with   */
57 /*                                            specified fill color        */
58 /*    _gx_multi_line_text_view_text_draw    Draw text                     */
59 /*    _gx_widget_children_draw              Draw children widgets         */
60 /*                                                                        */
61 /*  CALLED BY                                                             */
62 /*                                                                        */
63 /*    Application Code                                                    */
64 /*    GUIX Internal Code                                                  */
65 /*                                                                        */
66 /*  RELEASE HISTORY                                                       */
67 /*                                                                        */
68 /*    DATE              NAME                      DESCRIPTION             */
69 /*                                                                        */
70 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
71 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
72 /*                                            resulting in version 6.1    */
73 /*                                                                        */
74 /**************************************************************************/
_gx_multi_line_text_view_draw(GX_MULTI_LINE_TEXT_VIEW * text_view)75 VOID  _gx_multi_line_text_view_draw(GX_MULTI_LINE_TEXT_VIEW *text_view)
76 {
77 GX_RESOURCE_ID text_color;
78 
79     /* Set the brush color, font, width. */
80     if (text_view -> gx_widget_style & GX_STYLE_ENABLED)
81     {
82         if (text_view -> gx_widget_style & GX_STYLE_DRAW_SELECTED)
83         {
84             text_color = text_view -> gx_multi_line_text_view_selected_text_color;
85         }
86         else
87         {
88             text_color = text_view -> gx_multi_line_text_view_normal_text_color;
89         }
90     }
91     else
92     {
93         text_color = text_view -> gx_multi_line_text_view_disabled_text_color;
94     }
95 
96     /* Draw window background. */
97     _gx_window_background_draw((GX_WINDOW *)text_view);
98 
99     /* Draw text. */
100     _gx_multi_line_text_view_text_draw(text_view, text_color);
101 
102     /* Draw widget's children.  */
103     _gx_widget_children_draw((GX_WIDGET *)text_view);
104 }
105 
106