Choco OS  V.0.16.9.0
Join to the chocolate world
oC_TGUI_ProgressBarStyle_t Struct Reference

style for progress bar More...

#include <oc_tgui.h>

Data Fields

oC_TGUI_Color_t NonActiveColor
 Color of the not filled part of progress bar.
 
oC_TGUI_Color_t ActiveColor
 Color of the filled part of progress bar.
 
oC_TGUI_Style_t BorderStyle
 Style of the border.
 

Detailed Description

The type for storing style of the progress bar.

See also
oC_TGUI_DrawProgressBar

Here is example of usage:

// Style of the progress bar
static const oC_TGUI_ProgressBarStyle_t barStyle = {
.ActiveColor = oC_TGUI_Color_Green , // Color of the filled part of progress bar
.NonActiveColor = oC_TGUI_Color_LightGreen , // Color of the not filled part of progress bar
.BorderStyle.Foreground = oC_TGUI_Color_Black , // Foreground color for border
.BorderStyle.Background = oC_TGUI_Color_White , // Background color for border
.BorderStyle.DontDraw = false , // Set it to true if you don't need a border
};
// Position of progress bar
static const oC_TGUI_Position_t position = { .Column = 1 , .Line = 1 };
// Width of the progress bar
static const oC_TGUI_Column_t width = 30;
// current value of progress bar
static const uint32_t value = 15;
// Maximum value of the progress bar
static const uint32_t maxValue = 30;
// The progress bar will have 50% filled (value/maxValue = 15/30 = 0.5)
oC_TGUI_DrawProgressBar(position,width,value,maxValue,&barStyle);

The code above will result with creation of the following progress bar:

progress_bar_tgui_example.png
Progress Bar Example

Definition at line 274 of file oc_tgui.h.


The documentation for this struct was generated from the following file: