/*************************************************************************** * 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 */ /** */ /** Button Management (Button) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_widget.h" #include "gx_button.h" #include "gx_system.h" #include "gx_utility.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_icon_button_create PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function creates an icon button, which is a special type of */ /* button. */ /* */ /* INPUT */ /* */ /* button Button control block */ /* name Name of button */ /* parent Parent widget control block */ /* icon_id Resource ID of icon */ /* style Style of icon */ /* icon_button_id Application-definedID of icon */ /* size Button size */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _gx_button_create Create the underlying button */ /* _gx_widget_link Link the widget to its parent */ /* */ /* 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_icon_button_create(GX_ICON_BUTTON *button, GX_CONST GX_CHAR *name, GX_WIDGET *parent, GX_RESOURCE_ID icon_id, ULONG style, USHORT icon_button_id, GX_CONST GX_RECTANGLE *size) { /* Call the button create function. */ _gx_button_create((GX_BUTTON *)button, name, GX_NULL, style, icon_button_id, size); button -> gx_widget_type = GX_TYPE_ICON_BUTTON; button -> gx_widget_draw_function = (VOID (*)(GX_WIDGET *))_gx_icon_button_draw; button -> gx_icon_button_icon_id = icon_id; /* Determine if a parent widget was provided. */ if (parent) { _gx_widget_link(parent, (GX_WIDGET *)button); } /* Return the error status from button create. */ return(GX_SUCCESS); }