Search Locate Previous Next Contents

Adding a ‘Most Recently Used’ List

A final touch to make your file system really user-friendly is to include an MRU list on the file menu. The idea is that whenever the user opens a file, or saves an existing file with a new name, the file is added to the list at the bottom of the file menu, or rippled to the top if it is already there. To add an MRU, select it from the Special submenu in the designer – it will appear as another small square which I have placed under the existing NOSE. Set up its data as:

Filename: ‘file

Specification: 'file' 'tutor' 6

As with the NOSE, it has the file name as the main data expression, so it will update this variable automatically for you..

The Specification is to tell it which menu to hang on, which .INI file to store the list in, and how many entries to save. Typically you would attach it directly to the ‘file’ menu (so that the recent files came below File,Exit on the menu) but another option is to make a completely empty menu as a child of the file menu and hang it from here:

[file]
 &Open .... etc
 &Recent files>recent
[recent]

.... and so on. This way you can have a much longer list (say 20 files) without overloading an already large menu.

It will make a new .INI file section the first time you use it (the .INI file will be created in the Windows directory if it does not already exist), with entries like:


[Recent File List]
File1=C:\DATA\DWS\Joe.con
File2=C:\DATA\DWS\Test.con

... and these will automatically appear at the bottom of the menu you specified (the ‘file’ menu in the example).

The action table must (of course) ask the nose to open the selected file, but this time it passes in the name and so bypasses the file dialogue:

      Disp (dbx.main[;1]¼›’MRU’)œdbx.main[;5]

ÚÎÎÎÎÎÎÎÎÎÎÎÎÎÂÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ

ÛFile name ÛÚÎÎÎÎÎÎÎÎÎÎÂÎÎÎÎÎÎÎÌ Û

Û ÛÛExpressionÛ‘file Û Û

Û ÛÃÎÎÎÎÎÎÎÎÎÎÏÎÎÎÎÎÎÎÝ Û

Û ÛÛDependenceÛ{‘file}Û Û

Û ÛÀÎÎÎÎÎÎÎÎÎÎÁÎÎÎÎÎÎÎÙ Û

ÃÎÎÎÎÎÎÎÎÎÎÎÎÎÏÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÝ

ÛSpecificationÛÚÎÎÎÎÎÎÎÎÎÎÂÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û

Û ÛÛExpressionÛ’file’ ‘tutor’ 6Û Û

Û ÛÀÎÎÎÎÎÎÎÎÎÎÁÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ Û

ÃÎÎÎÎÎÎÎÎÎÎÎÎÎÏÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÝ

ÛBehaviour ÛÚÎÎÂÂÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÂÎÎÎÎÎÌÛ

Û ÛÛFOÛÛnose ’Do ‘Open’ (œ¾)Û{} ÛÛ

Û ÛÃÎÎÏÏÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÏÎÎÎÎÎÝÛ

Û ÛÛFOÛÛinx„1 Û{inx}ÛÛ

Û ÛÀÎÎÁÁÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÁÎÎÎÎÎÙÛ

ÀÎÎÎÎÎÎÎÎÎÎÎÎÎÁÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ



Continue to: Calling a Subsidiary Dialogue (Using a Grid)
© Copyright Causeway Graphical Systems Ltd 2001