/** * Create and add a list section to segmented list. * The new section will allow the user to set the list mode. * @param list A segmented list where to add the section. */ void SettingsScreen::createListSectionForListMode(SegmentedListView& list) { SegmentedListViewSection* section = new SegmentedListViewSection(); section->setHeaderText(MODE_SECTION_HEADING_TEXT); list.addSection(section); this->createModeOptionRows(*section); }
/** * Create and add a list section to segmented list. * @param list A segmented list where to add the section. */ void SettingsScreen::createListSection(SegmentedListView& list) { SegmentedListViewSection* section = new SegmentedListViewSection(); section->setHeaderText(FIRST_SECTION_HEADING_TEXT); list.addSection(section); this->createEditOptionRow(*section); this->createMoveOptionRow(*section); }
/** * Add a given section to list. * @param section Section to add. */ void IndexedListScreen::addSectionDataToList(const ListSection& section) { SegmentedListViewSection* segmentedListViewSection = new SegmentedListViewSection(); segmentedListViewSection->setTitle(section.getTitle()); segmentedListViewSection->setHeaderText(section.getTitle()); int countCells = section.getCellCount(); for (int i = 0; i < countCells; i++) { const String* cellText = section.getCellText(i); // Create cell and add it to section. CountrySegmentedListItem* cell = new CountrySegmentedListItem(*cellText); segmentedListViewSection->addItem(cell); } mSegmentedListView->addSection(segmentedListViewSection); }