Home » Archimedes archive » Archimedes World » AW-1992-03.adf » AWMar92 » !AWMar92/Goodies/ClickDir/!ClickDir/!Help
!AWMar92/Goodies/ClickDir/!ClickDir/!Help
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Archimedes World » AW-1992-03.adf » AWMar92 |
Filename: | !AWMar92/Goodies/ClickDir/!ClickDir/!Help |
Read OK: | ✔ |
File size: | 0A81 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
ClickDir, version 0.10 ====================== The Application --------------- For some reason, everyone seems to want to write an application to set the current directory, usually by dragging files to an icon on the icon bar. Now, I've never seen the point in this, being quite happy to type the directory name in the shell. However, inspiration struck for a new way of setting the current directory, and since it was such a small piece of code, I wrote it. What it did was to change the directory *every* time a file or directory was double-clicked in a Filer window. Unfortunately, this proved to be less than useful, since you could be anywhere when you went into the shell. So, this is a new improved version, which has two modes of operation, one shot and automatic. Automatic works like the original - the directory is changed on every double-click, which is useful for running simple (non-desktop) programs from the Desktop. To change the directory in one shot mode, you first have to click the ClickDir icon (on the icon bar) - this is useful when working in the shell. There is a menu on the icon to switch between modes (and quit). The program starts up in one shot mode (the most useful). Double-clicking directories will set the current directory to the directory clicked, double-clicking any other files will set it to the directory containing that file. The Program ----------- The program is written in ARM code. The directory contains the following: !Boot !Help - this file !Run !RunImage !Sprites CreateRI - source code Templates Please report any bugs/improvements to me at one of the addresses below. If anyone finds it useful, I may turn it into a module thus making it a little more permanent (in theory, it should also be smaller, but since RMA space is very difficult to recover, this is probably a false economy). I would prefer to do this myself, so that there can be a definitive version, but if you must do it yourself, might I recommend using Richard Lloyd's Trashcan module as a base (I probably will). Finally, here's a quick resume of how it works (in automatic mode): Repeatedly listen for User Message event If Message_Quit, then closedown and quit If Message_DataOpen, then use the filename given to set the directory. Do *not* reply to the message. Lewis Gordon, April 1991 Email: L.R.Gordon@ukc.ac.uk (until June '92) Snail: 4 Beech Way, Blackmore End, Wheathampstead, Herts, AL4 8LY Revision History ---------------- 0.01 - version the first. 0.02 - added bong on startup. 0.10 - major revision, introduced two modes, and put icon on icon bar, etc.
00000000 43 6c 69 63 6b 44 69 72 2c 20 76 65 72 73 69 6f |ClickDir, versio| 00000010 6e 20 30 2e 31 30 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d |n 0.10.=========| 00000020 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a 54 |=============..T| 00000030 68 65 20 41 70 70 6c 69 63 61 74 69 6f 6e 0a 2d |he Application.-| 00000040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a |--------------..| 00000050 46 6f 72 20 73 6f 6d 65 20 72 65 61 73 6f 6e 2c |For some reason,| 00000060 20 65 76 65 72 79 6f 6e 65 20 73 65 65 6d 73 20 | everyone seems | 00000070 74 6f 20 77 61 6e 74 20 74 6f 20 77 72 69 74 65 |to want to write| 00000080 20 61 6e 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 | an application | 00000090 74 6f 20 73 65 74 20 74 68 65 0a 63 75 72 72 65 |to set the.curre| 000000a0 6e 74 20 64 69 72 65 63 74 6f 72 79 2c 20 75 73 |nt directory, us| 000000b0 75 61 6c 6c 79 20 62 79 20 64 72 61 67 67 69 6e |ually by draggin| 000000c0 67 20 66 69 6c 65 73 20 74 6f 20 61 6e 20 69 63 |g files to an ic| 000000d0 6f 6e 20 6f 6e 20 74 68 65 20 69 63 6f 6e 20 62 |on on the icon b| 000000e0 61 72 2e 0a 4e 6f 77 2c 20 49 27 76 65 20 6e 65 |ar..Now, I've ne| 000000f0 76 65 72 20 73 65 65 6e 20 74 68 65 20 70 6f 69 |ver seen the poi| 00000100 6e 74 20 69 6e 20 74 68 69 73 2c 20 62 65 69 6e |nt in this, bein| 00000110 67 20 71 75 69 74 65 20 68 61 70 70 79 20 74 6f |g quite happy to| 00000120 20 74 79 70 65 20 74 68 65 0a 64 69 72 65 63 74 | type the.direct| 00000130 6f 72 79 20 6e 61 6d 65 20 69 6e 20 74 68 65 20 |ory name in the | 00000140 73 68 65 6c 6c 2e 20 48 6f 77 65 76 65 72 2c 20 |shell. However, | 00000150 69 6e 73 70 69 72 61 74 69 6f 6e 20 73 74 72 75 |inspiration stru| 00000160 63 6b 20 66 6f 72 20 61 20 6e 65 77 20 77 61 79 |ck for a new way| 00000170 20 6f 66 0a 73 65 74 74 69 6e 67 20 74 68 65 20 | of.setting the | 00000180 63 75 72 72 65 6e 74 20 64 69 72 65 63 74 6f 72 |current director| 00000190 79 2c 20 61 6e 64 20 73 69 6e 63 65 20 69 74 20 |y, and since it | 000001a0 77 61 73 20 73 75 63 68 20 61 20 73 6d 61 6c 6c |was such a small| 000001b0 20 70 69 65 63 65 20 6f 66 20 63 6f 64 65 2c 0a | piece of code,.| 000001c0 49 20 77 72 6f 74 65 20 69 74 2e 0a 0a 57 68 61 |I wrote it...Wha| 000001d0 74 20 69 74 20 64 69 64 20 77 61 73 20 74 6f 20 |t it did was to | 000001e0 63 68 61 6e 67 65 20 74 68 65 20 64 69 72 65 63 |change the direc| 000001f0 74 6f 72 79 20 2a 65 76 65 72 79 2a 20 74 69 6d |tory *every* tim| 00000200 65 20 61 20 66 69 6c 65 20 6f 72 20 64 69 72 65 |e a file or dire| 00000210 63 74 6f 72 79 20 77 61 73 0a 64 6f 75 62 6c 65 |ctory was.double| 00000220 2d 63 6c 69 63 6b 65 64 20 69 6e 20 61 20 46 69 |-clicked in a Fi| 00000230 6c 65 72 20 77 69 6e 64 6f 77 2e 20 55 6e 66 6f |ler window. Unfo| 00000240 72 74 75 6e 61 74 65 6c 79 2c 20 74 68 69 73 20 |rtunately, this | 00000250 70 72 6f 76 65 64 20 74 6f 20 62 65 20 6c 65 73 |proved to be les| 00000260 73 20 74 68 61 6e 0a 75 73 65 66 75 6c 2c 20 73 |s than.useful, s| 00000270 69 6e 63 65 20 79 6f 75 20 63 6f 75 6c 64 20 62 |ince you could b| 00000280 65 20 61 6e 79 77 68 65 72 65 20 77 68 65 6e 20 |e anywhere when | 00000290 79 6f 75 20 77 65 6e 74 20 69 6e 74 6f 20 74 68 |you went into th| 000002a0 65 20 73 68 65 6c 6c 2e 20 53 6f 2c 20 74 68 69 |e shell. So, thi| 000002b0 73 0a 69 73 20 61 20 6e 65 77 20 69 6d 70 72 6f |s.is a new impro| 000002c0 76 65 64 20 76 65 72 73 69 6f 6e 2c 20 77 68 69 |ved version, whi| 000002d0 63 68 20 68 61 73 20 74 77 6f 20 6d 6f 64 65 73 |ch has two modes| 000002e0 20 6f 66 20 6f 70 65 72 61 74 69 6f 6e 2c 20 6f | of operation, o| 000002f0 6e 65 20 73 68 6f 74 20 61 6e 64 0a 61 75 74 6f |ne shot and.auto| 00000300 6d 61 74 69 63 2e 20 41 75 74 6f 6d 61 74 69 63 |matic. Automatic| 00000310 20 77 6f 72 6b 73 20 6c 69 6b 65 20 74 68 65 20 | works like the | 00000320 6f 72 69 67 69 6e 61 6c 20 2d 20 74 68 65 20 64 |original - the d| 00000330 69 72 65 63 74 6f 72 79 20 69 73 20 63 68 61 6e |irectory is chan| 00000340 67 65 64 20 6f 6e 0a 65 76 65 72 79 20 64 6f 75 |ged on.every dou| 00000350 62 6c 65 2d 63 6c 69 63 6b 2c 20 77 68 69 63 68 |ble-click, which| 00000360 20 69 73 20 75 73 65 66 75 6c 20 66 6f 72 20 72 | is useful for r| 00000370 75 6e 6e 69 6e 67 20 73 69 6d 70 6c 65 20 28 6e |unning simple (n| 00000380 6f 6e 2d 64 65 73 6b 74 6f 70 29 0a 70 72 6f 67 |on-desktop).prog| 00000390 72 61 6d 73 20 66 72 6f 6d 20 74 68 65 20 44 65 |rams from the De| 000003a0 73 6b 74 6f 70 2e 20 54 6f 20 63 68 61 6e 67 65 |sktop. To change| 000003b0 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 69 | the directory i| 000003c0 6e 20 6f 6e 65 20 73 68 6f 74 20 6d 6f 64 65 2c |n one shot mode,| 000003d0 20 79 6f 75 0a 66 69 72 73 74 20 68 61 76 65 20 | you.first have | 000003e0 74 6f 20 63 6c 69 63 6b 20 74 68 65 20 43 6c 69 |to click the Cli| 000003f0 63 6b 44 69 72 20 69 63 6f 6e 20 28 6f 6e 20 74 |ckDir icon (on t| 00000400 68 65 20 69 63 6f 6e 20 62 61 72 29 20 2d 20 74 |he icon bar) - t| 00000410 68 69 73 20 69 73 20 75 73 65 66 75 6c 0a 77 68 |his is useful.wh| 00000420 65 6e 20 77 6f 72 6b 69 6e 67 20 69 6e 20 74 68 |en working in th| 00000430 65 20 73 68 65 6c 6c 2e 20 54 68 65 72 65 20 69 |e shell. There i| 00000440 73 20 61 20 6d 65 6e 75 20 6f 6e 20 74 68 65 20 |s a menu on the | 00000450 69 63 6f 6e 20 74 6f 20 73 77 69 74 63 68 20 62 |icon to switch b| 00000460 65 74 77 65 65 6e 0a 6d 6f 64 65 73 20 28 61 6e |etween.modes (an| 00000470 64 20 71 75 69 74 29 2e 0a 0a 54 68 65 20 70 72 |d quit)...The pr| 00000480 6f 67 72 61 6d 20 73 74 61 72 74 73 20 75 70 20 |ogram starts up | 00000490 69 6e 20 6f 6e 65 20 73 68 6f 74 20 6d 6f 64 65 |in one shot mode| 000004a0 20 28 74 68 65 20 6d 6f 73 74 20 75 73 65 66 75 | (the most usefu| 000004b0 6c 29 2e 0a 0a 44 6f 75 62 6c 65 2d 63 6c 69 63 |l)...Double-clic| 000004c0 6b 69 6e 67 20 64 69 72 65 63 74 6f 72 69 65 73 |king directories| 000004d0 20 77 69 6c 6c 20 73 65 74 20 74 68 65 20 63 75 | will set the cu| 000004e0 72 72 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 |rrent directory | 000004f0 74 6f 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 |to the directory| 00000500 0a 63 6c 69 63 6b 65 64 2c 20 64 6f 75 62 6c 65 |.clicked, double| 00000510 2d 63 6c 69 63 6b 69 6e 67 20 61 6e 79 20 6f 74 |-clicking any ot| 00000520 68 65 72 20 66 69 6c 65 73 20 77 69 6c 6c 20 73 |her files will s| 00000530 65 74 20 69 74 20 74 6f 20 74 68 65 20 64 69 72 |et it to the dir| 00000540 65 63 74 6f 72 79 0a 63 6f 6e 74 61 69 6e 69 6e |ectory.containin| 00000550 67 20 74 68 61 74 20 66 69 6c 65 2e 0a 0a 54 68 |g that file...Th| 00000560 65 20 50 72 6f 67 72 61 6d 0a 2d 2d 2d 2d 2d 2d |e Program.------| 00000570 2d 2d 2d 2d 2d 0a 0a 54 68 65 20 70 72 6f 67 72 |-----..The progr| 00000580 61 6d 20 69 73 20 77 72 69 74 74 65 6e 20 69 6e |am is written in| 00000590 20 41 52 4d 20 63 6f 64 65 2e 20 54 68 65 20 64 | ARM code. The d| 000005a0 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e |irectory contain| 000005b0 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 3a |s the following:| 000005c0 0a 0a 20 20 21 42 6f 6f 74 0a 20 20 21 48 65 6c |.. !Boot. !Hel| 000005d0 70 20 20 20 20 20 2d 20 74 68 69 73 20 66 69 6c |p - this fil| 000005e0 65 0a 20 20 21 52 75 6e 0a 20 20 21 52 75 6e 49 |e. !Run. !RunI| 000005f0 6d 61 67 65 0a 20 20 21 53 70 72 69 74 65 73 0a |mage. !Sprites.| 00000600 20 20 43 72 65 61 74 65 52 49 20 20 2d 20 73 6f | CreateRI - so| 00000610 75 72 63 65 20 63 6f 64 65 0a 20 20 54 65 6d 70 |urce code. Temp| 00000620 6c 61 74 65 73 0a 0a 50 6c 65 61 73 65 20 72 65 |lates..Please re| 00000630 70 6f 72 74 20 61 6e 79 20 62 75 67 73 2f 69 6d |port any bugs/im| 00000640 70 72 6f 76 65 6d 65 6e 74 73 20 74 6f 20 6d 65 |provements to me| 00000650 20 61 74 20 6f 6e 65 20 6f 66 20 74 68 65 20 61 | at one of the a| 00000660 64 64 72 65 73 73 65 73 20 62 65 6c 6f 77 2e 0a |ddresses below..| 00000670 0a 49 66 20 61 6e 79 6f 6e 65 20 66 69 6e 64 73 |.If anyone finds| 00000680 20 69 74 20 75 73 65 66 75 6c 2c 20 49 20 6d 61 | it useful, I ma| 00000690 79 20 74 75 72 6e 20 69 74 20 69 6e 74 6f 20 61 |y turn it into a| 000006a0 20 6d 6f 64 75 6c 65 20 74 68 75 73 20 6d 61 6b | module thus mak| 000006b0 69 6e 67 20 69 74 20 61 0a 6c 69 74 74 6c 65 20 |ing it a.little | 000006c0 6d 6f 72 65 20 70 65 72 6d 61 6e 65 6e 74 20 28 |more permanent (| 000006d0 69 6e 20 74 68 65 6f 72 79 2c 20 69 74 20 73 68 |in theory, it sh| 000006e0 6f 75 6c 64 20 61 6c 73 6f 20 62 65 20 73 6d 61 |ould also be sma| 000006f0 6c 6c 65 72 2c 20 62 75 74 20 73 69 6e 63 65 20 |ller, but since | 00000700 52 4d 41 0a 73 70 61 63 65 20 69 73 20 76 65 72 |RMA.space is ver| 00000710 79 20 64 69 66 66 69 63 75 6c 74 20 74 6f 20 72 |y difficult to r| 00000720 65 63 6f 76 65 72 2c 20 74 68 69 73 20 69 73 20 |ecover, this is | 00000730 70 72 6f 62 61 62 6c 79 20 61 20 66 61 6c 73 65 |probably a false| 00000740 20 65 63 6f 6e 6f 6d 79 29 2e 20 49 0a 77 6f 75 | economy). I.wou| 00000750 6c 64 20 70 72 65 66 65 72 20 74 6f 20 64 6f 20 |ld prefer to do | 00000760 74 68 69 73 20 6d 79 73 65 6c 66 2c 20 73 6f 20 |this myself, so | 00000770 74 68 61 74 20 74 68 65 72 65 20 63 61 6e 20 62 |that there can b| 00000780 65 20 61 20 64 65 66 69 6e 69 74 69 76 65 20 76 |e a definitive v| 00000790 65 72 73 69 6f 6e 2c 0a 62 75 74 20 69 66 20 79 |ersion,.but if y| 000007a0 6f 75 20 6d 75 73 74 20 64 6f 20 69 74 20 79 6f |ou must do it yo| 000007b0 75 72 73 65 6c 66 2c 20 6d 69 67 68 74 20 49 20 |urself, might I | 000007c0 72 65 63 6f 6d 6d 65 6e 64 20 75 73 69 6e 67 20 |recommend using | 000007d0 52 69 63 68 61 72 64 20 4c 6c 6f 79 64 27 73 0a |Richard Lloyd's.| 000007e0 54 72 61 73 68 63 61 6e 20 6d 6f 64 75 6c 65 20 |Trashcan module | 000007f0 61 73 20 61 20 62 61 73 65 20 28 49 20 70 72 6f |as a base (I pro| 00000800 62 61 62 6c 79 20 77 69 6c 6c 29 2e 0a 0a 46 69 |bably will)...Fi| 00000810 6e 61 6c 6c 79 2c 20 68 65 72 65 27 73 20 61 20 |nally, here's a | 00000820 71 75 69 63 6b 20 72 65 73 75 6d 65 20 6f 66 20 |quick resume of | 00000830 68 6f 77 20 69 74 20 77 6f 72 6b 73 20 28 69 6e |how it works (in| 00000840 20 61 75 74 6f 6d 61 74 69 63 20 6d 6f 64 65 29 | automatic mode)| 00000850 3a 0a 0a 20 20 20 20 20 20 20 20 52 65 70 65 61 |:.. Repea| 00000860 74 65 64 6c 79 20 6c 69 73 74 65 6e 20 66 6f 72 |tedly listen for| 00000870 20 55 73 65 72 20 4d 65 73 73 61 67 65 20 65 76 | User Message ev| 00000880 65 6e 74 0a 20 20 20 20 20 20 20 20 20 20 49 66 |ent. If| 00000890 20 4d 65 73 73 61 67 65 5f 51 75 69 74 2c 20 74 | Message_Quit, t| 000008a0 68 65 6e 20 63 6c 6f 73 65 64 6f 77 6e 20 61 6e |hen closedown an| 000008b0 64 20 71 75 69 74 0a 20 20 20 20 20 20 20 20 20 |d quit. | 000008c0 20 49 66 20 4d 65 73 73 61 67 65 5f 44 61 74 61 | If Message_Data| 000008d0 4f 70 65 6e 2c 20 74 68 65 6e 20 75 73 65 20 74 |Open, then use t| 000008e0 68 65 20 66 69 6c 65 6e 61 6d 65 20 67 69 76 65 |he filename give| 000008f0 6e 20 74 6f 20 73 65 74 20 74 68 65 0a 20 20 20 |n to set the. | 00000900 20 20 20 20 20 20 20 64 69 72 65 63 74 6f 72 79 | directory| 00000910 2e 20 44 6f 20 2a 6e 6f 74 2a 20 72 65 70 6c 79 |. Do *not* reply| 00000920 20 74 6f 20 74 68 65 20 6d 65 73 73 61 67 65 2e | to the message.| 00000930 0a 0a 4c 65 77 69 73 20 47 6f 72 64 6f 6e 2c 20 |..Lewis Gordon, | 00000940 41 70 72 69 6c 20 31 39 39 31 0a 0a 45 6d 61 69 |April 1991..Emai| 00000950 6c 3a 20 4c 2e 52 2e 47 6f 72 64 6f 6e 40 75 6b |l: L.R.Gordon@uk| 00000960 63 2e 61 63 2e 75 6b 20 28 75 6e 74 69 6c 20 4a |c.ac.uk (until J| 00000970 75 6e 65 20 27 39 32 29 0a 0a 53 6e 61 69 6c 3a |une '92)..Snail:| 00000980 20 34 20 42 65 65 63 68 20 57 61 79 2c 0a 20 20 | 4 Beech Way,. | 00000990 20 20 20 20 20 42 6c 61 63 6b 6d 6f 72 65 20 45 | Blackmore E| 000009a0 6e 64 2c 0a 20 20 20 20 20 20 20 57 68 65 61 74 |nd,. Wheat| 000009b0 68 61 6d 70 73 74 65 61 64 2c 0a 20 20 20 20 20 |hampstead,. | 000009c0 20 20 48 65 72 74 73 2c 0a 20 20 20 20 20 20 20 | Herts,. | 000009d0 41 4c 34 20 38 4c 59 0a 0a 52 65 76 69 73 69 6f |AL4 8LY..Revisio| 000009e0 6e 20 48 69 73 74 6f 72 79 0a 2d 2d 2d 2d 2d 2d |n History.------| 000009f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 30 2e 30 31 |----------..0.01| 00000a00 20 2d 20 76 65 72 73 69 6f 6e 20 74 68 65 20 66 | - version the f| 00000a10 69 72 73 74 2e 0a 0a 30 2e 30 32 20 2d 20 61 64 |irst...0.02 - ad| 00000a20 64 65 64 20 62 6f 6e 67 20 6f 6e 20 73 74 61 72 |ded bong on star| 00000a30 74 75 70 2e 0a 0a 30 2e 31 30 20 2d 20 6d 61 6a |tup...0.10 - maj| 00000a40 6f 72 20 72 65 76 69 73 69 6f 6e 2c 20 69 6e 74 |or revision, int| 00000a50 72 6f 64 75 63 65 64 20 74 77 6f 20 6d 6f 64 65 |roduced two mode| 00000a60 73 2c 20 61 6e 64 20 70 75 74 20 69 63 6f 6e 20 |s, and put icon | 00000a70 6f 6e 20 69 63 6f 6e 20 62 61 72 2c 20 65 74 63 |on icon bar, etc| 00000a80 2e |.| 00000a81