/*************************************************************************** * 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 Button Management (Button) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_system.h" #include "gx_display.h" #include "gx_context.h" #include "gx_widget.h" #include "gx_button.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_text_button_draw PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function draws the specified text button, which is a special */ /* type of widget. */ /* */ /* INPUT */ /* */ /* button Text button control block */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _gx_button_background_draw Draw button background */ /* _gx_widget_text_draw Draw text string */ /* _gx_widget_children_draw Draw children widgets */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* GUIX Internal 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 */ /* */ /**************************************************************************/ VOID _gx_text_button_draw(GX_TEXT_BUTTON *button) { GX_WIDGET *widget; /* Setup the button. */ widget = (GX_WIDGET *)button; /* Draw button background. */ _gx_button_background_draw((GX_BUTTON *)button); /* draw the text */ _gx_text_button_text_draw(button); /* Draw button's children. */ _gx_widget_children_draw(widget); if (!(button -> gx_widget_style & GX_STYLE_ENABLED)) { /* Draw a line on the button to show it's disable for mono driver. */ _gx_monochrome_driver_disabled_button_line_draw((GX_BUTTON *)button); } }