/[james]/archive/wimplibs/Wimp/6
ViewVC logotype

Annotation of /archive/wimplibs/Wimp/6

Parent Directory Parent Directory | Revision Log Revision Log


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

1 james 32 REM > JLibraries:Wimp.6
2     REM © James Bursa, 1997
3    
4     REM JB 17 Nov 1997 created
5     REM JB 27 Nov 1997 PROCWimp_StartDrag now supports text/sprite icons
6     REM JB 28 Nov 1997 removed PROCWimp_ReadMessages
7     REM JB 06 Dec 1997 works with Mess.2
8     REM JB 13 Dec 1997 PROCWimp_LoadFile: OS_File 17 -> OS_File 23
9     REM JB 27 Dec 1997 fixed 'Unknown territory number' bug
10    
11    
12     DEF PROCWimp_Init
13     LOCAL Size%, Numb%, PFlg%
14    
15     DIM B% 511
16    
17     SYS"Wimp_Initialise", 310, &4B534154, Task_Name$, 0 TO , Task_Hand%
18     SYS"WimpExt_Initialise", 16, Task_Hand%, %11100011000
19     PROCHeap_Init(50)
20    
21     SYS"OS_ReadVarVal", Task_Name$ + "$Dir", B%, 512 TO ,, Size%
22     B%?Size% = 13
23     Task_Path$ = $B% + "."
24     Task_Res1$ = Task_Path$ + "Resources."
25    
26     SYS"XOS_ReadVarVal", Task_Name$ + "$Language",, -1 TO ,, Size%
27     IF Size% = 0 THEN
28     SYS"Territory_Number" TO Numb%
29     SYS"XTerritory_NumberToName", Numb%, B%, 512 TO ;PFlg%
30     IF (PFlg% AND 1) THEN
31     Task_Res2$ = Task_Res1$ + "UK."
32     ELSE
33     Task_Res2$ = Task_Res1$ + FNWimp_GetString(B%) + "."
34     ENDIF
35     ELSE
36     SYS"OS_ReadVarVal", Task_Name$ + "$Language", B%, 512 TO ,, Size%
37     B%?Size% = 13
38     Task_Res2$ = Task_Res1$ + $B% + "."
39     ENDIF
40     IF NOT FNWimp_FileExists(LEFT$(Task_Res2$)) THEN Task_Res2$ = Task_Res1$ + "UK."
41    
42     Erro_Info% = &F0000
43     Erro_Warn% = &F0000 + 1
44     Erro_Ques% = &F0000 + 2
45     Erro_Memo% = &F0000 + 3
46     Erro_ERR% = -1
47     PROCObject_Init
48     File_Mess% = FNMess_Open(Task_Res2$ + "Messages", FALSE)
49     File_Help% = FNMess_Open(Task_Res2$ + "Help" , FALSE)
50     Erro_Erro$ = FNMess_Lookup("Erro_Erro", File_Mess%)
51     Erro_Quit$ = FNMess_Lookup("Erro_Quit", File_Mess%)
52     Erro_Memo$ = FNMess_Lookup("Erro_Memo", File_Mess%)
53     Task_PollMask% = &1831
54     Task_PollIdle% = 0
55     Task_LastPoll% = 0
56     Task_LastTemp% = 0
57     Task_Quit% = FALSE
58     Task_Slab% = FALSE
59     Menu_Open% = FALSE
60     Menu_Fast% = FALSE
61     ENDPROC
62    
63     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
64    
65     DEF FNWimp_IconBarIcon(Sprt$, SLen%, Text$, TLen%, Side%)
66     LOCAL Vali%, Text%, Hand%
67    
68     DIM Vali% SLen% + 1
69     DIM Text% TLen% + 1
70     $Vali% = "S" + Sprt$
71     $Text% = Text$
72    
73     B%!400 = Side%
74     B%!404 = -(10 * TLen% - 4)
75     B%!408 = -16
76     B%!412 = 68 + (10 * TLen% - 4)
77     B%!416 = 80
78     B%!420 = &1700310B
79     B%!424 = Text%
80     B%!428 = Vali%
81     B%!432 = TLen%
82     SYS"Wimp_CreateIcon",, B% + 400 TO Hand%
83     =Hand%
84    
85     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
86    
87     DEF FNWimp_IconBarSprite(Sprt$, SLen%, Area%, Side%, Size%)
88     LOCAL Sprt%, Hand%
89    
90     DIM Sprt% SLen%
91     $Sprt% = Sprt$
92    
93     B%!400 = Side%
94     B%!404 = 68 - Size%
95     B%!408 = 68 - Size%
96     B%!412 = 68 + (Size% - 68)
97     B%!416 = 68 + (Size% - 68)
98     B%!420 = &1700311A
99     B%!424 = Sprt%
100     B%!428 = Area%
101     B%!432 = SLen%
102     SYS"Wimp_CreateIcon",, B% + 400 TO Hand%
103     =Hand%
104    
105     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
106    
107     DEF PROCWimp_Poll
108     LOCAL Reas%, Temp%, Call$, Menu$, Time%, More%, Loop%, Key$, Temp$
109    
110     SYS"WimpExt_PrePoll"
111     IF Task_PollIdle% THEN
112     SYS"OS_ReadMonotonicTime" TO Time%
113     WHILE (Time% - Task_LastPoll%) > 0
114     Task_LastPoll% += Task_PollIdle%
115     ENDWHILE
116     SYS"Wimp_PollIdle", Task_PollMask%, B%, Task_LastPoll% TO Reas%
117     ELSE
118     SYS"Wimp_Poll", Task_PollMask%, B% TO Reas%
119     ENDIF
120     SYS"WimpExt_Action", Task_Hand%, B%, Reas% TO Reas%
121     SYS"Hourglass_On"
122    
123     @% = "+g10.9"
124    
125     CASE Reas% OF
126     WHEN 0: Call$ = "NullEvent"
127     WHEN 1: Call$ = "Redraw_"+FNObject_Name(0, !B%, 0)
128     WHEN 2: Call$ = "Open_"+FNObject_Name(0, !B%, 0)
129     WHEN 3: Call$ = "Close_"+FNObject_Name(0, !B%, 0)
130     WHEN 4: Call$ = "Leave_"+FNObject_Name(0, !B%, 0)
131     WHEN 5: Call$ = "Enter_"+FNObject_Name(0, !B%, 0)
132     WHEN 6: X% = B%!0: Y% = B%!4: Z% = B%!8: W% = B%!12: I% = B%!16
133     IF W% = -2 THEN
134     Call$ = "Click_IBar_"+STR$Z%
135     ELSE
136     Call$ = "Click_"+FNObject_Name(0, W%, 0)+"_"+FNObject_Name(1, I%, W%)
137     ENDIF
138     WHEN 7: Call$ = "DragEnd"
139     WHEN 8: W% = B%!0: I% = B%!4: K% = B%!24
140     Call$ = "Key_"+FNObject_Name(0, W%, 0)+"_"+STR$~K%
141     WHEN 9: Menu% = Menu_Current%
142     Item% = B%!0
143     Loop% = 4
144     WHILE B%!Loop% <> -1
145     Menu% = Menu%!(28 + 24 * Item% + 4)
146     Item% = B%!Loop%
147     Loop% += 4
148     ENDWHILE
149     Call$ = "Menu_"+FNObject_Name(2, Menu%, 0)+"_"+FNObject_Name(3, Item%, Menu%)
150     WHEN 10: Call$ = "Scroll_"+FNObject_Name(0, !B%, 0)
151     WHEN 11: Call$ = "LoseC_"+FNObject_Name(0, !B%, 0)
152     WHEN 12: Call$ = "GainC_"+FNObject_Name(0, !B%, 0)
153     WHEN 13: Call$ = "PollWord"
154     WHEN 17: Call$ = "MessUser_"+STR$~(B%!16)
155     WHEN 18: Call$ = "MessRec_"+STR$~(B%!16)
156     WHEN 19: Call$ = "MessAck_"+STR$~(B%!16)
157     OTHERWISE: Call$ = "PollReason_"+STR$~Reas%
158     ENDCASE
159    
160     CASE Reas% OF
161     WHEN 1: SYS"Wimp_RedrawWindow",,B% TO More%
162     IF FNWimp_Do(Call$+"_Pre")
163     WHILE More%
164     IF FNWimp_Do(Call$)
165     SYS"Wimp_GetRectangle",,B% TO More%
166     ENDWHILE
167     IF FNWimp_Do(Call$+"_Post")
168     WHEN 2: IF NOT FNWimp_Do(Call$) THEN SYS"WimpExt_OpenLinked",,B%
169     WHEN 3: IF NOT FNWimp_Do(Call$) THEN SYS"WimpExt_CloseLinked",,B%
170     WHEN 6: IF W% <> -2 THEN IF FNWimp_Do("Click_"+FNObject_Name(0, W%, 0))
171     IF FNWimp_Do(Call$)
172     IF Task_Slab% THEN SYS"WimpExt_SetIcon",,, Slab_Wind%, Slab_Icon%, 0: Task_Slab% = FALSE
173     WHEN 7: IF NOT FNWimp_Do(Call$) THEN SYS"XDragASprite_Stop"
174     WHEN 8: Key$ = FNMess_XLookup(Call$, File_Mess%)
175     IF Key$ = "" THEN
176     IF (FNWimp_Do("Key_"+FNObject_Name(0, W%, 0))=0 AND FNWimp_Do(Call$)=0) THEN SYS"Wimp_ProcessKey",B%!24
177     ELSE
178     IF Key$ = "+Help" THEN
179     PROCWimp_SupplyHelp
180     ELSE
181     I% = FNObject_Hand(1, Key$, W%)
182     B%!08 = 4
183     B%!12 = W%
184     B%!16 = I%
185     Task_Slab% = FALSE
186     SYS"Wimp_GetIconState",, B% + 12
187     REM IF NOT shaded AND NOT deleted
188     IF (B%!36 AND (%11<<22)) = 0 THEN
189     REM IF ESG = 0
190     IF ((B%!36 AND (%11111<<16)) = 0) THEN
191     REM IF ButtonType = Radio
192     IF (((B%!36 AND (%1111<<12))>>12) = 11) THEN
193     SYS"WimpExt_SetIcon",,, W%, I%, 1 - ((B%!36 AND (1<<21))>>21)
194     ENDIF
195     REM IF ButtonType = Click once AND indirected AND bordered AND text
196     IF (((B%!36 AND (%1111<<12))>>12) = 3) AND ((B%!36 AND (%100000101)) <> 0) THEN
197     Temp$ = FNWimp_GetString(B%!44)
198     REM IF button is 3d action
199     IF INSTR(Temp$, "r5") OR INSTR(Temp$, "R5") OR INSTR(Temp$, "r6") OR INSTR(Temp$, "R6") THEN
200     SYS"WimpExt_SetIcon",,, W%, I%, 1
201     Task_Slab% = TRUE
202     Slab_Wind% = W%
203     Slab_Icon% = I%
204     ENDIF
205     ENDIF
206     ELSE
207     SYS"WimpExt_SetIcon",,, W%, I%, 1
208     ENDIF
209     SYS"Wimp_SendMessage", 6, B%, Task_Hand%
210     ENDIF
211     ENDIF
212     ENDIF
213     WHEN 9: IF (FNWimp_Do("Menu_"+FNObject_Name(2, Menu_Current%, 0))=0 AND FNWimp_Do(Call$)=0) THEN PROCMenu_Adjust(Menu_Current$)
214     WHEN 17, 18:
215     CASE B%!16 OF
216     WHEN &0: IF NOT FNWimp_Do(Call$) THEN Task_Quit% = TRUE
217     WHEN &502: IF NOT FNWimp_Do(Call$) THEN PROCWimp_SendHelp
218     OTHERWISE : IF FNWimp_Do(Call$)
219     ENDCASE
220     OTHERWISE: IF FNWimp_Do(Call$)
221     ENDCASE
222    
223     SYS"Hourglass_Smash"
224     ENDPROC
225    
226     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
227    
228     DEF FNWimp_Do(Func$)
229     LOCAL ERROR
230     ON ERROR LOCAL RESTORE ERROR: =FNWimp_DoError
231     =EVAL("FN" + Func$)
232    
233     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
234    
235     DEF FNWimp_DoError
236     IF Task_Slab% THEN SYS"WimpExt_SetIcon",,, Slab_Wind%, Slab_Icon%, 0: Task_Slab% = FALSE
237     IF (ERR = 29) AND (Erro_ERR% = -1) THEN =FALSE
238     IF Erro_ERR% = -1 THEN
239     Erro_ERL% = ERL
240     Erro_REPORT$ = REPORT$
241     Erro_ERR% = ERR
242     ENDIF
243     ERROR ERR, REPORT$
244     =FALSE
245    
246     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
247    
248     DEF PROCWimp_Close
249     SYS"WimpExt_CloseDown", Task_Hand%
250     SYS"Wimp_CloseDown", Task_Hand%, &4B534154
251     SYS"XOS_CLI", "Unset " + Task_Name$ + "$Objects"
252     ENDPROC
253    
254     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
255    
256     DEF FNWimp_Error
257     LOCAL Quit%, Text$
258     LOCAL ERROR
259     ON ERROR LOCAL ON ERROR OFF: ERROR EXT 0, (REPORT$+" in Error Handler (Code "+STR$ERL+"); must exit.")
260    
261     SYS"Hourglass_Smash"
262    
263     IF Erro_ERR% = -1 THEN
264     Erro_ERR% = ERR
265     Erro_ERL% = ERL
266     Erro_REPORT$ = REPORT$
267     ENDIF
268    
269     CASE Erro_ERR% OF
270    
271     WHEN Erro_Memo%
272     Quit% = FNWimp_ReportError(Erro_Memo$, Erro_Warn%)
273    
274     WHEN Erro_Info%, Erro_Warn%
275     IF LEFT$(Erro_REPORT$, 1) = "%" THEN
276     Erro_REPORT$ = FNMess_Lookup(MID$(Erro_REPORT$, 2), File_Mess%)
277     ENDIF
278     Quit% = FNWimp_ReportError(Erro_REPORT$, Erro_ERR%)
279    
280     OTHERWISE
281     @% = "+g20.20"
282     SYS"WimpExt_SubstituteArgs", Erro_Erro$, B%, Erro_REPORT$, STR$Erro_ERL%, STR$~Erro_ERR%, 0, 0 TO ,Text$
283     Quit% = FNWimp_ReportError(Text$, 1)
284     IF Quit% THEN Quit% = FNWimp_ReportError(Erro_Quit$, Erro_Ques%)
285    
286     ENDCASE
287    
288     Erro_ERR% = -1
289    
290     =Quit%
291    
292     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
293    
294     DEF FNWimp_ReportError(Text$, Type%)
295     LOCAL Flag%, Clck%
296    
297     B%!00 = 1
298     $(B% + 04) = Text$
299    
300     CASE Type% OF
301     WHEN Erro_Info%: Flag% = %001100000001
302     WHEN Erro_Warn%: Flag% = %010100000001
303     WHEN Erro_Ques%: Flag% = %100100000011
304     OTHERWISE : Flag% = %000100000011
305     ENDCASE
306    
307     SYS"Wimp_ReportError", B%, Flag%, Task_Name$ TO ,Clck%
308     =(Clck% = 2)
309    
310     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
311    
312     DEF FNWimp_GetString(Addr%)
313     LOCAL Text$, a%
314     WHILE Addr%?a% > 31
315     Text$ += CHR$(Addr%?a%)
316     a% += 1
317     ENDWHILE
318     =Text$
319    
320     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
321    
322     DEF PROCWimp_ScreenSize(RETURN Wide%, RETURN High%)
323     LOCAL a%, b%
324    
325     B%!400 = 130
326     B%!404 = 131
327     B%!408 = -1
328     SYS"OS_ReadVduVariables", B% + 400, B% + 400
329     SYS"OS_ReadModeVariable", -1, 4 TO ,, a%
330     SYS"OS_ReadModeVariable", -1, 5 TO ,, b%
331     Wide% = ((B%!400) + 1) * 2 ^ a%
332     High% = ((B%!404) + 1) * 2 ^ b%
333    
334     ENDPROC
335    
336     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
337    
338     DEF PROCWimp_StartDrag
339     LOCAL Sprt$, Temp%
340    
341     B%!00 = W%
342     B%!04 = I%
343     SYS"Wimp_GetIconState",, B%
344     IF (B%!24 AND %10) THEN
345     CASE (B%!24 AND 1) + ((B%!24 AND 1<<8)>>7) OF
346     REM IT
347     WHEN %00, %01: SYS"WimpExt_DragIcon", %100000101, 1, W%, I%, B% + 28
348     WHEN %10: SYS"WimpExt_DragIcon", %100000101, 1, W%, I%, B%!28
349     WHEN %11
350     Vali$ = FNWimp_GetString(B%!32)
351     IF (LEFT$(Vali$, 1) = "s") OR (LEFT$(Vali$, 1) = "S") THEN
352     Sprt$ = MID$(Vali$, 2)
353     ELSE
354     Temp% = INSTR(Vali$, ";s")
355     IF Temp% = 0 THEN Temp% = INSTR(Vali$, ";S")
356     Sprt$ = MID$(Vali$, Temp% + 2)
357     ENDIF
358     IF INSTR(Sprt$, ";") THEN Sprt$ = LEFT$(Sprt$, INSTR(Sprt$, ";") - 1)
359     SYS"WimpExt_DragIcon", %100000101, 1, W%, I%, Sprt$
360     ENDCASE
361     ELSE
362     SYS"WimpExt_DragIcon", %101, 0, W%, I%
363     ENDIF
364     ENDPROC
365    
366    
367     CASE
368     SYS"WimpExt_DragIcon", %100000101, 1, W%, I%, B%!28
369     ELSE
370     SYS"WimpExt_DragIcon", %100000101, 1, W%, I%, B%+28
371     ENDIF
372     ENDPROC
373    
374     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
375    
376     DEF FNWimp_GetLeaf(Text$)
377     IF INSTR(Text$, ".") = 0 THEN =Text$
378     WHILE INSTR(Text$, ".")
379     Text$ = MID$(Text$, INSTR(Text$, ".") + 1)
380     ENDWHILE
381     =Text$
382    
383     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
384    
385     DEF PROCWimp_SendHelp
386     LOCAL Buff%, Help%, Obje$, Mess$, Temp%, Menu%, Item%
387    
388     IF B%!32 = -2 THEN
389     Mess$ = "IBar"
390     Help% = FNWimp_Do("Help_"+Mess$)
391     IF Help% = 0 THEN Help% = FNMess_XAdr(Mess$, File_Help%)
392    
393     ELSE
394     Obje$ = FNObject_Name(0, B%!32, 0)
395    
396     IF Obje$ = "None" THEN
397     SYS"Wimp_GetMenuState", 0, B% + 80
398     Menu% = Menu_Current%
399     Item% = B%!80
400     Loop% = 84
401     WHILE B%!Loop% <> -1
402     Menu% = Menu%!(28 + 24 * Item% + 4)
403     Item% = B%!Loop%
404     Loop% += 4
405     ENDWHILE
406     Mess$ = "Menu_"+FNObject_Name(2, Menu%, 0)+"_"+FNObject_Name(3, Item%, Menu%)
407     Help% = FNWimp_Do("Help_"+Mess$)
408     IF Help% = 0 THEN Help% = FNMess_XAdr(Mess$, File_Help%)
409     Mess$ = "Menu_"+FNObject_Name(2, Menu%, 0)
410     IF Help% = 0 THEN Help% = FNWimp_Do("Help_"+Mess$)
411     IF Help% = 0 THEN Help% = FNMess_XAdr(Mess$, File_Help%)
412     Mess$ = "Menu_"+FNObject_Name(2, Menu_Current%, 0)
413     IF Help% = 0 THEN Help% = FNWimp_Do("Help_"+Mess$)
414     IF Help% = 0 THEN Help% = FNMess_XAdr(Mess$, File_Help%)
415    
416     ELSE
417     Mess$ = "Wind_"+Obje$+"_"+FNObject_Name(1, B%!36, B%!32)
418     Help% = FNWimp_Do("Help_"+Mess$)
419     IF Help% = 0 THEN Help% = FNMess_XAdr(Mess$, File_Help%)
420     Mess$ = "Wind_"+Obje$
421     IF Help% = 0 THEN Help% = FNWimp_Do("Help_"+Mess$)
422     IF Help% = 0 THEN Help% = FNMess_XAdr(Mess$, File_Help%)
423     ENDIF
424     ENDIF
425    
426     IF Help% = 0 THEN Help% = FNMess_XAdr("Default", File_Help%)
427     SYS"WimpExt_SendHelp", Help%, B%
428    
429     ENDPROC
430    
431     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
432    
433     DEF PROCWimp_LoadFile(File$, Word%, Name$)
434     LOCAL File%, Type%, Siz1%, Siz2%, Siz3%, Sqsh%, Work%
435    
436     SYS"OS_File", 23, File$ TO File%,,,, Siz1%,, Type%
437     IF File% = 0 THEN ERROR Erro_Warn%, FNMess_Global1("NoFile", File$)
438     IF File% <> 1 THEN ERROR Erro_Warn%, FNMess_Global1("IsntFil", File$)
439    
440     CASE Type% OF
441     WHEN &FCA
442     IF NOT FNHeap_Grab(Siz1%, Word%, "_Sqsh") THEN ERROR Erro_Memo%, "NoMem"
443     Sqsh% = FNHeap_Find(Word%, "_Sqsh")
444     SYS"OS_File", 16, File$, Sqsh%
445     Siz2% = Sqsh%!04
446     OTHERWISE
447     Siz2% = Siz1%
448     ENDCASE
449    
450     IF NOT FNHeap_Grab(Siz2% + 4, Word%, Name$) THEN ERROR Erro_Memo%, "NoMem"
451     File% = FNHeap_Find(Word%, Name$)
452    
453     CASE Type% OF
454     WHEN &FCA
455     SYS"Squash_Decompress", %1000, Siz2% TO Siz3%
456     IF NOT FNHeap_Grab(Siz3%, Word%, "Work") THEN ERROR Erro_Memo%, "NoMem"
457     Work% = FNHeap_Find(Word%, "Work")
458     SYS"Squash_Decompress", %100, Work%, Sqsh% + 20, Siz1% - 20, File% + 4, Siz2%
459     PROCHeap_Lose(Word%, "_Sqsh")
460     PROCHeap_Lose(Word%, "Work")
461     OTHERWISE
462     SYS"OS_File", 16, File$, File% + 4
463     ENDCASE
464     File%!00 = Siz2%
465    
466     SYS"WimpExt_Heap", 6
467     ENDPROC
468    
469     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
470    
471     DEF PROCWimp_SaveFile(File$, Word%, Name$, Type%)
472     LOCAL File%
473     File% = FNHeap_Find(Word%, Name$)
474     SYS"OS_File", 10, File$, Type%,, File% + 4, File% + 4 + !File%
475     ENDPROC
476    
477     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
478    
479     DEF PROCWimp_SupplyHelp
480     SYS"Wimp_StartTask", "Filer_Run Resources:$.Apps.!Help"
481     ENDPROC
482    
483     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
484    
485     DEF FNWimp_TempFile
486     @% = "+g10.10"
487     Task_LastTemp% = TIME
488     =Task_Temp$+STR$TIME
489    
490     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
491    
492     DEF FNWimp_FileExists(Path$)
493     LOCAL Found%
494     SYS"OS_File", 17, Path$ TO Found%
495     =(Found% <> 0)
496    
497     REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
498    
499     DEF PROCWimp_IBoxVers
500     LOCAL File_Vers%
501    
502     SYS"OS_File", 23, Task_Path$ + "!RunImage" TO ,, B%!04, B%!00
503     SYS"Territory_ConvertDateAndTime", -1, B%, B% + 08, 503, FNMess_Lookup("IBox_Date", File_Mess%) + CHR$0
504    
505     PROCWimp_LoadFile(Task_Path$ + "!Version", -1, "_Vers")
506     File_Vers% = 4 + FNHeap_Find(-1, "_Vers")
507     @% = "+f20.2"
508    
509     PROCWind_SetText("IBox", "Vers", FNMess_Get2("IBox_Vers", File_Mess%, STR$(File_Vers%!00 / 100), FNWimp_GetString(B% + 08)))
510    
511     PROCHeap_Lose(-1, "_Vers")
512     ENDPROC

  ViewVC Help
Powered by ViewVC 1.1.26