‎2022-03-06 06:16 AM
Hi,
Is it possible to change the content of a scrollwheel by a button in the same screen.
For example I have 3 options Menu 1, Menu 2 and Menu 3 in scrollwheel when the screen appears for the firs time. I want to change these options to Menu 4 ~ Menu 6 by clicking a button in same screen.
Is there any other solution?
Thank you everyone.
Solved! Go to Solution.
‎2022-03-07 05:00 AM
‎2022-03-06 06:30 AM
you can do , what you need write into
scrollWheelUpdateItem(MenuElement& item, int16_t itemIndex)
‎2022-03-06 07:25 AM
thank you for your reply.
Yes I your are right and I already use it. I defined scrollWheelUpdateItem in screenview.cpp and it updates the content when change the screen from other screen to this screen.
But I want change the content by clicking a Button in current screen. (By defining an interaction for example)
‎2022-03-06 10:27 AM
Into button action place
markervariable=4;
scrollwhell.invalidate
and in
scrollWheelUpdateItem(MenuElement& item, int16_t itemIndex)
{
if (markervariable == 4)
{
}
else {
actual code or any other change what show
}
}
‎2022-03-06 10:42 PM
Thank you for your reply but unfortunately I still didn't get. Let me explain more.
this is in my ScreenSelectChannelView.cpp:
void ScreenSelectChannelView::scrollWheel1UpdateItem(TableContent& item, int16_t itemIndex)
{
item.updateColumn1(itemIndex);
item.updateColumn2(itemIndex);
item.updateColumn4(presenter->getChannelName(Temp_Input_Index, itemIndex));
touchgfx_printf("scrollWheel1UpdateItem\r\n");
}
void ScreenSelectChannelView::scrollWheel1UpdateCenterItem(TableSelectedRow& item, int16_t itemIndex)
{
item.updateColumn1(itemIndex);
item.updateColumn2(itemIndex);
item.updateColumn4(presenter->getChannelName(Temp_Input_Index, itemIndex));
touchgfx_printf("scrollWheel1UpdateCenterItem\r\n");
}
These 2 functions work correctly. They update my table when I change my screen from ScreenHome to ScreenSelectChannel. I have a button in ScreenSelectChannel. I want change the content of my table by pressing the button.
As I understand you say add this section:
if (markervariable == 4)
{
}
else {
actual code or any other change what show
}
to ScreenSelectChannelView::scrollWheel1UpdateItem and markervariable = 4 in button action.
My problem is I don't know how to call scrollWheel1UpdateItem in button function? Or there is an other way that I don't know.
Sorry if my question is too easy.
Thank you.
‎2022-03-06 11:00 PM
‎2022-03-07 02:07 AM
Thank you again for your fast replies. I searched a lot and so I don't have any way except asking here.
I already did what you say. This is my button action:
void ScreenSelectChannelView::setInputIndex1()
{
Temp_Input_Index = 1;
scrollWheel1.invalidate();
touchgfx_printf("setInputIndex1 %d \r\n", Temp_Input_Index);
}
I expect calling function "scrollWheel1UpdateItem " by pressing the button but touchgfx_printf shows it doesn't run:In Red section we see scrollWheel1UpdateItem and scrollWheel1UpdateCenterItem are called when I change the screen to ScreenSelectChannel. But pressing buttons doesn't call those functions.
Thank you.
‎2022-03-07 05:00 AM
‎2022-03-07 05:19 AM
Oh, Yes it works.
Thank you so much.
Thank you.:hibiscus: