Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - How to disable the sorting for all day event?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to disable the sorting for all day event?

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

Joined: 27 February 2007
Location: India
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote Makarand Quote  Post ReplyReply Direct Link To This Post Topic: How to disable the sorting for all day event?
    Posted: 05 January 2009 at 5:04am
Hi Oleg,

How can I disable the soring for all day event?
please see the attached image for more detail

We do not want to have sorting, since the list we have in database is also not sorted.

Now Codejock sorts the all day items, because of which our database list does not match with codejock all day items list.

Thanks in advance,
waiting for reply,
-Mak
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: 05 January 2009 at 12:01pm
Hi,
this is the sort function used inside, e.g. Populate call

int _cdecl CXTPCalendarEvents::CompareEvents_ForView(const CXTPCalendarEvent** ppEv1, const CXTPCalendarEvent** ppEv2)

{

if (*ppEv1 == NULL || *ppEv2 == NULL)

{

ASSERT(FALSE);

return XTPCompare(*ppEv1, *ppEv2);

}

int nPeriodDays1 = (*ppEv1)->GetEventPeriodDays();

int nPeriodDays2 = (*ppEv2)->GetEventPeriodDays();

int nAllDayEvent1 = (*ppEv1)->IsAllDayEvent() ? 1 : 0;

int nAllDayEvent2 = (*ppEv2)->IsAllDayEvent() ? 1 : 0;

BOOL bIsMultidayEvent = (nAllDayEvent1 && nAllDayEvent2 || nPeriodDays1 > 1 && nPeriodDays2 > 1);

int nCmp = 0;

//---------------------------------------------------------------------------

if (bIsMultidayEvent)

{

nCmp = XTPCompare((*ppEv1)->GetStartTime(), (*ppEv2)->GetStartTime());

if (nCmp)

{

return nCmp;

}

}

//---------------------------------------------------------------------------

nCmp = XTPCompare(nPeriodDays2, nPeriodDays1);

if (nCmp)

{

return nCmp;

}

nCmp = XTPCompare(nAllDayEvent2, nAllDayEvent1);

if (nCmp)

{

return nCmp;

}

if (!bIsMultidayEvent)

{

nCmp = XTPCompare((*ppEv1)->GetStartTime(), (*ppEv2)->GetStartTime());

if (nCmp)

{

return nCmp;

}

}

nCmp = XTPCompare((*ppEv1)->GetDurationMinutes(), (*ppEv2)->GetDurationMinutes());

if (nCmp)

{

return -nCmp;

}

//-----------------------------------------------------

nCmp = XTPCompare((*ppEv1)->GetSubject(), (*ppEv2)->GetSubject());

if (nCmp)

{

return nCmp;

}

//-----------------------------------------------------

nCmp = CompareEvents_ByID(ppEv1, ppEv2);

return nCmp;

}

 

virtual void Populate(COleDateTime dtDayDate)

{

.............................................
CXTPCalendarEventsPtr ptrEventsAr = new CXTPCalendarEvents();

............................................

// sort events by start time and some other criteria

ptrEventsAr->Sort(CXTPCalendarEvents::CompareEvents_ForView);

May be we can make this call optional?
Now looks like there is no way to eliminate this sort.
Back to Top
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2009 at 5:41am
Need to fix it!
Originally posted by <a href=member_profile.asp?PF=4721&FID=115 target=_blank>mdoubson</a> mdoubson wrote:

May be we can make this call optional?

I want add my own sorting.
How can I overload it?
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.