Re: Drag n drop (between processes)

2019-08-13 Thread Chip Scheide via 4D_Tech
This is a problem is of my own making, as the code for drag_n_drop was 
moved from the host system to a component. As a result in the case of 2 
or more allowed source tables, a process variable which contained a 
pointer to the dropped record's source table was no longer accessible.


right now the code looks like this:

In the host
:(On Begin Drag Over)
  Drag_n_Drop_Begin("Source_set";->[Source_Table])
  // Source set is most often the selection set of a listbox
  // source table is most often the source table for the listbox

:(On Drag Over)
  $0:=Drag_n_Drop_Verify(Form Event;Allowed_to_Drop(_One or 
_Many);->[allowed_table1_1...->[allowed_table_N]
  // allows or fails drag over & drop

:(On Drop)
  Drag_n_Drop_Verify(Form Event;Allowed_to_Drop(_One or 
_Many);->[allowed_table1_1...->[allowed_table_N]
  // Places dragged record(s) into current selection of allowed_Table


the Drag_n_Drop methods are all in a component.
Drag_n_Drop works as follows:
- Drag_n_Drop_Begin -- an IP set is created which holds the record(s) 
being dragged.
- On Drag over, the table to which the set belongs** is compared 
against the the allowed source table(s), and a long int is returned 
allowing (0) or dis-allowing (-1) the drag over/Drop action.
- On Drop the IP set is used & cleared, and the dropped record(s) are 
left in the current selection.

** I can do this due to code Ive written (is available as the component 
'Setutl') which allows me to ask the question:
To which table does a specified set belong?

All of this works very well, when there is only 1 source table allowed. 
As I have recently found, this breaks down when there are 2 or more 
source tables allowed, as, Outside of the component, I do not know 
which of the allowed tables the drag n drop belongs too.

After reading through the various replies, the simplest solution is to 
return a pointer to source table of the drag n drop, or Nil so my new 
code will look like this:

:(On Drag Over)
  $0:=Drag_n_Drop_Verify(Allowed_to_Drop(_One or 
_Many);->[allowed_table1_1...->[allowed_table_N])
  // allows or fails drag over & drop

:(On Drop)
  $Source_Table:=Drag_n_Drop_Process
  if (Not(Nil($Source_Table)))
// do stuff



On Mon, 12 Aug 2019 17:12:50 -0600, Adam Bevan via 4D_Tech wrote:
> I throw the data i want dropped into an object for dragndrop. Then 
> when i drop I know what iam getting as i include the table and record 
> numbers. Where i dragged it from(process,form,object) are also 
> included. Made my listbox drag an drop so much easier to handle and 
> very generic.
> 
> Sent from my iPhone
> 
>> On Aug 12, 2019, at 3:06 PM, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I am dragging and dropping 1 or more records from 1 process onto a 
>> listbox in a second process.
>> 
>> I see that I can use the pasteboard to mange the data during this 
>> action.
>> 
>> However(dragging 1 record)
>> I am looking at the data types returned by GET PASTEBOARD DATA TYPE
>> com.4d.private.pid & com.4d.private.Form.Object -- neither of these 
>> makes much sense to me.
>> 
>> By using GET PASTEBOARD DATA i get a blob which is either
>> 4 bytes (com.4d.private.pid)
>> or
>> 524 bytes (com.4d.private.object.form)
>> 
>> I do not know what to do with either of these blocks of data... can 
>> someone point me in the right direction.
>> 
>> The drop area is allowed to accept data from 5 different tables.
>> I need to be able to differentiate which table the data is from, & 
>> which record(s) were dropped.
>> 
>> Once I have which ever of the above data types hand, what do I do with 
>> them to extract the needed information.
>> 
>> Thanks
>> Chip
>> 
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop (between processes)

2019-08-12 Thread Chip Scheide via 4D_Tech
I'll reply in more detail tomorrow, as I am at home.


> I throw the data i want dropped into an object for dragndrop. Then 
> when i drop I know what iam getting as i include the table and record 
> numbers. Where i dragged it from(process,form,object) are also 
> included. Made my listbox drag an drop so much easier to handle and 
> very generic.
> 
> Sent from my iPhone
> 
>> On Aug 12, 2019, at 3:06 PM, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I am dragging and dropping 1 or more records from 1 process onto a 
>> listbox in a second process.
>> 
>> I see that I can use the pasteboard to mange the data during this 
>> action.
>> 
>> However(dragging 1 record)
>> I am looking at the data types returned by GET PASTEBOARD DATA TYPE
>> com.4d.private.pid & com.4d.private.Form.Object -- neither of these 
>> makes much sense to me.
>> 
>> By using GET PASTEBOARD DATA i get a blob which is either
>> 4 bytes (com.4d.private.pid)
>> or
>> 524 bytes (com.4d.private.object.form)
>> 
>> I do not know what to do with either of these blocks of data... can 
>> someone point me in the right direction.
>> 
>> The drop area is allowed to accept data from 5 different tables.
>> I need to be able to differentiate which table the data is from, & 
>> which record(s) were dropped.
>> 
>> Once I have which ever of the above data types hand, what do I do with 
>> them to extract the needed information.
>> 
>> Thanks
>> Chip
>> 
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop (between processes)

2019-08-12 Thread Adam Bevan via 4D_Tech
I throw the data i want dropped into an object for dragndrop. Then when i drop 
I know what iam getting as i include the table and record numbers. Where i 
dragged it from(process,form,object) are also included. Made my listbox drag an 
drop so much easier to handle and very generic.

Sent from my iPhone

> On Aug 12, 2019, at 3:06 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I am dragging and dropping 1 or more records from 1 process onto a 
> listbox in a second process.
> 
> I see that I can use the pasteboard to mange the data during this 
> action.
> 
> However(dragging 1 record)
> I am looking at the data types returned by GET PASTEBOARD DATA TYPE
> com.4d.private.pid & com.4d.private.Form.Object -- neither of these 
> makes much sense to me.
> 
> By using GET PASTEBOARD DATA i get a blob which is either
> 4 bytes (com.4d.private.pid)
> or
> 524 bytes (com.4d.private.object.form)
> 
> I do not know what to do with either of these blocks of data... can 
> someone point me in the right direction.
> 
> The drop area is allowed to accept data from 5 different tables.
> I need to be able to differentiate which table the data is from, & 
> which record(s) were dropped.
> 
> Once I have which ever of the above data types hand, what do I do with 
> them to extract the needed information.
> 
> Thanks
> Chip
> 
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop (between processes)

2019-08-12 Thread Pat Bensky via 4D_Tech
Chip,
This is how we manage dragging form a listbox in one process to a listbox
in another process:

1. In the source listbox:

*Case of*

*:* (*Form event*=On Begin Drag Over)

*RESOLVE POINTER*(*Self*;tSourceObjectName;$Table;$field)

*ARRAY LONGINT*($aiItemsSelected;0)

$lElementPos:=*Selected list items*(CategoryList;$aiItemsSelected;*)

*ARRAY TEXT*($atCategoryUUIDs;*Size of array*($aiItemsSelected))

*For* ($i;1;*Size of array*($aiItemsSelected))

*GET LIST ITEM PARAMETER*(CategoryList;$aiItemsSelected{$i};"recordnumber";
$DestCategoryUUID)

$atCategoryUUIDs{$i}:=$DestCategoryUUID

*End for*

$tSource:="CategoryList"

*SET BLOB SIZE*($blob;0)

*VARIABLE TO BLOB*($tSource;$blob;*)

*VARIABLE TO BLOB*($aiItemsSelected;$blob;*)

*VARIABLE TO BLOB*($atCategoryUUIDs;$blob;*)

*CLEAR PASTEBOARD*

* APPEND DATA TO PASTEBOARD*(Text data;$blob)
*End Case*

2. In the destination listbox:

*Case of*

*:* ($event=On Drop)

*GET PASTEBOARD DATA*(Text data;$blob)

$ioffset:=0

*BLOB TO VARIABLE*($blob;$var;$ioffset)
*End Case*

*Then deal with the data according to the content of $var ("CategoryList"
in this case).*
*HTH*
*PB*

On Mon, 12 Aug 2019 at 22:43, Douglas von Roeder via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Chip:
>
> Here’s some ALP code that uses that command - it might give you some ideas…
>
> *Case of*
>
> *:* ($formEvent_L=On Drop)
>
>
> *Case of*
>
> *:* ($currentObjectName_T="Lock_CustomerName”)
>
>
> *C_BLOB*($blob_X)
>
> *GET PASTEBOARD DATA*("net.e-node.alp.object";$blob_X)
>
>
> *If* (OK=1)
>
> *C_LONGINT*($eList)
>
> $eList:=*BLOB to longint*($blob_X;Native byte ordering)
>
>
> *C_LONGINT*($row_L)
>
> $row_L:=*AL_GetAreaLongProperty* ($eList;ALP_Area_DragSrcRow)
>
> $text_T:=*AL_GetAreaTextProperty* ($eList;ALP_Area_Name)
>
>
> *Case of*
>
> *:* ($eList=eLineItem)
>
> *GOTO SELECTED RECORD*([Line Items];$row_L)
>
> *OBJ_GPBN* ($currentObjectName_T)->:=[Line Items]Product Name
>
> *UNLOAD RECORD*([Line Items])
>
>
> *:* ($text_T="theOne_List_eList_01")
>
> *C_TEXT*($id_T)
>
> $id_T:=*AL_GetCellTextProperty* ($eList;$row_L;1;ALP_Cell_Value)
>
>
> *OBJ_GPBN* ($currentObjectName_T)->:=*AL_GetCellTextProperty*
> ($eList;$row_L;2;ALP_Cell_Value)
>
> *PROC_FormEvent_Set* ($h_;On Data Change)
>
> *PROPOSALS_FC* ($h_)
>
>
> *End case*
>
>
> *End if*
>
>
> *End case*
>
>
> *End case*
>
>
> --
> Douglas von Roeder
> 949-910-4084
>
>
> On Mon, Aug 12, 2019 at 2:39 PM Douglas von Roeder 
> wrote:
>
> > Chip:
> >
> > Check out the docs for “Managing Pasteboards”. I’ve used this feature
> only
> > with ALP but ALP uses the same drag and drop events that 4D does so there
> > will be some overlap.
> >
> > 4 bytes could well be a longint representing the process ID where the
> drag
> > was initiated - that’s a WAG. The bigger payload could be a BLOB of a
> fair
> > amount of text or perhaps a record that was put into the clipboard when
> the
> > On drag sequence started.
> >
> > Have you checked the knowlegebase or perhaps looked in the Summit
> > materials?
> >
> > --
> > Douglas von Roeder
> > 949-910-4084
> >
> >
> > On Mon, Aug 12, 2019 at 2:06 PM Chip Scheide via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> I am dragging and dropping 1 or more records from 1 process onto a
> >> listbox in a second process.
> >>
> >> I see that I can use the pasteboard to mange the data during this
> >> action.
> >>
> >> However(dragging 1 record)
> >> I am looking at the data types returned by GET PASTEBOARD DATA TYPE
> >> com.4d.private.pid & com.4d.private.Form.Object -- neither of these
> >> makes much sense to me.
> >>
> >> By using GET PASTEBOARD DATA i get a blob which is either
> >> 4 bytes (com.4d.private.pid)
> >> or
> >> 524 bytes (com.4d.private.object.form)
> >>
> >> I do not know what to do with either of these blocks of data... can
> >> someone point me in the right direction.
> >>
> >> The drop area is allowed to accept data from 5 different tables.
> >> I need to be able to differentiate which table the data is from, &
> >> which record(s) were dropped.
> >>
> >> Once I have which ever of the above data types hand, what do I do with
> >> them to extract the needed information.
> >>
> >> Thanks
> >> Chip
> >>
> >> ---
> >> Gas is for washing parts
> >> Alcohol is for drinkin'
> >> Nitromethane is for racing
> >> **
> >> 4D Internet Users Group (4D iNUG)
> >> Archive:  http://lists.4d.com/archives.html
> >> Options: https://lists.4d.com/mailman/options/4d_tech
> >> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >> **
> >
> >
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> 

Re: Drag n drop (between processes)

2019-08-12 Thread Douglas von Roeder via 4D_Tech
Chip:

Here’s some ALP code that uses that command - it might give you some ideas…

*Case of*

*:* ($formEvent_L=On Drop)


*Case of*

*:* ($currentObjectName_T="Lock_CustomerName”)


*C_BLOB*($blob_X)

*GET PASTEBOARD DATA*("net.e-node.alp.object";$blob_X)


*If* (OK=1)

*C_LONGINT*($eList)

$eList:=*BLOB to longint*($blob_X;Native byte ordering)


*C_LONGINT*($row_L)

$row_L:=*AL_GetAreaLongProperty* ($eList;ALP_Area_DragSrcRow)

$text_T:=*AL_GetAreaTextProperty* ($eList;ALP_Area_Name)


*Case of*

*:* ($eList=eLineItem)

*GOTO SELECTED RECORD*([Line Items];$row_L)

*OBJ_GPBN* ($currentObjectName_T)->:=[Line Items]Product Name

*UNLOAD RECORD*([Line Items])


*:* ($text_T="theOne_List_eList_01")

*C_TEXT*($id_T)

$id_T:=*AL_GetCellTextProperty* ($eList;$row_L;1;ALP_Cell_Value)


*OBJ_GPBN* ($currentObjectName_T)->:=*AL_GetCellTextProperty*
($eList;$row_L;2;ALP_Cell_Value)

*PROC_FormEvent_Set* ($h_;On Data Change)

*PROPOSALS_FC* ($h_)


*End case*


*End if*


*End case*


*End case*


--
Douglas von Roeder
949-910-4084


On Mon, Aug 12, 2019 at 2:39 PM Douglas von Roeder 
wrote:

> Chip:
>
> Check out the docs for “Managing Pasteboards”. I’ve used this feature only
> with ALP but ALP uses the same drag and drop events that 4D does so there
> will be some overlap.
>
> 4 bytes could well be a longint representing the process ID where the drag
> was initiated - that’s a WAG. The bigger payload could be a BLOB of a fair
> amount of text or perhaps a record that was put into the clipboard when the
> On drag sequence started.
>
> Have you checked the knowlegebase or perhaps looked in the Summit
> materials?
>
> --
> Douglas von Roeder
> 949-910-4084
>
>
> On Mon, Aug 12, 2019 at 2:06 PM Chip Scheide via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>> I am dragging and dropping 1 or more records from 1 process onto a
>> listbox in a second process.
>>
>> I see that I can use the pasteboard to mange the data during this
>> action.
>>
>> However(dragging 1 record)
>> I am looking at the data types returned by GET PASTEBOARD DATA TYPE
>> com.4d.private.pid & com.4d.private.Form.Object -- neither of these
>> makes much sense to me.
>>
>> By using GET PASTEBOARD DATA i get a blob which is either
>> 4 bytes (com.4d.private.pid)
>> or
>> 524 bytes (com.4d.private.object.form)
>>
>> I do not know what to do with either of these blocks of data... can
>> someone point me in the right direction.
>>
>> The drop area is allowed to accept data from 5 different tables.
>> I need to be able to differentiate which table the data is from, &
>> which record(s) were dropped.
>>
>> Once I have which ever of the above data types hand, what do I do with
>> them to extract the needed information.
>>
>> Thanks
>> Chip
>>
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
>
>
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop (between processes)

2019-08-12 Thread Douglas von Roeder via 4D_Tech
Chip:

Check out the docs for “Managing Pasteboards”. I’ve used this feature only
with ALP but ALP uses the same drag and drop events that 4D does so there
will be some overlap.

4 bytes could well be a longint representing the process ID where the drag
was initiated - that’s a WAG. The bigger payload could be a BLOB of a fair
amount of text or perhaps a record that was put into the clipboard when the
On drag sequence started.

Have you checked the knowlegebase or perhaps looked in the Summit
materials?

--
Douglas von Roeder
949-910-4084


On Mon, Aug 12, 2019 at 2:06 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am dragging and dropping 1 or more records from 1 process onto a
> listbox in a second process.
>
> I see that I can use the pasteboard to mange the data during this
> action.
>
> However(dragging 1 record)
> I am looking at the data types returned by GET PASTEBOARD DATA TYPE
> com.4d.private.pid & com.4d.private.Form.Object -- neither of these
> makes much sense to me.
>
> By using GET PASTEBOARD DATA i get a blob which is either
> 4 bytes (com.4d.private.pid)
> or
> 524 bytes (com.4d.private.object.form)
>
> I do not know what to do with either of these blocks of data... can
> someone point me in the right direction.
>
> The drop area is allowed to accept data from 5 different tables.
> I need to be able to differentiate which table the data is from, &
> which record(s) were dropped.
>
> Once I have which ever of the above data types hand, what do I do with
> them to extract the needed information.
>
> Thanks
> Chip
>
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop between processes

2018-07-11 Thread Chip Scheide via 4D_Tech
Thanks Keisuke
This works well.

On Wed, 11 Jul 2018 02:31:13 +, Keisuke Miyako via 4D_Tech wrote:
> Hello,
> 
> The 510 bytes data does not contain anything useful for you.
> 
> You need to append data yourself at the drag source (append data to 
> pasteboard),
> Which can be an array of record numbers/primary keys (variable to blob),
> A set (boolean array from set, variable to blob),
> Or anything that makes sense to you.
> You assign a unique “key” to that data,
> Which by convention looks like com.4d.whatever (UTI) but it can be 
> any string,
> As long as the string is unambiguous.
> 
> You can retrieve the data on the destination side using said key.
> 
>> 2018/07/11 2:43、Chip Scheide via 4D_Tech <4d_tech@lists.4d.com>のメール:
>> what I do not know, is how do I use the data on the pasteboard.
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop between processes

2018-07-11 Thread Chip Scheide via 4D_Tech
THANKS!

On Wed, 11 Jul 2018 02:31:13 +, Keisuke Miyako via 4D_Tech wrote:
> Hello,
> 
> The 510 bytes data does not contain anything useful for you.
> 
> You need to append data yourself at the drag source (append data to 
> pasteboard),
> Which can be an array of record numbers/primary keys (variable to blob),
> A set (boolean array from set, variable to blob),
> Or anything that makes sense to you.
> You assign a unique “key” to that data,
> Which by convention looks like com.4d.whatever (UTI) but it can be 
> any string,
> As long as the string is unambiguous.
> 
> You can retrieve the data on the destination side using said key.
> 
>> 2018/07/11 2:43、Chip Scheide via 4D_Tech <4d_tech@lists.4d.com>のメール:
>> what I do not know, is how do I use the data on the pasteboard.
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop between processes

2018-07-10 Thread Keisuke Miyako via 4D_Tech
Hello,

The 510 bytes data does not contain anything useful for you.

You need to append data yourself at the drag source (append data to pasteboard),
Which can be an array of record numbers/primary keys (variable to blob),
A set (boolean array from set, variable to blob),
Or anything that makes sense to you.
You assign a unique “key” to that data,
Which by convention looks like com.4d.whatever (UTI) but it can be any string,
As long as the string is unambiguous.

You can retrieve the data on the destination side using said key.

> 2018/07/11 2:43、Chip Scheide via 4D_Tech <4d_tech@lists.4d.com>のメール:
> what I do not know, is how do I use the data on the pasteboard.




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop between processes - native Pasteboard only?

2018-07-10 Thread Jeremy French via 4D_Tech
Hi Chip,

You don't need to use sets.

Follow Keith's scheme, but without using 4D objects (which were not available 
until v14.)

On Begin Drag, place the record's unique key in the text pasteboard. Or if 
there's more than one record,
store a delimited list of the record keys in the text pasteboard.

On Drop, locate the "dragged" records by their keys which you placed in the 
pasteboard during the "On Begin Drag” event..

- Jeremy French


> On Jul 10, 2018, at 3:15 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I was/am doing this through IP sets...
> 
> ...remember someone telling me that it was possible to do drag n 
> drop between processes using ONLY the pasteboard...

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop between processes - native Pasteboard only?

2018-07-10 Thread Chip Scheide via 4D_Tech
I was/am doing this through IP sets. Same idea - (to me, a bit easier 
and doable [v13]),
copy the selected set to an IP set, access the IP set on the drop side.
But I am trying to see where I can remove IP

I thought I would look at NOT using sets at all. 
I seem to remember someone telling me that it was possible to do drag n 
drop between processes using ONLY the pasteboard, and the native data 
placed there during Drag n drop.

Thanks
Chip

On Tue, 10 Jul 2018 13:35:34 -0500, Keith Culotta via 4D_Tech wrote:
> Hope this is on topic...
> 
> During : (Form event=On Begin Drag Over) in the source list, I put 
> the information about the item being dragged on the Pasteboard
>   LOAD RECORD([Item])
>   C_OBJECT($obj)
>   OB SET($obj;"$rec";Record number([Item]))
>   OB SET($obj;"$proc";Current process)
>   OB SET($obj;"$source";"LocEdit")
>   $text:=JSON Stringify($obj)
>   // set your data type
>   SET TEXT TO PASTEBOARD($text)
> 
> 
> Later on in the destination process, mouse button just up from On 
> Begin Drag Over, the information was read back out...
>   : (Form event=On Drop)
>   // check here to see if it's your data type on 
> the clipboard
>   C_OBJECT($obj)
>   $obj:=JSON Parse(Get text from pasteboard)
>   $rec:=OB Get($obj;"$rec";Is longint)
>   $proc:=OB Get($obj;"$proc";Is longint)
>   $source:=OB Get($obj;"$source";Is text)
>   
>   If ($proc#Current process) & ($source="LocEdit")...
> 
> Keith - CDI
> 
>> On Jul 10, 2018, at 12:43 PM, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> 
>> Context: dragging 1 (or more) records/rows from a selection listbox to 
>> another form in another process. 4D v13.
>> 
>> I know, and can see by using GET PASTEBOARD DATA TYPE, and GET 
>> PASTEBOARD DATA that if I drag a line/record from a selection listbox 
>> to another process there is "stuff" put on the pasteboard.
>> 
>> (native data types)
>> com.4d.private.pid  -- 4bytes
>> com.4d.private.form.object  -- 510bytes
>> 
>> what I do not know, is how do I use the data on the pasteboard.
>> Can someone help?
>> 
>> Thanks
>> Chip
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing 
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Drag n drop between processes

2018-07-10 Thread Keith Culotta via 4D_Tech
Hope this is on topic...

During : (Form event=On Begin Drag Over) in the source list, I put the 
information about the item being dragged on the Pasteboard
LOAD RECORD([Item])
C_OBJECT($obj)
OB SET($obj;"$rec";Record number([Item]))
OB SET($obj;"$proc";Current process)
OB SET($obj;"$source";"LocEdit")
$text:=JSON Stringify($obj)
  // set your data type
SET TEXT TO PASTEBOARD($text)


Later on in the destination process, mouse button just up from On Begin Drag 
Over, the information was read back out...
: (Form event=On Drop)
  // check here to see if it's your data type on the 
clipboard
C_OBJECT($obj)
$obj:=JSON Parse(Get text from pasteboard)
$rec:=OB Get($obj;"$rec";Is longint)
$proc:=OB Get($obj;"$proc";Is longint)
$source:=OB Get($obj;"$source";Is text)

If ($proc#Current process) & ($source="LocEdit")...

Keith - CDI

> On Jul 10, 2018, at 12:43 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 
> Context: dragging 1 (or more) records/rows from a selection listbox to 
> another form in another process. 4D v13.
> 
> I know, and can see by using GET PASTEBOARD DATA TYPE, and GET 
> PASTEBOARD DATA that if I drag a line/record from a selection listbox 
> to another process there is "stuff" put on the pasteboard.
> 
> (native data types)
> com.4d.private.pid  -- 4bytes
> com.4d.private.form.object  -- 510bytes
> 
> what I do not know, is how do I use the data on the pasteboard.
> Can someone help?
> 
> Thanks
> Chip
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**