Print Page | Close Window

CommitDraggingEvent is called too early

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=5428
Printed Date: 27 April 2024 at 8:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommitDraggingEvent is called too early
Posted By: znakeeye
Subject: CommitDraggingEvent is called too early
Date Posted: 04 November 2006 at 5:48am
Hi!

If I drag & move an event, it is of interest to cancel the movement when the user drops the item. That is, I have to catch the drop before CommitDraggingEvent is being called. I think I have tried everything now. My last attempt was to somehow overload all CXTPCalendarView-derived classes, but with no success.
 
Please, help me out on this one! How do I cancel a dragmove _after_ the drop?



Replies:
Posted By: sserge
Date Posted: 04 November 2006 at 3:46pm
Let me ask you why do you need this?

Because g
enerally users have tasks to restrict dragging of some events or restrict dragging to some places (dates or AllDayEvents area, etc).
For this purpose (and not only for dragging) Calendar sends special notification XTP_NC_CALENDAR_BEFORE_EVENT_EDIT_OPERATION
which allows you customize editing like dragging, copy/paste, resizing events ...

But if you really want what you are asking for -- derive from CXTPCalendarControl and catch message CXTPCalendarControl::OnLButtonUp().
Default implenentation throws it to views, days, ...
Check if you are in dragging mode and need to cancel dragging,
just call m_pActiveView->CancelDraggingEvent(); before calling base CXTPCalendarControl::OnLButtonUp().
(or do not call base implementation at all).

--
WBR,
Serge


Posted By: znakeeye
Date Posted: 04 November 2006 at 5:58pm
Hi,
 
I want users to be able to drag&drop events. Still, the users of this application will be quite inexperienced. It is therefore important to double-check with the user, that the event should indeed be moved.
 
Thanks for your solution.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net