EasyGUI
gui_progbar.h
1 
6 /*
7  * Copyright (c) 2019 Tilen MAJERLE
8  *
9  * Permission is hereby granted, free of charge, to any person
10  * obtaining a copy of this software and associated documentation
11  * files (the "Software"), to deal in the Software without restriction,
12  * including without limitation the rights to use, copy, modify, merge,
13  * publish, distribute, sublicense, and/or sell copies of the Software,
14  * and to permit persons to whom the Software is furnished to do so,
15  * subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be
18  * included in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
23  * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27  * OTHER DEALINGS IN THE SOFTWARE.
28  *
29  * This file is part of EasyGUI library.
30  *
31  * Author: Tilen Majerle <tilen@majerle.eu>
32  */
33 #ifndef GUI_HDR_PROGBAR_H
34 #define GUI_HDR_PROGBAR_H
35 
36 /* C++ detection */
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 #include "gui_widget.h"
42 
53 typedef enum {
58 
59 gui_handle_p gui_progbar_create(gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags);
60 uint8_t gui_progbar_setcolor(gui_handle_p h, gui_progbar_color_t index, gui_color_t color);
61 uint8_t gui_progbar_setmin(gui_handle_p h, int32_t val);
62 uint8_t gui_progbar_setmax(gui_handle_p h, int32_t val);
63 uint8_t gui_progbar_setvalue(gui_handle_p h, int32_t val);
64 uint8_t gui_progbar_setanimation(gui_handle_p h, uint8_t anim);
65 int32_t gui_progbar_getmin(gui_handle_p h);
66 int32_t gui_progbar_getmax(gui_handle_p h);
67 int32_t gui_progbar_getvalue(gui_handle_p h);
68 uint8_t gui_progbar_setpercentmode(gui_handle_p h, uint8_t enable);
69 
74 /* C++ detection */
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif /* GUI_HDR_PROGBAR_H */
Definition: gui_progbar.h:54
uint8_t gui_progbar_setmin(gui_handle_p h, int32_t val)
Set progress bar minimal value.
Definition: gui_progbar.c:308
uint8_t(* gui_widget_evt_fn)(gui_handle_p h, gui_widget_evt_t evt, gui_evt_param_t *const param, gui_evt_result_t *const result)
Callback function for widget.
Definition: gui_defs.h:1103
uint32_t gui_color_t
Definition: gui_defs.h:210
int32_t gui_progbar_getmin(gui_handle_p h)
Get progress bar minimal value.
Definition: gui_progbar.c:355
int32_t gui_progbar_getvalue(gui_handle_p h)
Get progress bar current value.
Definition: gui_progbar.c:379
gui_handle_p gui_progbar_create(gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags)
Create new progress bar widget.
Definition: gui_progbar.c:273
uint8_t gui_progbar_setanimation(gui_handle_p h, uint8_t anim)
Set progress bar to animation mode.
Definition: gui_progbar.c:344
uint8_t gui_progbar_setpercentmode(gui_handle_p h, uint8_t enable)
Sets percent mode. When in this mode, widget text is in percent according to current value between mi...
Definition: gui_progbar.c:332
uint8_t gui_progbar_setcolor(gui_handle_p h, gui_progbar_color_t index, gui_color_t color)
Set color to specific part of widget.
Definition: gui_progbar.c:285
gui_progbar_color_t
Progress bar color list enumeration.
Definition: gui_progbar.h:53
Definition: gui_progbar.h:56
uint8_t gui_progbar_setmax(gui_handle_p h, int32_t val)
Set progress bar maximal value.
Definition: gui_progbar.c:320
uint8_t gui_progbar_setvalue(gui_handle_p h, int32_t val)
Set progress bar current value.
Definition: gui_progbar.c:296
Definition: gui_progbar.h:55
int32_t gui_progbar_getmax(gui_handle_p h)
Get progress bar maximal value.
Definition: gui_progbar.c:367
uint32_t gui_id_t
Definition: gui_defs.h:209