Up One Level
 
New Message
Reply
History
 
Previous in Thread
Next in Thread
Previous Unread
Next Unread
 
Print
 
About this Form
   
  Message Message Postmark    
 
Mon, 20 Oct 2003 15:44:47
From:
Vincent Tournier
Vincent Tournier
Subject: [4D Agenda] Solving drag and drop variable name problem in 4D 2003 and above 
To:
Plugs FAQ
Plugs FAQ
Due to changes in the API in 4D 2003, it’s currently not possible to get the name of the variable dropped on 4D Agenda in a compiled database in 4D 2003/2003.1/2003.2

To solve this problem change your AG_DropHandler method to the following code

The method for the “AG_DropHandler” method

C_STRING (32;$1)        `Variable name
C_LONGINT
($2)  `Array index, if the dropped item is an array element
C_LONGINT
($3)  `Table number, if the dropped item is a field
C_LONGINT
($4)  `Field number, if the dropped item is a field
C_LONGINT
($5)  `Event ID
C_DATE
($6)     `Date location of the drop
C_TIME
($7)     `Time location of the drop
C_LONGINT
($8)  `Process number where the drop came from
C_BOOLEAN
($9)  `Is it an inter process drag/drop
C_LONGINT
($10) `Area reference number
C_BOOLEAN
($0)  `Return value to 4D Agenda

C_LONGINT
(AGDROP_EVENTID)
C_DATE (AGDROP_DATE)
C_TIME (AGDROP_TIME)

AGDROP_EVENTID := $5
AGDROP_DATE := $6
AGDROP_TIME := $7

$0:=True
 
The method for the 4D Agenda area

C_POINTER (SrcObject)
C_LONGINT
(srcElement)
C_LONGINT
(srcProcess)
C_INTEGER
(tableNum)
C_INTEGER
(fieldNum)
C_STRING
(32;varName)

Case of
  
: (Form event=On Drop )
    DRAG AND DROP PROPERTIES (srcObject ; srcElement ; srcProcess)
    RESOLVE POINTER
(srcObject ; varName ; tableNum ; fieldNUM)
    
$Message:="Variable name: "+varName+Char(13)
    $Message:=$Message+"Event ID: "+String(AGDROP_EventID)+Char(13)
    $Message:=$Message+"Drop date: "+String(AGDROP_DropDate)+Char(13)
    $Message:=$Message+"Drop time: "+String(AGDROP_DropTime)+Char(13)
    
    ALERT
($Message)
End case