Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is Drag & Drop from User's POV
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00935827
Message ID:
00935830
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
Hi Nadya?

VFP Drag&Drop or OLE Drag&Drop?


VFP Drag&Drop:
Object.OleDragMode=0

Object::DragOver()
IF nState=0 AND SYS(1272,oSource)=SYS(1272,This) && Start Drag&Drop (Source)
   RETURN && a vra» se
ENDIF

IF nState=1 &&  && Leaving Drag&Drop (Source)
   RETURN && pak se vra»
ENDIF

IF SYS(1272,oSource)=SYS(1272,This) &&  && The same object
   RETURN && pak se vra»
ENDIF

IF nState=2 &&  && Over Drag&Drop (Target)
ENDIF
Object::DragDrop()
IF OSOURCE.NAME='Source_Object_Name'
   * Drop End
ENDIF
Object::MouseUp()
This.DRAG(0) && Start Drag&Drop
Object::MouseMove()
IF NBUTTON#1
   This.MOUSEUP
ELSE
   This.DRAG(1)
ENDIF   
OLE Drag&Drop:
object.OLEDropMode=1

Object:OLEDragOver()
IF nState=0 AND oDataObject.GetFormat(15)
   This.OLEDropHasData=1
   This.OLEDropEffects=2
ENDIF
Object:OLEDragDrop
LOCAL loPDMs,llLS,lii,liz,llAdd,lolst
LOCAL ARRAY laFiles(1)

IF oDataObject.GetFormat(15) AND odataobject.GetData(15,@laFiles)
   lolst=This.Parent.lstFiles

   loPDMs=Thisform.Param.PDMs && Reference on public PDMs objekt

   llLS=Thisform.LockScreen
   Thisform.LockScreen=.T.
   FOR liz=1 TO ALEN(laFiles)
       IF !UPPER(ExtractExtensionFromFile(laFiles(m.liz)))=="PDM"
          LOOP
       ENDIF
       FOR lii=1 TO lolst.ListCount
           * If file exist in array
           IF UPPER(lolst.List(lii,1))==UPPER(laFiles(m.liz))
              EXIT && then exit FOR...
           ENDIF
       NEXT
       * If not in list, Then Add it
       =IIF(lii>lolst.ListCount,;
            lolst.AddListItem(laFiles(m.liz),lolst.NewItemId+1,1),.T.)
       llAdd=llAdd OR lii>lolst.ListCount
   NEXT
   =IIF(llAdd,Thisform.AfterAddFile(),.T.)
   Thisform.LockScreen=llLS
ENDIF
MartinJ

>Hi everybody,
>
>I'm trying to test Drag & Drop functionality, but I'm not sure, how I am suppose to test it. At least I do not see anything when I click on textboxes, grid cells, etc. How should I activate Drag & Drop? The sample form is supposed to work, but I just don't get it.
>
>Thanks in advance.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Reply
Map
View

Click here to load this message in the networking platform