2025-04-11 1:00 AM
Hi!
I have an issue with one of my implementations.
void CalendarRepetitiveDaysView::scrollListProgramsUpdateItem(CustomContainerPrograms& item, int16_t itemIndex)
{
getWeekPrograms();
if (itemIndex < programCount)
{
WeekdayProgramGroup& program = weekdayPrograms[itemIndex];
TypedTextId type = getTypeOfProgram(program.active_favorite, program.standby_active);
item.updateTypeText(type);
item.updateTimeText(program.start_hour, program.start_min, program.hour_duration, program.min_duration);
item.updateWeekdayText(program.weekdays, program.weekday_or_not, program.day, program.month);
if (itemIndex == selectedIndex)
{
item.triggerProgramInfo(selectedProgram.start_hour,selectedProgram.start_min, selectedProgram.hour_duration, selectedProgram.min_duration,type, selectedProgram.temp, selectedProgram.hum);
customContainerProgramInfo1.setVisible(true);
customContainerProgramInfo1.invalidate();
}
}
}
void CalendarRepetitiveDaysView::scrollListPrograms_ItemSelectedHandler(int16_t itemSelected)
{
if (itemSelected < programCount)
{
selectedIndex = itemSelected;
selectedProgram = weekdayPrograms[itemSelected];
selectedProgramSet = true;
scrollListPrograms.invalidate();
}
}
This screen has one CustomContainerPrograms and one CustomContainerProgramInfo.
The CustomContainerPrograms holds the info for the scrollist, while the the CustomContainerProgramInfo
holds the info about each program. CustomContainerProgramInfo is a pop-up window that should
appear when selecting a program and contain the information about that program. The problem is that
I need to trigger a function in the CustomContainerProgramInfo to modify the info depending on what program it is.
So I tried instead to access it through CustomContainerPrograms to then call the function in CustomContainerProgramInfo.
But this approach will not work since it will not update as soon as I have a selected program.
Do you have any suggestions?