المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : CTreeCtrl, CDockingPane, and mouse events



C++ Programming
03-16-2013, 12:00 PM
Hi All, many thanks up-front to anyone who can help here.

I have a client that wants me to migrate a CTreeView-derived class to one which works like a docking pane. The class is so large now that it's not feasible to rewrite everything.

So...I still have the underlying CTreeCtrl-derived class (more/less untouched), which is a child of a class derived from CDockablePane (migrated from the CView class). I've also derived from CMultiPaneFrameWnd (used when the pane is floating) to try to trap events.

I've got it working about 80%. I need help/direction with the other 20%. I've got the CDockablePane derived class working with bulk of the MESSAGE_MAP events (menu handlers, ON_UPDATE_COMMAND_UI, etc.) working correctly. The events associated with the mouse are giving me grief.

I see 3 standard modes for the dockable pane: floating, docked, and tabbed. And they all behave differently w/r to mouse events - and depending on the docking mode.

For example:
* If the docking mode is DT_SMART *and* the pane is NOT floating, then drag&drop and double-clicking work correctly.
* If the docking mode isn't DT_SMART, then drag&drop usually tries to drag the complete docking pane instead of working correctly (regardless of floating, docked, tabbed).
* When the pane is floating, I can't trap WM_LBUTTONDBLCLK (unless you click on the lines and little [+] boxes...) or the respective notify or reflect messages - even Spy++ doesn't record them. I just don't see any left button double-click events - at all!

Google searches show that I'm not the only one with these types of issues. I've read and tried pretty well every suggestion...and I still have these issues. I'm now concerned about bugs or assumptions in the framework after reading this:
http://connect.microsoft.com/VisualStudio/feedback/details/641096/cdockablepane-calls-releasecapture[^ (http://connect.microsoft.com/VisualStudio/feedback/details/641096/cdockablepane-calls-releasecapture)]

This link: http://www.johnbyrd.org/blog/index.php?itemid=405[^ (http://www.johnbyrd.org/blog/index.php?itemid=405)] helped a lot but didn't solve all issues either.

I can also replicate these issues (unable to trap double-clicking when floating) in the VisualStudioDemo feature pack demo.

Any suggestions on how to get a CTreeCtrl to work inside a CDockingPane - consistently - would be really appreciated. I feel that many issues are related to CMultiPaneFrameWnd, but can't resolve them.

Thanks!