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 /** Multi Line Text View Management (Multi Line Text View) */ 18 /** */ 19 /**************************************************************************/ 20 21 #define GX_SOURCE_CODE 22 23 24 /* Include necessary system files. */ 25 26 #include "gx_api.h" 27 #include "gx_system.h" 28 #include "gx_multi_line_text_view.h" 29 #include "gx_scrollbar.h" 30 #include "gx_window.h" 31 32 /**************************************************************************/ 33 /* */ 34 /* FUNCTION RELEASE */ 35 /* */ 36 /* _gx_multi_line_text_view_whitespace_set PORTABLE C */ 37 /* 6.1 */ 38 /* AUTHOR */ 39 /* */ 40 /* Kenneth Maxwell, Microsoft Corporation */ 41 /* */ 42 /* DESCRIPTION */ 43 /* */ 44 /* This function sets whitespace for a multi line text view widget. */ 45 /* */ 46 /* INPUT */ 47 /* */ 48 /* text_view Multi-line text view widget */ 49 /* control block */ 50 /* whitespace Value to set */ 51 /* */ 52 /* OUTPUT */ 53 /* */ 54 /* status Completion status */ 55 /* */ 56 /* CALLS */ 57 /* */ 58 /* _gx_multi_line_text_view_string_total_rows_compute */ 59 /* Calculate total rows of */ 60 /* text view text */ 61 /* _gx_window_scrollbar_find Find scrollbar for a window */ 62 /* _gx_scrollbar_reset Reset scrollbar information */ 63 /* _gx_multi_line_text_view_line_cache_update */ 64 /* Update line cache */ 65 /* _gx_system_dirty_mark Mark the widget dirty */ 66 /* _gx_system_event_fold Fold a event */ 67 /* */ 68 /* CALLED BY */ 69 /* */ 70 /* Application Code */ 71 /* */ 72 /* RELEASE HISTORY */ 73 /* */ 74 /* DATE NAME DESCRIPTION */ 75 /* */ 76 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ 77 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ 78 /* resulting in version 6.1 */ 79 /* */ 80 /**************************************************************************/ _gx_multi_line_text_view_whitespace_set(GX_MULTI_LINE_TEXT_VIEW * text_view,GX_UBYTE whitespace)81UINT _gx_multi_line_text_view_whitespace_set(GX_MULTI_LINE_TEXT_VIEW *text_view, GX_UBYTE whitespace) 82 { 83 GX_EVENT newevent; 84 85 text_view -> gx_multi_line_text_view_whitespace = whitespace; 86 text_view -> gx_multi_line_text_view_line_index_old = GX_TRUE; 87 88 if (text_view -> gx_widget_status & GX_STATUS_VISIBLE) 89 { 90 memset(&newevent, 0, sizeof(GX_EVENT)); 91 newevent.gx_event_type = GX_EVENT_CLIENT_UPDATED; 92 newevent.gx_event_target = (GX_WIDGET *)text_view; 93 _gx_system_event_fold(&newevent); 94 } 95 96 return(GX_SUCCESS); 97 } 98 99