[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Menus (not) in Xy4



Annie Fisher's post brings up the intriguing (to me at least)
question of why and whether to use menus. I'm not sure I
disagree with Carl that there's 'nothing' in the menus that you
can't do with the command line, or a little XPL. But I can't
think of a good reason to do XPL programming just to avoid
dialog boxes. In fact, I just rewrote some ZIP and UNZIP
routines so that they would run from dialog boxes instead of via
a combination of command-line prompts. What with the built-in
error-checking and other features, I managed to cut the amount
of code roughly by half -- and add a feature or two. But Annie
raises good points (as always), and I've been thinking about how
I use and don't use menus. I use them for the complicated stuff
-- wildcard searches
, search-and-extract, building frames, importing pictures, doing
multiple columns. I almost never use the menus for Open, New,
Save, etc., unless I have a special need (such as using a
template). This is true even though I've rewritten the Open
dialog and the SaveAs dialog to provide more features.  Also, I
tend to write little ad-hoc XPL programs for special purposes.
They contain very little error trapping, etc. Sometimes I
decide that an XPL routine needs to be in my command file or
dialog-box file; then I add more whistles and bells, mostly
having to do with error trapping and easier-to-use interface.
The rationale for making menus out of routines is based on either
 frequent use (make the interface quicker) or infrequent use
(help me remember what the heck the thing does, and keep me from
forgetting possible errors that can waste my time).

The impetus behind the menu system was IBM's insistence that we
adopt CUA -- common user access -- conventions. These are very
much like Windows conventions regarding key assignments,
location of menus, the "look" of dialog boxes, and so on. I
don't think it was a mistake. I use several applications
besides XyWrite, and the interfaces work more or less the same --
even XY4DOS in a DOS box. But the transition from XY3 was not
completely easy. I still occasionally hit F1 to begin a define!
 We fought to keep the command line, especially in the Win
product. Again, I think we were right.

XY4DOS (and even XYWin) can be set up to look and work just like
XY3, or pretty close. But even with a minimal installation, why
bother? XY3 is smaller and faster.

Robert's suggestion of loading the menu/dialog and using them
minimally makes sense to me. The cost is not very high -- about
750KB of disk space and minimal memory (the menus/dialogs don't
all load in memory at once).

Now to answer some questions:
1. The stuff I offer is based on the menu/dialog system -- it's
an extension and enhancement of the stuff that ships with
XY4DOS. It also includes some enhancements to command-line
stuff, like wildcard copying, etc.
2. Annie, you can get a view of your Save/Gets. Assign the
function SD to a key -- that'll give you a scrollable list of
the first line or so of all your S/Gs. Assign the function SK
to another key. When you press it, you'll be prompted for a
key, and then the contents of that key will be displayed. I
don't *think* you need the menus for either of these. And you
can try it out by typing 'FUNC SD' or 'FUNC SK' on the command
line and pressing Enter. You can also save the contents of a
Save/Get to a file with 'SAVE %x', where 'x' is a key
assignment. The file created will be 'x.SAV'. If you want to
give another name to it, you can. If the key is H, for instance
and you want the file to be 'ANNIE.PGM, you would type 'SAVE
%H,ANNIE.PGM'. No menus needed!  (You can do this with any
Save/Get, even an empty one. An XPL program can create a
zero-byte file with ≪SV01,≫BX sa %01,filename.ext Q2. It will
automatically overwrite an existing file, so be careful!)

Enough for now.

Cheers,

T.