Codechange: Add parameters to change range of slider widget.

This commit is contained in:
Peter Nelson
2022-10-23 15:35:35 +01:00
committed by PeterN
parent d35f1d3d06
commit 1180c95372
4 changed files with 29 additions and 15 deletions

View File

@@ -14,8 +14,15 @@
#include "../gfx_func.h"
void DrawSliderWidget(Rect r, byte value);
bool ClickSliderWidget(Rect r, Point pt, byte &value);
void DrawSliderWidget(Rect r, int min_value, int max_value, int value);
bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int &value);
inline bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, byte &value)
{
int tmp_value = value;
if (!ClickSliderWidget(r, pt, min_value, max_value, tmp_value)) return false;
value = tmp_value;
return true;
}
#endif /* WIDGETS_SLIDER_TYPE_H */