By Peter J. Morris [peetm]

Best viewed at 1280 x 1024 [sorry, I'm useless at web stuff]


Part 1: The 16-bit and 'Book Days'

bullet

Graphical CPU Load

bullet

Fonts in Menus

bullet

Is it a Toolbar or a Menu

bullet

Tear-off Menus

bullet

Personalised Menus - Sort of

bullet

Some Shell Functionality

 

[Part 2: The 32-bit Days]


You perhaps know how it is ...

I was writing a book called 'Windows - Advanced Programming and Design', and in doing so, I created what I thought were a few neat ideas and bits of code, that others would find interesting.

What I didn't think of was to patent any of those ideas [hey, I'm just a programmer]!

About the book ...

The book took two and a half years to write [910 pages], and code-wise, used a mixture of C and assembler for all its examples.

Most of it was written with pre-release builds of Windows 3.0.  It was finally published in the very early 90s [Windows 3 shipped on May 22nd 1990 - I know, coz I was there].

Never heard of it [the book that is]?  Well, see the ending for the probable reason!

First though, on to the things I should have patented perhaps.


 

Nowadays, when we want to know if our machines are CPU-bound, we're all used to hitting Ctrl + Alt + Del to get to the task-manager - and from there to the performance pane.

XP's 'Perf Meter'

Well, on the right you'll see my late 80s attempt at producing something like what we see today ...  shown running with/without caption/title-bar - and, if I remember right, it was 'top-most' and draggable, even without the caption.  It also ran as an icon [there was no tray back then].

Ok, so I didn't add a gauge showing the percentage ratio being used, and nor did I do a grid, or use colour.  Still, the main function is there for all to see.

It was a long time ago now, but I'm certain that there wasn't anything like this available anywhere else.


 

Again, I can't remember anyone else having this at the time - and yet the idea seemed so simple [and great was the need]: shouldn't you be able to see a sample of a font before you pick it!

Back Then ...

In other words, we used to have this kind of stuff [small mid section snapshot] in the font's menu.

So, when you selected a font, you only got to know what your text would look like post-selection.

I therefore decided to draw my Font menu's items using the actual font - for the font's name as it appears in the menu.

 

If memory serves, this was a pretty easy thing to do with Windows 3, the only limitation being the time it took to actually draw the menu.  I got around that by doing some 'off screen' stuff though - no big deal, and I think it took just a few hours work.

Ok, so I didn't get around to coming up with a neat solution to displaying symbolic fonts, although to substitute the particular font for the system font would have been easy - perhaps with a bracketed (sym) added to its name?

Q. What happens if you've got more fonts that can fit on the menu?  

Back then, the menu would go off screen - if I remember right, it would go off the top and bottom an equal amount, i.e., it would leave only the centre of the menu visible on-screen. Hmmm.  More on how to fix that problem can be found further below.


 

Doing the menu 'font thing' above got me thinking about other ways to improve menus.

For example, I often remember getting extremely frustrated when some app's menu contained a couple of things that I wanted to select.

You know how it goes - navigate to the top-level menu, select it, and then select item 1 from that sub-menu.  What happens next - the sub-menu goes away.  So, you repeat.  Navigate to the top-level menu, select it, and then select item 2 of the sub-menu!

Annoyance here grows exponentially with the number of items you want to select!

So, why not have a menu attribute/API that would create menus that didn't disappear - that is, not until you told them to?

Some history:

Now, this wasn't new, as Presentation Manager had this type of menu already [that's OS/2's PM for those that remember such things].  I worked a bit on PM and I really liked this feature - and, if PM had it, well I thought, why shouldn't Windows!

 

At the time, I remember trying to convince the lead programmer on the Windows team that this should be put into 3.0; I guess that, as it wasn't, he wasn't interested [not invented here perhaps?]

So there you have it - non-dismissible menus in Windows 3.0

Anyway, I'm pretty sure that IBM would have patented this, so it's not one I'm dwelling on here.  However it did lead on to something else that I wish I had patented - something that explains this item's title - toolbar or menu.


[Aside]

We didn't have toolbars back in the late 80s or early 90s, so everything was done through menus - or dialog boxes [which were usually modal].

That didn't seem ideal to me.  What was wanted was someway of keeping handy options available.  Modeless dialog boxes were a possibility - but that seemed like overkill to me - and they'd take up too much room, and you'd have to cope with the modeless nature of interaction with the user [the likely reason why dialogs are mostly modal to start with].

So, as the only non-modal things we really ever used then were menus [and you could argue that even these were modal], it had to a menu thing.

