Multiple Schedules |
Post Reply |
Author | |
Alex H.
Senior Member Joined: 12 February 2004 Status: Offline Points: 266 |
Post Options
Thanks(0)
Posted: 23 December 2009 at 8:41am |
How exactly can I add mulipple schedule support to may app?Here is my code to define schedules:CXTPCalendarData * pCalendarData = GetCalendarCtrl().GetDataProvider(); if ( pCalendarData ) { // We are going to make a copy of our local list of event labels CXTPCalendarEventLabels* pCustomLabels = new CXTPCalendarEventLabels(); CXTPCalendarSchedules* pSchedules = pCalendarData->GetSchedules(); if ( pCustomLabels ) { CBLUserColorMap& rMapUserToClr = m_poBLTMManager->GetOptions()->GetUserColorMap(); //iteration of my users (schedules) int i=1; for(CBLUserColorMap::iterator iterUserColors = rMapUserToClr.begin() ; iterUserColors != rMapUserToClr.end() ; ++iterUserColors, ++i) { // new label CXTPCalendarEventLabel * pEventLabel = new CXTPCalendarEventLabel( (int) i, (*iterUserColors).second, (*iterUserColors).first ); if ( pEventLabel ) { pCustomLabels->Add(pEventLabel, FALSE); m_oMapUserToLabelID.insert(CUICJMapUserToLabelID::value_type((*iterUserColors).first, i)); } CXTPCalendarSchedule* pCustomSchedule = new CXTPCalendarSchedule( (int) i , (*iterUserColors).first ); if ( pCustomSchedule && pSchedules) { pSchedules->Add(pCustomSchedule, FALSE); } } // Update the data provider with the event label copy pCalendarData->SetLabelList( pCustomLabels ); pCustomLabels->InternalRelease(); } When adding events i set the ScheduleID like that: ptrEvent->SetScheduleID(myId); In the sample (CalendarDemo) there ist something like m_pCalRCman->AddResource(_T("John"), TRUE); Do I need Resources too? Alex |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Resource are container for schedules. You need it
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |