![]() |
Dragging Tabs |
Post Reply
|
| Author | |
JayW
Newbie
Joined: 25 May 2005 Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
Topic: Dragging TabsPosted: 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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 April 2006 at 7:36am |
|
Override CXTPTabClientWnd , Catch WM_LBUTTONDOWN, etc
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
JayW
Newbie
Joined: 25 May 2005 Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 April 2006 at 7:53am |
|
Thanks Oleg. I'll post further if I run into any trouble. Jay |
|
![]() |
|
JayW
Newbie
Joined: 25 May 2005 Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
KSTurner
Newbie
Joined: 24 April 2006 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
ABuenger
Newbie
Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 April 2006 at 5:52pm |
|
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.
|
|
![]() |
|
JayW
Newbie
Joined: 25 May 2005 Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
KSTurner
Newbie
Joined: 24 April 2006 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |