Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site mmm.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!stolaf!umn-cs!mmm!schley
From: schley@mmm.UUCP (Steve Schley)
Newsgroups: net.micro.mac
Subject: Palettes: suggestions on how to do them
Message-ID: <194@mmm.UUCP>
Date: Thu, 26-Sep-85 10:43:01 EDT
Article-I.D.: mmm.194
Posted: Thu Sep 26 10:43:01 1985
Date-Received: Mon, 30-Sep-85 01:06:55 EDT
Distribution: net
Organization: 3M Company, St. Paul, Minn.
Lines: 49

A few months back, I solicited suggestions on how to put palettes (like
MacPaint has) in my application.  I stated that I would summarize the
responses to the net.

Well, better late than never.  Here they are, briefly and without
attribution:

--> Use the Dialog Mgr only to draw the dialog.  Put everything in
controls, and use PtInRect to locate where MouseDown occurred.
Highlight the controls where appropriate.

--> Use a normal window instead of a dialog.  Otherwise, same as first
suggestion.

--> Instead of using SelectWindow on the dialog to get events, use
BringToFront.  This won't deselect the main window.  (HiLiteWindow
should work, too.)  Might have to do a BringToFront on the main window
afterwards, though.

--> Dialog and Control Mgrs are overkill.  Draw palette with QuickDraw,
calculate MouseDown relative to palette buttons, and do highlighting
using QuickDraw.  In other words, do all the work yourself.

--> Put the palette inside the main window, as Helix and MacDraw do.

I solved the problem as the last response did suggested.  This has other
plusses, in that multiple windows will each have their own control
palette.  You must, however, ensure that your user cannot draw on the
palette.

I did not try any of the other suggestions.  The third one, in
particular, doesn't seem like it would do the trick.  I am passing
these suggestions along without any verification of correctness.  If
anyone finds out that these do or do not work, post to the net or at
least send me a note.  Furthermore, if anyone has more suggestions,
please come forward.  I don't think this issue has been entirely
cleared up.

Finally, I've seen that PageMaker from Aldus uses a very interesting
mini-palette.  It takes the form of a small, movable window (they call
it the "toolbox") that is always active and always in front of all
other windows!  It has eight control areas in it, and it's very handy
to be able to "float" it around the page -- it's always handy, and
never in the way of the document.  How do they do it?

-- 
	Steve Schley

	ihnp4!mmm!schley