/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** GUIX Component */ /** */ /** Text Input Management (Single Line Text Input) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_system.h" #include "gx_single_line_text_input.h" #include "gx_widget.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_single_line_text_input_style_add PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This service adds styles to a single line text input widget. */ /* */ /* INPUT */ /* */ /* text_input Single-line text input widget */ /* control block */ /* style New style to add */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _gx_system_timer_start Start the GUIX system timer */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _gx_single_line_text_input_style_add(GX_SINGLE_LINE_TEXT_INPUT *text_input, ULONG style) { UINT status; GX_VALUE blink_interval; GX_TEXT_INPUT_CURSOR *cursor_ptr; cursor_ptr = &text_input -> gx_single_line_text_input_cursor_instance; status = _gx_widget_style_add((GX_WIDGET *)text_input, style); if (text_input -> gx_widget_style & GX_STYLE_CURSOR_ALWAYS) { text_input -> gx_widget_status |= (GX_STATUS_CURSOR_SHOW | GX_STATUS_CURSOR_DRAW); if ((text_input -> gx_widget_status & GX_STATUS_VISIBLE) && (text_input -> gx_widget_style & GX_STYLE_CURSOR_BLINK)) { blink_interval = cursor_ptr -> gx_text_input_cursor_blink_interval; _gx_system_timer_start((GX_WIDGET *)text_input, ID_TEXT_INPUT_TIMER, (UINT)blink_interval, (UINT)blink_interval); } } return status; }