Change auto-increment timing in NxWidgets::CNumericEdit. From Petteri Aimonen
This commit is contained in:
parent
1e7b43629a
commit
a6a07f3e45
@ -370,5 +370,8 @@
|
|||||||
the Unit Tests are registered as built-in NSH applications (2013-5-30).
|
the Unit Tests are registered as built-in NSH applications (2013-5-30).
|
||||||
* NxWidgets::CImage: Allow a NULL pointer for a bitmap. Add protection
|
* NxWidgets::CImage: Allow a NULL pointer for a bitmap. Add protection
|
||||||
to prevent dereferencing the NULL pointer. From Petteri Aimonen
|
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).
|
||||||
|
|
||||||
|
@ -216,15 +216,23 @@ void CNumericEdit::handleActionEvent(const CWidgetEventArgs &e)
|
|||||||
{
|
{
|
||||||
m_timercount++;
|
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)
|
if (m_timercount > 50)
|
||||||
{
|
{
|
||||||
increment = m_increment * 100;
|
increment = m_increment * 100;
|
||||||
}
|
}
|
||||||
else if (m_timercount > 10)
|
else if (m_timercount > 20)
|
||||||
{
|
{
|
||||||
increment = m_increment * 10;
|
increment = m_increment * 10;
|
||||||
}
|
}
|
||||||
|
else if (m_timercount > 3)
|
||||||
|
{
|
||||||
|
increment = m_increment;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_button_minus->isClicked())
|
if (m_button_minus->isClicked())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user