/*************************************************************************** * 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 */ /** */ /** Scroll Wheel Management (Scroll Wheel) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_scroll_wheel.h" #include "gx_system.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_scroll_wheel_total_rows_set PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function sets the total rows for scroll wheel widget. */ /* */ /* INPUT */ /* */ /* wheel Scroll wheel control block */ /* total_rows Total rows to set */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _gx_system_dirty_mark */ /* */ /* 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 */ /* */ /**************************************************************************/ UINT _gx_scroll_wheel_total_rows_set(GX_SCROLL_WHEEL *wheel, INT total_rows) { wheel -> gx_scroll_wheel_total_rows = total_rows; if (wheel -> gx_scroll_wheel_selected_row > total_rows - 1) { _gx_scroll_wheel_selected_set(wheel, total_rows - 1); } if (wheel -> gx_widget_status & GX_STATUS_VISIBLE) { _gx_system_dirty_mark((GX_WIDGET *)wheel); } return GX_SUCCESS; }