Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Dragging Tabs
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dragging Tabs

 Post Reply Post Reply
Author
Message
JayW View Drop Down
Newbie
Newbie


Joined: 25 May 2005
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote JayW Quote  Post ReplyReply Direct Link To This Post Topic: Dragging Tabs
    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

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2006 at 7:36am
Override CXTPTabClientWnd , Catch WM_LBUTTONDOWN, etc
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
JayW View Drop Down
Newbie
Newbie


Joined: 25 May 2005
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote JayW Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2006 at 7:53am

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

Jay

Back to Top
JayW View Drop Down
Newbie
Newbie


Joined: 25 May 2005
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote JayW Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
KSTurner View Drop Down
Newbie
Newbie
Avatar

Joined: 24 April 2006
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote KSTurner Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post 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.

 

Back to Top
JayW View Drop Down
Newbie
Newbie


Joined: 25 May 2005
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote JayW Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
KSTurner View Drop Down
Newbie
Newbie
Avatar

Joined: 24 April 2006
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote KSTurner Quote  Post ReplyReply Direct Link To This Post 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.
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.078 seconds.