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

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

From: tedd@...
Date: Wed, 1 Nov 2000 17:45:54 -0500
>Hi:
>
>To whomever started this thread, try this.
>
>Granted, the following code does not show the window drag outline as 
>being equal distant, but it does stop the user from resizing a 
>window that is not equal in both x & y directions.
>
>tedd
>


Sorry, posted wrong code. I don't know what happened. Must have 
cut/pasted wrong.

This it.

BEGIN GLOBALS
DIM gOldProc AS LONG
DIM gWndPtr  AS WindowPtr
dim gTest
END GLOBALS

WINDOW 1,,,_doczoom

LOCAL FN doEvent
DIM evtPtr   AS PTR TO EventRecord
DIM @ wndPtr AS WindowPtr
DIM theMouse;0,x,y
DIM theStr    AS STR255
dim test
DIM r as rect

GetMouse(theMouse)

TextMode(_srcCopy)
theStr = "x =" + STR$(x)+", y =" + STR$(y)
MoveTo(20,20)
DrawString(theStr)
theStr = "Window size = " + str$(window(_width)) + "," + str$(window(_height))
MoveTo(20,40)
DrawString(theStr)


long if gTest = _true
gTest = _false
long if x < y
y = x
xelse
x = y
end if
CALL SIZEWINDOW(gWndPtr,x,x,_true)
CALL SETRECT(r,0,0,x,x)
CALL INVALRECT(r)
end if

evtPtr = EVENT
SELECT evtPtr.what

CASE 1 'MouseDown
SELECT FN FindWindow(#evtPtr.where,gWndPtr)

CASE _inGrow
gTest = _true

END SELECT

END SELECT
END FN

ON EVENT FN doEvent

DO
HANDLEEVENTS
UNTIL LEN(INKEY$)

END
-- 
http://sperling.com/
_______________________________________________________
Thinking about buying Jewelry?
Try our site: http://earthstones.com