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: ButtonGroup.cpp
- Revision:
- 26:a9cf68d24f40
- Parent:
- 14:b977160de2f3
- Child:
- 28:e2b7ea78b7a0
diff -r d1acf9d53f98 -r a9cf68d24f40 ButtonGroup.cpp --- a/ButtonGroup.cpp Mon Nov 07 00:14:52 2016 +0000 +++ b/ButtonGroup.cpp Wed Nov 09 10:30:09 2016 +0000 @@ -1,7 +1,7 @@ //----------------------------------------------------------- // ButtonGroup class // -// 2016/07/03, Copyright (c) 2016 MIKAMI, Naoki +// 2016/11/09, Copyright (c) 2016 MIKAMI, Naoki //----------------------------------------------------------- #include "ButtonGroup.hpp" @@ -81,7 +81,7 @@ return rtn; } - // Get touched number + // Get touched number, return value: true or false bool ButtonGroup::GetTouchedNumber(int &num) { bool rtn = false; @@ -107,6 +107,24 @@ return true; } + // Get touched number, return value: touched number + int ButtonGroup::GetTouchedNumber() + { + int num; + if (GetTouchedNumber(num)) + return num; + else + return -1; + } + + // Wait until touched and get touched number + int ButtonGroup::WaitTouchedAndGet() + { + int num; + while (!GetTouchedNumber(num)) {} + return num; + } + // Activate and inactivate button(s) bool ButtonGroup::Activate(int num) {