GUI parts for DISCO-F746NG. GuiBase, Button, ButtonGroup, ResetButton, Label, BlinkLabel, NumericLabel, SeekBar, SeekbarGroup
Dependencies: Array_Matrix BSP_DISCO_F746NG
Fork of F746_GUI by
Diff: SeekBar.hpp
- Revision:
- 12:687ec6183385
- Parent:
- 11:7debdaa7b503
- Child:
- 13:9ae055fac9cf
--- a/SeekBar.hpp Wed Apr 27 07:28:04 2016 +0000 +++ b/SeekBar.hpp Sat Apr 30 06:33:32 2016 +0000 @@ -1,7 +1,7 @@ //----------------------------------------------------------- // SeekBar class -- Header // -// 2016/04/27, Copyright (c) 2016 MIKAMI, Naoki +// 2016/04/30, Copyright (c) 2016 MIKAMI, Naoki //----------------------------------------------------------- #ifndef F746_SEEKBAR_HPP @@ -27,7 +27,7 @@ SeekBar(uint16_t x, uint16_t y, uint16_t length, float min, float max, float initialValue, Orientation hv = Holizontal, - uint32_t thumbColor = LCD_COLOR_WHITE, + uint32_t thumbColor = 0xFFB0B0FF, uint16_t thumbSize = 30, uint16_t width = 4, uint32_t colorL = LCD_COLOR_LIGHTGRAY, uint32_t colorH = 0xFFB0B0B0, @@ -35,21 +35,22 @@ : GuiBase(x, y, Font12, 0, backColor, thumbColor), L_(length), W_(width), SIZE_(thumbSize), COLOR_L_(colorL), COLOR_H_(colorH), - MIN_(min), MAX_(max), ORIENT_(hv), - labelL(NULL), labelC(NULL), labelR(NULL), - v_(initialValue), active_(true) + MIN_(min), MAX_(max), ORIENT_(hv), v_(initialValue), + labelOn_(false), slided_(false), 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, + uint32_t thumbColor = 0xFFB0B0FF, uint16_t thumbSize = 30, uint16_t width = 4, uint32_t colorL = LCD_COLOR_LIGHTGRAY, uint32_t colorH = 0xFFB0B0B0, uint32_t backColor = GuiBase::ENUM_BACK); + ~SeekBar(); + bool Slide(); float GetValue() { return v_; } int GetIntValue() { return Round(v_); } @@ -75,8 +76,9 @@ const float MIN_, MAX_; const Orientation ORIENT_; - Label *labelL, *labelC, *labelR; + Label **labelLCR; float v_; // value of seekbar + bool labelOn_; bool slided_; bool active_; @@ -89,4 +91,3 @@ }; } #endif // F746_SEEKBAR_HPP -