![]() |
How to disable multiday event. |
Post Reply ![]() |
Author | |
Makarand ![]() Senior Member ![]() ![]() Joined: 27 February 2007 Location: India Status: Offline Points: 140 |
![]() ![]() ![]() ![]() ![]() 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 ? |
|
![]() |
|
prashant ![]() Senior Member ![]() ![]() Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
![]() ![]() ![]() ![]() ![]() |
Hi Mak,
Try adding following where you are creating an event ptrEvent->SetAllDayEvent(FALSE); I hope this will help you ;) |
|
![]() |
|
Makarand ![]() Senior Member ![]() ![]() Joined: 27 February 2007 Location: India Status: Offline Points: 140 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Makarand ![]() Senior Member ![]() ![]() Joined: 27 February 2007 Location: India Status: Offline Points: 140 |
![]() ![]() ![]() ![]() ![]() |
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; } } |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |