Same as original
Diff: button_group.hpp
- Revision:
- 13:af578b53ff0e
- Parent:
- 11:204bc17f59cc
- Child:
- 14:3076e383e6b0
diff -r 710078d50d9b -r af578b53ff0e button_group.hpp --- 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&);