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

Event collection

 Post Reply Post Reply
Author
Message
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Topic: Event collection
    Posted: 25 April 2007 at 1:24pm
I created an event filtering method so I can selectively display the events I want based on the criteria I set. The objective is to remove events that have been filtered from the display (while not removing them from the database).

All works well and I have a collection of eventID's from another table that I will use to filter from. The problem I have run into is that I'm not sure where to find the event collection that the calendar is actively using. Are these loaded from the database every time they are required (such as in "Populate")?

I tried chasing the data member m_arEvents around the code but haven't found an accessor to it so I'm not sure that's what I am looking for.

So my questions are:

1. Is there a collection of events, or event pointers that identify the currently used (displayed) event objects?

2. Is there an accessor to this collection from one of the classes? If so, I could use a nudge in the right direction as to finding it.

3. If there is no collection, then is it correct to assume the best approach would be to reload all the events from the database and filter them at that time?

Thank you for any assistance that anyone can provide.
Back to Top
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 2007 at 5:40pm
Ok.. I'm assuming no one else knows what I'm talking about or if they do it's a trade secret 

Maybe if I rephrase the question:

Is there a way to traverse an XTPCalendarView's Calendar Events?

(Other than going directly to the database and grabbing the records)
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2007 at 7:38am
Hi,

Basing on a hierarchy of views and events you can iterate them in a following way. I've just tried this method:

    CString strEvents;
    CXTPCalendarView* pView = GetCalendarCtrl().GetActiveView();
    int nDays = pView->GetViewDayCount();
    for (int nDay = 0; nDay < nDays; nDay++)
    {
        CXTPCalendarViewDay* pViewDay = pView->GetViewDay_(nDay);
        int nGroupsCount = pViewDay->GetViewGroupsCount();
        for (int g = 0; g < nGroupsCount; g++)
        {
            CXTPCalendarViewGroup* pViewGroup = pViewDay->GetViewGroup_(g);
            int nECount = pViewGroup->GetViewEventsCount();
            for (int j = 0; j < nECount; j++)
            {
                CXTPCalendarViewEvent* pViewEvent = pViewGroup->GetViewEvent_(j);
                CXTPCalendarEvent* pEv = pViewEvent ? pViewEvent->GetEvent() : NULL;

                if (pEv)
                {
                    strEvents += pEv->GetSubject() + _T("\n");
                }

            }
        }

    }

    AfxMessageBox(strEvents);


--
WBR,
Serge
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.