# The MIT License (MIT)
#
# Copyright (C) 2026 Scott Duensing
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

.section Widgets
.topic widget.progressbar
.title ProgressBar
.toc 0 ProgressBar
.index ProgressBar
.index wgtProgressBar
.index wgtProgressBarV
.index wgtProgressBarSetValue
.index wgtProgressBarGetValue

.h2 ProgressBar

A visual indicator of progress, displayed as a filled bar. Supports both horizontal and vertical orientations. Value ranges from 0 to 100.

Header: widgets/progress.h

.h3 Creation

.table
  Macro                    Description
  -----                    -----------
  wgtProgressBar(parent)   Create a horizontal progress bar.
  wgtProgressBarV(parent)  Create a vertical progress bar.
.endtable

.h3 API Functions

.table
  Function                            Description
  --------                            -----------
  WidgetT *wgtProgressBar(parent)     Create a horizontal progress bar.
  WidgetT *wgtProgressBarV(parent)    Create a vertical progress bar.
  void wgtProgressBarSetValue(w, val) Set the progress value (0-100). Clamped to 0..maxValue.
  int32_t wgtProgressBarGetValue(w)   Get the current progress value.
.endtable

.h3 API Struct (wgtRegisterApi "progressbar")

.table
  Slot       Function
  ----       --------
  create     wgtProgressBar
  createV    wgtProgressBarV
  setValue   wgtProgressBarSetValue
  getValue   wgtProgressBarGetValue
.endtable

.h3 Properties (BASIC Interface)

.table
  Property     Type       Access       Description
  --------     ----       ------       -----------
  Value        Integer    Read/Write   Current progress value (0-100).
.endtable

.h3 Methods

No widget-specific methods.

.h3 Events

ProgressBar is a display-only widget. Typically no callbacks are set.

.h3 Default Event

None. (VB basName: ProgressBar.)
