diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-06-04 08:02:06 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-06-04 08:02:06 -0600 |
commit | eb9a60d5780d431a6fb579de8021d9e05c0453ee (patch) | |
tree | 28f4b1772f998779e494a006f436b958af0f1b00 /NxWidgets/libnxwidgets/src | |
parent | 87b4c6a3048f34bfb828285fbd48237aa60464cf (diff) | |
download | nuttx-eb9a60d5780d431a6fb579de8021d9e05c0453ee.tar.gz nuttx-eb9a60d5780d431a6fb579de8021d9e05c0453ee.tar.bz2 nuttx-eb9a60d5780d431a6fb579de8021d9e05c0453ee.zip |
Change auto-increment timing in NxWidgets::CNumericEdit. From Petteri Aimonen
Diffstat (limited to 'NxWidgets/libnxwidgets/src')
-rw-r--r-- | NxWidgets/libnxwidgets/src/cnumericedit.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/NxWidgets/libnxwidgets/src/cnumericedit.cxx b/NxWidgets/libnxwidgets/src/cnumericedit.cxx index 993e86fb8..4a1f6a0e2 100644 --- a/NxWidgets/libnxwidgets/src/cnumericedit.cxx +++ b/NxWidgets/libnxwidgets/src/cnumericedit.cxx @@ -216,15 +216,23 @@ void CNumericEdit::handleActionEvent(const CWidgetEventArgs &e) { m_timercount++; - int increment = m_increment; + // Increment the value at increasing speed. + // Ignore the first 3 timer ticks so that single clicks + // only increment by one. + + int increment = 0; if (m_timercount > 50) { increment = m_increment * 100; } - else if (m_timercount > 10) + else if (m_timercount > 20) { increment = m_increment * 10; } + else if (m_timercount > 3) + { + increment = m_increment; + } if (m_button_minus->isClicked()) { |