summaryrefslogtreecommitdiff
path: root/NxWidgets
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-06-04 08:02:06 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-06-04 08:02:06 -0600
commiteb9a60d5780d431a6fb579de8021d9e05c0453ee (patch)
tree28f4b1772f998779e494a006f436b958af0f1b00 /NxWidgets
parent87b4c6a3048f34bfb828285fbd48237aa60464cf (diff)
downloadnuttx-eb9a60d5780d431a6fb579de8021d9e05c0453ee.tar.gz
nuttx-eb9a60d5780d431a6fb579de8021d9e05c0453ee.tar.bz2
nuttx-eb9a60d5780d431a6fb579de8021d9e05c0453ee.zip
Change auto-increment timing in NxWidgets::CNumericEdit. From Petteri Aimonen
Diffstat (limited to 'NxWidgets')
-rw-r--r--NxWidgets/ChangeLog.txt5
-rw-r--r--NxWidgets/libnxwidgets/src/cnumericedit.cxx12
2 files changed, 14 insertions, 3 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt
index f83364b9a..93112b7a0 100644
--- a/NxWidgets/ChangeLog.txt
+++ b/NxWidgets/ChangeLog.txt
@@ -370,5 +370,8 @@
the Unit Tests are registered as built-in NSH applications (2013-5-30).
* NxWidgets::CImage: Allow a NULL pointer for a bitmap. Add protection
to prevent dereferencing the NULL pointer. From Petteri Aimonen
- (2013-6-3).
+ (2013-6-4).
+* NxWidgets::CNumericEdit: Delay before auto-incrementing now varies:
+ A longer delay is required to start auto-incrementing and speed increases
+ while pressed. From Petteri Aimonen (2013-6-4).
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())
{