CommitDraggingEvent is called too early |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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?
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Let me ask you why do you need this?
Because generally 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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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.
|
|
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 |