home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / mag_discs / 15 / director / !Director / !Help < prev    next >
Text File  |  1994-10-29  |  42KB  |  1,210 lines

  1. Help file for Director version 0.11
  2. ===================================
  3.  
  4. Director is Copyright (C) Nick Craig-Wood 1994
  5.  
  6. If you are reading this in !Edit then you might like to do Expand tabs on the
  7. Edit menu to turn those [09]'s into something useful!
  8.  
  9.  
  10. License
  11. =======
  12.  
  13. Director (The Software) is Copyright (C) Nick Craig-Wood 1994 (NCW) and may
  14. not be used or copied except as in accord with the terms and conditions
  15. below.
  16.  
  17. You may NOT Make the Software available to any third party EXCEPT with these
  18. terms and conditions imposed on said party.
  19.  
  20. You may NOT Make the Software available to any third party EXCEPT at no
  21. benefit to yourself or any third party, excepting that benefit contained
  22. within the Software.
  23.  
  24. You MUST make sure the Software is distributed whole, intact and unmodified,
  25. including all the files in the original distribution.
  26.  
  27. You may NOT may not sell, hire or include the Software in a package which is
  28. sold or hired, modify, translate, disassemble, decompile, reverse engineer,
  29. or create derivative works based upon the Software or include whole or part
  30. of the Software into other works. 
  31.  
  32. The Software is supplied "as is", NCW makes no warranty, express or implied,
  33. as to the merchantability or its fitness for any particular purpose.  It may
  34. or may not perform in accordance with the documentation or your expectations.
  35.  
  36. In no circumstances will NCW be liable for any damage, loss of profits,
  37. goodwill or for any indirect or consequential loss arising out of the use of
  38. the Software, or inability to use the Software, even if NCW has been advised
  39. of the possibility of such loss.
  40.  
  41. These conditions supersede any prior agreement, oral or written, between you
  42. and NCW relating to the Software.
  43.  
  44. You agree that except for written separate agreements between NCW and you,
  45. this agreement is a complete and exclusive statement of the rights and
  46. liabilities of the parties.
  47.  
  48. You acknowledge that you have read this agreement, that you understand this
  49. agreement, and by loading, running or copying the Software you agree to be
  50. bound by this agreement's terms and conditions.
  51.  
  52.  
  53. Introduction
  54. ============
  55.  
  56. Director is a general purpose desktop tool.  It allows you to customise your
  57. desktop by creating menus of useful commands and icons to attach the menus
  58. to.  Any number of menus or icons can be created and attached in any order to
  59. each other.
  60.  
  61. Director also allows an alternative and faster view onto files in the form of
  62. directory menus and allows these menus to be attached to other menus also.
  63.  
  64. Director has some other useful features such as remembering the most recently
  65. used files, the ability to add key strokes into the keyboard buffer and the
  66. ability to produce directory menus over drive icons.
  67.  
  68. Director is fully customisable by the user, and can do many or all of the
  69. functions of Pinboard+, TreeMenu (AKA DirMenu), Filer-, QuickDir, DeskUtils,
  70. Memorizer, Menon and some of the functions of Filer+.
  71.  
  72. Director will only run on RISC OS 3.10 or later.
  73.  
  74.  
  75. Motivation
  76. ==========
  77.  
  78. Director was initially conceived as a replacement for Pinboard+ (by Thomas
  79. Olsson).  For those of you who don't know, Pinboard+ is a replacement
  80. Pinboard module which allows user definable menus when clicking menu over the
  81. backdrop.
  82.  
  83. The initial design of Director was in order to overcome the fact that
  84. Pinboard+ needed a replacement pinboard module loaded (which did not work
  85. fully under RISCOS 3.5) and the fact that there was no easy way of specifying
  86. that you wanted the contents of a directory as a sub menu.
  87.  
  88. This then led on to the idea of incorporating the functions of TreeMenu (by
  89. Julian Smith) into Director.  This would then enable a directory tree listing
  90. to be attached to a menu at any point.
  91.  
  92. These ideas led onto Director being more of a general purpose program,
  93. merging several utilities into one compact package.
  94.  
  95. Memory usage was another of the main reasons for coding Director.  Here's a
  96. before and after on the memory front.
  97.  
  98. Before:
  99.  
  100. TreeMenu          65,536
  101. Pinboard+         18,812 (module)
  102.                   43,324 (menu)
  103. DeskUtils         32,768
  104. Memorizer         14,128
  105. ————————————————————————
  106. Total            174,568 Bytes
  107.  
  108. After:
  109.  
  110. Program code      18,672
  111. Workspace          3,600
  112. Heap              18,416 (119 blocks)
  113. ————————————————————————
  114. Total             40,688 Bytes
  115.  
  116. Thus giving a saving of 133,880 bytes or 130 kBytes!
  117.  
  118. Director also includes some ideas from Filer+ (by Jens H. Ovesen), Filer- (by
  119. Franz Philipps), and Memorizer (by Ben Summers).
  120.  
  121. Director is written entirely in ObjAsm assembler for its compactness and ease
  122. of making module tasks.
  123.  
  124. Although the not all ideas may not have been my own, the coding is all mine
  125. (including all the bugs)!
  126.  
  127.  
  128. Switching from Pinboard+ to Director
  129. ====================================
  130.  
  131. If you run the ExpandMenu program in the Utils directory you can convert your
  132. old Pinboard+ menus into the new form expected by Director.  This is a
  133. textual form based on the Obey file and is a lot easier to maintain than a
  134. graphical form.  However if you prefer you can maintain your menus using the
  135. Pinboard+ menu designer and ExpandMenu, however some of the new features of
  136. Director will be unavailable to you.
  137.  
  138.  
  139. Switching from TreeMenu (or DirMenu) to Director
  140. ================================================
  141.  
  142. Director has almost all the features of TreeMenu.  By default it will enable
  143. Directory menus over title bars of filer windows and other windows.  You may
  144. create icons as per TreeMenu also, see the section on Icons, and also the
  145. example Menus.
  146.  
  147.  
  148. Menus
  149. =====
  150.  
  151. Menus are referred to by name (case insensitive), either by the text of the
  152. menu title or an alias as given by you.  There can only be one menu of any
  153. given name, and if you attempt to create a menu with the same name as an
  154. existing one then the existing menu will be deleted without warning.  This is
  155. useful because you can update your menus at any time you like, or even create
  156. new menus on the fly.
  157.  
  158. Director keeps a list of menus which you can ask for with the "ListMenus"
  159. command.  Menus can be temporary or permanent.  Temporary menus are created
  160. by Director for making Directory Menus and then deleted afterwards. 
  161. Permanent Menus are created by you.
  162.  
  163. To create a menu you need to create an Obey file with the following format.
  164. (Indentation and spacing are generally unimportant.  The menus are described
  165. indented here to aid comprehension of the structure.)
  166.  
  167.     Menu ...
  168.         Option ...
  169.             Command ...
  170.         Option ...
  171.             Command ...
  172.     Dash
  173.         .
  174.         .
  175.         .
  176.         Option ...
  177.     EndMenu
  178.  
  179. The Menu command signals to Director to start a new Menu with the name and
  180. alias you give it.
  181.  
  182.     Syntax: Menu <title> [<alias>] [-key <key>] [-temp]
  183.  
  184. Possible examples are,
  185.  
  186.     Menu "Mode"
  187.         Starts a menu with title and internal name both "Mode"
  188.     Menu Mode
  189.         Same as above.  In general if you want to supply a string
  190.         to a command, you can supply it with or without quotes.
  191.         However if the string has spaces in it it must be supplied
  192.         with quotes.
  193.     Menu "Lots of Modes" Mode
  194.         Starts a menu with title "Lots of Modes" and internal name
  195.         "Mode"
  196.     Menu "DDE" -key ^D
  197.         Starts a menu called DDE with internal name DDE to be opened
  198.         on a CTRL-D key press (see the section called Keys for more
  199.         on what is allowed as a parameter to -keys)
  200.     Menu "Temporary" -temp
  201.         This will make a menu which will be displayed only once and
  202.         then destroyed.  This is useful for dynamic menus.
  203.  
  204. The EndMenu command signals to Director to stop making the menu.  The menu is
  205. available for display as soon as the Menu command has been issued though.
  206.  
  207.     Syntax: EndMenu
  208.  
  209. The Dash command writes a dashed line across the menu at that point in the
  210. menu structure.  It is useful for organising large menus.
  211.  
  212.     Syntax: Dash
  213.  
  214. The Option command is at the heart of Director's menus.  It has many options
  215. which you won't need immediately, but which may become useful later.
  216.  
  217.     Syntax: Option <text> | -path <file|directory>
  218.         [-tick]
  219.         [-bg <col>]
  220.         [-fg <col>]
  221.         [-sub [<menu>|*]]
  222.         [-len <len>]
  223.         [-dash]
  224.         [-grey]
  225.         [-key <number>]
  226.         [-up]
  227.  
  228. The Option command must be supplied with a text or a path or both.  For
  229. example
  230.  
  231.     Option "Mode 31"
  232.         Will produce a menu entry with the text "Mode 31" which could
  233.         have a command attached (see later).
  234.     Option -path ADFS::4.$.Apps
  235.         Will produce a menu entry with a directory icon in it and the
  236.         Apps directory attached.  If the Apps directory is not present
  237.         then it will produce a greyed out menu option with an unknown
  238.         file icon.  Director will use the leaf name of the path for
  239.         the text of the menu (in this case Apps) minus an initial !.
  240.     Option "Applications" -path ADFS::4.$.Apps
  241.         As above except the text in the menu option will be
  242.         "Applications" rather than "Apps".
  243.  
  244. A text option may have a 0, 1 or 2 Commands attached (see later) or a
  245. SubMenu.
  246.  
  247.     Option "Modes" -sub "Modes"
  248.         This produces a menu entry with the text "Modes" and a right
  249.         pointing arrow.  When pointer moves over the arrow the Menu
  250.         "Modes" will be opened as a sub menu.  If the user clicks on
  251.         the item (or uses a hotkey) the "Modes" menu will be opened
  252.         as the root menu.
  253.     Option "Modes" -sub *
  254.         This is equivalent to the Option above.  It is quite common
  255.         to have a SubMenu with the same name as the Option which
  256.         activates it, so this is shorthand for that.
  257.  
  258. A menu option may be activated by a key, eg
  259.  
  260.     Option -path ADFS::4.$.Apps -key ^A
  261.         Opens the Apps directory on CTRL-A
  262.     Option "Modes" -sub * -key M
  263.         Opens the modes SubMenu (if no command attached) or does the
  264.         attached command if M is pressed.
  265.     Option "Command" -key ⇧^Z
  266.         If a command is attached then it does it on SHIFT-CTRL-Z
  267.         otherwise it does nothing.
  268.  
  269. A menu option may have its foreground and background colours defined (see the
  270. section on colours for details of which numbers make which colours).  If the
  271. colours are not defined then they default foreground Black and background
  272. White.
  273.  
  274.     Option "Format" -fg 11
  275.         Produces Red text on the default background
  276.     Option "Boot" -fg 0 -bg 8
  277.         Produces White text on a Dark Blue background
  278.  
  279. Any menu can be made writable by including a -len option.  The parameter to
  280. len is the maximum length of the string writable into the icon.  When the
  281. item is selected the text is written into the system variable <MenuText>
  282. which can be used in commands.  In fact <MenuText> is written for
  283. non-writable items and when creating a submenu too.
  284.  
  285.     Option "13" -len 3
  286.         Might be used for typing in a mode number or maximum length 3
  287.         characters.  The command attached would then use <MenuText>
  288.         to set the actual mode.  The string "13" is the default text.
  289.     Option "" -len 200
  290.         Might be used by a general purpose command (eg the New Task
  291.         option in the TaskManager).  The default string is empty.
  292.         It must be supplied though or Director will complain.
  293.  
  294. -tick Ticks the menu item (useful for when you have 2 attached commands, this
  295. provides the initial ticked state).
  296.  
  297. -dash Writes a dash under the menu item.  This is equivalent to the Dash
  298. command.
  299.  
  300. -grey Makes the menu entry grey and unselectable.  Useful occasionally.
  301.  
  302. -up Makes -path have the directories above the path (Up Menus - see Directory
  303. Menus section) in the menu.  If -up is applied to a file then it will have a
  304. submenu arrow.
  305.  
  306. The Command command is for attaching commands to menu options.  Only text
  307. type menu options (ie not -path options) may have Commands attached.  You may
  308. have both SubMenus and commands attached to a menu option.
  309.  
  310.     Syntax: Command <*command>
  311.  
  312. For example
  313.  
  314.     Option "Mode 13"
  315.         Command WimpMode 13
  316.             Sets Mode 13 when clicked on
  317.     Option "13" -len 3
  318.         Command WimpMode <MenuText>
  319.             Sets the mode typed in when clicked on
  320.     Option "" -len 200
  321.         Command <MenuText>
  322.             Runs the command typed in when clicked on.
  323.  
  324. A menu option may have two commands attached.  Which command is run depends
  325. upon the ticked state of the option.
  326.  
  327. For example
  328.  
  329.     Option "A"
  330.         Command FontInstall Fonts:!A.
  331.         Command FontRemove Fonts:!A.
  332.  
  333. When this it not ticked then the first command will be run.  This will
  334. install the fonts in !A and to show that they have been installed the menu
  335. option will be ticked.  To remove the fonts the option is clicked again and
  336. the second command is run, removing the fonts, and returning the menu to the
  337. non-ticked state.
  338.  
  339. Commands are GSTransed before being run (see the section on GSTrans for more
  340. info) as a WimpTask.  Running commands as a WimpTask means that they don't
  341. interfere with Director, however if the command produces an error, an
  342. anonymous error box is produced.
  343.  
  344. This also means that multiple OS commands can be put on one line by
  345. separating them with |M.  For example
  346.  
  347.     Option "Reset SysFont"
  348.         Command fx 20|MSWI Wimp_CommandWindow -1
  349.  
  350. Which resets the system font with *FX 20 and then redraws the screen with the
  351. SWI Wimp_CommandWindow.
  352.  
  353.  
  354. System Variables
  355. ================
  356.  
  357. These system variables are set whenever a path sub menu is opened or a path
  358. item is chosen
  359.  
  360.     Director$CurrentPath
  361.         full path of object
  362.     Director$CurrentDir
  363.         directory object lives in
  364.     Director$CurrentLeaf
  365.         leaf name of object
  366.     
  367. If the object is a root directory (eg ADFS::4.$ or Root:) then CurrentPath =
  368. CurrentDir = CurrentLeaf
  369.  
  370.  
  371. The last Command that was run can be seen in the system variable
  372.  
  373.     Alias$DirectorRun
  374.  
  375. So issue *Show Alias$DirectorRun at the command line to see what it was.
  376.  
  377.  
  378. Whenever a text option is chosen
  379.  
  380.     MenuText
  381.  
  382. Is set to the text of that option
  383.  
  384.  
  385. Whenever menu is clicked over the File 'xxx' option in a Filer Menu
  386.  
  387.     Leaf
  388.  
  389. is set to the leaf name of the file ("xxx" in this case).
  390.  
  391.  
  392. GSTrans
  393. =======
  394.  
  395. If you are uncertain what GSTrans is, look it up in the index of your user
  396. guide.  The few pages referenced will teach you the basics (I won't attempt
  397. to explain them here).
  398.  
  399. As a rule every string parameter passed to Director is GSTransed when it is
  400. passed.  This means that
  401.  
  402.     Option -path <Wimp$Scrap>
  403.  
  404. Will be GSTransed into (something like)
  405.  
  406.     Option -path ADFS::HardDisc4.$.!Boot.!Scrap.ScrapDirs.ScrapFile
  407.  
  408. Which means that if Wimp$Scrap changes, the option won't be looking in the
  409. right place.  The menu text will read "ScrapFile".  Better is
  410.  
  411.     Option -path |<Wimp$Scrap>
  412.  
  413. Which GSTranses into
  414.  
  415.     Option -path <Wimp$Scrap>
  416.  
  417. which is what you want.  The menu text will read "<Wimp$Scrap>".  Probably
  418. best (for this use) is
  419.  
  420.     Option "Scrap" -path |<Wimp$Scrap>
  421.  
  422. Which has the menu text "Scrap" but is otherwise identical to the one above.
  423.  
  424. The only strings which don't get GSTransed on their way into Director are the
  425. parameters to Command.  These are GSTransed just before being run.
  426.  
  427.     Option "13" -len 3
  428.         Command WimpMode <MenuText>
  429.  
  430. The above command will only be GSTransed when it is run with the actual value
  431. of MenuText, not the value of MenuText when the command was installed.
  432.  
  433.     Option "Open App"
  434.         Command Filer_OpenDir <Obey$Dir>
  435.     Option "Open App"
  436.         Command Filer_OpenDir |<Obey$Dir>
  437.  
  438. These two commands in practice do the same thing.  This is because in the
  439. first Command the <Obey$Dir> is GSTransed (when the Command is being
  440. prepared) to the proper path which is then passed to Filer_OpenDir.  In the
  441. second case |<Obey$Dir> is GSTransed to <Obey$Dir> and passed to
  442. Filer_OpenDir.  Filer_OpenDir GSTranses the argument and comes up with the
  443. same answer.
  444.  
  445. If the commands had been Filer_Run in the above example then they would have
  446. done two different things.  The first would have worked (running the
  447. application) and the second would not because Filer_Run does not GSTrans its
  448. input.  (In fact the second command would have opened a directory onto the
  449. application for some obscure reason, with the Filer title set to <Obey$Dir>
  450. which should not normally be allowed.)
  451.  
  452.  
  453. Special forms of Menus and Commands
  454. ===================================
  455.  
  456. Whenever a Menu, SubMenu or Command is specified it may take one of several
  457. special forms.  These enable Director to be much more general, running
  458. commands instead of opening a sub menu or vice versa.  It also means that
  459. Commands can be attached to clicks on icons as well as menus.
  460.  
  461. When a Menu, SubMenu or Command is being processed, it is first checked to
  462. see if it is prefixed in one of the ways below.  If it is then its action is
  463. modified.
  464.  
  465. "Text"        For normal command or sub-menu (ie action unchanged)
  466.  
  467. "Menu:Name"    To bring up named menu
  468.  
  469. "Save:Path"    For save box of the given Path (*)
  470.  
  471. "Path:Path"    For a directory menu of that Path (*)
  472.  
  473. "Command:Text"    Runs the Text as if it were a command
  474.  
  475. "Quit:"        Quits Director
  476.  
  477. "Info:"        Brings up Director's info window
  478.  
  479. "OldMenu:"    To open the last filtered menu (for getting pinboard menu)
  480.  
  481. "MenuMenu:Path"    Takes Path, adds .<leaf> to it and opens the MenuMenu
  482.         pointing at that file.  Used internally. (*)
  483.  
  484. "Memoriser:"    Opens a menu recently used files.  (See Memoriser section.)
  485.  
  486. "Dynamic:Text"    Runs the Text as if it were a command.  When the command
  487.         returns Director tries to open the menu whose name is in
  488.         the system variable Director$Menu.
  489.  
  490. "GSTrans:Text"    GSTran-es the Text and then reinterprets it as an extended
  491.         command.
  492.  
  493. (*) If the path is missing eg "Path:" or "Save:" then it will use the path of
  494. the window that the pointer is over.  If the path is present it is GS_Transed
  495. before use.
  496.  
  497. For example
  498.  
  499.     Option "Floppy" -sub "Path:ADFS::0.$"
  500.  
  501. This will make a directory menu of the floppy disc drive if you click on the
  502. option or move the pointer over the SubMenu.  This is better than
  503.  
  504.     Option "Floppy" -path ADFS::0.$
  505.  
  506. because this will produce a greyed out path with an unknown file icon if the
  507. floppy is empty when the Option is run.
  508.  
  509.     Option "Root" -sub "Command:Filer_OpenDir ADFS::4.$"
  510.  
  511. This will open a filer window of your root directory if you click on the
  512. option or move the pointer over the SubMenu.
  513.  
  514.     Option "Pinboard" -sub "OldMenu:"
  515.  
  516. This will open the menu that should have been opened when you clicked the
  517. pointer.  So if you opened the menu over the pinboard, but wanted to see the
  518. pinboard menu then you could click or slide this option.
  519.  
  520.     Option Here -sub "Path:<Director$CurrentDir>"
  521.     Option Copy -sub "Save:<Director$CurrentPath>"
  522.  
  523. These options are useful for the MenuMenu (see the section titled MenuMenu
  524. and the section titled SaveBox).
  525.  
  526.     Option Info -sub Info:
  527.     Option Quit
  528.         Command Quit:
  529.  
  530. Helps bring an air of normality to Director by providing the standard Quit
  531. and Info choices!
  532.  
  533.  
  534. Memoriser
  535. =========
  536.  
  537. Director notices whenever you load a file or click on a drive and keeps a
  538. record of the fact.
  539.  
  540. If you then ask for the menu Memoriser: to be opened then you will get a menu
  541. with these files or directories in it.
  542.  
  543. This acts exactly like a normal directory Menu, except it has all your most
  544. recently used files/directories in it.
  545.  
  546. This is exceedingly useful when you traverse a large directory tree, open a
  547. file to have a look at it, close it, and then realise that you want to see
  548. the file again.  All you have to do is open the Memoriser menu and it will be
  549. there sitting at the top.
  550.  
  551. The number of items that are kept in the Memoriser menu is definable by you
  552. with the command
  553.  
  554.     Syntax: MemoriserItems <number>
  555.  
  556. This will not affect the currently built up number of items.  If you set it
  557. to 0 then no more items will be added to the menu.  This effectively turns
  558. the feature off.  0 is the default value.
  559.  
  560.  
  561. MenuMenu
  562. ========
  563.  
  564. A menu with name defined by the system variable Director$MenuMenu (defined by
  565. you) is opened whenever you click Menu on a path item or click Menu on the
  566. second option in a Filer Menu (the one that reads "File '!Run'" or
  567. "Selection") provided one and only one file is selected in the Filer window.
  568.  
  569. This menu deals with files and directories.  You should put on it things
  570. which you want to do to files.
  571.  
  572. Here is an example of a MenuMenu
  573.  
  574. Set Director$MenuMenu MenuMenu
  575.  
  576. Menu "File Menu" "MenuMenu"
  577.     Option Here -sub "Path:|<Director$CurrentDir>"
  578.  
  579. This allows you to see a directory Menu of where the selected file or
  580. directory is.  (See the section on GSTrans for the reason behind the | in the
  581. -sub string.)
  582.  
  583.     Option Copy -sub "Save:|<Director$CurrentPath>"
  584.  
  585. This allows the current file or directory to be copied to a filer window,
  586. dragged to an application or pinned to the pinboard (drag the icon onto the
  587. pinboard).
  588.  
  589.     Option "Set CSD"
  590.         Command Dir <Director$CurrentDir>
  591.  
  592. Sets the Current Directory to the directory in which the file or directory
  593. was found.
  594.  
  595.     Option "Open Directory"
  596.         Command Filer_OpenDir <Director$CurrentDir>
  597.  
  598. This opens a Filer Window onto the directory in which the file or directory
  599. was found.
  600.  
  601.     Option "Filer_Run"
  602.         Command Filer_Run <Director$CurrentPath>
  603.  
  604. This is equivalent to double clicking on the File or Directory.
  605.  
  606.     Option "Pin"
  607.         Command SWI OS_Mouse TO x y|M
  608.             Pin <Director$CurrentPath> |<x>-90 |<y>+45
  609.  
  610. This pins the file or Directory to the pinboard. (The command should be
  611. written all on one line).  It uses the SWI Module to read the current
  612. position of the mouse and then pins the centre of the icon there.  (Note the
  613. |<x>, this is GSTransed to at run time <x> when the Command is being
  614. prepared, which is then GSTransed to the mouse x co-ordinate when the Pin
  615. command is run.)
  616.  
  617.     Option "IconSprites"
  618.         Command IconSprites <Director$CurrentPath>
  619.  
  620. This IconSprites the file or directory.  (Only really useful over a sprite
  621. file.)
  622.  
  623. EndMenu
  624.  
  625. There are many other possibilities for the MenuMenu, such as SetType,
  626. ToolSprites, Delete, Wipe, Access etc.  A MenuMenu is perhaps best defined as
  627. a dynamic Menu.
  628.  
  629.  
  630. Pinboard
  631. ========
  632.  
  633. A menu of this name (defined by you) is opened whenever you click Menu on the
  634. pinboard backdrop or on a TinyDirs icon.
  635.  
  636. If the pinboard module isn't loaded or running, no error is produced, but
  637. none of the things in this section will work.
  638.  
  639. If you want to use the Pinboard's menu then you can press any of SHIFT, CTRL,
  640. ALT when clicking Menu and the old Menu will appear.
  641.  
  642. Alternatively on your Pinboard menu you can have an option
  643.  
  644.     Option Pinboard -sub OldMenu:
  645.  
  646. Which when clicked on or slid over will open the menu that would have been
  647. opened if Pinboard had been left to its own devices.  It will also move the
  648. pointer to be in the correct place.
  649.  
  650. (I debated long and hard about moving the pointer (which I dislike), but
  651. decided this was the least confusing option.  Try it for yourself!)
  652.  
  653.  
  654. SaveBox
  655. =======
  656.  
  657. Read the section on special forms of Menus and commands if you haven't
  658. already done so.
  659.  
  660. The SaveBox is not like a true SaveBox it is more like a miniature Filer
  661. window (except you can't (yet) double click on the icon).  You may drag the
  662. icon from a SaveBox to an application (equivalent to dragging it from the
  663. Filer) the pinboard (ditto) or a Filer window, which will copy the File in
  664. the way you have configured (possibly bringing up a Filer Action window etc).
  665.  
  666. There is only one SaveBox and if you try to open it twice the first one
  667. disappears/changes into the new file/directory.
  668.  
  669.  
  670. Keys
  671. ====
  672.  
  673. Any Menu or Menu Option can have a hot key assigned.
  674.  
  675. A hot key assigned to a menu (in the Menu command) will open the Menu when
  676. used and a hot key assigned to a Menu Option will be equivalent to clicking
  677. with select on a Menu Option when used.
  678.  
  679. Keys are added by name and possibly with a modifier.
  680.  
  681. A single letter key refers to that key eg -key M or -key 8.  Keys are case
  682. insensitive (and independent of CapsLock) so -key m is equivalent to -key M.
  683.  
  684. Some keys are referred to by name (case insensitive), and these are
  685.  
  686.     Home, Return, Ret, Enter, Backspace, BkSp, Space, Delete,
  687.     Del, Esc, Print, Pnt, F1, F2, F3, F4, F5, F6, F7, F8, F9,
  688.     Tab, Copy, Cpy, End, Left, Right, Down, Up, PageDown, PgDn,
  689.     PageUp, PgUp, F10, F11, F12, Insert, Ins
  690.  
  691. Some of them are named twice for your convenience.  So -key F1, -key f1 or
  692. -Key Insert would be valid.
  693.  
  694. Possible modifiers are
  695.  
  696.     ⇧    SHIFT
  697.     ^     CTRL
  698.     ~     ALT
  699.  
  700. (To get the ⇧ symbol, hold down ALT, type 139 on the numeric keypad and
  701. release ALT.  Alternatively map character 139 to a key in your favourite
  702. editor (CTRL-6 is a good mapping).)
  703.  
  704. These can be added (in any order) before a key name, indicating that you have
  705. to press the modifier keys indicated with the main key in order to activate
  706. the hot key.  eg
  707.  
  708.     ^M        CTRL-M
  709.     ⇧A        SHIFT-A
  710.     ^⇧F1 = ⇧^F1    SHIFT-CTRL-F1
  711.  
  712. Note that -key ⇧A = -key ⇧a which is not equal to -key A = -key a.
  713.  
  714. Some key combinations don't work, eg
  715.  
  716.     CTRL Number keys don't work, CTRL KeyPad numbers should
  717.     No keys work with ALT!
  718.  
  719. These may be fixed in a future release!
  720.  
  721. If an Option or a Menu has a key definition it is added to the text/title
  722. with a space before it.  If you want the items to line up then you will have
  723. to add spaces after the text/title.  RISCOS 3.5 will line them up for you
  724. provided the key definitions starts with ^ or ⇧ or is one of the long form
  725. named keys above.
  726.  
  727.  
  728. Colours
  729. =======
  730.  
  731. Any colours in Director are specified numerically from the 16 Wimp colours. 
  732. These colours can be seen by clicking on the Palette icon (supplied with
  733. versions of RISCOS < 3.5).  The numbers of each colour are given below.
  734.  
  735. If you are using a lot of colours or just want to make your menus neater, you
  736. can define names for the colours using SetEval.  Just put this block of
  737. definitions in your menu before you use the named colour.
  738.  
  739. SetEval White    0
  740. SetEval Grey1    1
  741. SetEval Grey2    2
  742. SetEval Grey3    3
  743. SetEval Grey4    4
  744. SetEval Grey5    5
  745. SetEval Grey6    6
  746. SetEval Black    7
  747. SetEval Blue    8
  748. SetEval Yellow    9
  749. SetEval Green    10
  750. SetEval Red    11
  751. SetEval Cream    12
  752. SetEval Khaki    13
  753. SetEval Orange    14
  754. SetEval Cyan    15
  755.  
  756. These can be used wherever a colour is needed, eg
  757.  
  758.     Option "Unreadable" -bg Red -fg Khaki
  759.  
  760.  
  761. Dynamic Menus
  762. =============
  763.  
  764. These are menus that are created just before the menu is opened rather than
  765. when you run Director.
  766.  
  767. They are used from an extended menu "Dynamic:Filename".  When this command is
  768. run the file or command "Filename" is run.  When the command or file finishes
  769. executing Director will try to open the menu whose name is in the system
  770. variable Director$Menu.
  771.  
  772. A simple example of a dynamic menu would be this
  773.  
  774.     Option "Time" -sub "Dynamic:DirectorObey Director:Menus.Time" -key ^⇧T
  775.  
  776. This will run the command "DirectorObey Director:Menus.Time" when this menu
  777. option is run (or ⇧^T is pressed).  The contents this file might be
  778.  
  779.     Menu "" Time -temp
  780.         Option "**The Time Was**" -fg 11
  781.         Option "   <Sys$Time>   "
  782.         Option "<Sys$Date> <Sys$Year>"
  783.     EndMenu
  784.  
  785.     Set Director$Menu Time
  786.  
  787. This creates a temporary menu called Time with the current time and date in
  788. it and returns the string "Time" in Director$Menu for Director to use as the
  789. name of a menu to open.
  790.  
  791. Because the menu was created as a temporary menu it will be deleted once it
  792. has been displayed to conserve memory (since it is rebuilt each time it is
  793. needed).
  794.  
  795. Dynamic menus are very useful for displaying lists of things that could vary
  796. whilst Director is running (such as modules or filetypes).  A few examples of
  797. dynamic menus are provided in the Menus directory inside Director.
  798.  
  799. It would be posible to simulate most of the other features of Director using
  800. dynamic menus, however in their current implementation they require a disc
  801. access per use.  It would be possible to register the dynamic menu files in
  802. the resource filing system to avoid this and mybe a future version of
  803. Director will do this for you.
  804.  
  805.  
  806. Icons
  807. =====
  808.  
  809. Icons are created in a similar way to menus.  Each one must be named (case
  810. insensitive) by its sprite name or an alias name provided by you and there
  811. can only be one of each name.  If you create an icon with the name of a
  812. already existing one then the existing icon will be deleted without warning
  813. and the new one created.
  814.  
  815. You may attach menus for Select, Adjust and Menu for the icon.  Remember that
  816. the menus can also be commands (see the section on Special forms of Menus and
  817. Commands)
  818.  
  819. This creates a new icon bar icon with attached menus. The icon is referred to
  820. by the name of its sprite or the alias name if supplied.
  821.  
  822.     Syntax: *DirectorIcon
  823.         <sprite>
  824.             Name of the sprite, must be provided and exist in the
  825.             Wimp sprite pool
  826.         [-alias <name>]
  827.             Internal name of the Icon.  If this is not supplied
  828.             then the icon is referred to by its sprite name.
  829.         [-text <text>]
  830.             Text to go under the Icon.  Optional.  If the -time
  831.             option is used then this Text defines the length of
  832.             the time string.
  833.         [-left|-right]
  834.             Whether the icon goes on the left of the Icon bar or
  835.             the right.  If omitted will default to -left.
  836.         [-priority <priority>]
  837.             This controls the positioning of the icon.  Larger
  838.             numbers are to the outside of the icon bar. Range
  839.             from 0 (inside) - &7FFFFFFF (outside).  Experiment to
  840.             see where your icons gets placed or look at 3-98 in
  841.             the RISCOS 3 PRMs.
  842.         [-time <format>]
  843.             This makes the text under the icon be interpreted as
  844.             a time, which is updated once per second.  The length of
  845.             the time is set by the -text option.  See the
  846.             Applications Guide, under !Alarm, "Time and date
  847.             formats" for more details or the RISCOS 3 PRMs 1-402.
  848.         [-menu <menu>]
  849.         [-select <menu>]
  850.         [-adjust <menu>]
  851.             These allow you to attach menus or commands to the 3
  852.             mouse buttons.
  853.  
  854. For example (these should be typed in on 1 line, but have been split for
  855. clarity)
  856.  
  857.     DirectorIcon romapps Apps -left -priority &50000000
  858.         -menu "Path:Resources:$"
  859.         -select "Command:Filer_OpenDir Resources:$.Apps"
  860.         -adjust Pinboard
  861.  
  862. This provides a replacement Apps icon which has the Pinboard menu on Adjust,
  863. does the normal this on select, and on menu (which would normally say
  864. "Open $") produce a directory menu of the whole of Resources which is usually
  865. much more useful.
  866.  
  867.     DirectorIcon !Director "00:00:00" -left -priority &0E000000
  868.         -menu IconMenu
  869.         -select IconClick
  870.         -adjust Pinboard
  871.         -time <37>24:%MI:%SE
  872.  
  873. This produces an icon with Director's own icon, the current time in 24 hour
  874. format and 3 menu IconClick, IconMenu and Pinboard.
  875.  
  876. [NB <37> GSTranses to %.  This odd looking construction is necessary because
  877. %2 refers to the second argument supplied (when Obeying the file, not in
  878. DirectorObey).  Since no arguments were supplied then the time string is
  879. converted to 4:%MI:%SE which is not what was required!  <37> is used rather
  880. than %% so the file will work with Obey and DirectorObey]
  881.  
  882.  
  883. Directory Menus
  884. ===============
  885.  
  886. Directory menus are automatically created and destroyed by Director when you
  887. click with Menu on the title bar of a Filer or other window with a valid path
  888. in it (eg an Edit window).  They are also produced by -path "directory" or
  889. Command "Path:Directory" etc.
  890.  
  891. A menu will appear with all the file that are in the directory in it.  It is
  892. intended to be complementary to the  Filer, quicker to use, but not as
  893. powerful.
  894.  
  895. Each item in the menu has the name of a file or directory and its icon.  This
  896. is very similar to a filer window with sort by name, small icons and adjusted
  897. to be tall and thin.
  898.  
  899. Items in the menu that are directories (or image files) will have a SubMenu
  900. arrow by them.  You may traverse this arrow to see the next directory down.
  901.  
  902. Clicking with Select or Adjust is equivalent to double clicking the file in a
  903. filer window.
  904.  
  905. Clicking with Menu over an Item will bring up the MenuMenu (see that section
  906. for more details).  If a MenuMenu is not defined then it will do nothing.
  907.  
  908. Directory menus come in 2 flavours, with and without "Up Menus".  Up Menus
  909. are the directories above the dotted line.  These show the directories up to
  910. the root from where you are now.  The first item above the dotted line never
  911. has a sub-menu because the item or the contents of that item are always
  912. visible.
  913.  
  914. A directory menu made by "Path:" has Up Menus (eg the ones produced by
  915. clicking Menu over a title bar).  A directory menu made by -path does not
  916. have Up Menus by default unless you use the -up switch.
  917.  
  918.  
  919. Other Features
  920. ==============
  921.  
  922. If you do an Adjust click on a drive icon on the icon bar it should open a
  923. Directory Menu rather than a Filer window.  Works for ADFS, Acorn SCSI, MOFS,
  924. RAMFS, Memphis, CFS, CDFS and Resources.  It will work for other filing
  925. systems provided they have been written in the way suggested in the PRMs!
  926.  
  927.  
  928. Other Commands
  929. ==============
  930.  
  931.     Syntax: *DirectorMemory
  932.  
  933. This shows the memory used by Director in the following form
  934.  
  935.     Program code      18000
  936.     Workspace          3536
  937.     Heap              16496 (117 blocks)
  938.     ———————————————————————
  939.     Total             38032 Bytes
  940.  
  941.  
  942.     Syntax: *DirectorObey <file> [-verbose]
  943.  
  944. This command is equivalent to *Obey except it searches for Director *commands
  945. with high priority. Obey is quite slow when processing lots of commands so
  946. this speeds up loading a file with lots of Director commands in it. 
  947. DirectorObey cut the loading time of a 14k menu from 5.2 seconds (with Obey)
  948. to 0.75 seconds, ie a speed up of nearly 7 times!
  949.  
  950. It should be exactly equivalent to Obey, excepting the fact that it doesn't
  951. substitute arguments (eg %0 and %%).  This means you have to be a bit careful
  952. with %'s if you want your menus to work with Obey and DirectorObey.  (See the
  953. Icons section about -time for an example.) The -verbose or -v option is
  954. useful for debugging.
  955.  
  956.     Syntax: *MenuProcessing <On|Off|1|0|Yes|No>
  957.  
  958. This stops and restarts the processing of Menu, EndMenu, Option, Command and
  959. Dash (ie all the menu commands).  This is so that you can comment out bits of
  960. your menus.  For example if the machine you are running the menu on has no
  961. SCSI card installed then there is no point having the SCSI menus installed
  962. and you could check for this at menu load time.
  963.  
  964.     Syntax: *DirectorDo <command>
  965.  
  966. This GSTrans the command line and then runs it.  This is useful for commands
  967. such as Filer_Run which don't GSTrans their input, but you want to give a
  968. string with a system variable in it.  You can also run a command from a
  969. system variable with this command.
  970.  
  971.     Syntax: *ListMenus
  972.  
  973. This lists the currently defined menus.
  974.  
  975.     Syntax: *ProcessKeys [[⇧][^]<key>|"<string>"]^
  976.  
  977. This sends the parameters to the current input focus, or hot key grabber.  It
  978. should work outside the Wimp, provided the keys are mapped as in the Wimp. 
  979. It takes a space separated list of either strings to be put into the keyboard
  980. buffer or key descriptions (see Keys section). You can of course map these
  981. onto keys for hot key actions.  For example
  982.  
  983.     ProcessKeys "Modules" Return
  984.     ProcessKeys F6 ^Left Down F6 ^Up ^V
  985.     ProcessKeys "Show Obey$Dir" ^M
  986.     ProcessKeys "42 Solution Road" ^M "Toytown" ^M "Shireshire" ^M
  987.     ProcessKeys TAB "Option -path "
  988.  
  989. A chars menu could be provided using this, or a menu of frequently used
  990. commands for command based application.
  991.  
  992.     Syntax: *DirectorEdit <file>
  993.  
  994. This loads the file given into an text editor (if one is loaded).  It is
  995. useful for transferring files that are not type Text to an editor.
  996.  
  997.     Syntax: *DirectorParsePath <path>
  998.  
  999. This parses the path supplied into 3 system variables Director$CurrentPath
  1000. Director$Leaf and Director$Dir.  This is the routine that is used internally
  1001. by Director to set these variables and can occasionally be useful externally.
  1002.  
  1003.     Syntax: *DirectorMouseDir <var_name>
  1004.  
  1005. This sets the supplied system variable to the path of the window the pointer
  1006. is over.  This is used to set the current directory from a key in the default
  1007. menu.  It also works over Edit or Zap windows and will return the directory
  1008. that the file is in.  If the pointer is not over a window with a valid path
  1009. in the title then the system variable will be set to the null string ("").
  1010.  
  1011.  
  1012. External Interface
  1013. ==================
  1014.  
  1015. If you Broadcast the following UserMessage
  1016.  
  1017. 0    Total length of message rounded up to nearest 4
  1018. 12    0
  1019. 16    &4A100
  1020. 20    X Co-ord
  1021. 24    Y Co-ord
  1022. 28    Mouse button state
  1023. 32    Window handle
  1024. 36    Icon number
  1025. 40    Null terminated menu name (or extended menu)
  1026.  
  1027. Director will display the menu (or run the command etc) at the position
  1028. specified.
  1029.  
  1030. Note bytes 20-39 are as returned from Wimp_GetPointerInfo.
  1031.  
  1032.  
  1033. SWIs
  1034. ====
  1035.  
  1036. &4A100    Director_Menu
  1037. &4A101    Director_EndMenu
  1038. &4A102    Director_Option
  1039. &4A103    Director_Dash
  1040. &4A104    Director_Command
  1041.  
  1042. Pass a pointer to the command line for the equivalent star command in r0. 
  1043. These are defined because processing star commands is very slow and in
  1044. dynamic menus especially it is important that items can be added to menus
  1045. quickly.
  1046.  
  1047.  
  1048. Debugging your Menus
  1049. ====================
  1050.  
  1051. If you are having trouble with your menus when you load them (they give a
  1052. funny error and you don't know why) try opening a TaskWindow (CTRL-F12) type
  1053. in "DirectorObey -v " and SHIFT drag your menu file to the window.  This will
  1054. print out commands as they are executed and you should be able to spot
  1055. exactly when it goes wrong.
  1056.  
  1057.     Option "Debug"
  1058.         Command TaskWindow "DirectorObey -v <Director$Dir>.Menus.Menu"
  1059.  
  1060. Would put this on a Director menu for you!  (Substitute the correct name and
  1061. path of your Menu.)
  1062.  
  1063. Another thing to bear in mind is that if you reference a menu that you
  1064. haven't created eg
  1065.  
  1066.     Option "Hello" -sub "NotThere"
  1067.  
  1068. Where menu "NotThere" hasn't been created, this will not produce an error at
  1069. load time, and at run time it will just fail to produce the menu (not
  1070. producing an error either).  Originally it produced an error, but this proved
  1071. very annoying in other circumstances (eg when you haven't defined a Pinboard
  1072. menu because you don't want one).
  1073.  
  1074. You may refer to one menu more than once in a menu tree, however menus can
  1075. only be on the screen once so if you tried to open a SubMenu of a Menu that
  1076. was already displayed then nothing would happen.  However if you clicked on
  1077. the Option (provided it had no Command attached) it would then open the Menu
  1078. referred to.
  1079.  
  1080.  
  1081. Oddities
  1082. ========
  1083.  
  1084. If you are running RISCOS 3.5 and wonder why your Menu titles are justified
  1085. all wrong (my menu is called "Nick's Menu" and the Menu gets right justified)
  1086. it is because you have included a reserved key name as the last word.  This
  1087. is RISCOS being helpful and lining up your key short cuts in Menus.  It
  1088. doesn't line up a key short cut of M for instance and will attempt to line up
  1089. anything with the last word "Menu"!  The solution is to put a hard space
  1090. before the "Menu" (hard space is ALT-SPACE).
  1091.  
  1092. If you put a -path <Director$CurrentDir> on your MenuMenu then beware,
  1093. looking at this Directory Menu will cause Director$CurrentDir and
  1094. Director$CurrentPath to change, so if you look at it again, you will be
  1095. looking up one level in the directory viewer.  This can be fixed by using a
  1096. dynamic menu as your MenuMenu (the default menu can be configured to do this,
  1097. look at its start).
  1098.  
  1099.  
  1100. Utils
  1101. =====
  1102.  
  1103. There are a few utilities provided with Director to make Commands more
  1104. powerful and to make your life easier.
  1105.  
  1106.     ExpandMenu    For converting old Pinboard+ menus to Director form
  1107.     RunFilerAc    For starting off Filer_Action tasks (see example menus)
  1108.     SwiModule    To be able to issue SWIs from the command line
  1109.     IfPodule    For finding out whether a podule is installed
  1110.     IfThereIs    For finding out whether a file/directory exists
  1111.     DriveName    For discovering the name of a drive from a path
  1112.  
  1113. You'll find these in the Utils directory within Director.  See there for
  1114. further documentation.
  1115.  
  1116. The SWI Module is very useful for building interesting commands but is not
  1117. essential to the operation of Director so you can stop it being loaded by
  1118. default by commenting out that line in the !Run file if you desire.
  1119.  
  1120.  
  1121. Planned Extensions
  1122. ==================
  1123.  
  1124. These go from will do definitely, to probably won't ever do, but nice idea!
  1125.  
  1126. A command to allow general purpose filtering of MouseClicks on other tasks. 
  1127. This would mean you could configure the Menu over Pinboard function.  This
  1128. would also allow ALT-Menu over Filer windows.
  1129.  
  1130. A command to allow general purpose filtering of low level mouse clicks.  This
  1131. would mean you could configure the clicks over the title bars (and over any
  1132. other icon in the window surround).
  1133.  
  1134. A command to open a menu.
  1135.  
  1136. A command to Delete a Menu, all Menus, an Icon or all Icons.
  1137.  
  1138. A command to add options to previously created menu (technically very easy).
  1139.  
  1140. -icon for Option to specify an icon in a text entry.
  1141.  
  1142. -noicon for a Path option for suppressing the icon.
  1143.  
  1144. A command to define menu colours for permanent and temporary menus.  Should
  1145. be able to define the title bar colours as well.
  1146.  
  1147. Auto scrolling for menus.
  1148.  
  1149. An extension to the Icon command to allow a command to be run when a file is
  1150. dragged to the icon.
  1151.  
  1152. An extension to the Icon command to allow a command to be run when the Icon
  1153. is dragged to a filer window or possibly an application.
  1154.  
  1155. Auto IconSprites or Filer_Boot applications
  1156.     1) Never
  1157.     2) When building permanent menus
  1158.     3) All the time
  1159.  
  1160. Holding down CTRL when making an auto menu could Filer_Boot the applications
  1161. within.
  1162.  
  1163. A Command run when Menu is pressed over a normal text item.
  1164.  
  1165. Make Director menus into windows.  Make the path options draggable and the
  1166. menu options clickable.  Make the menus persistent if torn off.
  1167.  
  1168.  
  1169. Thanks
  1170. ======
  1171.  
  1172. [Your name could go here if you send me interesting menu options, bug
  1173. reports, comments, ideas or even just tell me that you are using Director!]
  1174.  
  1175. Thomas Olsson, Julian Smith, Ben Summers, Jens Ovesen and Franz Philipps for
  1176. writing a set of excellent utilities which gave me lots of ideas for
  1177. Director.
  1178.  
  1179. Jonathan Coxhead for OSLib.
  1180.  
  1181. Jens Ovesen for very kindly allowing me to distribute his excellent and
  1182. indispensable SWI module with this application.
  1183.  
  1184. Dominic Symes for Zap.  No programmer should be without it.
  1185.  
  1186. Phil Slingsby for thinking of the name.
  1187.  
  1188. Dave Lawrence for testing, the original idea (and code) of creating Pinboard+
  1189. menus from a textual form, ExpandMenu, IfPodule, IfThereIs, DriveName and
  1190. loads of other ideas and suggestions (some of which I've almost certainly
  1191. credited to myself ;-)
  1192.  
  1193. My wife Loveday.
  1194.  
  1195.  
  1196. Contacts
  1197. ========
  1198.  
  1199. Post:    Nick Craig-Wood
  1200.     4 Victoria St
  1201.     Wolverton
  1202.     MILTON KEYNES
  1203.     MK12 5HL
  1204.  
  1205. EMail:    director@axis.demon.co.uk
  1206.  
  1207. BBS:    Arcade (0181 654 2212), User 939 (Nick Craig-Wood)
  1208.  
  1209. Any bug reports, ideas, donations gratefully accepted.
  1210.