Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Array_Matrix BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG
Fork of F746_GUI by
Revision 6:b8f197b0012c, committed 2016-04-12
- Comitter:
- MikamiUitOpen
- Date:
- Tue Apr 12 04:15:41 2016 +0000
- Parent:
- 5:9c3ea4d4bc6b
- Child:
- 7:3813be1ca81d
- Commit message:
- 7
Changed in this revision
--- a/BlinkLabel.hpp Sun Apr 10 09:25:36 2016 +0000 +++ b/BlinkLabel.hpp Tue Apr 12 04:15:41 2016 +0000 @@ -1,6 +1,6 @@ //----------------------------------------------------------- // BlinkLabel class -- derived class of Label class -// This class for displaying error message +// For displaying error message // // 2016/04/07, Copyright (c) 2016 MIKAMI, Naoki //-----------------------------------------------------------
--- a/GuiBase.hpp Sun Apr 10 09:25:36 2016 +0000
+++ b/GuiBase.hpp Tue Apr 12 04:15:41 2016 +0000
@@ -1,7 +1,7 @@
//-----------------------------------------------------------
// GuiBase class (abstract base class) ---- Header
//
-// 2016/03/30, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/04/10, Copyright (c) 2016 MIKAMI, Naoki
//-----------------------------------------------------------
#ifndef F746_GUI_BASE_HPP
@@ -30,8 +30,8 @@
ENUM_INACTIVE = 0xD0003538, ENUM_INACTIVE_TEXT = 0xFF808080};
protected:
- static LCD_DISCO_F746NG lcd_; // Pointer of object for LCD display
- static TS_DISCO_F746NG ts_; // Pointer of object for touch pannel
+ static LCD_DISCO_F746NG lcd_; // for LCD display
+ static TS_DISCO_F746NG ts_; // for touch pannel
static TS_StateTypeDef state_;
static bool multiTouch_;
--- a/SeekBar.cpp Sun Apr 10 09:25:36 2016 +0000
+++ b/SeekBar.cpp Tue Apr 12 04:15:41 2016 +0000
@@ -1,13 +1,33 @@
//-----------------------------------------------------------
// SeekBar class
//
-// 2016/04/10, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/04/12, Copyright (c) 2016 MIKAMI, Naoki
//-----------------------------------------------------------
#include "SeekBar.hpp"
namespace Mikami
{
+ // Constructor with scale value (only horizontal)
+ SeekBar::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,
+ uint16_t thumbSize, uint16_t width,
+ uint32_t colorL, uint32_t colorH,
+ uint32_t backColor)
+ : GuiBase(x, y, Font12, GuiBase::ENUM_TEXT, backColor, thumbColor),
+ L_(length), W_(width),
+ SIZE_(thumbSize), COLOR_L_(colorL), COLOR_H_(colorH),
+ MIN_(min), MAX_(max), ORIENT_(Holizontal),
+ v_(initialValue), active_(true)
+ {
+ Draw(initialValue);
+ labelL = new Label(x, y-28, left, Label::CENTER);
+ labelC = new Label(x+length/2, y-28, center, Label::CENTER);
+ labelR = new Label(x+length, y-28, right, Label::CENTER);
+ }
+
// Slide thumb
// If the thumb is not touched, return false
bool SeekBar::Slide()
@@ -32,17 +52,29 @@
return rtn;
}
-
+
void SeekBar::Activate()
{
active_ = true;
Draw(v_);
+ if (labelL != NULL)
+ {
+ labelL->Draw(TEXT_COLOR_);
+ labelC->Draw(TEXT_COLOR_);
+ labelR->Draw(TEXT_COLOR_);
+ }
}
-
+
void SeekBar::Inactivate()
{
active_ = false;
Draw(v_);
+ if (labelL != NULL)
+ {
+ labelL->Draw(INACTIVE_TEXT_COLOR_);
+ labelC->Draw(INACTIVE_TEXT_COLOR_);
+ labelR->Draw(INACTIVE_TEXT_COLOR_);
+ }
}
// Draw seekbar
@@ -128,4 +160,3 @@
return value;
}
}
-
--- 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_;
