home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities / _shield / !Shield / !RunImage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1994-06-21  |  4KB  |  171 lines

  1.  >!RunImage
  2.  !Shield !RunImage file
  3.  By Ben Carter 
  4.  1994 (FreeWare)
  5. d=   12*4
  6.   ^ Max # of directories (must be a multiple of 12)
  7. Db$="!Shield":
  8. "Fatal initialisation error - "+
  9. $+" ("+
  10. +")":
  11. $+" at line "+
  12. +" - Quit?"):
  13. a(a%):e=
  14. i::c=1:j=
  15. "Wimp_Initialise",200,&4B534154,b$
  16. r%,f%:
  17. "WimpExt_Initialise",11,f%,400::
  18. a 3000,l 100:
  19. a$(d):e=
  20. "WimpExt_PrePoll":
  21. "Wimp_Poll",0,a 
  22. "WimpExt_Action",f%,a,g%
  23. C,E,F::
  24. "WimpExt_OpenLinked",,a
  25. "WimpExt_CloseLinked",,a
  26. 17,18:
  27. "WimpExt_CloseDown",f%:
  28. "Wimp_CloseDown":
  29. b(g$):
  30. "Hourglass_Smash":!a=0:$(a+4)=g$+
  31. "Wimp_ReportError",a,0,b$:
  32. z(g$):
  33. "Hourglass_Smash":!a=0:$(a+4)=g$+
  34. "Wimp_ReportError",a,0,b$:
  35. d(h$):
  36. "Hourglass_Smash"
  37. (E!a=0:$(a+4)=h$+
  38. "Wimp_ReportError",a,19,"Message from "+b$
  39. G(h$):
  40. "Hourglass_Smash":!a=0:$(a+4)=h$+
  41. "Wimp_ReportError",a,19,"Message from "+b$:
  42. e(b,k$,r):$b=k$:b!12=459271:b!16=r:b!20=44:b!24=0:b+=28:=b
  43. c(b,i,i$,k%,l%,m%,n%,o%):!b=0:
  44. !b+=1
  45. !b+=2
  46. !b+=4
  47. !b+=128
  48. 0Gb!4=o%:b!8=&7000021:$(b+12)=i$:
  49. (i$)+1)*16>i!16
  50. i!16=(
  51. (i$)+1)*16
  52. b+=24:=b
  53. A(b,s,t,u,v,w):
  54. "WimpExt_MenuWidth",,b
  55. "WimpExt_CreateMenu",,b,!a-64,102+(44*(s+1))
  56. "WimpExt_CreateMenu",,b,v,w
  57. 8    x=t:
  58. y 400:f=y::i=f:f=
  59. e(f,"Shield",0)::f=
  60. c(f,i,"Info",
  61. ,i%):f=
  62. c(f,i,"Quit",
  63. ,-1)::z=2:A=i:
  64. k:$l="!Shield"+
  65. "WimpExt_IconBarSprite",,,-1,l,,3
  66. "Wimp_GetPointerInfo",,a::
  67. A(A,z,1,
  68. ,0,0):
  69. z("Menu click when no menu open!")
  70. a(b%)
  71. a(a%)
  72. a(i%)
  73. B 1000,m 6000,g 100::
  74. g+100
  75. 4:!I=0:
  76. "WimpExt_LoadTemplates",g,B,m,m+4000,-1,"<Shield$Dir>.Templates",1::i%=!g:b%=g!4:a%=g!8:e%=g!12::
  77. a(h%):!a=h%:
  78. "Wimp_GetWindowInfo",,a:
  79. "WimpExt_OpenLinked",,a:
  80. h(h%):!a=h%:
  81. "Wimp_GetWindowInfo",,a:
  82. "WimpExt_CloseLinked",,a:
  83. d(c%,d%,l$):!a=c%:a!4=d%:
  84. "Wimp_GetIconState",,a:a!8=0:a!12=0:$(a!28)=l$+
  85. "Wimp_SetIconState",,a:
  86. a(c%,d%):!a=c%:a!4=d%:
  87. "Wimp_GetIconState",,a:=
  88. b(a!28)
  89. f(c$):
  90. c$,"."):c$=
  91. c$,".")+1):
  92. :=c$+
  93. y:m$=
  94. b(a+44):j%=a!40:k=a!24:
  95. (a!20)<>b%
  96. j%<>4096
  97. j%<>8192
  98. b("This is not a directory or application"):
  99. d(b%,k,m$):
  100. "Wimp_SetCaretPosition",-1:
  101. g(h):d$="":
  102. ?h>31:d$+=
  103. (?h):h+=1:
  104. "Wimp_RedrawWindow",,a 
  105. n:s%=a!4-a!20:t%=a!16-a!24:
  106. "WimpExt_Redraw",,a:
  107. "Wimp_GetRectangle",,a 
  108. b(h):d$="":o=0:
  109. ?h>31
  110. o<255:d$+=
  111. (?h):h+=1:o+=1:
  112. H:!a=-1:a!4=p%:a!8=0:a!12=0:
  113. "Wimp_SetIconState",,a:
  114. I(c%,d%,q%):
  115. "WimpExt_SetIcon",,,c%,d%,q%:
  116. "<Shield$Dir>.Prefs":
  117. #D,p:
  118. b("There are more directories to protect than I have room for. Please increase max_directories or enter a new list"):
  119. #D,a$(I):
  120. "<Shield$Dir>.Prefs":
  121. #D,d:
  122. #D,a$(I):
  123.  I=c 
  124.  c+11
  125. d(b%,I-c,a$(I))
  126. "Wimp_SetCaretPosition",-1
  127. c+11:a$(I)=
  128. a(b%,I-c):
  129. a$(I),1)=
  130. 13a$(I)=
  131. a$(I),
  132. (a$(I))-1)
  133. c<(d-12)
  134. c:c+=12:
  135. c:c-=12:
  136. a(e%)
  137. v:e$=
  138. a(a%,3):
  139. e$,1)=
  140. 13e$=
  141. (e$)-1)
  142. e$=a$
  143. b("Sorry. That is the wrong password")
  144. h(a%):
  145. d(a%,3,""):
  146. w:a$=
  147. a(e%,0):
  148. a$,1)=
  149. 10a$=
  150. (a$)-1)
  151. h(e%):
  152. "<Shield$Dir>.RTLib":
  153. b("There is no password set - You will need to set one"):a$="":j=
  154. #D,f$:
  155. #D:a$="":
  156. (f$):a$+=
  157. f$,I,1))
  158. F:f$="":
  159. (a$):f$+=
  160. a$,I,1))
  161. "<Shield$Dir>.RTLib":
  162. #D,f$:
  163. ("Settype <Shield$Dir>.RTLib FFC"):
  164. }<j$=
  165. b(a+44):o$="":
  166. (j$):
  167. j$,I,1))>31o$+=
  168. j$,I,1)
  169. o$=a$(I)
  170. ("Filer_CloseDir "+o$):I=d
  171.