[futurebasic] Re: Resize Window in Proportion? FB^3

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2000 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Wed, 1 Nov 2000 03:53:42 -0400
>This will get you started:
>
>http://devworld.apple.com/techpubs/mac/Toolbox/Toolbox-250.html#HEADING250-0
>
>From there you can probably find an example I suspect.  Heck, the FB
>runtime has all the calls already working, so pirate that and add a
>draghook..I bet ALL window resizing will be that way :-)
>
>-D

Thanks Big D, but I don't know what a DragHook is exactly, nor how to do an
enterproc.

I see the below FN to the Runtime. Wonder if I could do an OverRide of this
during a drag event?

All I would need to do would be to keep the limitRect contained perhaps?
Nope, that ain't it. That just limits the lowest and highest sizes.
Argh.

40 Bonus points to the person who can write me a little demo that opens a
window to say, 300 x 400 and lets me resize it smaller or larger in
proportion while dragging, and have it end up re-drawn to the proportion on
Mouse-up, extra 1 point for the resulting window rect already being in some
global Rect so I can just stick it into my copybits FN without having to do
a Window(_wndPointer) +_portRect deal to get it. That is probably asking
too much. :)


Anyway, you will be my hero.  Another one for the Bob D. Covy FAQ regardless.

Robert Covington


From Runtime, the area to explore I bet:

LOCAL
DIM LongPoint&;0,longY,longX
DIM oldPort&;4
DIM wNum
LOCAL FN FBWindowGrow
wNum = FN FBGetWndNumber(gFBEvtWnd&)
LONG IF wNum
GetPort(oldPort&)
SetPort(gFBEvtWnd&)
FN FBSendDialogEvt(_Preview,_PreWndGrow)
LongPoint& = FN GrowWindow(gFBEvtWnd&, gFBEvtPt&, gFBWndLimitRect)
LONG IF LongPoint&
FN FBInvalScrolls
SizeWindow(gFBEvtWnd&,longX,longY,_zTrue)
FN FBResizeWindow(wNum)
END IF
SetPort(oldPort&)
END IF
END FN