[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: aaarghh...DragWindow doesn't drag...
jmk3@crux2.cit.cornell.edu (Jay Krell) writes:
: >From: gudat@avalon.physik.unizh.ch (gudat henrik)
: >Subject: aaarghh...DragWindow doesn't drag...
:
: >Hello Dave, Matt, Jay and all those other GS gurus!
:
: >I want to move windows to other places "manually", i.e. without using
: >taskmaster. The user has to select "Move Window...", the cursor becomes
: >a hand, and then he (or she) can walk with that window around. The
: >pseudocode looks like this:
: >...
: >_GetMouse
: >_LocalToGlobal
: >_DragWindow
: >...
: >I've noticed that this routine works only with titled windows, but I'd
: >like to apply this mechanism to windows without title bar. (Er, that's
: >why it's here...)
: >
: >Any way out? Does DragWindow check the frame bits (BTW, fMove=1)?
: >
: >What's going on? Thanks a ton for your reply!
: >
: >henrik
:
: I'm a guru? Wow. Thanks. Anyway, I must admit, my knowledge of the IIGS is very
: lacking. Two huge voids are QuickDraw II and the Window Manager. I've barely
: used them.
:
Ohhhh, you exaggerate..
: As a cop-out and not a bad answer at all, I can tell you what Matt would be
: sure to say: what you are doing is not part of the Apple interface and the
: inconsistency is against it and might confuse users. If you are trying to drag
: a modal dialog or window, you might consider a modeless dialog or a movable
: modal dialog, via FakeModalDialog (name?).
:
aaaarghhhh...I like non.standard techniques as long as they aren't too
wild.
: I've often thought, though, that it would be nice if windows were dragable w/o
: taking up so much room (esp. on the IIGS) for the title bar.
:
: I checked the DragWindow docs (never had before) and your use seems right. It
: doesn't mention flags it checks. You should try changing some of the bits and
: experimenting. Just call SetWFrame in Nifty List while testing your app.
:
The solution to the problem is: save the initial global coordinates
somehwere, then get the GrafPort of the chosen window. Convert the local
coordinates (0,0) to global coo.. Then drag that stuff. Read the last
mouse coordinates and calculate the delta. Finally add the delta values
to the upper corner of the window (to the (0,0) we have converted
before) and _Move the window.
IT WORKS!
I LOVE YOU ALL!
Hehe, and all that with toolbox calls..isn't that the Apple way?
Thanks Jay and all those who read this discussion,
henrik
PS: a nice feature would be: safe the coordinates in BRAM for later.....
aaaaaaaaaaaaaaaaaaaarghh....
--
Bright Software CH gudat@avalon.physik.unizh.ch Bright Software USA
P.O. Box 18 any demo: US$3.00 P.O. Box 120
4153 Reinach 2 info on GSymbolix, ShadowDial, Exeter, ME 04435-0120
Switzerland Gate, SpaceFox, Mandelbrot U.S.A.