9
0
Fork 0

Change auto-increment timing in NxWidgets::CNumericEdit. From Petteri Aimonen

This commit is contained in:
Gregory Nutt 2013-06-04 08:02:06 -06:00
parent 87b4c6a304
commit eb9a60d578
2 changed files with 14 additions and 3 deletions

View File

@ -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).

View File

@ -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())
{