cancel
Showing results for 
Search instead for 
Did you mean: 

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

Garnett.Robert
Senior III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Alexandre RENOUX
Principal

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

View solution in original post

4 REPLIES 4
Garnett.Robert
Senior III

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
Principal

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

At least Write down your solution here please.

Garnett.Robert
Senior III

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 */
}