cancel
Showing results for 
Search instead for 
Did you mean: 

Delete list element

heyo
Senior

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.

0693W00000aIdr9QAC.pngI 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++;
}

1 REPLY 1
heyo
Senior

Nevermind, I achieve that in very simple way :D

0693W00000aIdtKQAS.png