Re: [BLACKBOX] Opening an embedded form view

From: [at]} <Antony>
Date: Sun, 13 Dec 2009 17:50:59 -0800


The only way I use Models is:


TYPE View = POINTER TO RECORD (Views.View) END; Msg = RECORD (Models.Message) END;




PROCEDURE (v: View) HandleModelMsg (VAR msg: Models.Message);
BEGIN
WITH msg: Msg DO
Views.Update(v, Views.keepFrames)
ELSE
END
END HandleModelMsg;

PROCEDURE (v: View) HandlePropMsg (VAR p: Properties.Message);
CONST min = Xrange * Ports.point; max = 2 * Xrange * Ports.point;
minY = Yrange * Ports.point; maxY = 2 * Yrange * Ports.point;
BEGIN
WITH p: Properties.SizePref DO (* prevent illegal sizes *)
IF p.w = Views.undefined THEN
p.w := max
ELSIF p.w < min THEN p.w := min
ELSIF p.w > max THEN p.w := max
END;
IF p.h = Views.undefined THEN p.h := maxY
ELSIF p.h < min THEN p.h := minY
ELSIF p.h > max THEN p.h := maxY
END
| p: Properties.ResizePref DO
p.horFitToWin := TRUE; p.verFitToWin := TRUE
ELSE
END
END HandlePropMsg;

My summary seems simpler, but there are some other procedures as well, so maybe Douglas would react "Yuck" to my code as well.

Quick summary
(1) define View with appropriate handlers
(2) open an instance of View with desired size.
(3) select, copy, and paste the view into your form.
(4) save the form

For use, open the form.

That's all.

I couldn't decode Robert's, but I compiled the code, deposited a view, saved the form, and reopened and everything worked.

Antony


On Sun, Dec 13, 2009 at 4:10 PM, Douglas G. Danforth <danforth{([at]})nowhere.xy


Robert, Antony, Josef,


Quick summary
(1) define MyView with appropriate SizePref handler similar to above.
(2) open an instance of MyView with desired size.
(3) select, copy, and paste the view into your form.
(4) save the form
(5) From module, open form and get controller for form.
(6) Scan through form to get view with type MyView.
(7) Reset any necessary parameters of the view (such as W and H).
(8) Draw into the view and then update it.

I believe that is all that is necessary.
Now perhaps we could discuss step (7)?

-Doug Danforth





---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy


---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Mon Dec 14 2009 - 02:50:59 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:38 UTC