4D View v14PV SET DRAG SIGNATURES |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D View v14
PV SET DRAG SIGNATURES
|
PV SET DRAG SIGNATURES ( area ; firmas ) | ||||||||
Parámetro | Tipo | Descripción | ||||||
area | Entero largo |
![]() |
Área 4D View | |||||
firmas | Array cadena |
![]() |
Array de firmas | |||||
El comando PV SET DRAG SIGNATURES define el contenido del array firmas como firmas de "arrastrar" para el area.
Las firmas son cadenas alfanuméricas con contenido libre. La longitud máxima de una firma es de 32 caracteres.
Estas son las propiedades del area, definidas utilizando el comando PV SET PROPERTY, que permite indicar las posibilidades de un área 4D View y las opciones relacionadas con arrastrar y soltar:
Una vez arrastrar y soltar esté autorizado, puede interactuar con dos áreas (que pueden ser la misma) con la condición de que las áreas contengan al menos una firma común de arrastrar para el área fuente y de soltar para el área objetivo.
El evento de arrastrar y soltar, será interceptado por el comando PV ON EVENT.
El siguiente ejemplo ilustra un arrastrar y soltar entre dos áreas 4D View. Para empezar, definimos las firmas y el comportamiento de las áreas, por ejemplo, al cambiar de formulario:
ARRAY TEXT($DDSignatureArray;1)
$DDSignatureArray{1}:="Signature_1"
PV SET AREA PROPERTY(SourceArea;pv drag trigger;pv trigger on alt click) `alt-clic para arrastrar
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) `Las mismas firmas que arrastrar
El método de proyecto DragDropMethod se llamará cuando se ejecute un arrastrar con alt-clic o cuando ocurre un soltar en un área objetivo:
C_LONGINT($1) `Referencia del área 4D View
C_LONGINT($2) `Evento
C_LONGINT($3) `Código de la tecla (modificar)
C_LONGINT($4) `Número de la columna
C_LONGINT($5) `Número de la línea
C_LONGINT($6) `Código ASCII de la tecla
C_POINTER(SourceAreaPointer;TargetAreaPointer) `No hay donde conservarlos entre dos retrollamadas
C_BLOB($blob) `Portapapeles temporal de arrastrar y soltar
C_LONGINT($currentColumn;$currentRow) `Coordenadas de la celda actual
C_LONGINT($destinationColumn;$destinationRow) `Coordenadas de la celda donde ocurrirá el soltar
Case of
:($2=pv on drag)
PV GET DRAG SOURCE($1;SourceAreaPointer) `¿De dónde venimos?
:($2=pv on drop)
PV GET DROP TARGET($1;TargetAreaPointer) `¿A dónde vamos?
$blob:=PV Copy to blob(SourceAreaPointer->) `Copia en el portapaples
$destinationColumn:=PV Get drop info(TargetAreaPointer->;pv drop column)
`Destino....
$destinationRow:=PV Get drop info(TargetAreaPointer->;pv drop row) `...coordenadas
PV GET CURRENT CELL(TargetAreaPointer->;$currentColumn;$currentRow)
`Pegar al área asignada
PV GOTO CELL(TargetAreaPointer->;$destinationColumn;$destinationRow)
PV PASTE FROM BLOB(TargetAreaPointer->;$blob;1;1;1;1)
`Restablecimiento de la celda actual una vez realizada la operación
PV GOTO CELL(TargetAreaPointer->;$currentColumn;$currentRow)
End case
Producto: 4D View
Tema: PV Arrastrar y soltar
Número
15935
Creado por: 4D View 6.8
PV GET DRAG SIGNATURES
PV SET DROP SIGNATURES
4D View - Lenguaje ( 4D View v11.4)
4D View - Lenguaje ( 4D View v12)
4D View - Lenguaje ( 4D v13)
4D View - Lenguaje ( 4D View v14 R2)
4D View - Lenguaje ( 4D View v14)
4D View - Lenguaje ( 4D View v14 R3)
4D View - Lenguaje ( 4D View v14 R4)