-
Notifications
You must be signed in to change notification settings - Fork 74
/
MovableWDEF.p
147 lines (101 loc) · 2.58 KB
/
MovableWDEF.p
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{Photoshop version 1.0.1, file: MovableWDEF.p
Computer History Museum, www.computerhistory.org
This material is (C)Copyright 1990 Adobe Systems Inc.
It may not be distributed to third parties.
It is licensed for non-commercial use according to
www.computerhistory.org/softwarelicense/photoshop/ }
UNIT UMovableWDEF;
INTERFACE
USES
MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
FUNCTION MovableWDEF (varCode: INTEGER;
theWindow: WindowPtr;
message: INTEGER;
param: LONGINT): LONGINT;
IMPLEMENTATION
FUNCTION MovableWDEF (varCode: INTEGER;
theWindow: WindowPtr;
message: INTEGER;
param: LONGINT): LONGINT;
VAR
r: Rect;
s: Str255;
w: INTEGER;
white: Pattern;
black: Pattern;
index: INTEGER;
savePen: PenState;
BEGIN
MovableWDEF := 0;
CASE message OF
wDraw:
IF WindowPeek (theWindow)^.visible THEN
BEGIN
GetPenState (savePen);
PenNormal;
FOR index := 0 TO 7 DO
BEGIN
black [index] := 255;
white [index] := 0
END;
r := WindowPeek (theWindow)^.strucRgn^^.rgnBBox;
FrameRect (r);
InsetRect (r, 1, 1);
r.top := r.top + 15;
PenSize (2, 2);
PenPat (white);
FrameRect (r);
InsetRect (r, 2, 2);
PenPat (black);
FrameRect (r);
InsetRect (r, 2, 2);
PenPat (white);
FrameRect (r);
PenPat (black);
PenSize (1, 1);
r := WindowPeek (theWindow)^.strucRgn^^.rgnBBox;
InsetRect (r, 1, 1);
r.bottom := r.top + 15;
EraseRect (r);
IF WindowPeek (theWindow)^.hilited THEN
FOR index := 0 TO 5 DO
BEGIN
MoveTo (r.left, r.top + 3 + 2 * index);
Line (r.right - r.left - 1, 0)
END;
s := WindowPeek (theWindow)^.titleHandle^^;
w := StringWidth (s);
InsetRect (r, (r.right - r.left - w - 12) DIV 2, 0);
EraseRect (r);
MoveTo (r.left + 6, r.bottom - 2);
DrawString (s);
SetPenState (savePen)
END;
wHit:
BEGIN
r := WindowPeek (theWindow)^.contRgn^^.rgnBBox;
IF PtInRect (Point (param), r) THEN
MovableWDEF := wInContent
ELSE
BEGIN
r := WindowPeek (theWindow)^.strucRgn^^.rgnBBox;
r.bottom := r.top + 22;
IF PtInRect (Point (param), r) THEN
MovableWDEF := wInDrag
ELSE
MovableWDEF := wNoHit
END
END;
wCalcRgns:
BEGIN
r := theWindow^.portRect;
OffsetRect (r, -theWindow^.portBits.bounds.left,
-theWindow^.portBits.bounds.top);
RectRgn (WindowPeek (theWindow)^.contRgn, r);
InsetRect (r, -7, -7);
r.top := r.top - 15;
RectRgn (WindowPeek (theWindow)^.strucRgn, r)
END
END
END;
END.