Skip to main content
Garnett.Robert
Senior III
March 27, 2021
Solved

touchgfx: scrollwheel how do I start numbering from other than zero?

  • March 27, 2021
  • 4 replies
  • 1830 views

Hi,

I wish to use scroll wheel to set clocks and calendars.

i.e. 0 to 23 for hours

0 to 59 for minutes and seconds

1 to 12 for months

1 to 28, 29, 30, 31 for dates

For calendars the month and dates need to start from 1 not zero.

How can I set this when I initialize the scroll wheel.

I see there is a setOffset, but it is s protected function and cannot be used.

This topic has been closed for replies.
Best answer by Alexandre RENOUX

Hello Garnett.Robert,

If you found out how to do it, could you close this topic by choosing Select as Best ?

Also if possible, could you write briefly the solution so that others can see ?

Thank you in advance,

/Alexandre

4 replies

Garnett.Robert
Senior III
March 27, 2021

Once again as soon as I define the problem and ask the question, I immediately work out how to do it.

I wonder if I write up my question, but don't post it I will still be able to work it out?

Alexandre RENOUX
Alexandre RENOUXBest answer
Visitor II
March 30, 2021

Hello Garnett.Robert,

If you found out how to do it, could you close this topic by choosing Select as Best ?

Also if possible, could you write briefly the solution so that others can see ?

Thank you in advance,

/Alexandre

Rock Deng
Associate III
November 20, 2021

At least Write down your solution here please.

Garnett.Robert
Senior III
November 29, 2021

Sorry About that.

In the ScreenxView.cpp

you just add 1 to the list:

void Screen4View::scrollWheelDateUpdateCenterItem(textCenterContainer& item, int16_t itemIndex)
{
	item.updateText(itemIndex + 1); /* Add one to start the displayed list from 1 */
}