Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Multiple Schedules
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiple Schedules

 Post Reply Post Reply
Author
Message
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Topic: Multiple Schedules
    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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2010 at 7:06pm
Resource are container for schedules. You need it
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.

This page was generated in 0.191 seconds.