With this you could move menus around, and place them wherever you wanted - meaning that their functionality was always available. 

If you think about it, the result was that you could have multiple non-dismissible menus that could be placed according to the user's preference, i.e., you're left with a floating toolbar type of gadget here!

In the picture you'll see my solution to the problem - something which kind of built on to the non-dismissible menu idea above.

The menus on the right each have an extra item on them - like the 'Dismiss Menu' item show earlier.

Here the item says 'Tear Off', and that's exactly what it did i.e., when this was selected, the menu became a floating window in its own right - and with its own caption bar etc.  You could tear off any/all the menus in this way!

 


 

This idea really came about from the fonts menu shown earlier, i.e., back then, if a menu contained more items than it could show in one strip, it didn't do anything clever - it just went off the screen!

My first attempt at curing this was to use a listbox as a menu.  If you think about it, there are very many similarities between the two - however, listboxes can be scrolled - thus there's no problem with having them contain as much data as you want!

 

 

That took a while to get going, and, although I can't remember the exact problem now, I gave it up after a while and included it in the book as an example of having a stab at solving a problem, i.e., that you then might think on for a while - and then revisit and later improve upon [hopefully].

What I did in the end was to 'get in the knickers' [so to speak] of Windows' menuing system [the book had all the gory details], and the result was that I added scrollbars to the menus themselves, i.e., the only thing I wanted that the listbox gave me was the scrolling - so, why not just add scrolling to menus as standard?

After the book was published I improved this code so as to make it list items that were most frequently used - actually, I just altered it so that that just worked on the fonts menu [something I personally found I really wanted] ... but the code could have been used elsewhere of course.  And to think, all of this in the late 80s and early 90s - sigh.

 


 

One of things I always set in any W2K/XP/Vista machine I use is to enable the Quick Lauch toolbar.  However, I mainly do this to get the Show Desktop icon/functionality:

In the book I came up with a similar idea, i.e., adding some useful buttons to the desktop - including Iconise, i.e., iconise every open window [that could be made iconic] so that you can easily get back to the desktop.

I also added an Exit Windows button - that acted like the modern Start | Turn Off Computer.


After the book was done I layered a transparent window over the top of these. This transparent window was also transparent to the left mouse button [HT_TRANSPARENT processing I seem to remember] - meaning that you could still press the buttons [left clicks fall through to what's underneath]. 

However, the right mouse button was used to pop-up a menu that contained a list of common programs I liked - left-click to shell [naturally]. Windows did a pretty good job here - in that if any menu contained a sub-menu, when it got selected, Windows would move the menus so that they all fitted on to the screen.

All in all, functionality somewhat akin to what a part of the Windows' Taskbar gives you today.

 


The end of Part 1, and why the book didn't do so well.

When I wrote the book I worked for ... - well, enough said about that.  However, my employer's status certainly helped me in finding a few interested publishers [btw, just in case you ask - there wouldn't have been a block, on my patenting these ideas - even with said employer].  The two best known were Addison Wesley and Prentice Hall - either of which I very much fancied working with [I'm told that my old employer has since created their own publishing arm]!

However, a week or so after I'd talked to these two companies - and after they'd both made me an offer - I was called by a guy who had previously represented one of them [I won't say which] the week before.  It turned out that he'd jumped ship and moved from being an acquisitions editor at x, and gone to y [one I'd never heard of before].  He said that y would love the book, and as he knew how much x had offered me [he'd originally offered it!], he knew he could improve upon it!  He also told me that y could get it into as many countries and stores as Addison Wesley or Prentice Hall could.

Stupidly I went with y, and y screwed it up IMHO.

I've no idea now how many copies the book sold - over 25,000, but beyond that, I've no idea.

P.S. If you had this book and wondered about some of the code - like it didn't work - it might be because it got typeset using something called Ventura Publisher, and that treated characters like > as some sort of mark-up, and it would occasionally remove them if it thought they were 'bad mark-up' [starting to feel where this is going?], so in the books themselves, expressions like if(n >= i) often got turned in to if(n = i) - just a little bit different!!!!


Want a copy :-)

Can you spot mine amongst my other museum pieces?

Well, at the time of writing, Amazon.co.uk have two available starting at £118 http://tinyurl.com/229w6y!

And their .com has two for $40 http://tinyurl.com/yr45c3.

Failing that, just Google for the ISBN: http://tinyurl.com/23h5vq


Copyright © 2007 by peetm.

peet.morris -at- cslab.com