[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Keyboard menus



If you are currently writing or plan to write a desktop program that uses
custom menus, read this, please!

I am writing a utility which allows access to menus via the keyboard. It
works automatically with all standard menus, but custom menus need a few
(easy) modifications in order to work. I encourage you to make these
modifications as they are easy to makeand will result in only about 50
extra bytes of code. The result is well worth it.

If you make the modifications, your program will still work without my
utility, so you haven't got anything to lose!

Here are the modifications you must make:

-------
How to make custom menus work from the keyboard:

- The number of items in the menu must be stored as a word at offset $0C in
  the menu record. (as with standard menus)
- The internal item numbers (not the Item ID numbers) must number from 0 up.
- The highest (normally unused) byte of the defproc pointer (offset $09 in
  the menu record) must be equal to $55. This tells the keyboard menu select
  routine that your menu is compatible with it.
- There is a new request which the defproc must support: $06 MGetMItemEnable.
  It works just like MGetMItemID except it must return TRUE is an item is
  enabled and FALSE if not.
-------

If you need help or sample source code, contact me.

Thank you.

-------
Does anyone know of an NDA other than WriteIt that puts a menu bar in its
window? I need to test my utility on bars other than the system one.

The problem is that WriteIt handles keypresses itself instead of calling
MenuKey, defeating my patched MenuKey. (Notice that when you select something
from WriteIt's menus, the menu doesn't hilight!)

 ______________________________________________________________________
|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~|
| Phillip Vandry | Vandry@Cam.Org | II the future! | II 1993!          |
|________________|________________|________________|___________________|
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~