home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / desktop / finallook_1 / !FinalLook / !FLConfig / !RunImage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1995-04-20  |  9KB  |  330 lines

  1.  > !RunImage for !FLConfig
  2.  By Matthew Godbolt 
  3.  1995 templates by pixeleyes
  4.  See the !Help file for details
  5.  0,"Error during !FLConfig startup - "+
  6. $+" at line "+
  7. initialise
  8. error("Internal error: ")
  9.  end%
  10.  0,"Error during !FLConfig finalisation - "+
  11. $+" at line "+
  12. finalise
  13. initialise
  14. primary_initialise
  15. constants_initialise
  16. files_initialise
  17. wimp_initialise
  18. options_initialise
  19. primary_initialise
  20.  wimp_active%=
  21.  mouse_trapped%=
  22.  DoOnYes$=""
  23.  DoOnNo$=""
  24.  log%=0
  25.  end%=
  26. $& config_fontname$="Trinity.Medium"
  27.  config_fontxsize%=190
  28.  config_fontysize%=210
  29.  config_textureson%=
  30.  config_fontson%=
  31.  config_directoryopen%=
  32.  config_removegreyblobs%=
  33. +> config_texturepath$="<FinalLook$Dir>.WindowDrop.Default."
  34. files_initialise
  35.  openfiles%(maxopenfiles%),openfiles$(maxopenfiles%)
  36.  filesopen%=0
  37. constants_initialise
  38.  MaxInQueue=256
  39.  MaxRetr=7
  40.  MaxIndir=1.5*1024
  41. 8" Version$="0.01 (Development)"
  42.  input%=0
  43.  output%=1
  44.  input_and_output%=2
  45.  maxopenfiles%=32
  46. options_initialise
  47. @& NoteDelay = 400     : 
  48.  4 seconds
  49. wimp_initialise
  50.  WimpArea 1024, MesList 32, TemplateArea 1024, FontBlk 256
  51.  IndirArea MaxIndir
  52. F@ TempBlk=TemplateArea: 
  53.  can be used after template handling
  54. G) P%=MesList:[OPT 2:EQUD &502:EQUD 0:]
  55.  !FontBlk=0
  56.  "Wimp_Initialise",300,&4B534154,"!FLConfig",MesList 
  57.  ,TaskHandle
  58.  "EqWimp_Sprites","<FLConfig$Dir>.Sprites" 
  59.  SpriteArea
  60.  "EqWimp_Initialise","Configure,Style,Info,Alert,NoteHeader,Note", TemplateArea, IndirArea, IndirArea+MaxIndir-1, "<FLConfig$Dir>.Templates",SpriteArea,FontBlk 
  61.  "EqWimp_InstallOnIconbar",eq,"!FLConfig",2,-1 
  62.  ,IconHandle
  63.  "EqWimp_LoadMenus",eq,"<FLConfig$Dir>.MenuData"
  64.  SYS "EqWimp_LoadHelpFile",eq,"MultiWeb:Messages"
  65.  "EqWimp_WriteStringToIcon",eq,"Info","Version",Version$
  66.  error%=
  67.  NoteOpen=
  68.  wimp_active%=
  69. finalise
  70.  "EqWimp_Finalise",eq
  71.  "Wimp_CloseDown",TaskHandle,&4B534154
  72.  wimp_active%=
  73. close_all_files
  74. error(prepend$)
  75.  error%=
  76.  0,"Fatal error (Recursion in error handler) : "+
  77. $+" at line "+
  78.  error%=
  79.  "EqWimp_WriteStringToIcon",eq,"Alert","Error",prepend$++
  80. $+" at line "+
  81.  "EqWimp_PutAtFrontAndCentre",eq,"Alert"
  82.  "EqWimp_RestrictMouse",eq,"Alert"
  83.  mouse_trapped%=
  84. error_fatal
  85.  "EqWimp_ReleaseMouse",eq
  86.  mouse_trapped%=
  87.  end%=
  88. error_recover
  89.  "EqWimp_ShutWindow",eq,"Alert"
  90.  "EqWimp_RestoreCaret",eq
  91.  "EqWimp_ReleaseMouse",eq
  92.  mouse_trapped%=
  93.  error%=
  94.  Reason
  95.  "Wimp_PollIdle",,WimpArea,100 
  96.  Reason
  97.  Reason 
  98.  0             : 
  99.  error% 
  100. null_event
  101.  1             : 
  102. redraw(WimpArea)
  103.  2             : 
  104. open_window(WimpArea)
  105.  3             : 
  106. close_window(WimpArea)
  107.  6             : 
  108. mouse_click(WimpArea)
  109.  8             : 
  110. keypress(WimpArea)
  111.  9             : 
  112. menu_select(WimpArea)
  113.  17,18,19      : 
  114. message(WimpArea)
  115. message(Area)
  116.  Area!16 
  117.  0      : end%=
  118.   WHEN &502   : SYS "EqWimp_HelpRequest",eq,Area
  119. mouse_click(Area)
  120.  Window$,Icon$,mx%,my%,Button$
  121.  "EqWimp_MouseClick",eq,Area 
  122.  ,Window$,Icon$
  123.  "EqWimp_MouseInfo",eq 
  124.  ,mx%,my%,Button$
  125. clicked(Window$,Icon$,mx%,my%,Button$)
  126. clicked(Window$,Icon$,mx%,my%,Button$)
  127.  Useful%
  128.  Window$ 
  129.  "Iconbar" :
  130.  Button$ 
  131.  "Select" : 
  132. open_main
  133. ,    
  134.  "Menu"   : 
  135. open_iconbar_menu(mx%)
  136. "    
  137.  "Adjust" : 
  138. open_options
  139.  "Alert" :
  140.  Button$<>"Menu" 
  141.  Icon$ 
  142. &     
  143.  "Continue" : 
  144. error_recover
  145. $     
  146.  "Quit"     : 
  147. error_fatal
  148.         
  149.  "Retrieve" :
  150.  Button$<>"Menu" 
  151.  Icon$ 
  152. '     
  153.  "OK"       : 
  154. start_retrieve
  155. #     
  156.  "Cancel"   : 
  157. close_main
  158.         
  159.  "Query" :
  160.  Button$<>"Menu" 
  161.  Icon$ 
  162. "     
  163.  "Yes"      : 
  164. query_yes
  165. !     
  166.  "No"       : 
  167. query_no
  168.         
  169.  Window$<>"Iconbar" 
  170.  "EqWimp_UsefulButton",eq,Window$,Icon$ 
  171.  ,Useful%
  172.  Useful% 
  173.  "EqWimp_DragWindow",eq,Window$
  174. open_main
  175.  file%,line$,com$
  176. close_file(file%):
  177. open_file(file%),"<FinalLook$Dir>.!Choices",input%)
  178.  #file%
  179.   line$=
  180. readline(file%)
  181. line$,1)<>"#" 
  182. #   param$=
  183. line$,
  184. line$,":"+1))
  185. line$,
  186. line$,":")-1) 
  187. 5    
  188.  "FontName"        : config_fontname$=param$
  189. 9    
  190.  "FontXSize"       : config_fontxsize%=
  191. (param$)
  192. 9    
  193.  "FontYSize"       : config_fontysize%=
  194. (param$)
  195. ?    
  196.  "TexturesOn"      : config_textureson%=(param$="Yes")
  197. B    
  198.  "DirectoryOpen"   : config_directoryopen%=(param$="Yes")
  199. D    
  200.  "RemoveGreyBlobs" : config_removegreyblobs%=(param$="Yes")
  201. 8    
  202.  "TexturePath"     : config_texturepath$=param$
  203. close_file(file%)
  204.  "EqWimp_PutAtFrontAndCentre",eq,"Configure"
  205.  "EqWimp_GrabCaret",eq,"Configure",-1
  206. close_main
  207.  "EqWimp_ShutWindow",eq,"Configure"
  208.  "EqWimp_RestoreCaret",eq
  209.  "Wimp_CreateMenu",-1
  210. icon_length(window$,icon$)
  211.  Text$
  212.  "EqWimp_ReadIconString",eq,window$,icon$ 
  213.  ,Text$
  214. (Text$)
  215. open_iconbar_menu(mx%)
  216.  "EqWimp_OpenMenu",eq,"Ibar",mx%-64,-1
  217. open_window(Area)
  218.  "EqWimp_OpenWindow",eq,Area
  219. close_window(Area)
  220.  "EqWimp_CloseWindow",eq,Area
  221. null_event
  222.  NoteOpen 
  223.  > NoteCloseTime 
  224.  "EqWimp_ShutWindow",eq,"Note"
  225.    NoteOpen=
  226. notify(text$)
  227.  "EqWimp_WriteStringToIcon",eq,"Note","Note",text$
  228.  "EqWimp_PutAtFrontAndCentre",eq,"Note"
  229.  NoteOpen=
  230.  NoteCloseTime=
  231. +NoteDelay
  232. menu_select(Area)
  233.  menusel$,Button$
  234.  "EqWimp_DecodeMenu",eq,Area 
  235.  ,menusel$
  236. ("FNmenu_"+menusel$)
  237.  "EqWimp_MouseInfo",eq 
  238.  ,,,Button$
  239.  Button$="Adjust" 
  240.  "EqWimp_ReopenMenu"
  241. menu_Quit
  242.  end%=
  243. redraw(Area)
  244.  Window$,More
  245.  "EqWimp_NameFromHandle",eq,!Area 
  246.  ,Window$
  247.  "Wimp_RedrawWindow",,Area 
  248.  More
  249.  More :
  250.  Window$ 
  251. +    
  252.  "Configure" : 
  253. RedrawConfig(Area)
  254.  "Wimp_GetRectangle",,Area 
  255.  More
  256. readline(handle%)
  257.  string$,data%
  258.   data%=
  259. #handle%
  260.  data%<>&0a string$+=
  261. data%
  262.  data%=&0a 
  263. #handle%
  264. =string$
  265. strip(address)
  266.  string$
  267.  ?address>31
  268.   string$+=
  269. ?address
  270.   address+=1
  271. =string$
  272. open_file(
  273.  handle%,filename$,type%)
  274. close_file(handle%):
  275.  handle%=0
  276.  filesopen%=maxopenfiles% 
  277.  1234,"Too many open files when opening "+filename$
  278.  type% 
  279.  input%            : handle%=
  280. (filename$)
  281.  output%           : handle%=
  282. (filename$)
  283.  input_and_output% : handle%=
  284. (filename$)
  285. (% openfiles$(filesopen%)=filename$
  286. )# openfiles%(filesopen%)=handle%
  287.  filesopen%+=1
  288. status("Opened file "+filename$)
  289. close_file(
  290.  handle%)
  291.  find%
  292.  handle%<>0 
  293.  find%<filesopen% 
  294.  handle%<>openfiles%(find%)
  295.    find%+=1
  296.  find%=filesopen% 
  297. 57   
  298.  1234,"Open file not found during file closing"
  299.  #handle%
  300. 8B   
  301.  handle%<>log% 
  302. status("Closed file "+openfiles$(find%))
  303. 9=   
  304.  heheheh! Can't write to log if we've just closed it!
  305.    filesopen%-=1
  306.    handle%=0
  307.  filesopen%>0 
  308. =0    openfiles%(find%)=openfiles%(filesopen%)
  309. >0    openfiles$(find%)=openfiles$(filesopen%)
  310. close_all_files
  311.  filesopen%<>0 
  312.  N%=0 
  313.  filesopen%-1
  314. H"   
  315. close_file(openfiles%(N%))
  316. keypress(Area)
  317.  Click%,Window$,Icon$,Release%
  318.  "EqWimp_ProcessKey",eq,Area 
  319.  Click%,Window$,Icon$
  320.  Click% 
  321.  "EqWimp_ClickOnIcon",eq,Window$,Icon$ 
  322.  Release%
  323. clicked(Window$,Icon$,0,0,"Select")
  324.  Release% 
  325.  "EqWimp_DeselectIcon",eq,Window$,Icon$
  326.  mouse_trapped% 
  327.  "Wimp_ProcessKey",Area!24
  328. RedrawConfig(Area)
  329.  "Wimp_SetColour",132
  330.