Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » TVN_BEGINDRAG is not received by CExtTreeCtrl Collapse All
Subject Author Date
Joachim Meißner Feb 1, 2009 - 4:42 AM

If I create a message handler for TVN_BEGINDRAG, it is never called.

I tried two ways to solve the problem:


1) Change BEGIN_MESSAGE_MAP(CNavTreeCtrl, CExtTreeCtrl) to BEGIN_MESSAGE_MAP(CNavTreeCtrl, CTreeCtrl).

Then TVN_BEGINDRAG works, but the advanced features of CExtTreeCtrl don’t work correctly


2) Overwrite OnTreeMouseClick and return false, if the left mouse button is pressed.

Then TVN_BEGINDRAG is received, but the selection of tree items does not work correctcly.


So how do I implement drag and drop with CExtTreeCtrl?

Technical Support Feb 4, 2009 - 1:19 AM

The CExtTreeCtrl class features some mouse/keyboard/painting/hit-testing and other user-input related algorithms written from scratch. It uses a tree view common control only for storing tree items. The drag-n-dropping notification was implemented. Please update the source code for the .../Prof-UIS/Include/ExtControlsCommon.h and .../Prof-UIS/Src/ExtControlsCommon.cpp files from the following ZIP file:

http://www.prof-uis.com/download/forums/tmp/ExtTreeCtrlFixDND285.zip

The updated version of the CExtTreeCtrl class has a new CExtTreeCtrl::OnTreeItemDoDragDetect() virtual method which sends the TVN_BEGINDRAG notification to the parent window of the tree control