2022-07-04 02:35 AM
hello
The scroll wheel is set and used as follows.
void ScrTopSetView::scrollWheel_ScrTopSet_minuteUpdateCenterItem(CustomContainer_temp_wheel& item, int16_t itemIndex)
{
// Override and implement this function in ScrTopSet
int data;
minute = itemIndex;
Unicode::snprintf(textArea_ScrTopSet_nMinuteBuffer, TEXTAREA_SCRTOPSET_NMINUTE_SIZE, "%02d", (minute ));
textArea_ScrTopSet_nMinute.invalidate();
}
One step at a time is good.
I need a configuration that changes by 1 step or 10 steps depending on the setting value, but I am not sure how to set the 10 step change.
I'd like to know how to set the level at which the scroll wheel changes.
thank.
2022-07-04 03:01 AM
Hello mSH.1,
I'm not sure about what you mean by "1 step or 10 steps depending on the setting value"
Do you want to set the speed of your scroll ? If yes, that's possible in TouchGFX Designer with Swipe Acc. and Drag Acc. :
We have a very good documentation which explains the scroll wheel in detail, and also some example with code. I invite you to have a look at it. If you still have question, don't hesitate to write in this post again.
/Osman
2022-07-04 03:19 AM
hello, @Osman SOYKURT
-> It is implemented by referring to the basic example.
The scroll wheel value changes in one step.
-> What I need is to change the value of the scroll wheel by 10 steps.
Show 10 steps on the scroll wheel and void ScrTopSetView::scrollWheel_ScrTopSet_minuteUpdateCenterItem(CustomContainer_temp_wheel& item, int16_t itemIndex)
In the function, the value of itemindex changes in 10 steps.
I'm trying to set it up while looking at the API, but I'm not sure yet
tnank.
2022-07-05 03:37 AM
Hello mSH.1,
Ok, then I think you can use scrollWhellUpdateItem() function. You can then update your item like that :
item.updateText(itemIndex*10);
We have an example of scroll wheel usage on TouchGFX Designer, I invite your to have a look at it.
Another solution would be to update your scroll wheel in it entire with function like :
scrollWheel.setNumberOfItems(ITEM_NUMBER)
if you want to filter your items, then use modulo (%) to show what you want, for instance if you want 0, 10, 20, 30, then a %10 is good.
/Osman
2022-07-05 06:06 AM
hello, @Oskt (ST Employee)
Thanks for the helpful answer for me.