How to disable multiday event.
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=12724
Printed Date: 21 December 2024 at 9:00pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: How to disable multiday event.
Posted By: Makarand
Subject: How to disable multiday event.
Date Posted: 19 November 2008 at 5:08am
Hi,
I do not want to allow user to have a multiday event (since my application doesnt support this feature)
Can you tell me what is the way to disable adding a multiday event in calendar ?
|
Replies:
Posted By: prashant
Date Posted: 20 November 2008 at 12:44am
Hi Mak,
Try adding following where you are creating an event
ptrEvent->SetAllDayEvent(FALSE);
I hope this will help you ;)
|
Posted By: Makarand
Date Posted: 20 November 2008 at 1:20am
Thanks Prashant,
SetAllDayEvent(..) member function is used to set the "All Day" flag for an event. which is only for single day.
I do not want to allow user to have a multiday event.
see the attached image for more detail.
-Mak
|
Posted By: Makarand
Date Posted: 20 November 2008 at 4:54am
Got it!!!!!!!!!!!!!1
following code to handle the case
void CCalendar::OnEvent_BeforeEditAction(XTP_NOTIFY_CODE Event,
WPARAM wParam, LPARAM lParam)
{
if (XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION != Event) {
ASSERT(FALSE);
return;
}
XTP_EVENT_EDIT_OPERATION_PARAMS* pOPparams = (XTP_EVENT_EDIT_OPERATION_PARAMS*)wParam;
BOOL* pbHandled = (BOOL*)lParam;
ASSERT(pbHandled && pOPparams);
CXTPCalendarEvent* pEventNew = GetCalendarCtrl().GetActiveView()->GetDraggingEventNew();
if(pEventNew)
{
COleDateTime dtNew,dtOrig;
dtNew = pEventNew->GetStartTime();
//check start time
dtOrig = GetCalendarCtrl().GetActiveView()->GetDraggingEventOrig()->GetStartTime();
dtNew = pEventNew->GetStartTime();
if(dtNew.GetDay() != dtOrig.GetDay())
*pbHandled = TRUE;
//check end time
dtOrig = GetCalendarCtrl().GetActiveView()->GetDraggingEventOrig()->GetEndTime();
dtNew = pEventNew->GetEndTime();
if(dtNew.GetDay() != dtOrig.GetDay())
*pbHandled = TRUE;
}
}
|
|