home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / filemanager / winsave_1 / !WinSave / Resources / !Intro (.txt) next >
RISC OS BBC BASIC V Source  |  1995-11-11  |  5KB  |  184 lines

  1.  WinSave Intro
  2.  (c) 1995 Ian Clark
  3.  This program is not to be distributed seperatly
  4.  from the WinSave application
  5.  Although you may use it as a welcome screen for your
  6.  own programs if you want (You will need to change the templates
  7.  and sprites)
  8.  If you use it then you must leave the copyright messages in
  9.  Although you may copyright your templates and sprites
  10.  by adding another REM line
  11.  Remember, wealth is just a state of mind....
  12.  Therefore send all your money to me!!
  13.  Well, it was worth a try!
  14.  0,"Intro error: "+
  15. $+" at line "+
  16. <wimpslot%=64 : 
  17.  Set this variable to the wimpslot reqd.
  18.  block% 256
  19. "Wimp_SlotSize",-1,-1 
  20.  ,next%,free%
  21. wimpslot%=wimpslot%*1024
  22.  next%>free% next%=free%
  23.  free%>next% next%=free%
  24.  next%<wimpslot% 
  25.  0,"Application needs at least "+
  26. (wimpslot%/1024)+"k to start up."
  27.  The following few lines load the sprites
  28.  local to the program
  29. "Wimp_ReadSysInfo",2 
  30. String(sp%)
  31. #1spfile$="<WinSave$Dir>.Resources.Sprites"+sp$
  32. "OS_File",17,spfile$ 
  33.  found%
  34.  found%<>1 
  35.  spfile$="<WinSave$Dir>.Resources.Sprites"
  36.  size%=FNUnsquash(spfile$)
  37.  spfile$="<WinSave$Scrap>"
  38. "OS_File",17,spfile$ 
  39.  ,,,,size%
  40. size%+=4
  41.  "OS_Module",6,,,size% 
  42.  ,,sprite%
  43. !sprite%=size%:sprite%!8=16
  44. "OS_SpriteOp",&209,sprite%
  45. "OS_SpriteOp",&20A,sprite%,spfile$
  46. ./msgpath$="<WinSave$Dir>.Resources.Messages"
  47. "MessageTrans_FileInfo",,msgpath$ 
  48.  ,,msgsize%
  49.  "OS_Module",6,,,20+
  50. msgpath$ 
  51.  ,,msg%
  52. $(msg%+16)=msgpath$
  53.  "OS_Module",6,,,msgsize% 
  54.  ,,msblk%
  55. "MessageTrans_OpenFile",msg%,msg%+16,msblk%
  56. !block%=0
  57. "Wimp_Initialise",310,&4B534154,"WinSave intro",block% 
  58.  ,id%
  59. "Wimp_OpenTemplate",,"<WinSave$Dir>.Resources.Templates"
  60. "Wimp_LoadTemplate",,-1,-1,,-1,"Splash",0 
  61.  ,b%,i%,,,,ptr%
  62.  win% b%
  63.  indir% i%
  64.  font% 256 : 
  65.  byte array for fonts
  66.  Must init to zero!!!
  67.  x%=0 
  68.  256 
  69. font%!x%=0
  70. "Wimp_LoadTemplate",,win%,indir%,indir%+i%,font%,"Splash",0
  71. win%!64=sprite%
  72. "Wimp_CreateWindow",,win% 
  73.  mainw%
  74. quit%=
  75. Seticontext(mainw%,4,
  76. Gm("VER"),4),0)
  77. Centrew(mainw%)
  78. "Wimp_Poll",,block% 
  79.  code%
  80.  code%=2 
  81. "Wimp_OpenWindow",,block%
  82.  code%=0
  83. "Wimp_SlotSize",-1,-1 
  84.  ,next%,free%
  85. "Wimp_SlotSize",-1,wimpslot%
  86. "Wimp_StartTask","Run <WinSave$Dir>.!RunImage"
  87. "Wimp_SlotSize",-1,next%
  88. "Wimp_Poll",,block% 
  89.  code%
  90.  code% 
  91.  2 : 
  92. "Wimp_OpenWindow",,block%
  93.  3 : 
  94. "Wimp_CloseWindow",,block%
  95.  17,18
  96.  block%!16=0 quit%=
  97.  block%!16=&400C2 
  98.  block%!4<>id% quit%=
  99. -t%>150 
  100.  quit%
  101.  x%=0 
  102.  font%?x%>0
  103. font%?x%-=1
  104. "Wimp_CloseDown"
  105.  SYS"OS_Module",7,,sprite%
  106. "OS_Module",7,,msblk%
  107. "OS_Module",7,,msg%
  108. "XOS_CLI","Wipe <WinSave$Scrap> ~C~vRF"
  109. String(ptr%)
  110. t$<255 
  111.  ?ptr%>31
  112. (?ptr%)
  113. ptr%+=1
  114. Centrew(whandle%)
  115.  x%,y%,scrx%,scry%,dx%,dy%,w%,h%
  116. block%!0=4:block%!4=5
  117. block%!8=11:block%!12=12
  118. block%!16=-1
  119. "OS_ReadVduVariables",block%,block%+20
  120. dx%=1<<(block%!20)
  121. dy%=1<<(block%!24)
  122. scrx%=(block%!28+1)*dx%
  123. scry%=(block%!32+1)*dy%
  124. block%!0=whandle%
  125. "Wimp_GetWindowState",,block%
  126. w%=block%!12-block%!4
  127. h%=block%!16-block%!8
  128. x%=(scrx%-w%)/2
  129. y%=(scry%-h%)/2
  130. block%!4=x%
  131. block%!8=y%
  132. block%!12=x%+w%
  133. block%!16=y%+h%
  134. block%!28=-1
  135. "Wimp_OpenWindow",,block%
  136. Seticontext(w%,i%,t$,d%)
  137.  d% is set to true (-1) if it is a 3d bordered icon and we don't want
  138.  flicker when we update it, if d% is true the size of the area redrawn
  139.  is reduced so the border isn't redrawn
  140.  with some icons this may cut some of the text off
  141.  more%
  142. !block%=w%:block%!4=i%
  143. "Wimp_GetIconState",,block%
  144. $(block%!28)=t$
  145. (block%!4=block%!8:block%!8=block%!12
  146. +block%!12=block%!16:block%!16=block%!20
  147. block%!4+=5
  148. block%!8+=5
  149. block%!12-=5
  150. block%!16-=5
  151. "Wimp_UpdateWindow",,block% 
  152.  more%
  153.  more%
  154. "Wimp_GetRectangle",,block% 
  155.  more%
  156. Gm(tok$)
  157.  out$
  158. "MessageTrans_Lookup",msg%,tok$,msblk%,256 
  159.  ,,out$
  160.     =out$
  161. Unsquash(in$)
  162.  size%,in%,ws%,out%,work%
  163. "OS_File",17,in$ 
  164.  ,,,,size%
  165.  DIM in% size%+4
  166.  "OS_Module",6,,,size%+4 
  167.  ,,in%
  168. "OS_File",16,in$,in%,0
  169. "Squash_Decompress",1<<3 
  170.  DIM out% !in%
  171.  "OS_Module",6,,,!in% 
  172.  ,,out%
  173.  DIM work% ws%
  174.  "OS_Module",6,,,ws% 
  175.  ,,work%
  176. "Squash_Decompress",1<<2,work%,in%+4,size%-4,out%,!in% 
  177.  ,,,,ptr%
  178. "OS_File",10,"<WinSave$Scrap>",&FFD,,out%,ptr%
  179. size%=!in%
  180. "OS_Module",7,,in%
  181. "OS_Module",7,,out%
  182. "OS_Module",7,,work%
  183. =size%
  184.