4D View v16

PV SET DRAG SIGNATURES

Home

 
4D View v16
PV SET DRAG SIGNATURES

PV SET DRAG SIGNATURES 


 

PV SET DRAG SIGNATURES ( area ; signatures ) 
Parameter Type   Description
area  Longint in 4D View area
signatures  String array in Signatures array

The PV SET DRAG SIGNATURES command sets the content of the signatures array as "drag" signatures for area.

Signatures are alphanumeric strings with free content. The maximum length for a signature is 32 characters.

These are are properties, defined using the PV SET AREA PROPERTY, which allows revealing 4D View area drag and drop-related options:

Once drag and drop is authorized, it can interact with two areas (which can be the same) on the condition that the areas contain at least one common signature to drag for the source area and to drop for the target area.

As for the drag and drop event, it will be intercepted by the PV ON EVENT command.

Example  

The example below illustrates a drag and drop between two 4D View areas. Start by setting the signatures and behavior of areas, for example, upon changing a form:

 ARRAY TEXT($DDSignatureArray;1)
 $DDSignatureArray{1}:="Signature_1"
 
 PV SET AREA PROPERTY(SourceArea;pv drag trigger;pv trigger on alt click`alt-click to drag
 PV SET AREA PROPERTY(SourceArea;pv drag allowed;pv DD multiple cells)
 PV ON EVENT(SourceArea;pv on drag;"DragDropMethod")
 PV SET DRAG SIGNATURES(SourceArea;$DDSignatureArray)
 
 PV SET AREA PROPERTY(TargetArea;pv drop allowed;pv DD single cell+
 pv DD adjacent cells+pv DD multiple cells)
 PV SET AREA PROPERTY(TargetArea;pv drop mode;pv drop replace only)
 PV ON EVENT(TargetArea;pv on drop;"DragDropMethod")
 PV SET DROP SIGNATURES(TargetArea;$DDSignatureArray`Same signatures as drag

The project method DragDropMethod will be called when a drag is executed with alt-click or when there a drop occurs on a target area:

 C_LONGINT($1) &nbsp`4D View reference area
 C_LONGINT($2) &nbsp`Event
 C_LONGINT($3) &nbsp`Keyboard code (modify)
 C_LONGINT($4) &nbsp`Column number
 C_LONGINT($5) &nbsp`Line number
 C_LONGINT($6) &nbsp`ASCII code of the key
 
 C_POINTER(SourceAreaPointer;TargetAreaPointer`Nowhere to keep them between two callback methods
 C_BLOB($blob`Temporary drag and drop notepad
 C_LONGINT($currentColumn;$currentRow`Current cell coordinates
 C_LONGINT($destinationColumn;$destinationRow`Coordinates of cell where drop will occur
 
 Case of
    :($2=pv on drag)
       PV GET DRAG SOURCE($1;SourceAreaPointer) `Where do we come from?
 
    :($2=pv on drop)
       PV GET DROP TARGET($1;TargetAreaPointer) `Where are we going?
 
       $blob:=PV Copy to blob(SourceAreaPointer->) `Copy to notepad
       $destinationColumn:=PV Get drop info(TargetAreaPointer->;pv drop column)
  `Destination....
       $destinationRow:=PV Get drop info(TargetAreaPointer->;pv drop row`...coordinates
       PV GET CURRENT CELL(TargetAreaPointer->;$currentColumn;$currentRow)
  `Paste to assigned area
       PV GOTO CELL(TargetAreaPointer->;$destinationColumn;$destinationRow)
       PV PASTE FROM BLOB(TargetAreaPointer->;$blob;1;1;1;1)
  `Re-establish current cell once the operation is complete
       PV GOTO CELL(TargetAreaPointer->;$currentColumn;$currentRow)
 End case



See also 

PV GET DRAG SIGNATURES
PV SET DROP SIGNATURES

 
PROPERTIES 

Product: 4D View
Theme: PV Drag and drop
Number: 15935

 
HISTORY 

Created: 4D View 6.8

 
ARTICLE USAGE

4D View Language ( 4D View v16)