Class library: Button class and ButtonGroup class for DISCO-F746NG. クラスライブラリ: DISCO-F746NG 用の,Button クラス,ButtonGroup クラス.
Dependents: F746_SpectralAnalysis_NoPhoto F746_Fourier_series_of_square_wave_01 F746_ButtonGroup_Demo F746_Mandelbrot ... more
Diff: button_group.hpp
- Revision:
- 13:af578b53ff0e
- Parent:
- 11:204bc17f59cc
--- a/button_group.hpp Thu Feb 18 10:04:20 2016 +0000 +++ b/button_group.hpp Mon Feb 22 13:39:32 2016 +0000 @@ -1,7 +1,7 @@ //----------------------------------------------------------- // Button group class -- Header // -// 2016/02/17, Copyright (c) 2016 MIKAMI, Naoki +// 2016/02/22, Copyright (c) 2016 MIKAMI, Naoki //----------------------------------------------------------- #ifndef F746_BUTTON_GROUP_HPP @@ -30,9 +30,8 @@ ~ButtonGroup(); // Draw button - void Draw(int num, uint32_t color, - uint32_t textColor = LCD_COLOR_WHITE) - { buttons_[num]->Draw(color, textColor); } + bool Draw(int num, uint32_t color, + uint32_t textColor = LCD_COLOR_WHITE); // Draw all buttons void DrawAll(uint32_t color, @@ -64,9 +63,11 @@ private: Button **buttons_; int numberOfButtons_; + int touchedNum_; // Check range of argument - bool Range(int n); + bool Range(int n) + { return ((n >= 0) && (n < numberOfButtons_)); } // disallow copy constructor and assignment operator ButtonGroup(const ButtonGroup&);