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 TS_DISCO_F746NG LCD_DISCO_F746NG BSP_DISCO_F746NG
SeekBarGroup.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2016-04-24
- Revision:
- 9:c379410bda15
- Child:
- 10:5a2068884fd9
File content as of revision 9:c379410bda15:
//-----------------------------------------------------------
// SeekBarGroup class -- Header
//
// 2016/04/24, Copyright (c) 2016 MIKAMI, Naoki
//-----------------------------------------------------------
#ifndef F746_SEEKBAR_GROUP_HPP
#define F746_SEEKBAR_GROUP_HPP
#include "SeekBar.hpp"
namespace Mikami
{
class SeekbarGroup : public GuiBase
{
public:
SeekbarGroup(uint16_t x0, uint16_t y0, uint16_t length,
uint16_t number, uint16_t space,
float min, float max, float initialValue,
SeekBar::Orientation hv = SeekBar::Holizontal,
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);
~SeekbarGroup();
bool Slide(int num) { return seekBars_[num]->Slide(); }
float GetValue(int num) { return seekBars_[num]->GetValue(); }
int GetIntValue(int num) { return seekBars_[num]->Round(seekBars_[num]->GetIntValue()); }
// Get slided number
bool GetSlidedNumber(int &num);
void Draw(int num, float value, bool fill = false)
{ seekBars_[num]->Draw(value, fill); }
// Activate and inactivate
void Activate(int num) { seekBars_[num]->Activate(); }
void Inactivate(int num) { seekBars_[num]->Inactivate(); }
void ActivateAll()
{
for (int n=0; n<numberOfSeekBar_; n++)
seekBars_[n]->Activate();
}
void InactivateAll()
{
for (int n=0; n<numberOfSeekBar_; n++)
seekBars_[n]->Inactivate();
}
private:
SeekBar **seekBars_;
int numberOfSeekBar_;
// Check range of argument
bool Range(int n)
{ return ((n >= 0) && (n < numberOfSeekBar_)); }
// disallow copy constructor and assignment operator
SeekbarGroup(const SeekbarGroup&);
SeekbarGroup& operator=(const SeekbarGroup&);
};
}
#endif // F746_SEEKBAR_GROUP_HPP