From eb9a60d5780d431a6fb579de8021d9e05c0453ee Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 4 Jun 2013 08:02:06 -0600 Subject: Change auto-increment timing in NxWidgets::CNumericEdit. From Petteri Aimonen --- NxWidgets/ChangeLog.txt | 5 ++++- NxWidgets/libnxwidgets/src/cnumericedit.cxx | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'NxWidgets') 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()) { -- cgit v1.2.3