コード例 #1
0
//To print the list of events and tasks
void UserInterface::printList(Display& display) {
	vector<Entry*> eventList = display.getEventList();
	vector<Entry*> taskList = display.getTaskList();

	if (!eventList.empty()) {
		cout << endl;
		cout << EVENT_LIST << endl;
		for (int i = 0; i < eventList.size(); i++) {
			cout << "E" << i + 1 << ": ";
			eventList[i]->printEvent();
			cout << endl;
		}
	}
	if (!taskList.empty()) {
		cout << endl;
		cout << TASK_LIST << endl;
		for (int i = 0; i < taskList.size(); i++) {
			cout << "T" << i + 1 << ": "; 
			taskList[i]->printTask();
			cout << endl;
		}
	}
	
	if (eventList.empty() && taskList.empty()) {
		cout << MESSAGE_FOUNDNOTHING << endl;
	}
}
コード例 #2
0
void UserInterface::updateDisplay(Display &display)
{
	vector<Entry*> eventList;
	vector<Entry*> taskList;

	eventList = display.getEventList();
	taskList = display.getTaskList();

	generateEventStringList(eventList);
	generateTaskStringList(taskList);

	getFeedbackDisplay(display);

	displayEventList();
	displayTaskList();

	displayFeedback();
}