Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - CommitDraggingEvent is called too early
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommitDraggingEvent is called too early

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

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: CommitDraggingEvent is called too early
    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?
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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.
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.