home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-18 | 2.7 KB | 93 lines | [TEXT/PJMM] |
- {****************************************************}
- {}
- { CSATPane.p }
- {}
- { Methods for the director class by which the THINK Class Library can be used }
- { with the Sprite Animation Toolkit. }
- {}
- {****************************************************}
-
-
- unit CSATPane;
-
- interface
-
- uses
- TCL, SATTCLIntf;
-
- implementation
-
-
- {****************************************************}
- {}
- { ISATPane }
- {}
- { Initializes the SAT pane class, and SAT. The drawing area for SAT specifies }
- { the bounds of the panorama. }
- {}
- {****************************************************}
-
- procedure CSATPane.ISATPane (anEnclosure: CView; aSupervisor: CBureaucrat; aWidth, aHeight, aHEncl, aVEncl: Integer; aHSizing, aVSizing: SizingOption; aPICTColor, aPICTBW: Integer; aSATRect: Rect; aUseMenuBar, aDither4bit, aBeSmart: Boolean);
-
- var
- theLongRect: LongRect;
-
- begin { ISATPane }
- IPanorama(anEnclosure, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
-
- { Remember, a panorama pane is a window into the contents. }
-
- QDToLongRect(aSATRect, theLongRect);
- OffsetLongRect(theLongRect, -theLongRect.left, -theLongRect.top);
- SetBounds(theLongRect);
-
- SATCustomInit(aPICTColor, aPICTBW, aSATRect, WindowPtr(GetMacPort), nil, aUseMenuBar, FALSE, FALSE, aDither4bit, aBeSmart);
- end; { ISATPane }
-
-
- {****************************************************}
- {}
- { Draw }
- {}
- { TCL wants to draw the SAT pane. So draw it, as described in the manual. We }
- { don't use SATRedraw because we don't want the black bars. }
- {}
- {****************************************************}
-
- procedure CSATPane.Draw (var area: Rect);
-
- begin
- CopyBits(gSAT.offScreen.port^.portbits, gSAT.wind.port^.portbits, area, area, srcCopy, nil);
- end;
-
-
- {****************************************************}
- {}
- { PrepareForSATRun }
- {}
- { When SATRun occurs, the pane is redrawn. However the ports may not be }
- { valid. We could just call Refresh, but there is an annoying flicker when the }
- { window's Update method is used. This achieves the same effect, but without }
- { the flicker. }
- {}
- {****************************************************}
-
- procedure CSATPane.PrepareForSATRun;
-
- var
- savePort: GrafPtr;
-
- begin { PrepareForSATRun }
- Refresh;
-
- GetPort(savePort);
- SetPort(GetMacPort);
-
- BeginUpdate(GetMacPort);
- EndUpdate(GetMacPort);
-
- SetPort(savePort);
- end; { PrepareForSATRun }
-
-
- end. { CSATPane }