Skip to content

Commit eb9a60d

Browse files
committed
Change auto-increment timing in NxWidgets::CNumericEdit. From Petteri Aimonen
1 parent 87b4c6a commit eb9a60d

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

NxWidgets/ChangeLog.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -370,5 +370,8 @@
370370
the Unit Tests are registered as built-in NSH applications (2013-5-30).
371371
* NxWidgets::CImage: Allow a NULL pointer for a bitmap. Add protection
372372
to prevent dereferencing the NULL pointer. From Petteri Aimonen
373-
(2013-6-3).
373+
(2013-6-4).
374+
* NxWidgets::CNumericEdit: Delay before auto-incrementing now varies:
375+
A longer delay is required to start auto-incrementing and speed increases
376+
while pressed. From Petteri Aimonen (2013-6-4).
374377

NxWidgets/libnxwidgets/src/cnumericedit.cxx

+10-2
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,23 @@ void CNumericEdit::handleActionEvent(const CWidgetEventArgs &e)
216216
{
217217
m_timercount++;
218218

219-
int increment = m_increment;
219+
// Increment the value at increasing speed.
220+
// Ignore the first 3 timer ticks so that single clicks
221+
// only increment by one.
222+
223+
int increment = 0;
220224
if (m_timercount > 50)
221225
{
222226
increment = m_increment * 100;
223227
}
224-
else if (m_timercount > 10)
228+
else if (m_timercount > 20)
225229
{
226230
increment = m_increment * 10;
227231
}
232+
else if (m_timercount > 3)
233+
{
234+
increment = m_increment;
235+
}
228236

229237
if (m_button_minus->isClicked())
230238
{

0 commit comments

Comments
 (0)