GUI parts for DISCO-F469I a fork of DISCO-F746NG. GuiBase, Button, ButtonGroup, ResetButton, Label, BlinkLabel, NumericLabel, SeekBar, SeekbarGroup
Dependents: DISCO-F469NI_LCDTS_GUI_demo DISCO-F469NI_LCDTS_GUI_demo projekt_PSW_v1 DISCO-F469NI_LCDTS_GUI_demoaaaaaaaaaxxxx ... more
Fork of F746_GUI by
Diff: SeekBar.hpp
- Revision:
- 6:b8f197b0012c
- Parent:
- 5:9c3ea4d4bc6b
- Child:
- 9:c379410bda15
diff -r 9c3ea4d4bc6b -r b8f197b0012c SeekBar.hpp --- a/SeekBar.hpp Sun Apr 10 09:25:36 2016 +0000 +++ b/SeekBar.hpp Tue Apr 12 04:15:41 2016 +0000 @@ -1,13 +1,14 @@ //----------------------------------------------------------- // SeekBar class -- Header // -// 2016/04/10, Copyright (c) 2016 MIKAMI, Naoki +// 2016/04/12, Copyright (c) 2016 MIKAMI, Naoki //----------------------------------------------------------- #ifndef F746_SEEKBAR_HPP #define F746_SEEKBAR_HPP #include "GuiBase.hpp" +#include "Label.hpp" namespace Mikami { @@ -18,7 +19,7 @@ // Constructor SeekBar(uint16_t x, uint16_t y, uint16_t length, - float min, float max, float value, + float min, float max, float initialValue, Orientation hv = Holizontal, uint32_t thumbColor = LCD_COLOR_WHITE, uint16_t thumbSize = 30, uint16_t width = 4, @@ -29,8 +30,19 @@ L_(length), W_(width), SIZE_(thumbSize), COLOR_L_(colorL), COLOR_H_(colorH), MIN_(min), MAX_(max), ORIENT_(hv), - v_(value), active_(true) - { Draw(value); } + labelL(NULL), labelC(NULL), labelR(NULL), + v_(initialValue), active_(true) + { Draw(initialValue); } + + // Constructor with scale value (only horizontal) + SeekBar(uint16_t x, uint16_t y, uint16_t length, + float min, float max, float initialValue, + string left, string center, string right, + uint32_t thumbColor = LCD_COLOR_WHITE, + uint16_t thumbSize = 30, uint16_t width = 4, + uint32_t colorL = LCD_COLOR_LIGHTGRAY, + uint32_t colorH = 0xFFB0B0B0, + uint32_t backColor = GuiBase::ENUM_BACK); bool Slide(); float GetValue() { return v_; } @@ -51,6 +63,7 @@ const float MIN_, MAX_; const Orientation ORIENT_; + Label *labelL, *labelC, *labelR; float v_; // value of seekbar bool slided_; bool active_;