home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
287.lha
/
MenuPal_vA.1
/
MenuPal.doc
< prev
next >
Wrap
Text File
|
1989-09-09
|
9KB
|
260 lines
MenuPal - Copyright 1989 by Tim Coffey
Alpha release A.1 (Test release)
This is a DEMO version only.
NOT IN THE PUBLIC DOMAIN.
NOT TO BE REDISTRIBUTED ON ANY OTHER BULLETIN BOARD
WITHOUT PERMISSION OF THE AUTHOR.
Written using Modula-2/Amiga
TDI Software Inc. Dallas, Texas.
Okay, here it is - the long needed improvement to the Amiga's menuing
operations. My program, 'MenuPal', will take over the entire menuing opera-
tions for the Amiga and add some very useful extras. By 'extras', I mean
3 new menu types - including the standard menu type (ScreenBar).
Here are the 4 menu types I support:
ScreenBar: The standard menu look.
WindowBar: The menu bar will appear in the top of the window that
controls the menu. For full screen size windows, this
will effectively appear just like ScreenBar menus.
PopUp: A menu that appears at the pointer. Allows fast menuing.
TearOff: My personal favorite. This menu type is created from any
of the 3 above by placing the pointer in the parent's
select box of the menu you want to tear off. Click-hold the
left button to 'drag' the menu to the location you wish.
Then, release the left button to open the new TearOff menu.
Note that releasing the right button while dragging the new
TearOff menu will cancel the open. You must then press the
right button again and release it again to stop menuing.
Any window can have it's menus in one of the 3 menu modes: ScreenBar,
WindowBar, or PopUp. You can toggle the mode from one to the next by
activating the menu and pressing the left button while the pointer is
outside the main menubar. Once specified, the window stays in the mode
that you have specified. Note that upon opening, a window may be in any
of the 3 modes randomly. This is unavoidable, but easily changed by
pressing the Left button until it is the type you want.
TearOffs:
TearOff menus operate very differently. First, they are activated by
placing the pointer inside the TearOff menu box. You need not press the
menu button. Second, the window is notified of any items you pick only
after the pointer leaves the TearOff menu box. Third, TearOff menus
stay on screen until you explicitly close them. You will also notice
that an opened TearOff menu has some gadgets drawn into them.
These gadgets are:
Close: Does what you expect. Shuts the TearOff menu
Depth arrangement: Function just like any other depth gadgets.
Sizing: Works differently than a normal sizing gadget.
It toggles the TearOff menu between full-size and
reduced mode. When reduced, only the top of the
TearOff menu is shown. This helps avoiding
cluttering of the screen with TearOff menus.
Note that the TearOff menu can still be used
when in reduced mode by placing the pointer in
the visible portion and 'pulling down' the menu
with the mouse. There is no need to press any
buttons to do this.
Drag: Is used to drag the TearOff menu around the
screen. They do not look the same as other drag
gadgets, but are functionally equivalent.
Note that pressing the right button while dragging
the TearOff menu to it's new location will cancel
the dragging process.
TearOff menus will close
automatically whenever it's parent window closes. There are also
rare instances when a TearOff menu will close because it's 'checksum'
(used to insure integrity) is wrong. This can happen if the application
does some weird stuff with it's menus. An example is PowerWindows by
Inovatronics.
Rendering differences:
MenuPal will render menu's almost identical in look to Intuition menus.
On occasion, especially for PopUp menus in extreme Left/Right/Top/Bottom
places, parts of the menu will render justified some way so that the
entire strip can appear on screen. Functionality is not impaired by this.
MenuPal's own menu:
ShutDown Menu
MenuPal - will close MenuPal. Same as clicking the close gadget on
MenuPal's window.
Options Menu
Send MenuVerify - when checked, MenuVerify messages will be sent
to the application before menuing starts, just
like Intuition would.
When NOT checked, the MenuVerify will NOT be sent.
Instead, menuing will start immediately. This could
cause problems with some applications. It is here
because some applications like to CANCEL menuing
if the pointer is not in a certain part of the screen.
This way, PopUp menus can be used anywhere on the
screen. DPaint, I believe, is one such application
that requires the pointer be at the top of the
screen before it allows menuing.
Also, as of this time, a TearOff menu will NOT
send a MenuVerify before it is activated.
Sleeping - when checked, MenuPal is effectively asleep as far as
menuing operations are concerned. Any menuing will then
be controlled by Intuition.
TearOffs Menu
Close for Window - will close all TearOff menus for the last
active window.
Reduce for Window - will reduce all TearOff menus for last active
window.
Expand for Window - will expand all TearOff menus for last active
window.
Front for Window - will bring all TearOff menus for last active window
to front.
Back for Window - will push all TearOff menus for last active window
to back.
xxx for Screen - will do the same as described except it will affect
all TearOff menus for last active screen.
Constraints:
MenuPal will NOT control menus for it's own window or any window
controlled by the Workbench program proper. This is to prevent
potential lockups. I'm sure you don't mind this.
Also, MenuPal does NOT listen for Mouse equivalent keyboard
combinations. Example - pressing Right Amiga+Right ALT to activate
a menu will NOT be seen by MenuPal. Instead, Intuition will see it
and render the menu itself. This will be changed in a later release
so that MenuPal recognizes keyboard combinations as their corres-
ponding Mouse events.
INFO:
Okay, how did I do all this you ask? Well, I have to draw the entire
menu strip myself. this is not too tough and takes up about 20% of the
code. I also have to monitor the input.device for mouse activity. This
is about 30% of the code. The rest is TearOff menu support and stuff
like sending IDCMP messages to windows.
FUTURE ENHANCEMENTS:
1.
Conserving bitmap allocation for applications, like paint programs, that
use a lot of colors. Currently, if the screen depth is 5, I allocate
5 rasters per menu strip - even if the largest color used in defining
the menu could be rendered in 2 rasters. This will be a 'transparent'
change. (Pun intentional)
2.
For my own sanity, porting this thing off of TDI to some other
Modula-2. Right now, I can't afford a new compiler or memory upgrade
that some require to run.
BUGS:
Yes, there are bugs. Hey, this is an Alpha release, remember? Anyway
I don't seem to handle low-memory very well. 'Poorly' is the word.
Most of the other problems seem to be related exclusively to the
Layers functions I have to use to manipulate TearOff menus. Layers
seems to be a very non-forgiving library. Anything slightly wrong
calls the GURU. Moving TearOff menus seems to cause the most
problems.
Hey, let me know what this thing does not work with. I don't own
all commercially available software, so I have to rely on you folks
as testers.
This doc should be enough to get you going. Using MenuPal isn't too
complicated, so the amount of docs required isn't that much.
Use it in good health. Please inform me of problems.
Tim Coffey
72377,2617
(614) 848-9724