Multiple Schedules
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=15916
Printed Date: 28 April 2024 at 3:32pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Multiple Schedules
Posted By: Alex H.
Subject: Multiple Schedules
Date 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
|
Replies:
Posted By: mdoubson
Date Posted: 29 January 2010 at 7:06pm
Resource are container for schedules. You need it
------------- Mark Doubson, Ph.D.
|
|