Print Page | Close Window

Dragging Tabs

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4024
Printed Date: 10 November 2025 at 10:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dragging Tabs
Posted By: JayW
Subject: Dragging Tabs
Date Posted: 18 April 2006 at 5:00pm

I have an application used to create courseware for online presentation (see compacted image.) It uses a tree view in a docking pane as the course outline and supports several editor types (similar in style to Visual Studio) in a CXTPTabClientWnd tabbed interface. I need to allow users to drag an editor tab onto the tree view to an existing item to replace it's content (for some reason, a much requested feature...) Are there any hooks in the interface (none that I could find) that support anything like COleDropTarget (which I already use to support drag/drop from the Windows shell)?

Thanks in advance.

Jay




Replies:
Posted By: Oleg
Date Posted: 19 April 2006 at 7:36am
Override CXTPTabClientWnd , Catch WM_LBUTTONDOWN, etc

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: JayW
Date Posted: 19 April 2006 at 7:53am

Thanks Oleg.  I'll post further if I run into any trouble.   

Jay



Posted By: JayW
Date Posted: 19 April 2006 at 11:09am

Oleg,

FYI, this is a bit more involved if you want to preserve the ability to reorder tabs (which I do) without re-implementing tab reordering in user code or modifying Codejock source. As suggested, I can get the mouse button down events and then track mouse movement, but I will have to bypass XTP tab reordering code to do it. I thought I might set up drag/drop information and then track the mouse when came into the tree view window, but XTP displays a "no-drop" cursor (resource ID: XTP_IDC_WORKSAPCE_DELETE, nice spelling by the way ;-)) when the mouse tracks outside the MDI tabs. If I call the parent class's mouse tracking methods CXTPTabClientWnd::CWorkspace::ReOrder() will display a "no-drop" cursor when the user tracks outside of the allowable drop region (MDI Tabs). It does this by "manually" processing events in a loop so I can't get ON_MOUSELEAVE and reset the cursor. There may be other issues with mouse capture, etc., but I didn't look into it further.

I will pass on implementing this for the moment because I've got other stuff to do. If I find a better solution I will post it here. (Or if I'm missing something, let me know.)

Thanks,

Jay



Posted By: KSTurner
Date Posted: 24 April 2006 at 5:44pm
I was thinking about something very similar -- whether it was possible to drag a tab from one MDI frame to another, seperate MDI frame. Basically you would drag a tab from one CXTPTabClientWnd to another. I have no idea how to do that yet, however.


Posted By: ABuenger
Date Posted: 24 April 2006 at 5:52pm

Originally posted by KSTurner KSTurner wrote:

I was thinking about something very similar -- whether it was possible to drag a tab from one MDI frame to another, seperate MDI frame.

I was looking for the same, dragging a tab from one tabbed MDI frame into a new one and back.

If a tab is dragged out the XTP lib should call a method to ask if the window already exists and then use that one, like the tear off popups.

 



Posted By: JayW
Date Posted: 24 April 2006 at 6:26pm

If there were a virtual method we could override to set up the OLE clipboard contents when the drag starts, then we could use the COleDropTarget interface within the calling application and provide information for drops outside the application as well.  This method would have to be called even when there is only one tab and when reordering tabs is turned off.  (I'm not going to look at the source again, but I'm pretty sure from my recollection, dragging isn't a concern unless reordering is turned on and there's something to reorder...)

Maybe there will be this or another solution in a future release.  Hint, hint... 

Jay



Posted By: KSTurner
Date Posted: 27 April 2006 at 1:18pm
I agree -- OLE might be the most practical solution for all cases. As a side note, I took a peek at Firefox's Windows code to see how they handled their tab drag from frame to frame and it appears they chose OLE as well.



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