Has anybody figured out 'drag form omnis'. 'drop on file system (eg desktop)'

Chris Hughes ataddata at bigpond.net.au
Tue May 25 23:05:29 UTC 2021


The drag and drop is easy part. the following is called from context menu.

This takes the highlighted from list turns into text that goes into any documents, this was written for Windows,Linux and Macintosh.

Note it even calculates derived values and exports the result.

Do LvList.$copydefinition(iEstSectLst)
Do LvList.$merge(iEstSectLst,,kTrue)
Do LvList.$sort($ref.ma_sect_nu,kFalse,$ref.ma_seq,kFalse)
Do LvList.$line.$assign(1)
Repeat
Calculate $root.LvList(8,LvList.$line) as $root.LvList(5,LvList.$line)*$root.LvList(6,LvList.$line)*(1-($root.LvList(7,LvList.$line)/100))
Calculate $root.LvList(10,LvList.$line) as $root.LvList(5,LvList.$line)*$root.LvList(9,LvList.$line)
Do LvList.$line.$assign(LvList.$line+1)
Until LvList.$line>LvList.$linecount
Calculate LvHeadings as con('SectNo',chr(9),'Catalogue Number',chr(9),'Description',chr(9),'Unit',chr(9),'Quantity',chr(9),'Price$',chr(9),'Dis%',chr(9),'Ext Price$',chr(9),'Lab Rate',chr(9),'Ext Lab',chr(9),'Mat CC',chr(9),'Lab CC',chr(9),'Lab Class',chr(9),'Area',chr(9),'Alt CC',chr(9),'Comments',chr(10))

Do LvObject.$ListToClipBoard(LvList,LvHeadings)




Block of Procedure this will adjust to different column counts. And cleans out the not wanted characters.

If len(pHeading)>0
Calculate LvBody as pHeading
End If
;  
Do pList1.$line.$assign(1)
Repeat
Do LvColTotNo.$assign(pList1.$colcount)
Do LvColNo.$assign(1)
Repeat
Do LvValue.$assign($root.pList1(LvColNo,pList1.$line))
If sys(6)='X'
If LvColNo=8
Calculate LvValue as con('=e',pList1.$line+1,'*f',pList1.$line+1,'*(1-(g',pList1.$line+1,'/100))')
End If
If LvColNo=10
Calculate LvValue as con('=e',pList1.$line+1,'*i',pList1.$line+1)
End If
End If
Do LvValue.$assign(replaceall(LvValue,chr(9),''))     ;; Clean out possible control characters. Horizontal TAB
Do LvValue.$assign(replaceall(LvValue,chr(10),''))     ;; Clean out possible control characters. New Line feed
Do LvValue.$assign(replaceall(LvValue,chr(13),''))     ;; Clean out possible Carriage Return characters.
Do LvValue.$assign(replaceall(LvValue,chr(34),''))     ;; Clean out  " characters.
Do LvValue.$assign(replaceall(LvValue,chr(44),''))     ;; Clean out Coma control characters.
;  
Do LvBody.$assign(con(LvBody,LvValue,chr(9)))     ;; We get the contents of the cell in the list.
;  
Do LvColNo.$assign(LvColNo+1)
Until LvColNo>LvColTotNo
Do LvBody.$assign(con(LvBody,chr(10)))     ;; Character Line feed
Do pList1.$line.$assign(pList1.$line+1)
Until pList1.$line>pList1.$linecount
;  
Copy to clipboard LvBody





-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Doug Easterbrook
Sent: Wednesday, 26 May 2021 2:30 AM
To: OmnisDev List - English
Subject: Re: Has anybody figured out 'drag form omnis'. 'drop on file system (eg desktop)'

hi Phil:

I was hoping that a drag and drop on a system just told me the folder that the file was being dropping into.

if I got an eventlike evDropOnFileSystem with ‘desktop’ or ‘MyFolder’ as the destination, then it's up to me to contextually decide what to do.

if a person, then a vcard format
if a calendar, then an ics format
if a list, then perhaps asked ‘excel or text’

file name could also be prompted….  or simply a ‘clipping’ style of thing with a timestamp.



its then a step to drag from omnis onto excel ….   perhaps an evDropOnOtherApp


I’m looking for options to expedite getting data from our app to other places in intuitive ways.     

for example, you can drag a selection from word onto excel … why not omnis to excel?


Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On May 24, 2021, at 9:54 AM, Phil (OmnisList) via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> Hi,
> 
> I think it was dragging from the filesystem onto Omnis that they made work cross platform...
> 
> Technically, I wonder what lines of a list would be considered as, if you dropped them onto a desktop... a text document, csv... what about icons pictures etc.
> 
> Seems as though we would need to create a file, and place it where it was dropped... but it seems in Omnis code its the receiver that decodes the drop, not the sender.
> 
> Just some thoughts...
> 
> regards
> Phil Potter
> Based in Chester in the UK.
> 
> On 24/05/2021 16:49, Das Goravani wrote:
>> Didn’t Omnis add that capability recently.. I remember something new about file system files and drag and drop. Am I wrong?
>> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list