2023-03-09 09:32 PM
Hello,
I want to delete list element. First of all I click on the zone and then click delete zone. How to achieve that? I've tried with remove function but it does not work.
I add zone like this.
void InputOutpuConfigurationView::AddNewZone()
{
uint8_t zoneadd = addzone;
FansExpandss.setVisible(false);
FansExpand.setVisible(false);
Fans.setVisible(false);
fans.setVisible(false);
DeleteZone.setVisible(true);
if(addzone<11)
{
presenter->SaveClickedZone(addzone);
ZoneClicked(addzone);
selectedzone.setX((86*(addzone))+zonescroll.getScrolledX());
Unicode::snprintf(zoneheadlineBuffer, ZONEHEADLINE_SIZE, "%s - %d",TypedText(T_ZONE).getText(),addzone);
presenter->SaveZoneHeadline(zoneheadlineBuffer,addzone,0);
for (uint8_t i = 0; i < addzone; ++i)
{
zonelist.remove(ZoneElements[i]);
}
while(zoneadd > 0)
{
zonelist.setHeight(0);
ZoneElements[zoneadd-1].setupListElement(presenter->getHeadlineOfZone(zoneadd),zoneadd,16,156,241,zoneadd,presenter->getModified(zoneadd));
zoneadd--;
}
if(zoneadd == 0)
{
for (uint8_t i = 0; i < addzone; ++i)
{
ZoneElements[i].setAction(listElementClickedCallback);
zonelist.add(ZoneElements[i]);
}
}
}
if(addzone>0 && addzone<11)
addzone++;
}
2023-03-09 09:48 PM
Nevermind, I achieve that in very simple way :D