Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - Drag / Drop on
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drag / Drop on

 Post Reply Post Reply
Author
Message
XiMaker View Drop Down
Groupie
Groupie
Avatar

Joined: 11 December 2009
Location: United States
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote XiMaker Quote  Post ReplyReply Direct Link To This Post Topic: Drag / Drop on
    Posted: 21 December 2009 at 6:58pm
I'm using the TaskPanel as a navigation menu for an MDI application - I allow users to also Drag/Drop items on the task panel to launch other applications.   I've added the code to do the drag drop and it works for external programs to be dropped into the task panel but when I try to move items already in the taskpanel menu to a new location (drag up or drag down) the items vanish.   The problem in part is due to the GetFormat because the items dragged don't have either format but I don't know that to check on- is there a different OLEDrag setting that I need to use for this type... is there a sample for this?

Private Sub wndToolBox_OLEDragDrop(ByVal Data As XtremeTaskPanel.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
   Const MODULE_NAME = "wndToolBox_OLEDragDrop"

   Dim Text As String
   Dim Index As Long
   Dim Ext As String
   Dim icount As Integer
   Dim iIndex As Integer
   Dim Group As TaskPanelGroup
   Dim fullpath As String
   Dim tItem As TaskPanelGroupItem
   
   


    If (Data.GetFormat(vbCFText)) Then
        Effect = vbDropEffectCopy
        Text = Data.GetData(vbCFText)
    ElseIf Data.GetFormat(vbCFFiles) Then
        Effect = vbDropEffectCopy
       
        For Each file In Data.Files
           fullpath = file
           Ext = LCase(Right(file, 3))
           ' Remove the extension
           Text = Left(file, Len(file) - 4)
           Do
              Index = InStr(Text, "\")
              If Index <= 0 Then
                  Exit Do
              End If
              Text = Right(Text, Len(Text) - Index)
           Loop
           Set Group = frmMain.MainMenuPane.wndToolBox.FocusedItem.Group
           CreateToolboxEXEItem Group, Text, fullpath

           bSaveMenuINI = True
       
        Next
    
    Else
        'Effect = vbDropEffectNone
   End If
End Sub

Private Sub wndToolBox_OLEDragOver(ByVal Data As XtremeTaskPanel.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single, ByVal state As Integer)
    If (Data.GetFormat(vbCFText)) Then
        Effect = vbDropEffectCopy
    ElseIf Data.GetFormat(vbCFFiles) Then
        Effect = vbDropEffectCopy
    Else
'        Effect = vbDropEffectNone
    End If

End Sub
Back to Top
XiMaker View Drop Down
Groupie
Groupie
Avatar

Joined: 11 December 2009
Location: United States
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote XiMaker Quote  Post ReplyReply Direct Link To This Post Posted: 29 December 2009 at 12:58pm
Anyone got anything for me on this one?
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.125 seconds.