schley@mmm.UUCP (Steve Schley) (06/12/85)
I am writing an application that will include "palettes" like MacPaint. Can someone out there give me some advice on this? I have chosen to implement these palettes as modeless dialogs. One contains 22 StatText Enabled items, while the other contains three RadioItem Enabled controls. I want to allow the user to push the radio buttons and select StatText items, all while performing graphical operations within the main document window. The latter means that I really do not want to deactivate the main window. The problem is that I can't get events from the dialogs in the normal fashion, because when the main window is active, the dialogs are inactive. Calling IsDialogEvent() from my Main Event Loop (MEL) returns False for these events. The work-around that I have come up with is to never call IsDialogEvent(). Instead, whenever I get a MouseDown event inContent (which is the case even for inactive windows, such as my dialogs), I decide which window the event occurred in by pointer comparison. If it was a dialog, I call SelectWindow() to activate the dialog, then call DialogSelect() (which, like IsDialogEvent(), returns False if the dialog is inactive) to find the item that was selected. I then call SelectWindow() to reactivate the main window and finally I handle the event by item number. This seems pretty hoky to me. It looks hoky, too, since the main window's title bar gets de-hilighted while the mouse button is down in the dialog box, and re-hilights when the mouse goes up. MacPaint doesn't do this. I'm beginning to think that I shouldn't be using dialogs at all, or at least not relying on the Control Manager for handling the events. In fact, in Macpaint, the selections occur on mouseDown, implying that the Control Manager isn't being used. {By the way, if it helps, I'm working in Workshop Pascal 3.0 on the Lisa.} Anyone have any hints, or (better yet!) solutions? I sure would appreciate it -- my boss wants a demo in a few days! (:-) Send mail directly to me, and I'll post solutions to the net. -- Steve Schley ihnp4!mmm!schley