/[james]/archive/wimplibs/Wind/5
ViewVC logotype

Contents of /archive/wimplibs/Wind/5

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (show annotations) (download)
Thu Sep 25 18:54:17 2003 UTC (21 years, 3 months ago) by james
File size: 7486 byte(s)
Initial import.

1 REM > JLibraries:Wind.5
2 REM © James Bursa, 1997
3
4 REM JB 17 Nov 1997 created
5 REM JB 19 Nov 1997 windows referenced by name instead of handle
6 REM JB 26 Nov 1997 removed obsolete PROCWind_Open
7 REM JB 27 Nov 1997 corrected conversion of handles to names
8 REM JB 27 Nov 1997 added PROCWind_PutCaret
9 REM JB 29 Nov 1997 added PROCWind_SetFocus
10 REM JB 06 Dec 1997 added PROCWind_IconSele
11 REM JB 21 Dec 1997 corrected FNWind_Open to return bool
12 REM JB 03 Apr 1998 added PROCWind_SetTitle
13 REM JB 24 Apr 1998 added PROCWind_SetVal
14
15
16 DEF PROCWind_OpenPointer(Wind$)
17 LOCAL XPos%, YPos%, XOff%, YOff%
18
19 SYS"Wimp_GetPointerInfo",, B% + 400
20 XPos% = B%!400
21 YPos% = B%!404
22
23 B%!400 = FNObject_Hand(0, Wind$, 0)
24 SYS"Wimp_GetWindowState",, B% + 400
25
26 XOff% = B%!404 - B%!412
27 YOff% = B%!408 - B%!416
28 PROCWind_OpenUp(Wind$, XPos% + XOff% / 2, YPos% + YOff% / 2, -1)
29
30 ENDPROC
31
32 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
33
34 DEF PROCWind_PopOpen(Wind$)
35 B%!400 = FNObject_Hand(0, Wind$, 0)
36 SYS"Wimp_GetWindowState",, B% + 400
37 B%!428 = -1
38 SYS"WimpExt_OpenLinked",, B% + 400
39 ENDPROC
40
41 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
42
43 DEF PROCWind_Close(Wind$)
44 B%!400 = FNObject_Hand(0, Wind$, 0)
45 SYS"WimpExt_CloseLinked",, B% + 400
46 ENDPROC
47
48 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
49
50 DEF PROCWind_Origin(Wind$, RETURN XPos%, RETURN YPos%)
51 B%!400 = FNObject_Hand(0, Wind$, 0)
52 SYS"Wimp_GetWindowState",, B% + 400
53 XPos% = B%!404 - B%!420
54 YPos% = B%!416 - B%!424
55 ENDPROC
56
57 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
58
59 DEF FNWind_Open(Wind$)
60 LOCAL Open%
61
62 SYS"WimpExt_CheckWindowOpen", FNObject_Hand(0, Wind$, 0) TO Open%
63 =(Open% = 1)
64
65 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
66
67 DEF PROCWind_ForceRedraw(Wind$)
68 LOCAL Wind%
69
70 Wind% = FNObject_Hand(0, Wind$, 0)
71 B%!400 = Wind%
72 SYS"Wimp_GetWindowInfo",, (B% + 400) OR 1
73 SYS"Wimp_ForceRedraw", Wind%, B%!444, B%!448, B%!452, B%!456
74 ENDPROC
75
76 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
77
78 DEF PROCWind_OpenUp(Wind$, XPos%, YPos%, Open%)
79 LOCAL XOff%, YOff%
80
81 B%!400 = FNObject_Hand(0, Wind$, 0)
82 SYS"Wimp_GetWindowState",, B% + 400
83 XOff% = B%!412 - B%!404
84 YOff% = B%!416 - B%!408
85 B%!404 = XPos%
86 B%!408 = YPos%
87 B%!412 = XPos% + XOff%
88 B%!416 = YPos% + YOff%
89 B%!428 = Open%
90 SYS"WimpExt_OpenLinked",, B% + 400
91 ENDPROC
92
93 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
94
95 DEF PROCWind_Load(Name$, Sprt%)
96 LOCAL Size%, IndS%, Find%, Buff%, Indi%, Icon%, Wind%, Temp%, Icon$
97
98 SYS"Wimp_LoadTemplate",, 0,,,, Name$, 0 TO , Size%, IndS%,,,, Find%
99 IF Find% = 0 THEN ERROR 1, "Wind_Load:'"+Name$+"'NotFound"
100
101 Buff% = FNHeap_Alloc(Size%)
102 IF Buff% = 0 THEN ERROR Erro_Memo%, "Mem"
103 BuffB% = !Buff%
104 DIM Indi% IndS%
105
106 SYS"Wimp_LoadTemplate",, BuffB%, Indi%, Indi% + IndS%, -1, Name$, 0
107 BuffB%!64 = Sprt%
108 SYS"WimpExt_RedirectSprites", Sprt%, BuffB%
109 SYS"Wimp_CreateWindow",, BuffB% TO Wind%
110 PROCObject_Add(0, Wind%, 0, Name$)
111
112 @% = "+g20.255"
113
114 IF BuffB%!84 > 0 THEN
115 FOR Icon% = 1 TO BuffB%!84
116 Icon$ = STR$(Icon% - 1)
117 IF (BuffB%!(88 + (Icon% - 1) * 32 + 16) AND %100000001) = %100000001 THEN
118 IF BuffB%!(88 + (Icon% - 1) * 32 + 24) = -1 THEN
119 Vali$ = ""
120 ELSE
121 Vali$ = FNWimp_GetString(BuffB%!(88 + (Icon% - 1) * 32 + 24))
122 ENDIF
123 Temp% = INSTR(Vali$, ";=")
124 IF Temp% <> 0 THEN Temp% += 2
125 IF (Temp% = 0) AND (LEFT$(Vali$, 1) = "=") THEN Temp% = 2
126 IF Temp% <> 0 THEN
127 Icon$ = MID$(Vali$, Temp%)
128 Temp% = INSTR(Icon$, ";")
129 IF Temp% <> 0 THEN
130 Icon$ = LEFT$(Icon$, Temp% - 1)
131 ENDIF
132 ENDIF
133 ENDIF
134 PROCObject_Add(1, Icon% - 1, Wind%, Icon$)
135 NEXT
136 ENDIF
137
138 PROCHeap_Free(Buff%)
139 ENDPROC
140
141 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
142
143 DEF PROCWind_UpdateIcon(Wind$, Icon$)
144 B%!400 = FNObject_Hand(0, Wind$, 0)
145 B%!404 = FNObject_Hand(1, Icon$, B%!400)
146 B%!408 = 0
147 B%!412 = 0
148 SYS"Wimp_SetIconState",, B% + 400
149 ENDPROC
150
151 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
152
153 DEF PROCWind_HideIcon(Wind$, Icon$)
154 B%!400 = FNObject_Hand(0, Wind$, 0)
155 B%!404 = FNObject_Hand(1, Icon$, B%!400)
156 B%!408 = &00800080
157 B%!412 = &00800080
158 SYS"Wimp_SetIconState",, B% + 400
159 ENDPROC
160
161 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
162
163 DEF PROCWind_ShowIcon(Wind$, Icon$)
164 B%!400 = FNObject_Hand(0, Wind$, 0)
165 B%!404 = FNObject_Hand(1, Icon$, B%!400)
166 B%!408 = &00000000
167 B%!412 = &00800080
168 SYS"Wimp_SetIconState",, B% + 400
169 ENDPROC
170
171 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
172
173 DEF FNWind_Title(Wind$)
174 B%!400 = FNObject_Hand(0, Wind$, 0)
175 SYS"Wimp_GetWindowInfo",, B% + 401
176 =FNWimp_GetString(B%!476)
177
178 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
179
180 DEF FNWind_GetIcon(Wind$, Icon$)
181 LOCAL Sele%, Wind%
182 Wind% = FNObject_Hand(0, Wind$, 0)
183 SYS"WimpExt_GetIcon",,, Wind%, FNObject_Hand(1, Icon$, Wind%) TO Sele%
184 =(Sele% = 1)
185
186 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
187
188 DEF PROCWind_OpenC(Wind$)
189 B%!400 = FNObject_Hand(0, Wind$, 0)
190 SYS"Wimp_GetWindowState",, B% + 400
191 B%!428 = -1
192 SYS"WimpExt_CentreWindow",, B% + 404
193 SYS"WimpExt_CentreWindowV",, B% + 404
194 SYS"WimpExt_OpenLinked",, B% + 400
195 ENDPROC
196
197 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
198
199 DEF FNWind_GetText(Wind$, Icon$)
200 B%!400 = FNObject_Hand(0, Wind$, 0)
201 B%!404 = FNObject_Hand(1, Icon$, B%!400)
202 SYS"Wimp_GetIconState",, B% + 400
203 IF B%!424 AND (1<<8) THEN =FNWimp_GetString(B%!428)
204 =FNWimp_GetString(B% + 428)
205
206 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
207
208 DEF PROCWind_SetText(Wind$, Icon$, Text$)
209 LOCAL Wind%
210 Wind% = FNObject_Hand(0, Wind$, 0)
211 SYS"WimpExt_SetIconString",,, Wind%, FNObject_Hand(1, Icon$, Wind%), Text$
212 ENDPROC
213
214 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
215
216 DEF PROCWind_IconGrey(Wind$, Icon$, Grey%)
217 LOCAL Wind%, Icon%
218 Wind% = FNObject_Hand(0, Wind$, 0)
219 Icon% = FNObject_Hand(1, Icon$, Wind%)
220 SYS"WimpExt_ShadeIcon",,, Wind%, Icon%, Grey%
221 ENDPROC
222
223 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
224
225 DEF PROCWind_PutCaret(Wind$, Icon$)
226 LOCAL Wind%
227 Wind% = FNObject_Hand(0, Wind$, 0)
228 SYS"WimpExt_PutCaretIcon",,, Wind%, FNObject_Hand(1, Icon$, Wind%)
229 ENDPROC
230
231 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
232
233 DEF PROCWind_SetFocus(Wind$)
234 SYS"Wimp_SetCaretPosition", FNObject_Hand(0, Wind$, 0), -1,,, 1 << 25, -1
235 ENDPROC
236
237 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
238
239 DEF PROCWind_IconSele(Wind$, Icon$, Sele%)
240 LOCAL Wind%
241 Wind% = FNObject_Hand(0, Wind$, 0)
242 SYS"WimpExt_SetIcon",,, Wind%, FNObject_Hand(1, Icon$, Wind%), Sele%
243 ENDPROC
244
245 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
246
247 DEF PROCWind_SetTitle(Wind$, Text$)
248 LOCAL Wind%
249 Wind% = FNObject_Hand(0, Wind$, 0)
250 SYS"WimpExt_SetWindowTitle",,, Wind%, Text$
251 ENDPROC
252
253 REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
254
255 DEF PROCWind_SetVal(Wind$, Icon$, Text$)
256 LOCAL Wind%, Icon%
257 Wind% = FNObject_Hand(0, Wind$, 0)
258 Icon% = FNObject_Hand(1, Icon$, Wind%)
259 B%!400 = Wind%
260 B%!404 = Icon%
261 SYS"Wimp_GetIconState",, B% + 400
262 $(B%!432) = Text$
263 PROCWind_UpdateIcon(Wind$, Icon$)
264 ENDPROC

  ViewVC Help
Powered by ViewVC 1.1.26