home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Handler to deal with double-clicks in DOpus for TwinExpress.
- *
- * (c) 1994 by K.P. van Beem (2:280/464.2, patrick.van.beem@aobh.xs4all.nl)
- *
- * Based on the DOpusLhaARexx package by Geoff Seeley (but you can better
- * use GuiArc in stead of DOpus and a script, to deal with archives)
- *
- */
-
- DOpusPort = 'DOPUS.1'
- TwinPort = 'TWIN.1'
-
- if ~show(l,"rexxsupport.library") then
- call addlib("rexxsupport.library",0,-30,0)
- if showlist('Ports', TwinPort) then do
- call ExitIt
- end
-
- options results
-
- /* open our message port */
- OurPort = openport(TwinPort)
- HandlerStatus = 'OPEN'
-
- do until HandlerStatus = 'CLOSE'
- call waitpkt(TwinPort)
- Packet = getpkt(TwinPort)
- if Packet ~= null() then do
- Cmd = getarg(Packet, 0)
- Directory = getarg(Packet, 2) /* entry text */
- call reply(Packet, 0)
- if Cmd = '1' then do
- address value DOpusPort
- /* Get current directory */
- 'Status 6 -1'
- GetEntry Result
- FilePath = Result
- if left(FilePath,1) ~= '*' then
- TopText "You are not in a 'Twin' directory."
- else do
- FilePath = SubStr(FilePath,2)
- /* Check if entry is a directory */
- if SubStr(Directory,26,9) ~= "Directory" then
- TopText "Selected item is no directory."
- else do
- /* Create new path and... */
- if right(FilePath,1) = ':' then
- FilePath = FilePath || Strip(left(Directory,25))
- else
- FilePath = FilePath || '/' || Strip(left(Directory,25))
- /* ...command the actually entering of the directory */
- address COMMAND "Rexx:DOpus/ReadDir.rexx" FilePath
- end
- end
- end
- if Cmd = '2' then do
- OtherWindow
- address COMMAND "Rexx:DOpus/CopyFile.rexx"
- end
- if Cmd = 'CLOSE' then
- HandlerStatus = 'CLOSE'
- end
- end
-
- /* close up shop */
- call closeport(OurPort)
-
- exit
-